Sweet Home 3D 4.0

com.eteks.sweethome3d.viewcontroller
Class HomeFurnitureController

java.lang.Object
  extended by com.eteks.sweethome3d.viewcontroller.HomeFurnitureController
All Implemented Interfaces:
Controller

public class HomeFurnitureController
extends Object
implements Controller

A MVC controller for home furniture view.

Author:
Emmanuel Puybaret

Nested Class Summary
static class HomeFurnitureController.FurniturePaint
          The possible values for paint type.
static class HomeFurnitureController.FurnitureShininess
          The possible values for shininess type.
static class HomeFurnitureController.Property
          The properties that may be edited by the view associated to this controller.
 
Constructor Summary
HomeFurnitureController(Home home, UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager, UndoableEditSupport undoSupport)
          Creates the controller of home furniture view with undo support.
HomeFurnitureController(Home home, UserPreferences preferences, ViewFactory viewFactory, UndoableEditSupport undoSupport)
          Creates the controller of home furniture view with undo support.
 
Method Summary
 void addPropertyChangeListener(HomeFurnitureController.Property property, PropertyChangeListener listener)
          Adds the property change listener in parameter to this controller.
 void displayView(View parentView)
          Displays the view controlled by this controller.
 Float getAngle()
          Returns the edited angle in radians.
 Integer getAngleInDegrees()
          Returns the edited angle in degrees.
 Boolean getBasePlanItem()
          Returns whether furniture is a base plan item or not.
 Integer getColor()
          Returns the edited color.
 Float getDepth()
          Returns the edited depth.
 String getDescription()
          Returns the edited description.
 Float getElevation()
          Returns the edited elevation.
 Float getHeight()
          Returns the edited height.
 Content getIcon()
          Returns the edited icon.
 Float getLightPower()
          Returns the edited light power.
 ModelMaterialsController getModelMaterialsController()
          Returns the model materials controller of the piece.
 Boolean getModelMirrored()
          Returns whether furniture model is mirrored or not.
 String getName()
          Returns the edited name.
 Boolean getNameVisible()
          Returns whether furniture name should be drawn or not.
 HomeFurnitureController.FurniturePaint getPaint()
          Returns whether the piece is colored, textured, uses customized materials or unknown painted.
 BigDecimal getPrice()
          Returns the edited price.
 HomeFurnitureController.FurnitureShininess getShininess()
          Returns whether the piece is shininess is the default one, matt, shiny or unknown.
 TextureChoiceController getTextureController()
          Returns the texture controller of the piece.
 DialogView getView()
          Returns the view associated with this controller.
 Boolean getVisible()
          Returns whether furniture is visible or not.
 Float getWidth()
          Returns the edited width.
 Float getX()
          Returns the edited abscissa.
 Float getY()
          Returns the edited ordinate.
 boolean isBasePlanItemEditable()
          Deprecated. the method is wrongly named and should be replaced by isBasePlanItemEnabled.
 boolean isBasePlanItemEnabled()
          Returns true if base plan item is an enabled property.
 boolean isDeformable()
          Returns whether furniture model can be deformed or not.
 boolean isLightPowerEditable()
          Returns true if light power is an editable property.
 boolean isPropertyEditable(HomeFurnitureController.Property property)
          Returns true if the given property is editable.
 boolean isProportional()
          Returns whether furniture proportions should be kept or not.
 boolean isResizable()
          Returns whether furniture model can be resized or not.
 boolean isTexturable()
          Returns whether the color or the texture of the furniture model can be changed or not.
 void modifyFurniture()
          Controls the modification of selected furniture in the edited home.
 void removePropertyChangeListener(HomeFurnitureController.Property property, PropertyChangeListener listener)
          Removes the property change listener in parameter from this controller.
 void setAngle(Float angle)
          Sets the edited angle in radians.
 void setAngleInDegrees(Integer angleInDegrees)
          Sets the edited angle in degrees.
 void setBasePlanItem(Boolean basePlanItem)
          Sets whether furniture is a base plan item or not.
 void setColor(Integer color)
          Sets the edited color.
 void setDepth(Float depth)
          Sets the edited depth.
 void setDescription(String description)
          Sets the edited description.
 void setElevation(Float elevation)
          Sets the edited elevation.
 void setHeight(Float height)
          Sets the edited height.
 void setLightPower(Float lightPower)
          Sets the edited light power.
 void setModelMirrored(Boolean modelMirrored)
          Sets whether furniture model is mirrored or not.
 void setName(String name)
          Sets the edited name.
 void setNameVisible(Boolean nameVisible)
          Sets whether furniture name is visible or not.
 void setPaint(HomeFurnitureController.FurniturePaint paint)
          Sets whether the piece is colored, textured, uses customized materials or unknown painted.
 void setPrice(BigDecimal price)
          Sets the edited price.
 void setProportional(boolean proportional)
          Sets whether furniture proportions should be kept.
 void setShininess(HomeFurnitureController.FurnitureShininess shininess)
          Sets whether the piece shininess is the default one, matt, shiny or unknown.
 void setVisible(Boolean visible)
          Sets whether furniture is visible or not.
 void setWidth(Float width)
          Sets the edited width.
 void setX(Float x)
          Sets the edited abscissa.
 void setY(Float y)
          Sets the edited ordinate.
protected  void updateProperties()
          Updates edited properties from selected furniture in the home edited by this controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeFurnitureController

public HomeFurnitureController(Home home,
                               UserPreferences preferences,
                               ViewFactory viewFactory,
                               UndoableEditSupport undoSupport)
Creates the controller of home furniture view with undo support.


HomeFurnitureController

public HomeFurnitureController(Home home,
                               UserPreferences preferences,
                               ViewFactory viewFactory,
                               ContentManager contentManager,
                               UndoableEditSupport undoSupport)
Creates the controller of home furniture view with undo support.

Method Detail

getTextureController

public TextureChoiceController getTextureController()
Returns the texture controller of the piece.


getModelMaterialsController

public ModelMaterialsController getModelMaterialsController()
Returns the model materials controller of the piece.


getView

public DialogView getView()
Returns the view associated with this controller.

Specified by:
getView in interface Controller

displayView

public void displayView(View parentView)
Displays the view controlled by this controller.


addPropertyChangeListener

public void addPropertyChangeListener(HomeFurnitureController.Property property,
                                      PropertyChangeListener listener)
Adds the property change listener in parameter to this controller.


removePropertyChangeListener

public void removePropertyChangeListener(HomeFurnitureController.Property property,
                                         PropertyChangeListener listener)
Removes the property change listener in parameter from this controller.


updateProperties

protected void updateProperties()
Updates edited properties from selected furniture in the home edited by this controller.


isPropertyEditable

public boolean isPropertyEditable(HomeFurnitureController.Property property)
Returns true if the given property is editable. Depending on whether a property is editable or not, the view associated to this controller may render it differently. The implementation of this method always returns true except for DESCRIPTION and PRICE properties.


getIcon

public Content getIcon()
Returns the edited icon.


setName

public void setName(String name)
Sets the edited name.


getName

public String getName()
Returns the edited name.


setNameVisible

public void setNameVisible(Boolean nameVisible)
Sets whether furniture name is visible or not.


getNameVisible

public Boolean getNameVisible()
Returns whether furniture name should be drawn or not.


setDescription

public void setDescription(String description)
Sets the edited description.

Since:
4.0

getDescription

public String getDescription()
Returns the edited description.

Since:
4.0

setPrice

public void setPrice(BigDecimal price)
Sets the edited price.

Since:
4.0

getPrice

public BigDecimal getPrice()
Returns the edited price.

Since:
4.0

setX

public void setX(Float x)
Sets the edited abscissa.


getX

public Float getX()
Returns the edited abscissa.


setY

public void setY(Float y)
Sets the edited ordinate.


getY

public Float getY()
Returns the edited ordinate.


setElevation

public void setElevation(Float elevation)
Sets the edited elevation.


getElevation

public Float getElevation()
Returns the edited elevation.


setAngleInDegrees

public void setAngleInDegrees(Integer angleInDegrees)
Sets the edited angle in degrees.


getAngleInDegrees

public Integer getAngleInDegrees()
Returns the edited angle in degrees.


setAngle

public void setAngle(Float angle)
Sets the edited angle in radians.

Since:
3.6

getAngle

public Float getAngle()
Returns the edited angle in radians.

Since:
3.6

isBasePlanItemEnabled

public boolean isBasePlanItemEnabled()
Returns true if base plan item is an enabled property.

Since:
4.0

isBasePlanItemEditable

public boolean isBasePlanItemEditable()
Deprecated. the method is wrongly named and should be replaced by isBasePlanItemEnabled.

Returns true if base plan item is an enabled property.


setBasePlanItem

public void setBasePlanItem(Boolean basePlanItem)
Sets whether furniture is a base plan item or not.


getBasePlanItem

public Boolean getBasePlanItem()
Returns whether furniture is a base plan item or not.


setWidth

public void setWidth(Float width)
Sets the edited width.


getWidth

public Float getWidth()
Returns the edited width.


setDepth

public void setDepth(Float depth)
Sets the edited depth.


getDepth

public Float getDepth()
Returns the edited depth.


setHeight

public void setHeight(Float height)
Sets the edited height.


getHeight

public Float getHeight()
Returns the edited height.


setProportional

public void setProportional(boolean proportional)
Sets whether furniture proportions should be kept.


isProportional

public boolean isProportional()
Returns whether furniture proportions should be kept or not.


setColor

public void setColor(Integer color)
Sets the edited color.


getColor

public Integer getColor()
Returns the edited color.


setPaint

public void setPaint(HomeFurnitureController.FurniturePaint paint)
Sets whether the piece is colored, textured, uses customized materials or unknown painted.


getPaint

public HomeFurnitureController.FurniturePaint getPaint()
Returns whether the piece is colored, textured, uses customized materials or unknown painted.


setShininess

public void setShininess(HomeFurnitureController.FurnitureShininess shininess)
Sets whether the piece shininess is the default one, matt, shiny or unknown.


getShininess

public HomeFurnitureController.FurnitureShininess getShininess()
Returns whether the piece is shininess is the default one, matt, shiny or unknown.


setVisible

public void setVisible(Boolean visible)
Sets whether furniture is visible or not.


getVisible

public Boolean getVisible()
Returns whether furniture is visible or not.


setModelMirrored

public void setModelMirrored(Boolean modelMirrored)
Sets whether furniture model is mirrored or not.


getModelMirrored

public Boolean getModelMirrored()
Returns whether furniture model is mirrored or not.


isLightPowerEditable

public boolean isLightPowerEditable()
Returns true if light power is an editable property.


getLightPower

public Float getLightPower()
Returns the edited light power.


setLightPower

public void setLightPower(Float lightPower)
Sets the edited light power.


isResizable

public boolean isResizable()
Returns whether furniture model can be resized or not.


isDeformable

public boolean isDeformable()
Returns whether furniture model can be deformed or not.


isTexturable

public boolean isTexturable()
Returns whether the color or the texture of the furniture model can be changed or not.


modifyFurniture

public void modifyFurniture()
Controls the modification of selected furniture in the edited home.


Sweet Home 3D 4.0

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License