org.crosswire.common.swing.desktop
Class LayoutPersistence

java.lang.Object
  extended by org.crosswire.common.swing.desktop.LayoutPersistence

public final class LayoutPersistence
extends Object

Window layout persistence mechanism. Intended to be flexible enough to allow persisting size, position, layout of multiple windows.

Author:
Adam Thomas, DM Smith
See Also:
for license details.

Field Summary
private static int HEIGHT
          Suffix for window height key
private static LayoutPersistence instance
          The singleton instance of this class.
private static int LOCATION_X
          Suffix for window location x key
private static int LOCATION_Y
          Suffix for window location y key
private static org.slf4j.Logger log
          The log stream
private  org.crosswire.common.util.PropertyMap settings
          The persistence storage and retrieval object
private static int STATE
          Suffix for window state key
private static int WIDTH
          Suffix for window width key
 
Constructor Summary
private LayoutPersistence()
          Creates the singleton persistence object capable of storing and retrieving layout information on behalf windows.
 
Method Summary
static LayoutPersistence instance()
          All access to LayoutPersistence is through this single instance.
 boolean isLayoutPersisted(Window window)
          Indicates whether the window passed to the constructor has had layout information persisted.
 void restoreLayout(Window window)
          Loads and restores the layout to the window that was passed to the constructor.
 void saveLayout(Window window)
          Stores the current window's layout information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

settings

private org.crosswire.common.util.PropertyMap settings
The persistence storage and retrieval object


STATE

private static final int STATE
Suffix for window state key

See Also:
Constant Field Values

WIDTH

private static final int WIDTH
Suffix for window width key

See Also:
Constant Field Values

HEIGHT

private static final int HEIGHT
Suffix for window height key

See Also:
Constant Field Values

LOCATION_X

private static final int LOCATION_X
Suffix for window location x key

See Also:
Constant Field Values

LOCATION_Y

private static final int LOCATION_Y
Suffix for window location y key

See Also:
Constant Field Values

instance

private static LayoutPersistence instance
The singleton instance of this class.


log

private static final org.slf4j.Logger log
The log stream

Constructor Detail

LayoutPersistence

private LayoutPersistence()
Creates the singleton persistence object capable of storing and retrieving layout information on behalf windows.

Method Detail

instance

public static LayoutPersistence instance()
All access to LayoutPersistence is through this single instance.

Returns:
the singleton instance

isLayoutPersisted

public boolean isLayoutPersisted(Window window)
Indicates whether the window passed to the constructor has had layout information persisted.

Parameters:
window - the window to persist
Returns:
Returns true is layout information for the current window has been persisted, otherwise returns false

saveLayout

public void saveLayout(Window window)
Stores the current window's layout information.

Parameters:
window - the window to persist

restoreLayout

public void restoreLayout(Window window)
Loads and restores the layout to the window that was passed to the constructor.

Parameters:
window - the window to persist

Copyright ยจ 2003-2015