public abstract class UserPreferences
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
UserPreferences.Property
The properties of user preferences that may change.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FURNITURE_LIBRARY_TYPE |
static java.lang.String |
LANGUAGE_LIBRARY_TYPE |
static java.lang.String |
TEXTURES_LIBRARY_TYPE |
Constructor and Description |
---|
UserPreferences()
Creates user preferences.
|
Modifier and Type | Method and Description |
---|---|
void |
addAutoCompletionString(java.lang.String property,
java.lang.String autoCompletionString)
Adds the given string to the list of the strings used in auto completion of a
property
and notifies listeners of this change. |
abstract void |
addFurnitureLibrary(java.lang.String furnitureLibraryLocation)
Adds
furnitureLibraryName to furniture catalog
to make the furniture it contains available. |
abstract void |
addLanguageLibrary(java.lang.String languageLibraryLocation)
Adds the language library to make the languages it contains available to supported languages.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the property change
listener in parameter to these preferences. |
void |
addPropertyChangeListener(UserPreferences.Property property,
java.beans.PropertyChangeListener listener)
Adds the
listener in parameter to these preferences to listen
to the changes of the given property . |
abstract void |
addTexturesLibrary(java.lang.String texturesLibraryLocation)
Adds the textures library at the given location to textures catalog
to make the textures it contains available.
|
abstract boolean |
furnitureLibraryExists(java.lang.String furnitureLibraryLocation)
Returns
true if the furniture library at the given location exists. |
java.util.List<java.lang.String> |
getAutoCompletedProperties()
Returns the list of properties with auto completion strings.
|
java.util.List<java.lang.String> |
getAutoCompletionStrings(java.lang.String property)
Returns the strings that may be used for the auto completion of the given
property . |
int |
getAutoSaveDelayForRecovery()
Returns the delay between two automatic save operations of homes for recovery purpose.
|
java.lang.String |
getCurrency()
Returns the currency in use, noted with ISO 4217 code, or
null
if prices aren't used in application. |
java.lang.String |
getDefaultFontName()
Returns the name of the font that should be used by default or
null
if the default font should be the default one in the application. |
java.lang.String[] |
getDefaultSupportedLanguages()
Returns the array of default available languages in Sweet Home 3D.
|
TextStyle |
getDefaultTextStyle(java.lang.Class<? extends Selectable> selectableClass)
Returns the default text style of a class of selectable item.
|
java.math.BigDecimal |
getDefaultValueAddedTaxPercentage()
Returns the Value Added Tax percentage applied to prices by default, or
null
if VAT isn't taken into account in the application. |
FurnitureCatalog |
getFurnitureCatalog()
Returns the furniture catalog.
|
int |
getFurnitureModelIconSize()
Returns the size used to generate icons of furniture viewed from top.
|
java.util.List<HomeDescriptor> |
getHomeExamples()
Returns the home examples available for the user.
|
java.lang.String |
getLanguage()
Returns the preferred language to display information, noted with an ISO 639 code
that may be followed by an underscore and an ISO 3166 code.
|
LengthUnit |
getLengthUnit()
Returns the length unit currently in use.
|
abstract java.util.List<Library> |
getLibraries()
Returns the libraries available in user preferences.
|
java.lang.String |
getLocalizedString(java.lang.Class<?> resourceClass,
java.lang.String resourceKey,
java.lang.Object... resourceParameters)
Returns the string matching
resourceKey in current language in the
context of resourceClass . |
java.lang.String |
getLocalizedString(java.lang.String resourceFamily,
java.lang.String resourceKey,
java.lang.Object... resourceParameters)
Returns the string matching
resourceKey in current language
for the given resource family. |
java.util.Iterator<java.lang.String> |
getLocalizedStringKeys(java.lang.String resourceFamily)
Returns the keys of the localized property strings of the given resource family.
|
float |
getNewFloorThickness()
Returns default thickness of the floor of new levels in home.
|
java.lang.Integer |
getNewRoomFloorColor()
Returns the default color of new rooms in home.
|
float |
getNewWallBaseboardHeight()
Returns default baseboard height of new home walls.
|
float |
getNewWallBaseboardThickness()
Returns default baseboard thickness of new walls in home.
|
float |
getNewWallHeight()
Returns default wall height of new home walls.
|
TextureImage |
getNewWallPattern()
Returns the pattern used for new walls in plan or
null if it's not set. |
float |
getNewWallThickness()
Returns default thickness of new walls in home.
|
PatternsCatalog |
getPatternsCatalog()
Returns the patterns catalog available to fill plan areas.
|
java.lang.String |
getPhotoRenderer()
Returns the preferred rendering engine used to create photos.
|
java.util.List<java.lang.Integer> |
getRecentColors()
Returns an unmodifiable list of the recent colors.
|
java.util.List<java.lang.String> |
getRecentHomes()
Returns an unmodifiable list of the recent homes.
|
int |
getRecentHomesMaxCount()
Returns the maximum count of homes that should be proposed to the user.
|
java.util.List<TextureImage> |
getRecentTextures()
Returns an unmodifiable list of the recent textures.
|
java.util.List<java.lang.ClassLoader> |
getResourceClassLoaders()
Returns the class loaders through which localized strings returned by
getLocalizedString might be loaded. |
int |
getStoredCamerasMaxCount()
Returns the maximum count of stored cameras in homes that should be proposed to the user.
|
java.lang.String[] |
getSupportedLanguages()
Returns the array of available languages in Sweet Home 3D including languages in libraries.
|
TexturesCatalog |
getTexturesCatalog()
Returns the textures catalog.
|
java.lang.Long |
getUpdatesMinimumDate()
Returns the minimum date of updates that may interest user.
|
TextureImage |
getWallPattern()
Returns the wall pattern in plan used by default.
|
boolean |
isActionTipIgnored(java.lang.String actionKey)
Returns whether an action tip should be ignored or not.
|
boolean |
isAerialViewCenteredOnSelectionEnabled()
Returns whether aerial view should be centered on selection or not.
|
boolean |
isCheckUpdatesEnabled()
Returns
true if updates should be checked. |
boolean |
isDrawingModeEnabled()
Returns
true is drawing mode
should be taken into account. |
boolean |
isEditingIn3DViewEnabled()
Returns whether interactive editing in 3D view is enabled or not.
|
boolean |
isFurnitureCatalogViewedInTree()
Returns
true if the furniture catalog should be viewed in a tree. |
boolean |
isFurnitureViewedFromTop()
Returns
true if furniture should be viewed from its top in plan. |
boolean |
isGridVisible()
Returns
true if plan grid visible. |
boolean |
isLanguageEditable()
Returns
true if the language in preferences can be set. |
boolean |
isMagnetismEnabled()
Returns
true if magnetism is enabled. |
boolean |
isNavigationPanelVisible()
Returns
true if the navigation panel should be displayed. |
boolean |
isObserverCameraSelectedAtChange()
Returns whether the observer camera should be selected at each change.
|
boolean |
isRoomFloorColoredOrTextured()
Returns
true if room floors should be rendered with color or texture
in plan. |
boolean |
isRulersVisible()
Returns
true if rulers are visible. |
boolean |
isValueAddedTaxEnabled()
Returns
true if Value Added Tax should be taken in account in prices. |
abstract boolean |
languageLibraryExists(java.lang.String languageLibraryLocation)
Returns
true if the language library at the given location exists. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the property change
listener in parameter from these preferences. |
void |
removePropertyChangeListener(UserPreferences.Property property,
java.beans.PropertyChangeListener listener)
Removes the
listener in parameter from these preferences. |
void |
resetIgnoredActionTips()
Resets the ignore flag of action tips.
|
void |
setActionTipIgnored(java.lang.String actionKey)
Sets which action tip should be ignored.
|
void |
setAerialViewCenteredOnSelectionEnabled(boolean aerialViewCenteredOnSelectionEnabled)
Sets whether aerial view should be centered on selection or not.
|
void |
setAutoCompletionStrings(java.lang.String property,
java.util.List<java.lang.String> autoCompletionStrings)
Sets the auto completion strings list of the given
property and notifies listeners of this change. |
void |
setAutoSaveDelayForRecovery(int autoSaveDelayForRecovery)
Sets the delay between two automatic save operations of homes for recovery purpose.
|
void |
setCheckUpdatesEnabled(boolean updatesChecked)
Sets whether updates should be checked or not.
|
void |
setCurrency(java.lang.String currency)
Sets the currency in use.
|
void |
setDefaultFontName(java.lang.String defaultFontName)
Sets the name of the font that should be used by default.
|
void |
setDefaultValueAddedTaxPercentage(java.math.BigDecimal valueAddedTaxPercentage)
Sets the Value Added Tax percentage applied to prices by default.
|
void |
setEditingIn3DViewEnabled(boolean editingIn3DViewEnabled)
Sets whether interactive editing in 3D view is enabled or not.
|
void |
setFloorColoredOrTextured(boolean roomFloorColoredOrTextured)
Sets whether room floors should be rendered with color or texture,
and notifies listeners of this change.
|
protected void |
setFurnitureCatalog(FurnitureCatalog catalog)
Sets furniture catalog.
|
void |
setFurnitureCatalogViewedInTree(boolean furnitureCatalogViewedInTree)
Sets whether the furniture catalog should be viewed in a tree or a different way.
|
void |
setFurnitureModelIconSize(int furnitureModelIconSize)
Sets the name of the font that should be used by default.
|
void |
setFurnitureViewedFromTop(boolean furnitureViewedFromTop)
Sets how furniture icon should be displayed in plan, and notifies
listeners of this change.
|
void |
setGridVisible(boolean gridVisible)
Sets whether plan grid is visible or not, and notifies
listeners of this change.
|
protected void |
setHomeExamples(java.util.List<HomeDescriptor> homeExamples)
Sets the home examples available for the user.
|
void |
setLanguage(java.lang.String language)
If language can be changed, sets the preferred language to display information,
changes current default locale accordingly and notifies listeners of this change.
|
void |
setMagnetismEnabled(boolean magnetismEnabled)
Sets whether magnetism is enabled or not, and notifies
listeners of this change.
|
void |
setNavigationPanelVisible(boolean navigationPanelVisible)
Sets whether the navigation panel should be displayed or not.
|
void |
setNewFloorThickness(float newFloorThickness)
Sets default thickness of the floor of new levels in home, and notifies
listeners of this change.
|
void |
setNewRoomFloorColor(java.lang.Integer newRoomFloorColor)
Sets the default color of new rooms in home, and notifies
listeners of this change.
|
void |
setNewWallBaseboardHeight(float newWallBaseboardHeight)
Sets default baseboard height of new walls, and notifies
listeners of this change.
|
void |
setNewWallBaseboardThickness(float newWallBaseboardThickness)
Sets default baseboard thickness of new walls in home, and notifies
listeners of this change.
|
void |
setNewWallHeight(float newWallHeight)
Sets default wall height of new walls, and notifies
listeners of this change.
|
void |
setNewWallPattern(TextureImage newWallPattern)
Sets how new walls should be displayed in plan, and notifies
listeners of this change.
|
void |
setNewWallThickness(float newWallThickness)
Sets default thickness of new walls in home, and notifies
listeners of this change.
|
void |
setObserverCameraSelectedAtChange(boolean observerCameraSelectedAtChange)
Sets whether the observer camera should be selected at each change.
|
protected void |
setPatternsCatalog(PatternsCatalog catalog)
Sets the patterns available to fill plan areas.
|
void |
setPhotoRenderer(java.lang.String photoRenderer)
Sets the preferred rendering engine used to create photos.
|
void |
setRecentColors(java.util.List<java.lang.Integer> recentColors)
Sets the recent colors list and notifies listeners of this change.
|
void |
setRecentHomes(java.util.List<java.lang.String> recentHomes)
Sets the recent homes list and notifies listeners of this change.
|
void |
setRecentTextures(java.util.List<TextureImage> recentTextures)
Sets the recent colors list and notifies listeners of this change.
|
void |
setRulersVisible(boolean rulersVisible)
Sets whether rulers are visible or not, and notifies
listeners of this change.
|
protected void |
setSupportedLanguages(java.lang.String[] supportedLanguages)
Sets the available languages in Sweet Home 3D.
|
protected void |
setTexturesCatalog(TexturesCatalog catalog)
Sets textures catalog.
|
void |
setUnit(LengthUnit unit)
Changes the unit currently in use, and notifies listeners of this change.
|
void |
setUpdatesMinimumDate(java.lang.Long updatesMinimumDate)
Sets the minimum date of updates that may interest user, and notifies
listeners of this change.
|
void |
setValueAddedTaxEnabled(boolean valueAddedTaxEnabled)
Sets whether Value Added Tax should be taken in account in prices.
|
void |
setWallPattern(TextureImage wallPattern)
Sets how walls should be displayed in plan by default, and notifies
listeners of this change.
|
abstract boolean |
texturesLibraryExists(java.lang.String texturesLibraryLocation)
Returns
true if the textures library at the given location exists. |
abstract void |
write()
Writes user preferences.
|
public static final java.lang.String FURNITURE_LIBRARY_TYPE
public static final java.lang.String TEXTURES_LIBRARY_TYPE
public static final java.lang.String LANGUAGE_LIBRARY_TYPE
public UserPreferences()
public abstract void write() throws RecorderException
RecorderException
- if user preferences couldn'y be saved.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
in parameter to these preferences.
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
in parameter from these preferences.public void addPropertyChangeListener(UserPreferences.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter to these preferences to listen
to the changes of the given property
.
public void removePropertyChangeListener(UserPreferences.Property property, java.beans.PropertyChangeListener listener)
listener
in parameter from these preferences.public FurnitureCatalog getFurnitureCatalog()
protected void setFurnitureCatalog(FurnitureCatalog catalog)
public TexturesCatalog getTexturesCatalog()
protected void setTexturesCatalog(TexturesCatalog catalog)
public PatternsCatalog getPatternsCatalog()
protected void setPatternsCatalog(PatternsCatalog catalog)
public LengthUnit getLengthUnit()
public void setUnit(LengthUnit unit)
unit
- one of the values of Unit.public java.lang.String getLanguage()
public void setLanguage(java.lang.String language)
language
- an ISO 639 code that may be followed by an underscore and an ISO 3166 code
(for example fr, de, it, en_US, zh_CN).public boolean isLanguageEditable()
true
if the language in preferences can be set.true
except if user.language
System property isn't writable.public java.lang.String[] getDefaultSupportedLanguages()
public java.lang.String[] getSupportedLanguages()
protected void setSupportedLanguages(java.lang.String[] supportedLanguages)
public java.lang.String getLocalizedString(java.lang.Class<?> resourceClass, java.lang.String resourceKey, java.lang.Object... resourceParameters)
resourceKey
in current language in the
context of resourceClass
.
If resourceParameters
isn't empty the string is considered
as a format string, and the returned string will be formatted with these parameters.
This implementation searches first the key in a properties file named as
resourceClass
, then if this file doesn't exist, it searches
the key prefixed by resourceClass
name and a dot in a package.properties file
in the folder matching the package of resourceClass
.java.lang.IllegalArgumentException
- if no string for the given key can be foundpublic java.lang.String getLocalizedString(java.lang.String resourceFamily, java.lang.String resourceKey, java.lang.Object... resourceParameters)
resourceKey
in current language
for the given resource family.
resourceFamily
should match the absolute path of a .properties resource family,
shouldn't start by a slash and may contain dots '.' or slash '/' as folder separators.
If resourceParameters
isn't empty the string is considered
as a format string, and the returned string will be formatted with these parameters.
This implementation searches the key in a properties file named as
resourceFamily
.java.lang.IllegalArgumentException
- if no string for the given key can be foundpublic java.util.Iterator<java.lang.String> getLocalizedStringKeys(java.lang.String resourceFamily)
resourceFamily
should match the absolute path of a .properties resource family,
shouldn't start by a slash and may contain dots '.' or slash '/' as folder separators.public java.util.List<java.lang.ClassLoader> getResourceClassLoaders()
getLocalizedString
might be loaded.public java.lang.String getCurrency()
null
if prices aren't used in application.public void setCurrency(java.lang.String currency)
public boolean isValueAddedTaxEnabled()
true
if Value Added Tax should be taken in account in prices.public void setValueAddedTaxEnabled(boolean valueAddedTaxEnabled)
valueAddedTaxEnabled
- if true
VAT will be added to prices.public java.math.BigDecimal getDefaultValueAddedTaxPercentage()
null
if VAT isn't taken into account in the application.public void setDefaultValueAddedTaxPercentage(java.math.BigDecimal valueAddedTaxPercentage)
valueAddedTaxPercentage
- the default VAT percentagepublic boolean isFurnitureCatalogViewedInTree()
true
if the furniture catalog should be viewed in a tree.public void setFurnitureCatalogViewedInTree(boolean furnitureCatalogViewedInTree)
public boolean isNavigationPanelVisible()
true
if the navigation panel should be displayed.public void setNavigationPanelVisible(boolean navigationPanelVisible)
public boolean isEditingIn3DViewEnabled()
public void setEditingIn3DViewEnabled(boolean editingIn3DViewEnabled)
public boolean isAerialViewCenteredOnSelectionEnabled()
public void setAerialViewCenteredOnSelectionEnabled(boolean aerialViewCenteredOnSelectionEnabled)
public boolean isObserverCameraSelectedAtChange()
public void setObserverCameraSelectedAtChange(boolean observerCameraSelectedAtChange)
public boolean isMagnetismEnabled()
true
if magnetism is enabled.true
by default.public void setMagnetismEnabled(boolean magnetismEnabled)
magnetismEnabled
- true
if magnetism is enabled,
false
otherwise.public boolean isRulersVisible()
true
if rulers are visible.true
by default.public void setRulersVisible(boolean rulersVisible)
rulersVisible
- true
if rulers are visible,
false
otherwise.public boolean isGridVisible()
true
if plan grid visible.true
by default.public void setGridVisible(boolean gridVisible)
gridVisible
- true
if grid is visible,
false
otherwise.public boolean isDrawingModeEnabled()
true
is drawing mode
should be taken into account.public java.lang.String getDefaultFontName()
null
if the default font should be the default one in the application.public void setDefaultFontName(java.lang.String defaultFontName)
public boolean isFurnitureViewedFromTop()
true
if furniture should be viewed from its top in plan.public void setFurnitureViewedFromTop(boolean furnitureViewedFromTop)
furnitureViewedFromTop
- if true
the furniture
should be viewed from its top.public int getFurnitureModelIconSize()
public void setFurnitureModelIconSize(int furnitureModelIconSize)
public boolean isRoomFloorColoredOrTextured()
true
if room floors should be rendered with color or texture
in plan.false
by default.public void setFloorColoredOrTextured(boolean roomFloorColoredOrTextured)
roomFloorColoredOrTextured
- true
if floor color
or texture is used, false
otherwise.public TextureImage getWallPattern()
public void setWallPattern(TextureImage wallPattern)
public TextureImage getNewWallPattern()
null
if it's not set.public void setNewWallPattern(TextureImage newWallPattern)
public float getNewWallThickness()
public void setNewWallThickness(float newWallThickness)
public float getNewWallHeight()
public void setNewWallHeight(float newWallHeight)
public float getNewWallBaseboardThickness()
public void setNewWallBaseboardThickness(float newWallBaseboardThickness)
public float getNewWallBaseboardHeight()
public void setNewWallBaseboardHeight(float newWallBaseboardHeight)
public java.lang.Integer getNewRoomFloorColor()
public void setNewRoomFloorColor(java.lang.Integer newRoomFloorColor)
public float getNewFloorThickness()
public void setNewFloorThickness(float newFloorThickness)
public boolean isCheckUpdatesEnabled()
true
if updates should be checked.public void setCheckUpdatesEnabled(boolean updatesChecked)
public java.lang.Long getUpdatesMinimumDate()
null
if not defined.public void setUpdatesMinimumDate(java.lang.Long updatesMinimumDate)
public int getAutoSaveDelayForRecovery()
public void setAutoSaveDelayForRecovery(int autoSaveDelayForRecovery)
public java.util.List<java.lang.String> getRecentHomes()
public void setRecentHomes(java.util.List<java.lang.String> recentHomes)
public int getRecentHomesMaxCount()
public int getStoredCamerasMaxCount()
public void setActionTipIgnored(java.lang.String actionKey)
public boolean isActionTipIgnored(java.lang.String actionKey)
setActionTipIgnored
.
By default it returns true
.public void resetIgnoredActionTips()
public TextStyle getDefaultTextStyle(java.lang.Class<? extends Selectable> selectableClass)
public java.util.List<java.lang.String> getAutoCompletionStrings(java.lang.String property)
property
.public void addAutoCompletionString(java.lang.String property, java.lang.String autoCompletionString)
property
and notifies listeners of this change.public void setAutoCompletionStrings(java.lang.String property, java.util.List<java.lang.String> autoCompletionStrings)
property
and notifies listeners of this change.public java.util.List<java.lang.String> getAutoCompletedProperties()
public java.util.List<java.lang.Integer> getRecentColors()
public void setRecentColors(java.util.List<java.lang.Integer> recentColors)
public java.util.List<TextureImage> getRecentTextures()
public void setRecentTextures(java.util.List<TextureImage> recentTextures)
protected void setHomeExamples(java.util.List<HomeDescriptor> homeExamples)
public java.util.List<HomeDescriptor> getHomeExamples()
public void setPhotoRenderer(java.lang.String photoRenderer)
public java.lang.String getPhotoRenderer()
public abstract void addLanguageLibrary(java.lang.String languageLibraryLocation) throws RecorderException
languageLibraryLocation
- the location where the library can be found.RecorderException
public abstract boolean languageLibraryExists(java.lang.String languageLibraryLocation) throws RecorderException
true
if the language library at the given location exists.languageLibraryLocation
- the name of the resource to checkRecorderException
public abstract void addFurnitureLibrary(java.lang.String furnitureLibraryLocation) throws RecorderException
furnitureLibraryName
to furniture catalog
to make the furniture it contains available.furnitureLibraryLocation
- the location where the library can be found.RecorderException
public abstract boolean furnitureLibraryExists(java.lang.String furnitureLibraryLocation) throws RecorderException
true
if the furniture library at the given location exists.furnitureLibraryLocation
- the name of the resource to checkRecorderException
public abstract void addTexturesLibrary(java.lang.String texturesLibraryLocation) throws RecorderException
texturesLibraryLocation
- the location where the library can be found.RecorderException
public abstract boolean texturesLibraryExists(java.lang.String texturesLibraryLocation) throws RecorderException
true
if the textures library at the given location exists.texturesLibraryLocation
- the name of the resource to checkRecorderException
public abstract java.util.List<Library> getLibraries()
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License