Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4386 times and has 3 replies Next Thread
trojanrob
Newbie



Poland
Joined: Apr 17, 2013
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
How to get unique index furniture that is displayed in the panel ?

I need this unique index in HomeFurniturePanel to control attributes added to furniture.

Thanks in advance.
Robert
[Apr 30, 2013, 8:52:47 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to get unique index furniture that is displayed in the panel ?

Sorry, but I don't see what you mean by "unique index".
By the way, it would be nice to explain also what is your project.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[May 1, 2013, 10:12:25 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
trojanrob
Newbie



Poland
Joined: Apr 17, 2013
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to get unique index furniture that is displayed in the panel ?

Sorry, but I don't see what you mean by "unique index".
By the way, it would be nice to explain also what is your project.


Hi,

I want use SH3D to create simple 2D plan, put on it my objects.
Add new atributes to objects.
Set added attributes and export all to my application (BMS for small houses) under android.

It's generally.


No problem to add 2D objects.
No problem to add additional attributes to objects.

I added two attributes :
- Type of function
- Number of nod

When the user changes these two attributes (in HomeFurniturePanel)I have to check whether the combination of these two attributes is unique in entire plan of the house.

When checking objects on the plan, I do not know which object is edited

private boolean isNrNoda(Integer typFunkcji, Integer nrNoda) {
for (PieceOfFurniture piece : this.home.getFurniture()) {
if (piece.getTypFunkcji()!=null) {
if (typFunkcji.equals(piece.getTypFunkcji())) {
if (nrNoda.equals(piece.getNrNoda())) {
JOptionPane.showMessageDialog(null, "In this type of function already is nod nr = "+nrNoda);
return true;
}
}
}
}
return false;
}



Sorry for my english.

best regards
Robert
[May 5, 2013, 5:12:42 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
trojanrob
Newbie



Poland
Joined: Apr 17, 2013
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to get unique index furniture that is displayed in the panel ?

Problem solved.


this.home.getFurniture().indexOf(leadSelectedPieceOfFurniture)

[May 10, 2013, 2:54:20 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved