Package ptolemy.vergil.icon
Class CopyCatIcon
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,IconAttribute
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,ValueListener
public class CopyCatIcon extends XMLIcon
This is an icon that copies the icon of the last entity contained by the same container, if there is one, and behaves like the base class if not.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (eal)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description ColorAttribute
echoBoxColor
Color of the echo boxes.Parameter
echos
The number of echos of the bounding box to draw.Parameter
includeName
If true, include the name of the copied actor in the icon if the name is included normally in its icon.-
Fields inherited from class ptolemy.vergil.icon.DynamicEditorIcon
_figures
-
Fields inherited from class ptolemy.vergil.icon.EditorIcon
_containerToBe, _iconCache
-
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 CopyCatIcon(NamedObj container, java.lang.String name)
Create a new icon with the given name in the given container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone(Workspace workspace)
Clone the object into the specified workspace.Figure
createBackgroundFigure()
Create a new background figure.-
Methods inherited from class ptolemy.vergil.icon.XMLIcon
_description, _recreateFigure, createIcon, getXMLIcon, getXMLIcon, paintedList, toString, valueChanged
-
Methods inherited from class ptolemy.vergil.icon.DynamicEditorIcon
_addLiveFigure, _liveFigureIterator, _trimLiveFigures
-
Methods inherited from class ptolemy.vergil.icon.EditorIcon
_createDefaultBackgroundFigure, _isPropertySet, createFigure, getContainerOrContainerToBe, setContainerToBe
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _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, uniqueName, validateSettables, workspace
-
-
-
-
Field Detail
-
echoBoxColor
public ColorAttribute echoBoxColor
Color of the echo boxes. This defaults to white.
-
echos
public Parameter echos
The number of echos of the bounding box to draw. This is an int that defaults to 2.
-
includeName
public Parameter includeName
If true, include the name of the copied actor in the icon if the name is included normally in its icon. NOTE: This will not include the name if the inside actor does not have an icon attribute, but only has an _iconDescription, so it's far from perfect. This is a boolean that defaults to false.
-
-
Constructor Detail
-
CopyCatIcon
public CopyCatIcon(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Create a new icon with the given name in the given container.- Parameters:
container
- The container.name
- The name of the attribute.- Throws:
IllegalActionException
- If the attribute is not of an acceptable class for the container.NameDuplicationException
- If the name coincides with an attribute already in the container.
-
-
Method Detail
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Clone the object into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is an object with no container.- Overrides:
clone
in classXMLIcon
- Parameters:
workspace
- The workspace for the cloned object.- Returns:
- The new Attribute.
- Throws:
java.lang.CloneNotSupportedException
- Not thrown in this base class- See Also:
NamedObj.exportMoML(Writer, int, String)
,NamedObj.setDeferringChangeRequests(boolean)
-
createBackgroundFigure
public Figure createBackgroundFigure()
Create a new background figure. This method looks for entities contained by the same container, and if there are any, copies the icon of the last such entity. If there are none, then it behaves like the base class.- Overrides:
createBackgroundFigure
in classXMLIcon
- Returns:
- A new figure.
-
-