Package org.esa.snap.core.util
Class AbstractPropertyMap
java.lang.Object
org.esa.snap.core.util.AbstractPropertyMap
- All Implemented Interfaces:
PropertyMap
- Direct Known Subclasses:
DefaultPropertyMap,PreferencesPropertyMap
Abstract implementation of the
PropertyMap interface.- Since:
- SNAP 2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidfirePropertyChange(String key, String oldValue, String newValue) protected abstract Stringprotected abstract StringbooleangetPropertyBool(String key) Gets a value of typeboolean.getPropertyBool(String key, Boolean defaultValue) Gets a value of typeBoolean.getPropertyColor(String key) Gets a value of typeColor.getPropertyColor(String key, Color defaultValue) Gets a value of typeColor.doublegetPropertyDouble(String key) Gets a value of typedouble.getPropertyDouble(String key, Double defaultValue) Gets a value of typeDouble.getPropertyFont(String key) Gets a value of typeFont.getPropertyFont(String key, Font defaultValue) Gets a value of typeFont.intgetPropertyInt(String key) Gets a value of typeint.getPropertyInt(String key, Integer defaultValue) Gets a value of typeInteger.getPropertyString(String key) Gets a value of typeString.getPropertyString(String key, String defaultValue) Gets a value of typeString.protected abstract StringvoidsetPropertyBool(String key, Boolean newValue) Sets a value of typeBoolean.voidsetPropertyColor(String key, Color value) Sets a value of typeColor.voidsetPropertyDouble(String key, Double value) Sets a value of typeDouble.voidsetPropertyFont(String key, Font font) Sets a font of typeFont.voidsetPropertyInt(String key, Integer value) Sets a value of typeInteger.voidsetPropertyString(String key, String value) Sets a value of typeString.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.esa.snap.core.util.PropertyMap
addPropertyChangeListener, addPropertyChangeListener, getProperties, getPropertyKeys, load, removePropertyChangeListener, removePropertyChangeListener, store
-
Field Details
-
DEFAULT_FONT
-
DEFAULT_COLOR
-
-
Constructor Details
-
AbstractPropertyMap
public AbstractPropertyMap()
-
-
Method Details
-
getPropertyBool
Gets a value of typeboolean.- Specified by:
getPropertyBoolin interfacePropertyMap- Parameters:
key- the key- Returns:
- the value for the given key, or
falseif the key is not contained in this property set.
-
getPropertyBool
Gets a value of typeBoolean.- Specified by:
getPropertyBoolin interfacePropertyMap- Parameters:
key- the keydefaultValue- the default value that is returned if the key was not found in this property set.- Returns:
- the value for the given key, or
defaultValueif the key is not contained in this property set.
-
setPropertyBool
Sets a value of typeBoolean.- Specified by:
setPropertyBoolin interfacePropertyMap- Parameters:
key- the keynewValue- the new value- Throws:
IllegalArgumentException
-
getPropertyInt
Gets a value of typeint.- Specified by:
getPropertyIntin interfacePropertyMap- Parameters:
key- the key- Returns:
- the value for the given key, or
0(zero) if the key is not contained in this property set.
-
getPropertyInt
Gets a value of typeInteger.- Specified by:
getPropertyIntin interfacePropertyMap- Parameters:
key- the keydefaultValue- the default value that is returned if the key was not found in this property set.- Returns:
- the value for the given key, or
defaultValueif the key is not contained in this property set.
-
setPropertyInt
Sets a value of typeInteger.- Specified by:
setPropertyIntin interfacePropertyMap- Parameters:
key- the keyvalue- the value- Throws:
IllegalArgumentException
-
getPropertyDouble
Gets a value of typedouble.- Specified by:
getPropertyDoublein interfacePropertyMap- Parameters:
key- the key- Returns:
- the value for the given key, or
0.0(zero) if the key is not contained in this property set.
-
getPropertyDouble
Gets a value of typeDouble.- Specified by:
getPropertyDoublein interfacePropertyMap- Parameters:
key- the keydefaultValue- the default value that is returned if the key was not found in this property set.- Returns:
- the value for the given key, or
defaultValueif the key is not contained in this property set.
-
setPropertyDouble
Sets a value of typeDouble.- Specified by:
setPropertyDoublein interfacePropertyMap- Parameters:
key- the keyvalue- the value- Throws:
IllegalArgumentException
-
getPropertyString
Gets a value of typeString.- Specified by:
getPropertyStringin interfacePropertyMap- Parameters:
key- the key- Returns:
- the value for the given key, or
""(empty string) if the key is not contained in this property set, nevernull.
-
getPropertyString
Gets a value of typeString.- Specified by:
getPropertyStringin interfacePropertyMap- Parameters:
key- the keydefaultValue- the default value that is returned if the key was not found in this property set.- Returns:
- the value for the given key, or
defaultValueif the key is not contained in this property set.
-
setPropertyString
Sets a value of typeString.- Specified by:
setPropertyStringin interfacePropertyMap- Parameters:
key- the keyvalue- the new value- Throws:
IllegalArgumentException
-
getPropertyColor
Gets a value of typeColor.- Specified by:
getPropertyColorin interfacePropertyMap- Parameters:
key- the key- Returns:
- the value for the given key, or
Color.blackif the key is not contained in this property set, nevernull.
-
getPropertyColor
Gets a value of typeColor.- Specified by:
getPropertyColorin interfacePropertyMap- Parameters:
key- the keydefaultValue- the default value that is returned if the key was not found in this property set.- Returns:
- the value for the given key, or
defaultValueif the key is not contained in this property set.
-
setPropertyColor
Sets a value of typeColor.- Specified by:
setPropertyColorin interfacePropertyMap- Parameters:
key- the keyvalue- the value- Throws:
IllegalArgumentException
-
getPropertyFont
Gets a value of typeFont.- Specified by:
getPropertyFontin interfacePropertyMap- Parameters:
key- the key- Returns:
- the value for the given key, or a plain, 12-point "SandSerif" font if the key is not contained in this
property set, never
null.
-
getPropertyFont
Gets a value of typeFont.- Specified by:
getPropertyFontin interfacePropertyMap- Parameters:
key- the keydefaultValue- the default value that is returned if the key was not found in this property set.- Returns:
- the value for the given key, or
defaultValueif the key is not contained in this property set.
-
setPropertyFont
Sets a font of typeFont. The method actually puts three keys in this property set in order to store the font's properties:<key>.namefor the font's name<key>.stylefor the font's style (an integer font)<key>.namefor the font's size in points (an integer font)
- Specified by:
setPropertyFontin interfacePropertyMap- Parameters:
key- the keyfont- the font- Throws:
IllegalArgumentException
-
get
-
get
-
set
-
firePropertyChange
-