ecologylab.appframework.types.prefs.gui
Class PrefsEditor

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.appframework.types.prefs.gui.PrefEditorWidgets
          extended by ecologylab.appframework.types.prefs.gui.PrefsEditor
All Implemented Interfaces:
java.awt.event.WindowListener, java.util.EventListener, javax.swing.event.ChangeListener

public class PrefsEditor
extends PrefEditorWidgets
implements java.awt.event.WindowListener

Create the GUI for preference editing; also responsible for all actions associated with the GUI.

Author:
Cae

Field Summary
 
Fields inherited from class ecologylab.appframework.types.prefs.gui.PrefEditorWidgets
IDENTIFIER_SPINNER, jCatComponentsMap, jContentPane, metaPrefSet, prefSet, RIGHT_GUI_INSET, savePrefsPURL, TEXT_FIELD_PADDING
 
Constructor Summary
PrefsEditor(MetaPrefSet metaPrefSet, PrefSet prefSet, ParsedURL savePrefsPURL, boolean createJFrame, boolean isStandalone)
          The base function that you call to construct the prefs editor GUI.
 
Method Summary
protected  javax.swing.JRadioButton createRadio(javax.swing.JPanel panel, MetaPref mp, javax.swing.ButtonGroup buttonGroup, boolean initialValue, java.lang.String label, java.lang.String name, int row, int col)
          Creates a radio button.
static void setupColorChooser(javax.swing.JPanel jPanel, MetaPref mp)
          Creates a color chooser dialog for a color chooser metapref and places it on the panel.
 java.awt.Container setupContainer(boolean createJFrame, boolean isStandalone)
          Calls createJFrame
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          Altered behavior: print that we are closing save our window location
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class ecologylab.appframework.types.prefs.gui.PrefEditorWidgets
actionSavePreferences, createCheckBox, createDropDown, createSlider, createSpinner, createTextField, getJContentPane, jCatComponentsMap, lookupComponent, registerComponent, savePrefs, stateChanged, updatePrefsFromWidgets
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrefsEditor

public PrefsEditor(MetaPrefSet metaPrefSet,
                   PrefSet prefSet,
                   ParsedURL savePrefsPURL,
                   boolean createJFrame,
                   boolean isStandalone)
The base function that you call to construct the prefs editor GUI. This requires that the MetaPrefSet and PrefSet be instantiated and populated prior to call. This function creates the entire GUI and handles all actions for it.

Parameters:
metaPrefSet - Set of MetaPrefs
prefSet - Set of Prefs
savePrefsPURL - ParsedURL to save prefs.xml to
isStandalone - Whether or not we're calling this standalone
Method Detail

setupContainer

public java.awt.Container setupContainer(boolean createJFrame,
                                         boolean isStandalone)
Calls createJFrame

Returns:
Base window (JFrame) for the GUI
See Also:
#createJFrame()

setupColorChooser

public static void setupColorChooser(javax.swing.JPanel jPanel,
                                     MetaPref mp)
Creates a color chooser dialog for a color chooser metapref and places it on the panel.

Parameters:
jPanel - panel the dialog will be associated with
mp - metapref the chooser is being created for

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Altered behavior: print that we are closing save our window location

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

createRadio

protected javax.swing.JRadioButton createRadio(javax.swing.JPanel panel,
                                               MetaPref mp,
                                               javax.swing.ButtonGroup buttonGroup,
                                               boolean initialValue,
                                               java.lang.String label,
                                               java.lang.String name,
                                               int row,
                                               int col)
Creates a radio button.

Parameters:
panel - JPanel this button will be associated with.
mp - MetaPref this button is being created for.
buttonGroup - ButtonGroup this button is a member of.
initialValue - boolean; true=selected. false=not selected.
label - Text label for button
name - Name of button
row - Row this button is in for GridBagLayout
col - Column this button is in for GridBagLayout
Returns:
JRadioButton with properties initialized to parameters.