net.talvi.puffinplot
Class PuffinPrefs

java.lang.Object
  extended by net.talvi.puffinplot.PuffinPrefs

public final class PuffinPrefs
extends java.lang.Object

PuffinPrefs stores, loads, and saves PuffinPlot's user preferences. It is essentially a convenience wrapper around a Preferences object.


Constructor Summary
PuffinPrefs(PuffinApp app)
          Instantiates a set of PuffinPlot preferences for the specified PuffinApp instance.
 
Method Summary
 void exportToFile(java.io.File file)
          Exports the current preferences to a specified file.
 TwoGeeLoader.Protocol get2gProtocol()
          Returns the measurement protocol used when opening 2G data files.
 java.awt.geom.Rectangle2D getPlotSize(java.lang.String plotName)
          Gives the configured size and position for a specified plot.
 java.util.prefs.Preferences getPrefs()
          Returns the underlying Preferences object which holds the preferences.
 SensorLengths getSensorLengths()
          Returns the effective sensor lengths for opening 2G data files.
 void importFromFile(java.io.File file)
          Imports preferences from a specified file.
 boolean isAxisScaleLocked()
          Reports whether the axis scale is locked across all samples in the current suite.
 boolean isPcaAnchored()
          Reports whether PCA fits should be anchored to the origin.
 void load()
          Loads the preferences from the preferences backing store.
 void save()
          Saves the preferences to the preferences backing store.
 void set2gProtocol(TwoGeeLoader.Protocol protocol)
          Sets the measurement protocol to use when opening 2G data files.
 void setAxisScaleLocked(boolean axisScaleLocked)
          Sets whether the axis scale is locked across all samples in the current suite.
 void setPcaAnchored(boolean pcaThroughOrigin)
          Sets whether PCA fits should be anchored to the origin.
 void setSensorLengths(SensorLengths sensorLengths)
          Sets the effective sensor lengths for opening 2G data files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PuffinPrefs

public PuffinPrefs(PuffinApp app)
Instantiates a set of PuffinPlot preferences for the specified PuffinApp instance. The preference settings are loaded from the Preferences node associated with the package containing PuffinPrefs.

Parameters:
app - the PuffinPlot instance for which to create the preferences
Method Detail

getPrefs

public java.util.prefs.Preferences getPrefs()
Returns the underlying Preferences object which holds the preferences.

Returns:
the Preferences object containing the preferences

isAxisScaleLocked

public boolean isAxisScaleLocked()
Reports whether the axis scale is locked across all samples in the current suite. This preference is currently ignored by PuffinPlot.

Returns:
true if the axis scale is locked

setAxisScaleLocked

public void setAxisScaleLocked(boolean axisScaleLocked)
Sets whether the axis scale is locked across all samples in the current suite. This preference is currently ignored by PuffinPlot.

Parameters:
axisScaleLocked - true to lock the axis scale, false to unlock it

getSensorLengths

public SensorLengths getSensorLengths()
Returns the effective sensor lengths for opening 2G data files.

Returns:
the effective sensor lengths for opening 2G data files

setSensorLengths

public void setSensorLengths(SensorLengths sensorLengths)
Sets the effective sensor lengths for opening 2G data files.

Parameters:
sensorLengths - the effective sensor lengths for opening 2G data files

isPcaAnchored

public boolean isPcaAnchored()
Reports whether PCA fits should be anchored to the origin.

Returns:
true if PCA fits should be anchored to the origin.
See Also:
PcaValues

setPcaAnchored

public void setPcaAnchored(boolean pcaThroughOrigin)
Sets whether PCA fits should be anchored to the origin.

Parameters:
pcaThroughOrigin - true if PCA fits should be anchored to the origin.
See Also:
PcaValues

getPlotSize

public java.awt.geom.Rectangle2D getPlotSize(java.lang.String plotName)
Gives the configured size and position for a specified plot.

Parameters:
plotName - the name of a plot
Returns:
the bounding box of the specified plot within the main display area
See Also:
Plot

load

public void load()
Loads the preferences from the preferences backing store. The preferences node used is the one associated with the package containing this class.

See Also:
Preferences

save

public void save()
Saves the preferences to the preferences backing store. The preferences node used is the one associated with the package containing this class.

See Also:
Preferences

exportToFile

public void exportToFile(java.io.File file)
Exports the current preferences to a specified file.

Parameters:
file - the file to which to save the preferences

importFromFile

public void importFromFile(java.io.File file)
Imports preferences from a specified file. The current preferences will be overwritten.

Parameters:
file - the file from which to import the preferences

get2gProtocol

public TwoGeeLoader.Protocol get2gProtocol()
Returns the measurement protocol used when opening 2G data files.

Returns:
the measurement protocol used when opening 2G data files

set2gProtocol

public void set2gProtocol(TwoGeeLoader.Protocol protocol)
Sets the measurement protocol to use when opening 2G data files.

Parameters:
protocol - the measurement protocol to use when opening 2G data files