ecologylab.appframework.types.prefs.gui
Class PrefEditorWidgets

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

public class PrefEditorWidgets
extends Debug
implements javax.swing.event.ChangeListener

Contains methods for creating widgets associated with Prefs.

Author:
Zachary O. Toups (toupsz@cs.tamu.edu)

Field Summary
static java.lang.String IDENTIFIER_SPINNER
          The string that will be added to the metapref's id, to create a unique identifier for a jComponent.
 
Constructor Summary
PrefEditorWidgets(MetaPrefSet metaPrefSet, PrefSet prefSet, ParsedURL savePrefsPURL)
          The base function that you call to construct the prefs editor GUI.
 
Method Summary
 void actionSavePreferences()
          Save the preferences; called by #createApplyButton() and #createSaveButton().
 javax.swing.JPanel getJContentPane()
          Get the jContentPane for the editor.
 void registerComponent(MetaPref mp, java.lang.String labelAndName, javax.swing.JComponent jComponent)
          Registers a JComponent with the ObjectRegistry
 void stateChanged(javax.swing.event.ChangeEvent e)
          This is for sliders; when we move the slider, we need to update the tooltip and force it to display.
 void updatePrefsFromWidgets()
          Queries all widgets and updates their associated Prefs; this will cascade and cause each Pref to notify all PrefChangedListeners associated with Pref.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENTIFIER_SPINNER

public static final java.lang.String IDENTIFIER_SPINNER
The string that will be added to the metapref's id, to create a unique identifier for a jComponent.

See Also:
Constant Field Values
Constructor Detail

PrefEditorWidgets

public PrefEditorWidgets(MetaPrefSet metaPrefSet,
                         PrefSet prefSet,
                         ParsedURL savePrefsPURL)
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

registerComponent

public void registerComponent(MetaPref mp,
                              java.lang.String labelAndName,
                              javax.swing.JComponent jComponent)
Registers a JComponent with the ObjectRegistry

Parameters:
mp - metapref we want to register
labelAndName - label/name to add to the metapref's id to identify a particular jComponent. must be UNIQUE.
jComponent - jComponent to register

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
This is for sliders; when we move the slider, we need to update the tooltip and force it to display. TODO: change placement of tooltip

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

updatePrefsFromWidgets

public void updatePrefsFromWidgets()
Queries all widgets and updates their associated Prefs; this will cascade and cause each Pref to notify all PrefChangedListeners associated with Pref.


actionSavePreferences

public void actionSavePreferences()
Save the preferences; called by #createApplyButton() and #createSaveButton(). Saves the prefs to savePrefsPURL.


getJContentPane

public javax.swing.JPanel getJContentPane()
Get the jContentPane for the editor.

Returns: