public class PtolemyPreferences extends ScopeExtendingAttribute
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
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.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
PtolemyPreferences(NamedObj container,
java.lang.String name)
Construct an instance of the preferences attribute.
|
Modifier and Type | Method and Description |
---|---|
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.
|
expand, setContainer, validate
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
attributeList, getAttribute
public ColorAttribute backgroundColor
public static final java.lang.String PREFERENCES_FILE_NAME
public static final java.lang.String PREFERENCES_WITHIN_CONFIGURATION
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.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.