Package ptolemy.actor.gui.style
Class CheckBoxStyle
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.gui.style.ParameterEditorStyle
-
- ptolemy.actor.gui.style.CheckBoxStyle
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class CheckBoxStyle extends ParameterEditorStyle
This attribute annotates user settable attributes to specify a checkbox style for configuring the containing attribute. This style is only valid for boolean valued attributes, so this class expects that the container will be an instance of Parameter that contains a boolean token.- Since:
- Ptolemy II 1.0
- Version:
- $Id$
- Author:
- Steve Neuendorffer and Edward A. Lee
- See Also:
EditorPaneFactory
,ParameterEditorStyle
- Pt.AcceptedRating:
- Yellow (neuendor)
- Pt.ProposedRating:
- Green (neuendor)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description CheckBoxStyle()
Construct an attribute in the default workspace with an empty string as its name.CheckBoxStyle(Parameter container, java.lang.String name)
Construct an attribute with the specified container and name.CheckBoxStyle(Workspace workspace)
Construct an attribute in the given workspace with an empty string as its name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptable(Settable param)
Return true if this style is acceptable for the given parameter.void
addEntry(PtolemyQuery query)
Create a new check box entry in the given query associated with the parameter containing this style.void
setContainer(NamedObj container)
Override the base class to check that the container is an instance of parameter.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_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
-
-
-
-
Constructor Detail
-
CheckBoxStyle
public CheckBoxStyle()
Construct an attribute in the default workspace with an empty string as its name. The object is added to the directory of the workspace. Increment the version number of the workspace.
-
CheckBoxStyle
public CheckBoxStyle(Workspace workspace)
Construct an attribute in the given workspace with an empty string as its name. The object is added to the directory of the workspace. Increment the version number of the workspace.- Parameters:
workspace
- The workspace that will contain the attribute that is being constructed.
-
CheckBoxStyle
public CheckBoxStyle(Parameter container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct an attribute with the specified container and name.- Parameters:
container
- The container.name
- The name of the attribute.- Throws:
IllegalActionException
- If the attribute is not of an acceptable attribute for the container, or if the container is not an instance of Parameter.NameDuplicationException
- If the name coincides with an attribute already in the container.
-
-
Method Detail
-
acceptable
public boolean acceptable(Settable param)
Return true if this style is acceptable for the given parameter.- Specified by:
acceptable
in classParameterEditorStyle
- Parameters:
param
- The attribute that this annotates.- Returns:
- True if the argument is a parameter that contains a boolean token.
-
addEntry
public void addEntry(PtolemyQuery query) throws IllegalActionException
Create a new check box entry in the given query associated with the parameter containing this style. The name of the entry is the name of the parameter. Attach the parameter to the created entry.- Specified by:
addEntry
in classParameterEditorStyle
- Parameters:
query
- The query into which to add the entry.- Throws:
IllegalActionException
- If the containing parameter does not contain a boolean token.
-
setContainer
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Override the base class to check that the container is an instance of parameter.- Overrides:
setContainer
in classParameterEditorStyle
- Parameters:
container
- The container to attach this attribute to.- Throws:
IllegalActionException
- If this attribute and container are not in the same workspace, or the proposed container would result in recursive containment, or the proposed container is not an instance of Parameter.NameDuplicationException
- If the container already has an attribute with the name of this attribute.- See Also:
Attribute.getContainer()
-
-