public abstract class AbstractPropertyMap extends Object implements PropertyMap
PropertyMap
interface.Modifier and Type | Field and Description |
---|---|
static Color |
DEFAULT_COLOR |
static Font |
DEFAULT_FONT |
Constructor and Description |
---|
AbstractPropertyMap() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
firePropertyChange(String key,
String oldValue,
String newValue) |
protected abstract String |
get(String key) |
protected abstract String |
get(String key,
String defaultValue) |
boolean |
getPropertyBool(String key)
Gets a value of type
boolean . |
Boolean |
getPropertyBool(String key,
Boolean defaultValue)
Gets a value of type
Boolean . |
Color |
getPropertyColor(String key)
Gets a value of type
Color . |
Color |
getPropertyColor(String key,
Color defaultValue)
Gets a value of type
Color . |
double |
getPropertyDouble(String key)
Gets a value of type
double . |
Double |
getPropertyDouble(String key,
Double defaultValue)
Gets a value of type
Double . |
Font |
getPropertyFont(String key)
Gets a value of type
Font . |
Font |
getPropertyFont(String key,
Font defaultValue)
Gets a value of type
Font . |
int |
getPropertyInt(String key)
Gets a value of type
int . |
Integer |
getPropertyInt(String key,
Integer defaultValue)
Gets a value of type
Integer . |
String |
getPropertyString(String key)
Gets a value of type
String . |
String |
getPropertyString(String key,
String defaultValue)
Gets a value of type
String . |
protected abstract String |
set(String key,
String value) |
void |
setPropertyBool(String key,
Boolean newValue)
Sets a value of type
Boolean . |
void |
setPropertyColor(String key,
Color value)
Sets a value of type
Color . |
void |
setPropertyDouble(String key,
Double value)
Sets a value of type
Double . |
void |
setPropertyFont(String key,
Font font)
Sets a font of type
Font . |
void |
setPropertyInt(String key,
Integer value)
Sets a value of type
Integer . |
void |
setPropertyString(String key,
String value)
Sets a value of type
String . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, getProperties, getPropertyKeys, load, removePropertyChangeListener, removePropertyChangeListener, store
public static final Font DEFAULT_FONT
public static final Color DEFAULT_COLOR
public boolean getPropertyBool(String key)
boolean
.getPropertyBool
in interface PropertyMap
key
- the keyfalse
if the key is not contained in this property set.public Boolean getPropertyBool(String key, Boolean defaultValue)
Boolean
.getPropertyBool
in interface PropertyMap
key
- the keydefaultValue
- the default value that is returned if the key was not found in this property set.defaultValue
if the key is not contained in this property
set.public void setPropertyBool(String key, Boolean newValue)
Boolean
.setPropertyBool
in interface PropertyMap
key
- the keynewValue
- the new valueIllegalArgumentException
public int getPropertyInt(String key)
int
.getPropertyInt
in interface PropertyMap
key
- the key0
(zero) if the key is not contained in this property set.public Integer getPropertyInt(String key, Integer defaultValue)
Integer
.getPropertyInt
in interface PropertyMap
key
- the keydefaultValue
- the default value that is returned if the key was not found in this property set.defaultValue
if the key is not contained in this property
set.public void setPropertyInt(String key, Integer value)
Integer
.setPropertyInt
in interface PropertyMap
key
- the keyvalue
- the valueIllegalArgumentException
public double getPropertyDouble(String key)
double
.getPropertyDouble
in interface PropertyMap
key
- the key0.0
(zero) if the key is not contained in this property
set.public Double getPropertyDouble(String key, Double defaultValue)
Double
.getPropertyDouble
in interface PropertyMap
key
- the keydefaultValue
- the default value that is returned if the key was not found in this property set.defaultValue
if the key is not contained in this property
set.public void setPropertyDouble(String key, Double value)
Double
.setPropertyDouble
in interface PropertyMap
key
- the keyvalue
- the valueIllegalArgumentException
public String getPropertyString(String key)
String
.getPropertyString
in interface PropertyMap
key
- the key""
(empty string) if the key is not contained in this
property set, never null
.public String getPropertyString(String key, String defaultValue)
String
.getPropertyString
in interface PropertyMap
key
- the keydefaultValue
- the default value that is returned if the key was not found in this property set.defaultValue
if the key is not contained in this property
set.public void setPropertyString(String key, String value)
String
.setPropertyString
in interface PropertyMap
key
- the keyvalue
- the new valueIllegalArgumentException
public Color getPropertyColor(String key)
Color
.getPropertyColor
in interface PropertyMap
key
- the keyColor.black
if the key is not contained in this property
set, never null
.public Color getPropertyColor(String key, Color defaultValue)
Color
.getPropertyColor
in interface PropertyMap
key
- the keydefaultValue
- the default value that is returned if the key was not found in this property set.defaultValue
if the key is not contained in this property
set.public void setPropertyColor(String key, Color value)
Color
.setPropertyColor
in interface PropertyMap
key
- the keyvalue
- the valueIllegalArgumentException
public Font getPropertyFont(String key)
Font
.getPropertyFont
in interface PropertyMap
key
- the keynull
.public Font getPropertyFont(String key, Font defaultValue)
Font
.getPropertyFont
in interface PropertyMap
key
- the keydefaultValue
- the default value that is returned if the key was not found in this property set.defaultValue
if the key is not contained in this property
set.public void setPropertyFont(String key, Font font)
Font
. 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)setPropertyFont
in interface PropertyMap
key
- the keyfont
- the fontIllegalArgumentException
Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.