Class FurnitureController
				
				
			
				
				
				
					
Defined in:  SweetHome3D.js.
				
			
| Constructor Attributes | Constructor Name and Description | 
|---|---|
| 
								FurnitureController(home, preferences, viewFactory, contentManager, undoSupport)
							 Creates the controller of home furniture view with undo support. | 
| Method Attributes | Method Name and Description | 
|---|---|
| addFurnitureToGroup(furniture, group)
								 Controls new furniture added to the given group. | |
| Controls the alignment of selected furniture on the back side of the first selected piece. | |
| Controls the alignment of selected furniture on bottom of the first selected piece. | |
| Controls the alignment of selected furniture on the front side of the first selected piece. | |
| Controls the alignment of selected furniture on left of the first selected piece. | |
| Controls the alignment of selected furniture on the left side of the first selected piece. | |
| Controls the alignment of selected furniture on right of the first selected piece. | |
| Controls the alignment of selected furniture on the right side of the first selected piece. | |
| Controls the alignment of selected furniture on top of the first selected piece. | |
| Controls the alignment of selected furniture on the sides of the first selected piece. | |
| createHomeFurnitureGroup(furniture, leadingPiece)
								 Returns a new furniture group for the given furniture list. | |
| createHomePieceOfFurniture(piece)
								 Returns a new home piece of furniture created from an other given  pieceof furniture. | |
| deleteFurniture(deletedFurniture)
								 Deletes the furniture of  deletedFurniturefrom home. | |
| Controls the deletion of the current selected furniture in home. | |
| distributeSelectedFurniture(horizontal)
								 Controls the distribution of the selected furniture along the axis orthogonal to the given one. | |
| Controls the distribution of the selected furniture along horizontal axis. | |
| Controls the distribution of the selected furniture along vertical axis. | |
| getFurnitureInSameGroup(piece)
								 Returns the furniture list of the given  piecewhich belongs to same group
or home furniture if it doesn't belong to home furniture. | |
| getView()
								 Returns the view associated with this controller. | |
| Groups the selected furniture as one piece of furniture. | |
| importFurniture(modelName)
								 Displays the wizard that helps to import furniture to home with a
given model name. | |
| isPieceOfFurnitureDeletable(piece)
								 Returns  trueif the givenpiecemay be deleted. | |
| isPieceOfFurnitureMovable(piece)
								 Returns  trueif the givenpiecemay be moved. | |
| Returns  trueif the givenpieceisn't movable. | |
| Returns  trueif the given piece is viewable and
its height and elevation make it viewable at the selected level in home. | |
| Controls the modification of selected furniture. | |
| moveSelectedFurnitureBefore(beforePiece)
								 Reorders the selected furniture in home to place it before the given piece. | |
| Resets the elevation of the selected furniture to its default elevation. | |
| Selects all furniture in home. | |
| setFurnitureVisibleProperties(furnitureVisibleProperties)
								 Updates the furniture visible properties in home. | |
| setFurnitureVisiblePropertyNames(furnitureVisiblePropertyNames)
								 Updates the furniture visible properties in home. | |
| setHomeProperty(propertyName, propertyValue)
								 Controls the change of value of a property in home. | |
| setSelectedFurniture(selectedFurniture, resetSelection)
								 Updates the selected furniture in home, unselecting all other kinds of selected objects
when  resetSelectionistrue. | |
| setVisualProperty(propertyName, propertyValue)
								 Controls the change of value of a visual property in home. | |
| sortFurniture(furniturePropertyName)
								 Controls the sort of the furniture in home. | |
| toggleFurnitureSort(furniturePropertyName)
								 Uses  furniturePropertyNameto sort home furniture
or cancels home furniture sort if home is already sorted onfurnitureProperty | |
| Toggles home furniture sort order. | |
| toggleFurnitureVisibleProperty(furniturePropertyName)
								 Toggles furniture property visibility in home. | |
| Controls the modification of the visibility of the selected piece of furniture. | |
| Ungroups the selected groups of furniture. | 
					Class Detail
				
				
				
						FurnitureController(home, preferences, viewFactory, contentManager, undoSupport)
				
				
				
					Creates the controller of home furniture view with undo support.
					
Author: Emmanuel Puybaret.
				
				
				
				
					
						Author: Emmanuel Puybaret.
- Parameters:
- {Home} home
- {UserPreferences} preferences
- {Object} viewFactory
- {Object} contentManager
- {javax.swing.undo.UndoableEditSupport} undoSupport
					Method Detail
				
				
					 
					
					
					
					addFurnitureToGroup(furniture, group)
					
					
					
						Controls new furniture added to the given group.
Once added the furniture will be selected in view
and undo support will receive a new undoable edit.
						
						
					
					
					
					
						
							- Parameters:
- {HomePieceOfFurniture[]} furniture
- the furniture to add.
- {HomeFurnitureGroup} group
- the group to which furniture will be added.
					
					
					alignSelectedFurnitureOnBackSide()
					
					
					
						Controls the alignment of selected furniture on the back side of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnBottom()
					
					
					
						Controls the alignment of selected furniture on bottom of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnFrontSide()
					
					
					
						Controls the alignment of selected furniture on the front side of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnLeft()
					
					
					
						Controls the alignment of selected furniture on left of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnLeftSide()
					
					
					
						Controls the alignment of selected furniture on the left side of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnRight()
					
					
					
						Controls the alignment of selected furniture on right of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnRightSide()
					
					
					
						Controls the alignment of selected furniture on the right side of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureOnTop()
					
					
					
						Controls the alignment of selected furniture on top of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					alignSelectedFurnitureSideBySide()
					
					
					
						Controls the alignment of selected furniture on the sides of the first selected piece.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					{HomeFurnitureGroup}
					createHomeFurnitureGroup(furniture, leadingPiece)
					
					
					
						Returns a new furniture group for the given furniture list.
						
						
					
					
					
					
						
							- Parameters:
- {HomePieceOfFurniture[]} furniture
- {HomePieceOfFurniture} leadingPiece
- Returns:
- {HomeFurnitureGroup}
					
					{HomePieceOfFurniture}
					createHomePieceOfFurniture(piece)
					
					
					
						Returns a new home piece of furniture created from an other given 
					
					
					
						
							piece of furniture.
						
						
					- Parameters:
- {Object} piece
- Returns:
- {HomePieceOfFurniture}
					
					
					deleteFurniture(deletedFurniture)
					
					
					
						Deletes the furniture of 
					
					
					
						
							deletedFurniture from home.
Once the selected furniture is deleted, undo support will receive a new undoable edit.
						
						
					- Parameters:
- {HomePieceOfFurniture[]} deletedFurniture
					
					
					deleteSelection()
					
					
					
						Controls the deletion of the current selected furniture in home.
Once the selected furniture is deleted, undo support will receive a new undoable edit.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					distributeSelectedFurniture(horizontal)
					
					
					
						Controls the distribution of the selected furniture along the axis orthogonal to the given one.
						
						
					
					
					
					
						
							- Parameters:
- {boolean} horizontal
					
					
					distributeSelectedFurnitureHorizontally()
					
					
					
						Controls the distribution of the selected furniture along horizontal axis.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					distributeSelectedFurnitureVertically()
					
					
					
						Controls the distribution of the selected furniture along vertical axis.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					{HomePieceOfFurniture[]}
					getFurnitureInSameGroup(piece)
					
					
					
						Returns the furniture list of the given 
					
					
					
						
							piece which belongs to same group
or home furniture if it doesn't belong to home furniture.
						
						
					- Parameters:
- {HomePieceOfFurniture} piece
- Returns:
- {HomePieceOfFurniture[]}
					
					{Object}
					getView()
					
					
					
						Returns the view associated with this controller.
						
						
					
					
					
					
						
						
						
						
						
							- Returns:
- {Object}
					
					
					groupSelectedFurniture()
					
					
					
						Groups the selected furniture as one piece of furniture.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					importFurniture(modelName)
					
					
					
						Displays the wizard that helps to import furniture to home with a
given model name.
						
						
					
					
					
					
						
							- Parameters:
- {string} modelName
					
					{boolean}
					isPieceOfFurnitureDeletable(piece)
					
					
					
						Returns 
					
					
					
						
							true if the given piece may be deleted.
Default implementation always returns true.
						
						
					- Parameters:
- {HomePieceOfFurniture} piece
- Returns:
- {boolean}
					
					{boolean}
					isPieceOfFurnitureMovable(piece)
					
					
					
						Returns 
					
					
					
						
							true if the given piece may be moved.
Default implementation always returns true.
						
						
					- Parameters:
- {HomePieceOfFurniture} piece
- Returns:
- {boolean}
					
					{boolean}
					isPieceOfFurniturePartOfBasePlan(piece)
					
					
					
						Returns 
					
					
					
						
							true if the given piece isn't movable.
						
						
					- Parameters:
- {HomePieceOfFurniture} piece
- Returns:
- {boolean}
					
					{boolean}
					isPieceOfFurnitureVisibleAtSelectedLevel(piece)
					
					
					
						Returns 
					
					
					
						
							true if the given piece is viewable and
its height and elevation make it viewable at the selected level in home.
						
						
					- Parameters:
- {HomePieceOfFurniture} piece
- Returns:
- {boolean}
					
					
					modifySelectedFurniture()
					
					
					
						Controls the modification of selected furniture.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					moveSelectedFurnitureBefore(beforePiece)
					
					
					
						Reorders the selected furniture in home to place it before the given piece.
						
						
					
					
					
					
						
							- Parameters:
- {HomePieceOfFurniture} beforePiece
					
					
					resetFurnitureElevation()
					
					
					
						Resets the elevation of the selected furniture to its default elevation.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					selectAll()
					
					
					
						Selects all furniture in home.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					setFurnitureVisibleProperties(furnitureVisibleProperties)
					
					
					
						Updates the furniture visible properties in home.
						
						
					
					
					
					
						
							- Parameters:
- {string[]} furnitureVisibleProperties
- Deprecated:
- 
								should be replaced by calls to #setFurnitureVisiblePropertyNames(List) to allow displaying additional properties. 
					
					
					setFurnitureVisiblePropertyNames(furnitureVisiblePropertyNames)
					
					
					
						Updates the furniture visible properties in home.
						
						
					
					
					
					
						
							- Parameters:
- {string[]} furnitureVisiblePropertyNames
					
					
					setHomeProperty(propertyName, propertyValue)
					
					
					
						Controls the change of value of a property in home.
						
						
					
					
					
					
						
							- Parameters:
- {string} propertyName
- {string} propertyValue
					
					
					setSelectedFurniture(selectedFurniture, resetSelection)
					
					
					
						Updates the selected furniture in home, unselecting all other kinds of selected objects
when 
					
					
					
						
							resetSelection is true.
						
						
					- Parameters:
- {HomePieceOfFurniture[]} selectedFurniture
- {boolean} resetSelection
					
					
					setVisualProperty(propertyName, propertyValue)
					
					
					
						Controls the change of value of a visual property in home.
						
						
					
					
					
					
						
							- Parameters:
- {string} propertyName
- {Object} propertyValue
- Deprecated:
- should be replaced by a call to {@link #setHomeProperty(String, String)} to ensure the property can be easily saved and read.
					
					
					sortFurniture(furniturePropertyName)
					
					
					
						Controls the sort of the furniture in home. If home furniture isn't sorted
or is sorted on an other property, it will be sorted on the given
					
					
					
						
							furnitureProperty in ascending order. If home furniture is already
sorted on the given furnitureProperty, it will be sorted in descending
order, if the sort is in ascending order, otherwise it won't be sorted at all
and home furniture will be listed in insertion order.
						
						
					- Parameters:
- {string} furniturePropertyName
- the furniture property on which the view wants to sort the furniture it displays.
					
					
					toggleFurnitureSort(furniturePropertyName)
					
					
					
						Uses 
					
					
					
						
							furniturePropertyName to sort home furniture
or cancels home furniture sort if home is already sorted on furnitureProperty
						
						
					- Parameters:
- {string} furniturePropertyName
- a property of HomePieceOfFurniture class.
					
					
					toggleFurnitureSortOrder()
					
					
					
						Toggles home furniture sort order.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					toggleFurnitureVisibleProperty(furniturePropertyName)
					
					
					
						Toggles furniture property visibility in home.
						
						
					
					
					
					
						
							- Parameters:
- {string} furniturePropertyName
					
					
					toggleSelectedFurnitureVisibility()
					
					
					
						Controls the modification of the visibility of the selected piece of furniture.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					ungroupSelectedFurniture()
					
					
					
						Ungroups the selected groups of furniture.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
				
			
			
		
			
			
			
