|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface State
This interface should be implemented by the object which will be exchanged
with a component in the state saving/restoring process. This is basically
java.util.Properties
with extension for other useful types of
objects that are not strings. A State
can be used to create
and store other State
object as well and in such way the
hierarchy can be builded easily. For example a component can use this code
snippet to produce a State
object which has two child object
'Window' and 'Splitter'. This allows the component to easy distinguish
between parts of the state later in process of restoring.
public State getState() {
State state = StateFactory.createState();
State s = state.createChild("Window");
getWindow().setProperties(s);
s = state.createChild("Splitter");
getSplitter().setProperties(s);
}
Beside that the enumeration of stored objects is added to allow different
StateStorage
objects to iterate over.
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. |
void |
writeXML(java.io.Writer writer)
DOCUMENT ME! |
Method Detail |
---|
void putState(java.lang.String key, State state)
key
- the key under state is storedstate
- the state to be addedState createState(java.lang.String key)
key
- the key of new state inside this containment
boolean getBoolean(java.lang.String key, boolean defaultValue)
key
- DOCUMENT ME!defaultValue
- DOCUMENT ME!
State getState(java.lang.String key)
key
- DOCUMENT ME!
java.lang.Class getClass(java.lang.String key)
key
- DOCUMENT ME!
java.awt.Color getColor(java.lang.String key)
key
- DOCUMENT ME!
java.awt.Color[] getColorSeq(java.lang.String key)
java.awt.Dimension getDimension(java.lang.String key)
key
- DOCUMENT ME!
double getDouble(java.lang.String key, double defaultValue)
key
- DOCUMENT ME!defaultValue
- DOCUMENT ME!
double[] getDoubleSeq(java.lang.String key)
key
- DOCUMENT ME!
java.awt.Font getFont(java.lang.String key)
key
- DOCUMENT ME!
java.awt.Font[] getFontSeq(java.lang.String key)
java.lang.String getID()
void setID(java.lang.String id)
id
- the new ID stringint getInt(java.lang.String key, int defaultValue)
key
- DOCUMENT ME!defaultValue
- DOCUMENT ME!
int[] getIntSeq(java.lang.String key)
key
- DOCUMENT ME!
java.lang.Object getObject(java.lang.String key)
key
- DOCUMENT ME!
java.lang.Class getType(java.lang.String key)
key
- DOCUMENT ME!
java.awt.Rectangle getRectangle(java.lang.String key)
java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
java.lang.String[] getStringSeq(java.lang.String key)
java.util.Set keySet()
void putBoolean(java.lang.String key, boolean value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putClass(java.lang.String key, java.lang.Class value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putColor(java.lang.String key, java.awt.Color value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putColorSeq(java.lang.String key, java.awt.Color[] value)
void putDimension(java.lang.String key, java.awt.Dimension value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putDouble(java.lang.String key, double value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putDoubleSeq(java.lang.String key, double[] value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putFont(java.lang.String key, java.awt.Font value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putFontSeq(java.lang.String key, java.awt.Font[] value)
void putInt(java.lang.String key, int value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putIntSeq(java.lang.String key, int[] value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putRectangle(java.lang.String key, java.awt.Rectangle value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putString(java.lang.String key, java.lang.String value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void putStringSeq(java.lang.String key, java.lang.String[] value)
key
- DOCUMENT ME!value
- DOCUMENT ME!void writeXML(java.io.Writer writer) throws java.io.IOException
writer
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |