I need this unique index in HomeFurniturePanel to control attributes added to furniture.
Thanks in advance.
Robert
How to get unique index furniture that is displayed in the panel ?
This topic has been viewed 5548 times and has 3 replies
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.
By the way, it would be nice to explain also what is your project.
Emmanuel Puybaret, Sweet Home 3D creator
Re: How to get unique index furniture that is displayed in the panel ?
Hi,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.
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
Code: Select all
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
Re: How to get unique index furniture that is displayed in the panel ?
Problem solved.
Code: Select all
this.home.getFurniture().indexOf(leadSelectedPieceOfFurniture)
Who is online
Users browsing this forum: No registered users and 1 guest