Sweet Home 3D 4.0

com.eteks.sweethome3d.viewcontroller
Class UserPreferencesController

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

public class UserPreferencesController
extends Object
implements Controller

A MVC controller for user preferences view.

Author:
Emmanuel Puybaret

Nested Class Summary
static class UserPreferencesController.Property
          The properties that may be edited by the view associated to this controller.
 
Constructor Summary
UserPreferencesController(UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager)
          Creates the controller of user preferences view.
UserPreferencesController(UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager, HomeController homeController)
          Creates the controller of user preferences view.
 
Method Summary
 void addPropertyChangeListener(UserPreferencesController.Property property, PropertyChangeListener listener)
          Adds the property change listener in parameter to this controller.
 void checkUpdates()
          Checks if some updates are available.
 void displayView(View parentView)
          Displays the view controlled by this controller.
 int getAutoSaveDelayForRecovery()
          Returns the edited auto recovery save delay.
 String getLanguage()
          Returns the edited language.
 float getNewFloorThickness()
          Returns the edited new floor thickness.
 float getNewWallHeight()
          Returns the edited new wall height.
 TextureImage getNewWallPattern()
          Returns the edited new wall top pattern in plan.
 float getNewWallThickness()
          Returns the edited new wall thickness.
 LengthUnit getUnit()
          Returns the edited unit.
 DialogView getView()
          Returns the view associated with this controller.
 TextureImage getWallPattern()
          Returns the default walls top pattern in plan.
 void importLanguageLibrary()
          Imports a language library chosen by the user.
 boolean isAerialViewCenteredOnSelectionEnabled()
          Returns whether aerial view should be centered on selection or not.
 boolean isAutoSaveForRecoveryEnabled()
          Returns true if auto recovery save is enabled.
 boolean isCheckUpdatesEnabled()
          Returns true if updates should be checked.
 boolean isFurnitureCatalogViewedInTree()
          Returns true if furniture catalog should be viewed in a tree.
 boolean isFurnitureViewedFromTop()
          Returns how furniture should be displayed in plan.
 boolean isGridVisible()
          Returns whether grid is visible or not.
 boolean isMagnetismEnabled()
          Returns whether magnetism is enabled or not.
 boolean isNavigationPanelVisible()
          Returns true if the navigation panel should be displayed.
 boolean isPropertyEditable(UserPreferencesController.Property property)
          Returns true if the given property is editable.
 boolean isRoomFloorColoredOrTextured()
          Returns true if floor texture is visible in plan.
 boolean isRulersVisible()
          Returns whether rulers are visible or not.
 boolean mayImportLanguageLibrary()
          Returns true if language libraries can be imported.
 void modifyUserPreferences()
          Controls the modification of user preferences.
 void removePropertyChangeListener(UserPreferencesController.Property property, PropertyChangeListener listener)
          Removes the property change listener in parameter from this controller.
 void resetDisplayedActionTips()
          Resets the displayed flags of action tips.
 void setAerialViewCenteredOnSelectionEnabled(boolean aerialViewCenteredOnSelectionEnabled)
          Sets whether aerial view should be centered on selection or not.
 void setAutoSaveDelayForRecovery(int autoSaveDelayForRecovery)
          Sets the edited auto recovery save delay.
 void setAutoSaveForRecoveryEnabled(boolean autoSaveForRecoveryEnabled)
          Sets whether auto recovery save is enabled or not.
 void setCheckUpdatesEnabled(boolean updatesChecked)
          Sets whether updates should be checked or not.
 void setFurnitureCatalogViewedInTree(boolean furnitureCatalogViewedInTree)
          Sets whether the furniture catalog should be viewed in a tree or a different way.
 void setFurnitureViewedFromTop(boolean furnitureViewedFromTop)
          Sets how furniture should be displayed in plan.
 void setGridVisible(boolean gridVisible)
          Sets whether grid is visible or not.
 void setLanguage(String language)
          Sets the edited language.
 void setMagnetismEnabled(boolean magnetismEnabled)
          Sets whether magnetism is enabled or not.
 void setNavigationPanelVisible(boolean navigationPanelVisible)
          Sets whether the navigation panel should be displayed or not.
 void setNewFloorThickness(float newFloorThickness)
          Sets the edited new floor thickness.
 void setNewWallHeight(float newWallHeight)
          Sets the edited new wall height.
 void setNewWallPattern(TextureImage newWallPattern)
          Sets the edited new wall top pattern in plan, and notifies listeners of this change.
 void setNewWallThickness(float newWallThickness)
          Sets the edited new wall thickness.
 void setRoomFloorColoredOrTextured(boolean floorTextureVisible)
          Sets whether floor texture is visible in plan or not.
 void setRulersVisible(boolean rulersVisible)
          Sets whether rulers are visible or not.
 void setUnit(LengthUnit unit)
          Sets the edited unit.
 void setWallPattern(TextureImage wallPattern)
          Sets default walls top pattern in plan, and notifies listeners of this change.
protected  void updateProperties()
          Updates preferences properties edited by this controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserPreferencesController

public UserPreferencesController(UserPreferences preferences,
                                 ViewFactory viewFactory,
                                 ContentManager contentManager)
Creates the controller of user preferences view.


UserPreferencesController

public UserPreferencesController(UserPreferences preferences,
                                 ViewFactory viewFactory,
                                 ContentManager contentManager,
                                 HomeController homeController)
Creates the controller of user preferences view.

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


removePropertyChangeListener

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


updateProperties

protected void updateProperties()
Updates preferences properties edited by this controller.


isPropertyEditable

public boolean isPropertyEditable(UserPreferencesController.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 LANGUAGE if it's not editable.


setLanguage

public void setLanguage(String language)
Sets the edited language.


getLanguage

public String getLanguage()
Returns the edited language.


setUnit

public void setUnit(LengthUnit unit)
Sets the edited unit.


getUnit

public LengthUnit getUnit()
Returns the edited unit.


setFurnitureCatalogViewedInTree

public void setFurnitureCatalogViewedInTree(boolean furnitureCatalogViewedInTree)
Sets whether the furniture catalog should be viewed in a tree or a different way.


isFurnitureCatalogViewedInTree

public boolean isFurnitureCatalogViewedInTree()
Returns true if furniture catalog should be viewed in a tree.


setNavigationPanelVisible

public void setNavigationPanelVisible(boolean navigationPanelVisible)
Sets whether the navigation panel should be displayed or not.


isNavigationPanelVisible

public boolean isNavigationPanelVisible()
Returns true if the navigation panel should be displayed.


setAerialViewCenteredOnSelectionEnabled

public void setAerialViewCenteredOnSelectionEnabled(boolean aerialViewCenteredOnSelectionEnabled)
Sets whether aerial view should be centered on selection or not.

Since:
4.0

isAerialViewCenteredOnSelectionEnabled

public boolean isAerialViewCenteredOnSelectionEnabled()
Returns whether aerial view should be centered on selection or not.

Since:
4.0

setMagnetismEnabled

public void setMagnetismEnabled(boolean magnetismEnabled)
Sets whether magnetism is enabled or not.


isMagnetismEnabled

public boolean isMagnetismEnabled()
Returns whether magnetism is enabled or not.


setRulersVisible

public void setRulersVisible(boolean rulersVisible)
Sets whether rulers are visible or not.


isRulersVisible

public boolean isRulersVisible()
Returns whether rulers are visible or not.


setGridVisible

public void setGridVisible(boolean gridVisible)
Sets whether grid is visible or not.


isGridVisible

public boolean isGridVisible()
Returns whether grid is visible or not.


setFurnitureViewedFromTop

public void setFurnitureViewedFromTop(boolean furnitureViewedFromTop)
Sets how furniture should be displayed in plan.


isFurnitureViewedFromTop

public boolean isFurnitureViewedFromTop()
Returns how furniture should be displayed in plan.


setRoomFloorColoredOrTextured

public void setRoomFloorColoredOrTextured(boolean floorTextureVisible)
Sets whether floor texture is visible in plan or not.


isRoomFloorColoredOrTextured

public boolean isRoomFloorColoredOrTextured()
Returns true if floor texture is visible in plan.


setWallPattern

public void setWallPattern(TextureImage wallPattern)
Sets default walls top pattern in plan, and notifies listeners of this change.


getWallPattern

public TextureImage getWallPattern()
Returns the default walls top pattern in plan.


setNewWallPattern

public void setNewWallPattern(TextureImage newWallPattern)
Sets the edited new wall top pattern in plan, and notifies listeners of this change.

Since:
4.0

getNewWallPattern

public TextureImage getNewWallPattern()
Returns the edited new wall top pattern in plan.

Since:
4.0

setNewWallThickness

public void setNewWallThickness(float newWallThickness)
Sets the edited new wall thickness.


getNewWallThickness

public float getNewWallThickness()
Returns the edited new wall thickness.


setNewWallHeight

public void setNewWallHeight(float newWallHeight)
Sets the edited new wall height.


getNewWallHeight

public float getNewWallHeight()
Returns the edited new wall height.


setNewFloorThickness

public void setNewFloorThickness(float newFloorThickness)
Sets the edited new floor thickness.


getNewFloorThickness

public float getNewFloorThickness()
Returns the edited new floor thickness.


setCheckUpdatesEnabled

public void setCheckUpdatesEnabled(boolean updatesChecked)
Sets whether updates should be checked or not.

Since:
4.0

isCheckUpdatesEnabled

public boolean isCheckUpdatesEnabled()
Returns true if updates should be checked.

Since:
4.0

setAutoSaveDelayForRecovery

public void setAutoSaveDelayForRecovery(int autoSaveDelayForRecovery)
Sets the edited auto recovery save delay.


getAutoSaveDelayForRecovery

public int getAutoSaveDelayForRecovery()
Returns the edited auto recovery save delay.


setAutoSaveForRecoveryEnabled

public void setAutoSaveForRecoveryEnabled(boolean autoSaveForRecoveryEnabled)
Sets whether auto recovery save is enabled or not.


isAutoSaveForRecoveryEnabled

public boolean isAutoSaveForRecoveryEnabled()
Returns true if auto recovery save is enabled.


checkUpdates

public void checkUpdates()
Checks if some updates are available.

Since:
4.0

mayImportLanguageLibrary

public boolean mayImportLanguageLibrary()
Returns true if language libraries can be imported.


importLanguageLibrary

public void importLanguageLibrary()
Imports a language library chosen by the user.


resetDisplayedActionTips

public void resetDisplayedActionTips()
Resets the displayed flags of action tips.


modifyUserPreferences

public void modifyUserPreferences()
Controls the modification of user preferences.


Sweet Home 3D 4.0

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