public class FurnitureController extends java.lang.Object implements Controller
Constructor and Description |
---|
FurnitureController(Home home,
UserPreferences preferences,
ViewFactory viewFactory)
Creates the controller of home furniture view.
|
FurnitureController(Home home,
UserPreferences preferences,
ViewFactory viewFactory,
ContentManager contentManager,
javax.swing.undo.UndoableEditSupport undoSupport)
Creates the controller of home furniture view with undo support.
|
Modifier and Type | Method and Description |
---|---|
void |
addFurniture(java.util.List<HomePieceOfFurniture> furniture)
Controls new furniture added to home.
|
void |
alignSelectedFurnitureOnBackSide()
Controls the alignment of selected furniture on the back side of the first selected piece.
|
void |
alignSelectedFurnitureOnBottom()
Controls the alignment of selected furniture on bottom of the first selected piece.
|
void |
alignSelectedFurnitureOnFrontSide()
Controls the alignment of selected furniture on the front side of the first selected piece.
|
void |
alignSelectedFurnitureOnLeft()
Controls the alignment of selected furniture on left of the first selected piece.
|
void |
alignSelectedFurnitureOnLeftSide()
Controls the alignment of selected furniture on the left side of the first selected piece.
|
void |
alignSelectedFurnitureOnRight()
Controls the alignment of selected furniture on right of the first selected piece.
|
void |
alignSelectedFurnitureOnRightSide()
Controls the alignment of selected furniture on the right side of the first selected piece.
|
void |
alignSelectedFurnitureOnTop()
Controls the alignment of selected furniture on top of the first selected piece.
|
void |
alignSelectedFurnitureSideBySide()
Controls the alignment of selected furniture on the sides of the first selected piece.
|
protected HomeFurnitureGroup |
createHomeFurnitureGroup(java.util.List<HomePieceOfFurniture> furniture)
Returns a new furniture group for the given furniture list.
|
HomePieceOfFurniture |
createHomePieceOfFurniture(PieceOfFurniture piece)
Returns a new home piece of furniture created from an other given
piece of furniture. |
void |
deleteFurniture(java.util.List<HomePieceOfFurniture> deletedFurniture)
Deletes the furniture of
deletedFurniture from home. |
void |
deleteSelection()
Controls the deletion of the current selected furniture in home.
|
void |
distributeSelectedFurniture(boolean horizontal)
Controls the distribution of the selected furniture along the axis orthogonal to the given one.
|
void |
distributeSelectedFurnitureHorizontally()
Controls the distribution of the selected furniture along horizontal axis.
|
void |
distributeSelectedFurnitureVertically()
Controls the distribution of the selected furniture along vertical axis.
|
View |
getView()
Returns the view associated with this controller.
|
void |
groupSelectedFurniture()
Groups the selected furniture as one piece of furniture.
|
void |
importFurniture()
Displays the wizard that helps to import furniture to home.
|
void |
importFurniture(java.lang.String modelName)
Displays the wizard that helps to import furniture to home with a
given model name.
|
protected boolean |
isPieceOfFurnitureDeletable(HomePieceOfFurniture piece)
Returns
true if the given piece may be deleted. |
protected boolean |
isPieceOfFurnitureMovable(HomePieceOfFurniture piece)
Returns
true if the given piece may be moved. |
protected boolean |
isPieceOfFurniturePartOfBasePlan(HomePieceOfFurniture piece)
Returns
true if the given piece is movable. |
void |
modifySelectedFurniture()
Controls the modification of selected furniture.
|
void |
selectAll()
Selects all furniture in home.
|
void |
setFurnitureVisibleProperties(java.util.List<HomePieceOfFurniture.SortableProperty> furnitureVisibleProperties)
Updates the furniture visible properties in home.
|
void |
setSelectedFurniture(java.util.List<HomePieceOfFurniture> selectedFurniture)
Updates the selected furniture in home.
|
java.util.List<HomePieceOfFurniture> |
sortFurniture(com.eteks.sweethome3d.viewcontroller.FurnitureController.AlignedPieceOfFurniture[] furniture,
HomePieceOfFurniture leadPiece,
java.awt.geom.Line2D orthogonalAxis)
Returns a list containing aligned furniture and lead piece sorted in the order of their distribution along
a line orthogonal to the given axis.
|
void |
sortFurniture(HomePieceOfFurniture.SortableProperty furnitureProperty)
Controls the sort of the furniture in home.
|
void |
toggleFurnitureSort(HomePieceOfFurniture.SortableProperty furnitureProperty)
Uses
furnitureProperty to sort home furniture
or cancels home furniture sort if home is already sorted on furnitureProperty |
void |
toggleFurnitureSortOrder()
Toggles home furniture sort order.
|
void |
toggleFurnitureVisibleProperty(HomePieceOfFurniture.SortableProperty furnitureProperty)
Toggles furniture property visibility in home.
|
void |
toggleSelectedFurnitureVisibility()
Controls the modification of the visibility of the selected piece of furniture.
|
void |
ungroupSelectedFurniture()
Ungroups the selected groups of furniture.
|
public FurnitureController(Home home, UserPreferences preferences, ViewFactory viewFactory)
home
- the home edited by this controller and its viewpreferences
- the preferences of the applicationviewFactory
- a factory able to create the furniture view managed by this controllerpublic FurnitureController(Home home, UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager, javax.swing.undo.UndoableEditSupport undoSupport)
public View getView()
getView
in interface Controller
public void addFurniture(java.util.List<HomePieceOfFurniture> furniture)
furniture
- the furniture to add.public void deleteSelection()
public void deleteFurniture(java.util.List<HomePieceOfFurniture> deletedFurniture)
deletedFurniture
from home.
Once the selected furniture is deleted, undo support will receive a new undoable edit.public void setSelectedFurniture(java.util.List<HomePieceOfFurniture> selectedFurniture)
public void selectAll()
protected boolean isPieceOfFurniturePartOfBasePlan(HomePieceOfFurniture piece)
true
if the given piece
is movable.protected boolean isPieceOfFurnitureMovable(HomePieceOfFurniture piece)
true
if the given piece
may be moved.
Default implementation always returns true
.protected boolean isPieceOfFurnitureDeletable(HomePieceOfFurniture piece)
true
if the given piece
may be deleted.
Default implementation always returns true
.public HomePieceOfFurniture createHomePieceOfFurniture(PieceOfFurniture piece)
piece
of furniture.public void toggleFurnitureSort(HomePieceOfFurniture.SortableProperty furnitureProperty)
furnitureProperty
to sort home furniture
or cancels home furniture sort if home is already sorted on furnitureProperty
furnitureProperty
- a property of HomePieceOfFurniture
class.public void toggleFurnitureSortOrder()
public void sortFurniture(HomePieceOfFurniture.SortableProperty furnitureProperty)
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.
furnitureProperty
- the furniture property on which the view wants
to sort the furniture it displays.public void setFurnitureVisibleProperties(java.util.List<HomePieceOfFurniture.SortableProperty> furnitureVisibleProperties)
public void toggleFurnitureVisibleProperty(HomePieceOfFurniture.SortableProperty furnitureProperty)
public void modifySelectedFurniture()
public void toggleSelectedFurnitureVisibility()
public void groupSelectedFurniture()
protected HomeFurnitureGroup createHomeFurnitureGroup(java.util.List<HomePieceOfFurniture> furniture)
public void ungroupSelectedFurniture()
public void importFurniture()
public void importFurniture(java.lang.String modelName)
public void alignSelectedFurnitureOnTop()
public void alignSelectedFurnitureOnBottom()
public void alignSelectedFurnitureOnLeft()
public void alignSelectedFurnitureOnRight()
public void alignSelectedFurnitureOnFrontSide()
public void alignSelectedFurnitureOnBackSide()
public void alignSelectedFurnitureOnLeftSide()
public void alignSelectedFurnitureOnRightSide()
public void alignSelectedFurnitureSideBySide()
public java.util.List<HomePieceOfFurniture> sortFurniture(com.eteks.sweethome3d.viewcontroller.FurnitureController.AlignedPieceOfFurniture[] furniture, HomePieceOfFurniture leadPiece, java.awt.geom.Line2D orthogonalAxis)
public void distributeSelectedFurnitureHorizontally()
public void distributeSelectedFurnitureVertically()
public void distributeSelectedFurniture(boolean horizontal)
© Copyrights 2006-2014 eTeks - All rights reserved
Distributed under GNU General Public License