de.saar.chorus.ubench.gui
Class Preferences

Object
  extended by Preferences
All Implemented Interfaces:
Cloneable

public class Preferences
extends Object
implements Cloneable

This contains several preferences for layouting and solving graphs and a master object containing the general used preferences. Every JDomGraph has a Preferences object of its own and has to be repaintet, if its preferences are not aligned to the global master preferences. The global preferences concerning layout and solving can be changed by using the menu checkboxes of the JDomGraphMenu. The default values are true for showing labels and automatical solving and false for automatical window fitting.

Author:
Alexander Koller

Constructor Summary
Preferences()
          Creating a new Preferences object with the default values.
 
Method Summary
 Preferences clone()
          Clones this.
 void copyTo(Preferences second)
          Copies these preferences to a second given Preferences object.
static Preferences getInstance()
          Returns the master Preferences object which is a new one if there is no master yet.
static boolean isAutoCount()
           
static boolean isFitToWindow()
           
 boolean isShowLabels()
           
static boolean mustUpdateLayout(Preferences previousLayoutPreferences)
          Compares the given Preferences object with this one.
static void setAutoCount(boolean xautoCount)
          This can enable or disable the automatical solving / counting of solved forms.
static void setFitToWindow(boolean fit)
          Set to true, fitWindow will cause the visible and all further opened graphs to be zoomed out if they oversize their tab.
 void setShowLabels(boolean showLabels)
          Setting the parameter indicating whether node labels or node names are shown.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Preferences

public Preferences()
Creating a new Preferences object with the default values.

Method Detail

isShowLabels

public boolean isShowLabels()
Returns:
true if node labels are shown (default)

setShowLabels

public void setShowLabels(boolean showLabels)
Setting the parameter indicating whether node labels or node names are shown. If set to false, the node names are shown instead of the node labels. (Default: true, node labels are shown)

Parameters:
showLabels - set this to false for showing node names

setFitToWindow

public static void setFitToWindow(boolean fit)
Set to true, fitWindow will cause the visible and all further opened graphs to be zoomed out if they oversize their tab. Default: false.

Parameters:
fit -

isAutoCount

public static boolean isAutoCount()
Returns:
true if all graphs are automatically solved

setAutoCount

public static void setAutoCount(boolean xautoCount)
This can enable or disable the automatical solving / counting of solved forms. If disabled, a menu item for "manual" solving / solved form counting should get enabled! Default: true (automatical counting)

Parameters:
xautoCount -

isFitToWindow

public static boolean isFitToWindow()
Returns:
true if the graphs shall be fitted into their tab

getInstance

public static Preferences getInstance()
Returns the master Preferences object which is a new one if there is no master yet.

Returns:
the master Preferences object

clone

public Preferences clone()
Clones this.

Overrides:
clone in class Object
Returns:
a clone of this Preferences

mustUpdateLayout

public static boolean mustUpdateLayout(Preferences previousLayoutPreferences)
Compares the given Preferences object with this one.

Parameters:
previousLayoutPreferences - the preferences to compare to
Returns:
true if the previous preferences are out of date

copyTo

public void copyTo(Preferences second)
Copies these preferences to a second given Preferences object.

Parameters:
second - the Preferences to copy the values to