|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.xml.ElementState
ecologylab.xml.types.element.ArrayListState
ecologylab.appframework.types.prefs.Pref<T>
public abstract class Pref<T>
Generic base class for application Preference objects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ecologylab.xml.ElementState |
|---|
ElementState.ClassToCollectionMap, ElementState.DeclarationStyle, ElementState.xml_attribute, ElementState.xml_class, ElementState.xml_classes, ElementState.xml_collection, ElementState.xml_leaf, ElementState.xml_map, ElementState.xml_nested, ElementState.xml_tag |
| Field Summary |
|---|
| Fields inherited from class ecologylab.xml.types.element.ArrayListState |
|---|
set |
| Fields inherited from class ecologylab.xml.ElementState |
|---|
CDATA, ESTIMATE_CHARS_PER_FIELD, FLOATING_PRECISION_OFF, MARSHALLING_PARAMS, NORMAL, UTF16, UTF16_LE, UTF8, XML_FILE_HEADER |
| Fields inherited from interface ecologylab.xml.XMLTranslationExceptionTypes |
|---|
FILE_NOT_FOUND, IO_EXCEPTION, NULL_PURL, UNKNOWN |
| Constructor Summary | |
|---|---|
|
Pref()
No-argument constructor for XML translation. |
protected |
Pref(java.lang.String name)
|
| Method Summary | |
|---|---|
static void |
addPrefChangedListener(PrefChangedListener l)
|
static boolean |
containsKey(java.lang.String key)
Check for existence / membership. |
java.lang.String |
getName()
|
static boolean |
hasPref(java.lang.String name)
Check for existence / membership. |
java.lang.String |
key()
|
static boolean |
lookupBoolean(java.lang.String name)
Look up a PrefBoolean by name in the map of all Prefs. |
static boolean |
lookupBoolean(java.lang.String name,
boolean defaultValue)
Look up a PrefBoolean by name in the map of all Prefs. |
static java.awt.Color |
lookupColor(java.lang.String name)
Look up a PrefColor by name in the map of all Prefs. |
static java.awt.Color |
lookupColor(java.lang.String name,
java.awt.Color defaultValue)
Look up a PrefColor by name in the map of all Prefs. |
static ElementState |
lookupElementState(java.lang.String name)
Look up a PrefElementState by name in the map of all Prefs. |
static java.io.File |
lookupFile(java.lang.String name)
Look up a PrefFile by name in the map of all Prefs. |
static float |
lookupFloat(java.lang.String name)
Look up a PrefFloat by name in the map of all Prefs. |
static float |
lookupFloat(java.lang.String name,
float defaultValue)
Look up a PrefFloat by name in the map of all Prefs. |
static int |
lookupInt(java.lang.String name)
Look up a PrefInt by name in the map of all Prefs. |
static int |
lookupInt(java.lang.String name,
int defaultValue)
Look up a PrefInt by name in the map of all Prefs. |
static Pref<?> |
lookupPref(java.lang.String name)
Look up a Pref by name in the map of all Prefs |
static java.lang.String |
lookupString(java.lang.String name)
Look up a PrefString by name in the map of all Prefs. |
static java.lang.String |
lookupString(java.lang.String name,
java.lang.String defaultValue)
Look up a PrefString by name in the map of all Prefs. |
protected void |
prefChanged()
Performs all housekeeping associated with updating this Pref. |
static void |
prefUpdated(Pref<?> pref)
|
void |
print()
Print Pref name and value |
abstract void |
setValue(T newValue)
Generic value setter. |
java.lang.String |
toString()
Return String of Pref name and value |
static void |
useAndSetPrefInt(java.lang.String name,
int value)
Lookup a Pref associated with name. |
static PrefBoolean |
usePrefBoolean(java.lang.String name,
boolean defaultValue)
This is for working with Prefs whose values you will continue to access as they
are edited, live, by the user. |
static PrefColor |
usePrefColor(java.lang.String name,
java.awt.Color defaultValue)
This is for working with Prefs whose values you will continue to access as they
are edited, live, by the user. |
static PrefFloat |
usePrefFloat(java.lang.String name,
float defaultValue)
This is for working with Prefs whose values you will continue to access as they
are edited, live, by the user. |
static PrefInt |
usePrefInt(java.lang.String name,
int defaultValue)
This is for working with Prefs whose values you will continue to access as they
are edited, live, by the user. |
static PrefString |
usePrefString(java.lang.String name,
java.lang.String defaultValue)
This is for working with Prefs whose values you will continue to access as they
are edited, live, by the user. |
T |
value()
Public generic accessor for the value. |
| Methods inherited from class ecologylab.xml.types.element.ArrayListState |
|---|
add, add, addAll, addAll, clear, clone, contains, containsAll, get, getArrayList, getCollection, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, recycle, remove, remove, removeAll, retainAll, set, set, size, subList, toArray, toArray, trimToSize |
| 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, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Pref()
protected Pref(java.lang.String name)
| Method Detail |
|---|
public T value()
public void print()
public java.lang.String toString()
toString in class Debugpublic abstract void setValue(T newValue)
newValue - protected void prefChanged()
public static PrefBoolean usePrefBoolean(java.lang.String name,
boolean defaultValue)
Prefs whose values you will continue to access as they
are edited, live, by the user. The result will be immediate changes in the program's behavior.
Lookup a Pref associated with name.
If you find it return it.
If not, create a new Pref object of the correct type.
Set its value to default value.
name - Name of the Pref to lookup and find or create.defaultValue - Initial value of the Pref if it didn't already exist.
public static PrefFloat usePrefFloat(java.lang.String name,
float defaultValue)
Prefs whose values you will continue to access as they
are edited, live, by the user. The result will be immediate changes in the program's behavior.
Lookup a Pref associated with name.
If you find it return it.
If not, create a new Pref object of the correct type.
Set its value to default value.
name - Name of the Pref to lookup and find or create.defaultValue - Initial value of the Pref if it didn't already exist.
public static PrefString usePrefString(java.lang.String name,
java.lang.String defaultValue)
Prefs whose values you will continue to access as they
are edited, live, by the user. The result will be immediate changes in the program's behavior.
Lookup a Pref associated with name.
If you find it return it.
If not, create a new Pref object of the correct type.
Set its value to default value.
name - Name of the Pref to lookup and find or create.defaultValue - Initial value of the Pref if it didn't already exist.
public static PrefInt usePrefInt(java.lang.String name,
int defaultValue)
Prefs whose values you will continue to access as they
are edited, live, by the user. The result will be immediate changes in the program's behavior.
Lookup a Pref associated with name.
If you find it return it.
If not, create a new Pref object of the correct type.
Set its value to default value.
name - Name of the Pref to lookup and find or create.defaultValue - Initial value of the Pref if it didn't already exist.
public static void useAndSetPrefInt(java.lang.String name,
int value)
name - Name of the Pref to lookup and find or create.defaultValue - Initial value of the Pref if it didn't already exist.
public static PrefColor usePrefColor(java.lang.String name,
java.awt.Color defaultValue)
Prefs whose values you will continue to access as they
are edited, live, by the user. The result will be immediate changes in the program's behavior.
Lookup a Pref associated with name.
If you find it return it.
If not, create a new Pref object of the correct type.
Set its value to default value.
name - Name of the Pref to lookup and find or create.defaultValue - Initial value of the Pref if it didn't already exist.
public static Pref<?> lookupPref(java.lang.String name)
name - Name of Pref
public static int lookupInt(java.lang.String name,
int defaultValue)
throws java.lang.ClassCastException
name - Name of PrefIntdefaultValue - default value for PrefInt
java.lang.ClassCastException
public static int lookupInt(java.lang.String name)
throws java.lang.ClassCastException
name - Name of PrefInt
java.lang.ClassCastException
public static boolean lookupBoolean(java.lang.String name,
boolean defaultValue)
throws java.lang.ClassCastException
name - Name of PrefBooleandefaultValue - default value for PrefBoolean
java.lang.ClassCastException
public static boolean lookupBoolean(java.lang.String name)
throws java.lang.ClassCastException
name - Name of PrefBoolean
java.lang.ClassCastException
public static float lookupFloat(java.lang.String name,
float defaultValue)
throws java.lang.ClassCastException
name - Name of PrefFloatdefaultValue - default value to set PrefFloat to
java.lang.ClassCastException
public static float lookupFloat(java.lang.String name)
throws java.lang.ClassCastException
name - Name of PrefFloat
java.lang.ClassCastException
public static java.lang.String lookupString(java.lang.String name,
java.lang.String defaultValue)
throws java.lang.ClassCastException
name - Name of PrefStringdefaultValue - default value for PrefString
java.lang.ClassCastException
public static java.lang.String lookupString(java.lang.String name)
throws java.lang.ClassCastException
name - Name of PrefString
java.lang.ClassCastException
public static java.io.File lookupFile(java.lang.String name)
throws java.lang.ClassCastException
name - Name of the PrefFile
java.lang.ClassCastException - if name does not match a PrefFile object
public static java.awt.Color lookupColor(java.lang.String name,
java.awt.Color defaultValue)
throws java.lang.ClassCastException
name - Name of PrefColordefaultValue - default value for PrefColor
java.lang.ClassCastException
public static java.awt.Color lookupColor(java.lang.String name)
throws java.lang.ClassCastException
name - Name of PrefColor
java.lang.ClassCastException
public static ElementState lookupElementState(java.lang.String name)
throws java.lang.ClassCastException
name - Name of PrefElementState
java.lang.ClassCastExceptionpublic static boolean hasPref(java.lang.String name)
key -
public static boolean containsKey(java.lang.String key)
key -
public java.lang.String getName()
public static void addPrefChangedListener(PrefChangedListener l)
public static void prefUpdated(Pref<?> pref)
public java.lang.String key()
key in interface Mappable<java.lang.String>Mappable.key()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||