Class Index | File Index

Classes


Class FurnitureController


Defined in: SweetHome3D.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
FurnitureController(home, preferences, viewFactory, contentManager, undoSupport)
Creates the controller of home furniture view with undo support.
Method Summary
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.
 
Returns a new home piece of furniture created from an other given piece of furniture.
 
deleteFurniture(deletedFurniture)
Deletes the furniture of deletedFurniture from home.
 
Controls the deletion of the current selected furniture in home.
 
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.
 
Returns the furniture list of the given piece which belongs to same group or home furniture if it doesn't belong to home furniture.
 
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.
 
Returns true if the given piece may be deleted.
 
Returns true if the given piece may be moved.
 
Returns true if the given piece isn't movable.
 
Returns true if 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.
 
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.
 
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 resetSelection is true.
 
sortFurniture(furnitureProperty)
Controls the sort of the furniture in home.
 
toggleFurnitureSort(furnitureProperty)
Uses furnitureProperty to sort home furniture or cancels home furniture sort if home is already sorted on furnitureProperty
 
Toggles home furniture sort order.
 
toggleFurnitureVisibleProperty(furnitureProperty)
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.
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

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

sortFurniture(furnitureProperty)
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} furnitureProperty
the furniture property on which the view wants to sort the furniture it displays.

toggleFurnitureSort(furnitureProperty)
Uses furnitureProperty to sort home furniture or cancels home furniture sort if home is already sorted on furnitureProperty
Parameters:
{string} furnitureProperty
a property of HomePieceOfFurniture class.

toggleFurnitureSortOrder()
Toggles home furniture sort order.

toggleFurnitureVisibleProperty(furnitureProperty)
Toggles furniture property visibility in home.
Parameters:
{string} furnitureProperty

toggleSelectedFurnitureVisibility()
Controls the modification of the visibility of the selected piece of furniture.

ungroupSelectedFurniture()
Ungroups the selected groups of furniture.

© Copyright 2021 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Tue Mar 02 2021 19:55:52 GMT+0100 (CET)