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 void
firePropertyChange
(String key, String oldValue, String newValue) protected abstract String
protected abstract String
boolean
getPropertyBool
(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
.double
getPropertyDouble
(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
.int
getPropertyInt
(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 String
void
setPropertyBool
(String key, Boolean newValue) Sets a value of typeBoolean
.void
setPropertyColor
(String key, Color value) Sets a value of typeColor
.void
setPropertyDouble
(String key, Double value) Sets a value of typeDouble
.void
setPropertyFont
(String key, Font font) Sets a font of typeFont
.void
setPropertyInt
(String key, Integer value) Sets a value of typeInteger
.void
setPropertyString
(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, wait
Methods 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:
getPropertyBool
in interfacePropertyMap
- Parameters:
key
- the key- Returns:
- the value for the given key, or
false
if the key is not contained in this property set.
-
getPropertyBool
Gets a value of typeBoolean
.- Specified by:
getPropertyBool
in 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
defaultValue
if the key is not contained in this property set.
-
setPropertyBool
Sets a value of typeBoolean
.- Specified by:
setPropertyBool
in interfacePropertyMap
- Parameters:
key
- the keynewValue
- the new value- Throws:
IllegalArgumentException
-
getPropertyInt
Gets a value of typeint
.- Specified by:
getPropertyInt
in 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:
getPropertyInt
in 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
defaultValue
if the key is not contained in this property set.
-
setPropertyInt
Sets a value of typeInteger
.- Specified by:
setPropertyInt
in interfacePropertyMap
- Parameters:
key
- the keyvalue
- the value- Throws:
IllegalArgumentException
-
getPropertyDouble
Gets a value of typedouble
.- Specified by:
getPropertyDouble
in 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:
getPropertyDouble
in 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
defaultValue
if the key is not contained in this property set.
-
setPropertyDouble
Sets a value of typeDouble
.- Specified by:
setPropertyDouble
in interfacePropertyMap
- Parameters:
key
- the keyvalue
- the value- Throws:
IllegalArgumentException
-
getPropertyString
Gets a value of typeString
.- Specified by:
getPropertyString
in 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:
getPropertyString
in 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
defaultValue
if the key is not contained in this property set.
-
setPropertyString
Sets a value of typeString
.- Specified by:
setPropertyString
in interfacePropertyMap
- Parameters:
key
- the keyvalue
- the new value- Throws:
IllegalArgumentException
-
getPropertyColor
Gets a value of typeColor
.- Specified by:
getPropertyColor
in interfacePropertyMap
- Parameters:
key
- the key- Returns:
- the value for the given key, or
Color.black
if the key is not contained in this property set, nevernull
.
-
getPropertyColor
Gets a value of typeColor
.- Specified by:
getPropertyColor
in 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
defaultValue
if the key is not contained in this property set.
-
setPropertyColor
Sets a value of typeColor
.- Specified by:
setPropertyColor
in interfacePropertyMap
- Parameters:
key
- the keyvalue
- the value- Throws:
IllegalArgumentException
-
getPropertyFont
Gets a value of typeFont
.- Specified by:
getPropertyFont
in 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:
getPropertyFont
in 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
defaultValue
if 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>.name
for the font's name<key>.style
for the font's style (an integer font)<key>.name
for the font's size in points (an integer font)
- Specified by:
setPropertyFont
in interfacePropertyMap
- Parameters:
key
- the keyfont
- the font- Throws:
IllegalArgumentException
-
get
-
get
-
set
-
firePropertyChange
-