|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.appframework.types.prefs.gui.PrefEditorWidgets
public class PrefEditorWidgets
Contains methods for creating widgets associated with Prefs.
| 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. |
protected java.util.HashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,Scope<javax.swing.JComponent>>> |
jCatComponentsMap
Okay, this is really, really important. |
protected javax.swing.JPanel |
jContentPane
Content pane within base window for GUI |
protected MetaPrefSet |
metaPrefSet
Set of MetaPrefs |
protected PrefSet |
prefSet
Set of Prefs |
protected static int |
RIGHT_GUI_INSET
The inset between the right side of the gui panel and the right side of values. |
protected ParsedURL |
savePrefsPURL
PURL to save prefs.xml to |
protected static int |
TEXT_FIELD_PADDING
The padding between the default value in a text field and either side of the text field. |
| 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(). |
protected javax.swing.JCheckBox |
createCheckBox(javax.swing.JPanel panel,
MetaPref mp)
Creates a check box. |
protected javax.swing.JComboBox |
createDropDown(javax.swing.JPanel panel,
MetaPref mp)
Creates a drop down menu; combo box. |
protected javax.swing.JSlider |
createSlider(javax.swing.JPanel panel,
MetaPref mp,
java.lang.String labelAndName,
boolean valuesAreAltered,
int valueAlteredBy)
Creates a slider. |
protected javax.swing.JSpinner |
createSpinner(javax.swing.JPanel panel,
MetaPref mp)
Creates a spinner. |
protected javax.swing.JTextField |
createTextField(javax.swing.JPanel panel,
MetaPref mp)
Creates a text field. |
javax.swing.JPanel |
getJContentPane()
Get the jContentPane for the editor. |
protected Scope<javax.swing.JComponent> |
jCatComponentsMap(MetaPref mp)
Returns the ObjectRegistry for this MetaPref's jComponents. |
protected javax.swing.JComponent |
lookupComponent(MetaPref mp,
java.lang.String labelAndName)
Returns a JComponent from the ObjectRegistry by name |
void |
registerComponent(MetaPref mp,
java.lang.String labelAndName,
javax.swing.JComponent jComponent)
Registers a JComponent with the ObjectRegistry |
protected void |
savePrefs()
|
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String IDENTIFIER_SPINNER
protected static final int RIGHT_GUI_INSET
protected static final int TEXT_FIELD_PADDING
protected java.util.HashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,Scope<javax.swing.JComponent>>> jCatComponentsMap
protected MetaPrefSet metaPrefSet
protected PrefSet prefSet
protected ParsedURL savePrefsPURL
protected javax.swing.JPanel jContentPane
| Constructor Detail |
|---|
public PrefEditorWidgets(MetaPrefSet metaPrefSet,
PrefSet prefSet,
ParsedURL savePrefsPURL)
metaPrefSet - Set of MetaPrefsprefSet - Set of PrefssavePrefsPURL - ParsedURL to save prefs.xml toisStandalone - Whether or not we're calling this standalone| Method Detail |
|---|
protected javax.swing.JTextField createTextField(javax.swing.JPanel panel,
MetaPref mp)
panel - JPanel this field will be associated with.mp - MetaPref this field is for.
protected javax.swing.JCheckBox createCheckBox(javax.swing.JPanel panel,
MetaPref mp)
panel - JPanel this button will be associated with.mp - MetaPref this checkbox is being created for.
protected javax.swing.JComboBox createDropDown(javax.swing.JPanel panel,
MetaPref mp)
panel - JPanel this field will be associated with.mp - MetaPref this combo box is being created for.
protected javax.swing.JSlider createSlider(javax.swing.JPanel panel,
MetaPref mp,
java.lang.String labelAndName,
boolean valuesAreAltered,
int valueAlteredBy)
panel - JPanel this slider will be associated with.mp - MetaPref this slider is being created for.labelAndName - Name of slidervaluesAreAltered - Whether or not the values of the metapref/pref need to be
altered for the slider.valueAlteredBy - How much the metapref/pref values are multiplied/ divided by.
Only used if valuesAreAltered=true.
protected javax.swing.JSpinner createSpinner(javax.swing.JPanel panel,
MetaPref mp)
panel - JPanel this spinner will be associated with.mp - MetaPref this spinner is being created for.
protected Scope<javax.swing.JComponent> jCatComponentsMap(MetaPref mp)
mp - MetaPref whose jComponents we want.
public void registerComponent(MetaPref mp,
java.lang.String labelAndName,
javax.swing.JComponent jComponent)
mp - metapref we want to registerlabelAndName - label/name to add to the metapref's id to identify a
particular jComponent. must be UNIQUE.jComponent - jComponent to registerpublic void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged in interface javax.swing.event.ChangeListenerpublic void updatePrefsFromWidgets()
protected javax.swing.JComponent lookupComponent(MetaPref mp,
java.lang.String labelAndName)
mp - metapref to look uplabelAndName - the label/name that was added to the metapref's id to identify
a particular jComponent
protected void savePrefs()
public void actionSavePreferences()
#createApplyButton()
and #createSaveButton().
Saves the prefs to savePrefsPURL.
public javax.swing.JPanel getJContentPane()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||