Re: How to group furniture using a plug-in?
I thought it would be possible to create an empty group and then add the furniture to it separately.What other capabilities would you expect?
It was the addFurnitureToGroup method that caused me problems because it is necessary to have a list of furniture and a group of furniture as a parameter.Look at FurnitureController class to understand how a furniture group is created and handled.
As it is to add new light sources in the plan, the undo/redo function is not negligible.The difficult thing is probably to allow undo / redo on groups, but maybe you won't need that?
Code: Select all
getHomeController().getPlanController().setSelectedLevel(lightLevel);
List<HomePieceOfFurniture> singleLightSource = new ArrayList<HomePieceOfFurniture>();
singleLightSource.add(lightSourceClone);
getHomeController().getFurnitureController().addFurniture(singleLightSource);
severalLightSources.add(lightSourceClone);
...
getHomeController().getFurnitureController().setSelectedFurniture(severalLightSources);
getHomeController().getFurnitureController().groupSelectedFurniture();
HomeFurnitureGroup lightSourcesGroup = (HomeFurnitureGroup) getHome().getSelectedItems().get(0);