public class LevelController extends java.lang.Object implements Controller
Modifier and Type | Class and Description |
---|---|
static class |
LevelController.Property
The properties that may be edited by the view associated to this controller.
|
Constructor and Description |
---|
LevelController(Home home,
UserPreferences preferences,
ViewFactory viewFactory,
javax.swing.undo.UndoableEditSupport undoSupport)
Creates the controller of home levels view with undo support.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(LevelController.Property property,
java.beans.PropertyChangeListener listener)
Adds the property change
listener in parameter to this controller. |
void |
displayView(View parentView)
Displays the view controlled by this controller.
|
java.lang.Float |
getElevation()
Returns the edited elevation.
|
java.lang.Integer |
getElevationIndex()
Returns the edited elevation index.
|
java.lang.Float |
getFloorThickness()
Returns the edited floor thickness.
|
java.lang.Float |
getHeight()
Returns the edited height.
|
Level[] |
getLevels()
Returns a copy of home levels.
|
java.lang.String |
getName()
Returns the edited name.
|
java.lang.Integer |
getSelectedLevelIndex()
Returns the selected level index.
|
DialogView |
getView()
Returns the view associated with this controller.
|
java.lang.Boolean |
getViewable()
Returns the edited viewable attribute.
|
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,
java.beans.PropertyChangeListener listener)
Removes the property change
listener in parameter from this controller. |
void |
setElevation(java.lang.Float elevation)
Sets the edited elevation.
|
void |
setElevationIndex(java.lang.Integer elevationIndex)
Sets the edited elevation index.
|
void |
setFloorThickness(java.lang.Float floorThickness)
Sets the edited floor thickness.
|
void |
setHeight(java.lang.Float height)
Sets the edited height.
|
void |
setName(java.lang.String name)
Sets the edited name.
|
void |
setViewable(java.lang.Boolean viewable)
Sets the edited viewable attribute.
|
protected void |
updateProperties()
Updates edited properties from selected level in the home edited by this controller.
|
public LevelController(Home home, UserPreferences preferences, ViewFactory viewFactory, javax.swing.undo.UndoableEditSupport undoSupport)
public DialogView getView()
getView
in interface Controller
public void displayView(View parentView)
public void addPropertyChangeListener(LevelController.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter to this controller.public void removePropertyChangeListener(LevelController.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter from this controller.protected void updateProperties()
public boolean isPropertyEditable(LevelController.Property property)
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
.public void setName(java.lang.String name)
public java.lang.String getName()
public void setViewable(java.lang.Boolean viewable)
public java.lang.Boolean getViewable()
public void setElevation(java.lang.Float elevation)
public java.lang.Float getElevation()
public void setElevationIndex(java.lang.Integer elevationIndex)
public java.lang.Integer getElevationIndex()
public void setFloorThickness(java.lang.Float floorThickness)
public java.lang.Float getFloorThickness()
public void setHeight(java.lang.Float height)
public java.lang.Float getHeight()
public Level[] getLevels()
public java.lang.Integer getSelectedLevelIndex()
public void modifyLevels()
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License