Sweet Home 3D 4.1

com.eteks.sweethome3d.viewcontroller
Class LevelController

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

public class LevelController
extends Object
implements Controller

A MVC controller for home levels view.

Author:
Emmanuel Puybaret

Nested Class Summary
static class LevelController.Property
          The properties that may be edited by the view associated to this controller.
 
Constructor Summary
LevelController(Home home, UserPreferences preferences, ViewFactory viewFactory, UndoableEditSupport undoSupport)
          Creates the controller of home levels view with undo support.
 
Method Summary
 void addPropertyChangeListener(LevelController.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 getElevation()
          Returns the edited elevation.
 Float getFloorThickness()
          Returns the edited floor thickness.
 Float getHeight()
          Returns the edited height.
 Level[] getLevels()
          Returns a copy of home levels.
 String getName()
          Returns the edited name.
 Integer getSelectedLevelIndex()
          Returns the selected level index.
 DialogView getView()
          Returns the view associated with this controller.
 boolean isPropertyEditable(LevelController.Property property)
          Returns true if the given property is editable.
 void modifyLevels()
          Controls the modification of selected level in the edited home.
 void removePropertyChangeListener(LevelController.Property property, PropertyChangeListener listener)
          Removes the property change listener in parameter from this controller.
 void setElevation(Float elevation)
          Sets the edited elevation.
 void setFloorThickness(Float floorThickness)
          Sets the edited floor thickness.
 void setHeight(Float height)
          Sets the edited height.
 void setName(String name)
          Sets the edited name.
protected  void updateProperties()
          Updates edited properties from selected level 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

LevelController

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

Method Detail

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(LevelController.Property property,
                                      PropertyChangeListener listener)
Adds the property change listener in parameter to this controller.


removePropertyChangeListener

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


updateProperties

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


isPropertyEditable

public boolean isPropertyEditable(LevelController.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 FLOOR_THICKNESS if the selected level is the first level and HEIGHT if the selected level is the last level.


setName

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


getName

public String getName()
Returns the edited name.


setElevation

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


getElevation

public Float getElevation()
Returns the edited elevation.


setFloorThickness

public void setFloorThickness(Float floorThickness)
Sets the edited floor thickness.


getFloorThickness

public Float getFloorThickness()
Returns the edited floor thickness.


setHeight

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


getHeight

public Float getHeight()
Returns the edited height.


getLevels

public Level[] getLevels()
Returns a copy of home levels.


getSelectedLevelIndex

public Integer getSelectedLevelIndex()
Returns the selected level index.


modifyLevels

public void modifyLevels()
Controls the modification of selected level in the edited home.


Sweet Home 3D 4.1

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