org.jcreme.swing.state
Class BaseUIMemento

java.lang.Object
  extended byorg.jcreme.state.BaseMemento
      extended byorg.jcreme.swing.state.BaseUIMemento
All Implemented Interfaces:
Memento
Direct Known Subclasses:
BaseTableColorModelMemento, BaseTableColumnMemento, EditableTableColumnModelMemento, FrameMemento, JTableMemento

public abstract class BaseUIMemento
extends BaseMemento

This class is used as a base class for all the Creme Mementos. It specifies that the update of a Memento should be done through an updateMemento method. That method is also used to ensure that a Memento is up to date before it is serialized.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Field Summary
static java.lang.String BLUE_PREFERENCE
           
static java.lang.String GREEN_PREFERENCE
           
static java.lang.String HEIGHT_PREFERENCE
           
static java.lang.String RED_PREFERENCE
           
static java.lang.String WIDTH_PREFERENCE
           
static java.lang.String X_PREFERENCE
           
static java.lang.String Y_PREFERENCE
           
 
Fields inherited from class org.jcreme.state.BaseMemento
STORED_OBJECT_TYPE_PREFERENCE, SUB_MEMENTO_CONTENTS_PREFERENCE, SUB_MEMENTO_TYPE_PREFERENCE
 
Constructor Summary
BaseUIMemento()
           
 
Method Summary
protected  java.awt.Color loadColor(java.util.prefs.Preferences node)
          Enables to recover a Color stored in the preferences as its RGB components.
protected  java.awt.Dimension loadDimension(java.util.prefs.Preferences node)
          Enables to recover Dimension stored in the preferences.
protected  java.awt.Point loadPoint(java.util.prefs.Preferences node)
          Enables to store a Point into the preferences.
protected  void storeColor(java.awt.Color color, java.util.prefs.Preferences node)
          Enables to store a Color into the preferences as its RGB components.
protected  void storeDimension(java.awt.Dimension dimension, java.util.prefs.Preferences node)
          Enables to store a Dimension into the preferences.
protected  void storePoint(java.awt.Point point, java.util.prefs.Preferences node)
          Enables to store a Point into the preferences.
 
Methods inherited from class org.jcreme.state.BaseMemento
buildObject, getObjectType, loadSubMemento, storeSubMemento
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jcreme.state.Memento
load, store, updateMemento, updateObject
 

Field Detail

RED_PREFERENCE

public static final java.lang.String RED_PREFERENCE
See Also:
Constant Field Values

GREEN_PREFERENCE

public static final java.lang.String GREEN_PREFERENCE
See Also:
Constant Field Values

BLUE_PREFERENCE

public static final java.lang.String BLUE_PREFERENCE
See Also:
Constant Field Values

WIDTH_PREFERENCE

public static final java.lang.String WIDTH_PREFERENCE
See Also:
Constant Field Values

HEIGHT_PREFERENCE

public static final java.lang.String HEIGHT_PREFERENCE
See Also:
Constant Field Values

X_PREFERENCE

public static final java.lang.String X_PREFERENCE
See Also:
Constant Field Values

Y_PREFERENCE

public static final java.lang.String Y_PREFERENCE
See Also:
Constant Field Values
Constructor Detail

BaseUIMemento

public BaseUIMemento()
Method Detail

storeColor

protected void storeColor(java.awt.Color color,
                          java.util.prefs.Preferences node)
Enables to store a Color into the preferences as its RGB components.

Parameters:
color - the Color to store.
node - the node to store the color in.

loadColor

protected java.awt.Color loadColor(java.util.prefs.Preferences node)
Enables to recover a Color stored in the preferences as its RGB components.

Parameters:
node - the node in which the color was saved.
Returns:
the recovered Color.

storeDimension

protected void storeDimension(java.awt.Dimension dimension,
                              java.util.prefs.Preferences node)
Enables to store a Dimension into the preferences.

Parameters:
dimension - the Dimension to store.
node - the node to store the Dimension in.

loadDimension

protected java.awt.Dimension loadDimension(java.util.prefs.Preferences node)
Enables to recover Dimension stored in the preferences.

Parameters:
node - the node in which the Dimension was stored.
Returns:
the recovered Dimension.

storePoint

protected void storePoint(java.awt.Point point,
                          java.util.prefs.Preferences node)
Enables to store a Point into the preferences.

Parameters:
point - the Point to store.
node - the node to store the Point in.

loadPoint

protected java.awt.Point loadPoint(java.util.prefs.Preferences node)
Enables to store a Point into the preferences.

Parameters:
node - the node in which the Point was stored.
Returns:
the recovered Point.


Copyright 2006 null. All Rights Reserved.