textbender.o.awt
Class ComponentLocationPreference

java.lang.Object
  extended by ComponentLocationPreference

@ThreadRestricted(value="AWT event dispatch")
public class ComponentLocationPreference
extends Object

Preference storage for component location. Stores under keys "x" and "y".


Field Summary
protected  Component component
           
 
Constructor Summary
ComponentLocationPreference(Component c, Preferences preferences)
          Creates a ComponentLocationPreference.
 
Method Summary
 Preferences preferences()
          Returns the preference node used for storage.
 void restore(int defaultX, int defaultY)
          Restores the preferred location, and begins automatically storing changes.
 void restore(Point defaultLocation)
          Restores the preferred location, and begins automatically storing changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

component

protected final Component component
Constructor Detail

ComponentLocationPreference

public ComponentLocationPreference(Component c,
                                   Preferences preferences)
Creates a ComponentLocationPreference. Begins to automatically store changes only after you call restore().

There is currently no way to remove it from the component. Create one only per component, or they will accumulate.

Parameters:
c - component whose location to store and restore
preferences - per preferences()
Method Detail

preferences

public Preferences preferences()
Returns the preference node used for storage.


restore

public void restore(Point defaultLocation)
Restores the preferred location, and begins automatically storing changes. Normally, called once only; subsequent calls should have no effect.

Parameters:
defaultLocation - in case no stored preference available

restore

public void restore(int defaultX,
                    int defaultY)
Restores the preferred location, and begins automatically storing changes. Normally, called once only; subsequent calls should have no effect.

Parameters:
defaultX - in case no stored preference available
defaultY - in case no stored preference available