org.mlc.swing.layout
Class UserPrefs

java.lang.Object
  extended by org.mlc.swing.layout.UserPrefs

public class UserPrefs
extends java.lang.Object

This is a singleton container for handling user preferences. These include window size and positions, debug frame visibility, etc.

Since:
Ptolemy II 8.0
Version:
$Id: UserPrefs.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Kevin Routley

Field Summary
private  java.util.prefs.Preferences prefStore
           
(package private) static UserPrefs usersPrefs
           
 
Constructor Summary
private UserPrefs()
          Creates a new instance of UserPrefs - private to prevent external instantiation
 
Method Summary
static UserPrefs getPrefs()
          Access the singleton instance.
(package private)  java.awt.Rectangle getWinLoc(java.lang.String winname)
           
 void saveDebugState(boolean b)
          Save the current state of the panel - debug on/off.
(package private)  void saveWinLoc(java.lang.String winname, java.awt.Point screenloc, java.awt.Dimension size)
           
 void saveWinLoc(java.lang.String winname, java.awt.Window window)
          Save a window's size and position data under the provided name.
 boolean showDebugPanel()
          Should we show the debug panel?
(package private)  boolean showPreviewBorder()
           
 void useSavedBounds(java.lang.String winname, java.awt.Window window)
          Fetch a window's size and position data and apply it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefStore

private java.util.prefs.Preferences prefStore

usersPrefs

static UserPrefs usersPrefs
Constructor Detail

UserPrefs

private UserPrefs()
Creates a new instance of UserPrefs - private to prevent external instantiation

Method Detail

getPrefs

public static UserPrefs getPrefs()
Access the singleton instance.


showPreviewBorder

boolean showPreviewBorder()

showDebugPanel

public boolean showDebugPanel()
Should we show the debug panel?


saveWinLoc

void saveWinLoc(java.lang.String winname,
                java.awt.Point screenloc,
                java.awt.Dimension size)

getWinLoc

java.awt.Rectangle getWinLoc(java.lang.String winname)

saveDebugState

public void saveDebugState(boolean b)
Save the current state of the panel - debug on/off.


useSavedBounds

public void useSavedBounds(java.lang.String winname,
                           java.awt.Window window)
Fetch a window's size and position data and apply it. The window name must be the same as supplied when calling @see saveWinLoc.


saveWinLoc

public void saveWinLoc(java.lang.String winname,
                       java.awt.Window window)
Save a window's size and position data under the provided name. (The data must be fetched using the same name).