|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.application.state.impl.DefaultState
public class DefaultState
This is the default implementation of the State
interface. It
is basically extended properties. It uses the LinkedHashMap
for the intermidiate storage. This implementation should be sufficient for
the majority application and it is not likely that a component need to
implement its own state object to exchange with the
StateKeeper
Field Summary | |
---|---|
protected java.util.LinkedHashMap |
map
|
Constructor Summary | |
---|---|
DefaultState()
|
Method Summary | |
---|---|
State |
createState(java.lang.String key)
Creates new child and adds it to contaiment with provided key. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
DOCUMENT ME! |
java.lang.Class |
getClass(java.lang.String key)
DOCUMENT ME! |
java.awt.Color |
getColor(java.lang.String key)
DOCUMENT ME! |
java.awt.Color[] |
getColorSeq(java.lang.String key)
|
java.awt.Dimension |
getDimension(java.lang.String key)
DOCUMENT ME! |
double |
getDouble(java.lang.String key,
double defaultValue)
DOCUMENT ME! |
double[] |
getDoubleSeq(java.lang.String key)
DOCUMENT ME! |
java.awt.Font |
getFont(java.lang.String key)
DOCUMENT ME! |
java.awt.Font[] |
getFontSeq(java.lang.String key)
|
java.lang.String |
getID()
Returns ID, which is used to distinguish different states. |
int |
getInt(java.lang.String key,
int defaultValue)
DOCUMENT ME! |
int[] |
getIntSeq(java.lang.String key)
DOCUMENT ME! |
java.lang.Object |
getObject(java.lang.String key)
DOCUMENT ME! |
java.awt.Rectangle |
getRectangle(java.lang.String key)
|
State |
getState(java.lang.String key)
DOCUMENT ME! |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
|
java.lang.String[] |
getStringSeq(java.lang.String key)
|
java.lang.Class |
getType(java.lang.String key)
DOCUMENT ME! |
java.util.Set |
keySet()
|
void |
putBoolean(java.lang.String key,
boolean value)
DOCUMENT ME! |
void |
putClass(java.lang.String key,
java.lang.Class value)
DOCUMENT ME! |
void |
putColor(java.lang.String key,
java.awt.Color value)
DOCUMENT ME! |
void |
putColorSeq(java.lang.String key,
java.awt.Color[] value)
|
void |
putDimension(java.lang.String key,
java.awt.Dimension value)
DOCUMENT ME! |
void |
putDouble(java.lang.String key,
double value)
DOCUMENT ME! |
void |
putDoubleSeq(java.lang.String key,
double[] value)
DOCUMENT ME! |
void |
putFont(java.lang.String key,
java.awt.Font value)
DOCUMENT ME! |
void |
putFontSeq(java.lang.String key,
java.awt.Font[] value)
|
void |
putInt(java.lang.String key,
int value)
DOCUMENT ME! |
void |
putIntSeq(java.lang.String key,
int[] value)
DOCUMENT ME! |
void |
putRectangle(java.lang.String key,
java.awt.Rectangle value)
DOCUMENT ME! |
void |
putState(java.lang.String key,
State state)
Adds child State with given key. |
void |
putString(java.lang.String key,
java.lang.String value)
DOCUMENT ME! |
void |
putStringSeq(java.lang.String key,
java.lang.String[] value)
DOCUMENT ME! |
void |
setID(java.lang.String ID)
Sets ID to state. |
static void |
setTyped(boolean typed)
Turn on/off storing type information about stored objects. |
java.lang.String |
toString()
|
void |
writeXML(java.io.Writer writer)
DOCUMENT ME! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.LinkedHashMap map
Constructor Detail |
---|
public DefaultState()
Method Detail |
---|
public static void setTyped(boolean typed)
getType()
can be used.
typed
- on/offpublic void putState(java.lang.String key, State state)
State
putState
in interface State
key
- the key under state is storedstate
- the state to be addedpublic State createState(java.lang.String key)
State
createState
in interface State
key
- the key of new state inside this containment
public boolean getBoolean(java.lang.String key, boolean defaultValue)
State
getBoolean
in interface State
key
- DOCUMENT ME!defaultValue
- DOCUMENT ME!
public State getState(java.lang.String key)
State
getState
in interface State
key
- DOCUMENT ME!
public java.lang.Class getClass(java.lang.String key)
State
getClass
in interface State
key
- DOCUMENT ME!
public java.awt.Color getColor(java.lang.String key)
State
getColor
in interface State
key
- DOCUMENT ME!
public java.awt.Dimension getDimension(java.lang.String key)
State
getDimension
in interface State
key
- DOCUMENT ME!
public double getDouble(java.lang.String key, double defaultValue)
State
getDouble
in interface State
key
- DOCUMENT ME!defaultValue
- DOCUMENT ME!
public double[] getDoubleSeq(java.lang.String key)
State
getDoubleSeq
in interface State
key
- DOCUMENT ME!
public java.awt.Color[] getColorSeq(java.lang.String key)
getColorSeq
in interface State
public java.awt.Font getFont(java.lang.String key)
State
getFont
in interface State
key
- DOCUMENT ME!
public java.awt.Font[] getFontSeq(java.lang.String key)
getFontSeq
in interface State
public java.lang.String getID()
State
getID
in interface State
public int getInt(java.lang.String key, int defaultValue)
State
getInt
in interface State
key
- DOCUMENT ME!defaultValue
- DOCUMENT ME!
public int[] getIntSeq(java.lang.String key)
State
getIntSeq
in interface State
key
- DOCUMENT ME!
public java.lang.Object getObject(java.lang.String key)
State
getObject
in interface State
key
- DOCUMENT ME!
public java.lang.Class getType(java.lang.String key)
State
getType
in interface State
key
- DOCUMENT ME!
public java.awt.Rectangle getRectangle(java.lang.String key)
getRectangle
in interface State
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
getString
in interface State
public java.lang.String[] getStringSeq(java.lang.String key)
getStringSeq
in interface State
public java.util.Set keySet()
keySet
in interface State
public void putBoolean(java.lang.String key, boolean value)
State
putBoolean
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putClass(java.lang.String key, java.lang.Class value)
State
putClass
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putColor(java.lang.String key, java.awt.Color value)
State
putColor
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putDimension(java.lang.String key, java.awt.Dimension value)
State
putDimension
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putDouble(java.lang.String key, double value)
State
putDouble
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putDoubleSeq(java.lang.String key, double[] value)
State
putDoubleSeq
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putColorSeq(java.lang.String key, java.awt.Color[] value)
putColorSeq
in interface State
public void putFont(java.lang.String key, java.awt.Font value)
State
putFont
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putFontSeq(java.lang.String key, java.awt.Font[] value)
putFontSeq
in interface State
public void putInt(java.lang.String key, int value)
State
putInt
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putIntSeq(java.lang.String key, int[] value)
State
putIntSeq
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putRectangle(java.lang.String key, java.awt.Rectangle value)
State
putRectangle
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putString(java.lang.String key, java.lang.String value)
State
putString
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void putStringSeq(java.lang.String key, java.lang.String[] value)
State
putStringSeq
in interface State
key
- DOCUMENT ME!value
- DOCUMENT ME!public void setID(java.lang.String ID)
State
setID
in interface State
ID
- the new ID stringpublic void writeXML(java.io.Writer writer) throws java.io.IOException
State
writeXML
in interface State
writer
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |