|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.data.expr.ScopeExtendingAttribute
ptolemy.actor.gui.PtolemyPreferences
public class PtolemyPreferences
Default preferences definition for Vergil. This is defined as a class rather than in MoML so that the inheritance mechanism prevents exported MoML for every model from duplicating this information.
Red (cxh) |
Yellow (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
ColorAttribute |
backgroundColor
The background color. |
static java.lang.String |
PREFERENCES_FILE_NAME
The file name where user-defined preferences are stored. |
static java.lang.String |
PREFERENCES_WITHIN_CONFIGURATION
The location with the configuration of the preferences attribute. |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
PtolemyPreferences(NamedObj container,
java.lang.String name)
Construct an instance of the preferences attribute. |
Method Summary | |
---|---|
static PtolemyPreferences |
getPtolemyPreferencesWithinConfiguration(Configuration configuration)
Get the PtolemyPreferences within the specified configuration. |
static Token |
preferenceValue(NamedObj context,
java.lang.String preferenceName)
Check to see whether a preference of the specified name is defined in the specified context, and if it is, return its value. |
static Token |
preferenceValueLocal(NamedObj context,
java.lang.String preferenceName)
Check to see whether a preference of the specified name is defined in the container of the specified context, either directly or within an instance of PtolemyPreferences, or globally, and if it is, return it's value. |
void |
save()
Save the preference values in this instance to the user preferences file. |
void |
setAsDefault()
Set the values in this instance of PtolemyPreferences to be the default values by creating entries in the Constants class so that these values are accessible to any expression. |
static void |
setDefaultPreferences(Configuration configuration)
Look for a default preferences object within the specified configuration, and set it as the default preferences. |
Methods inherited from class ptolemy.data.expr.ScopeExtendingAttribute |
---|
setContainer |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.data.expr.ScopeExtender |
---|
attributeList, getAttribute |
Field Detail |
---|
public ColorAttribute backgroundColor
public static final java.lang.String PREFERENCES_FILE_NAME
public static final java.lang.String PREFERENCES_WITHIN_CONFIGURATION
Constructor Detail |
---|
public PtolemyPreferences(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name.
IllegalActionException
- If the attribute is not of an
acceptable class for the container, or if the name contains a period.
NameDuplicationException
- If the name coincides with
an attribute already in the container.Method Detail |
---|
public static PtolemyPreferences getPtolemyPreferencesWithinConfiguration(Configuration configuration) throws IllegalActionException
configuration
- The configuration in which to search for
PREFERENCES_WITHIN_CONFIGURATION
IllegalActionException
- If there is a problem getting the
PREFERENCES_WITHIN_CONFIGURATION
attribute.public static Token preferenceValue(NamedObj context, java.lang.String preferenceName)
context
- The context for the preference.preferenceName
- The name of the preference.
public static Token preferenceValueLocal(NamedObj context, java.lang.String preferenceName)
context
- The context for the preference.preferenceName
- The name of the preference.
public void save() throws java.io.IOException
java.io.IOException
- If an error occurs writing the file.public void setAsDefault() throws IllegalActionException
IllegalActionException
- If any expression for
a preference cannot be evaluated.public static void setDefaultPreferences(Configuration configuration)
configuration
- The specified configuration.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |