ptolemy.vergil.ptera
Class EventIcon

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.vergil.icon.EditorIcon
              extended by ptolemy.vergil.icon.NameIcon
                  extended by ptolemy.vergil.modal.StateIcon
                      extended by ptolemy.vergil.ptera.EventIcon
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Direct Known Subclasses:
TimeAdvanceEventIcon

public class EventIcon
extends StateIcon

An icon for a Ptera event.

Since:
Ptolemy II 8.0
Version:
$Id: EventIcon.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private static java.awt.Font _ACTION_FONT
           
private static java.awt.Color _ENDING_COLOR
           
private static java.awt.Color _FINAL_COLOR
           
private static java.awt.Color _INITIAL_COLOR
           
private static double _MIN_HEIGHT
           
 
Fields inherited from class ptolemy.vergil.icon.NameIcon
_labelFont, _roundingValue, _spacingValue, _xPadding, _yPadding, rounding, spacing
 
Fields inherited from class ptolemy.vergil.icon.EditorIcon
_containerToBe, _iconCache
 
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
EventIcon(NamedObj container, java.lang.String name)
          Create a new icon with the given name in the given container.
 
Method Summary
private  void _addLabel(CompositeFigure figure, java.lang.String text)
           
protected  java.awt.geom.Point2D _getBackgroundSize()
          Return the background size.
protected  java.awt.Paint _getFill()
          Return the paint to use to fill the icon.
protected  float _getLineWidth()
          Return the line width to use in rendering the box.
 Figure createFigure()
          Create a Figure.
 javax.swing.Icon createIcon()
          Create an icon.
 
Methods inherited from class ptolemy.vergil.icon.NameIcon
attributeChanged, createBackgroundFigure, setContainer
 
Methods inherited from class ptolemy.vergil.icon.EditorIcon
_createDefaultBackgroundFigure, _isPropertySet, _recreateFigure, clone, getContainerOrContainerToBe, setContainerToBe
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, 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, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_ACTION_FONT

private static final java.awt.Font _ACTION_FONT

_FINAL_COLOR

private static final java.awt.Color _FINAL_COLOR

_INITIAL_COLOR

private static final java.awt.Color _INITIAL_COLOR

_ENDING_COLOR

private static final java.awt.Color _ENDING_COLOR

_MIN_HEIGHT

private static final double _MIN_HEIGHT
See Also:
Constant Field Values
Constructor Detail

EventIcon

public EventIcon(NamedObj container,
                 java.lang.String name)
          throws NameDuplicationException,
                 IllegalActionException
Create a new icon with the given name in the given container. The container is required to implement Settable, or an exception will be thrown.

Parameters:
container - The container for this attribute.
name - The name of this attribute.
Throws:
IllegalActionException - If thrown by the parent class or while setting an attribute.
NameDuplicationException - If the name coincides with an attribute already in the container.
Method Detail

createFigure

public Figure createFigure()
Create a Figure.

Overrides:
createFigure in class NameIcon
Returns:
The figure.

createIcon

public javax.swing.Icon createIcon()
Create an icon.

Overrides:
createIcon in class StateIcon
Returns:
The icon.

_getBackgroundSize

protected java.awt.geom.Point2D _getBackgroundSize()
Description copied from class: NameIcon
Return the background size.

Overrides:
_getBackgroundSize in class NameIcon
Returns:
the background size.

_getFill

protected java.awt.Paint _getFill()
Description copied from class: StateIcon
Return the paint to use to fill the icon. By default, this class returns Color.white, unless the refinement name is not empty, in which case it returns a light green. However, if this attribute contains a ColorParameter named "fill", then the color of that color parameter is returned instead. In addition, if the container is a State and contains a ColorAttribute named "fill", then that color is returned.

Overrides:
_getFill in class StateIcon
Returns:
The paint to use to fill the icon.

_getLineWidth

protected float _getLineWidth()
Return the line width to use in rendering the box. This returns 1.0f, unless the container is an instance of State and its isInitialState parameter is set to true.

Overrides:
_getLineWidth in class StateIcon
Returns:
The line width to use in rendering the box.

_addLabel

private void _addLabel(CompositeFigure figure,
                       java.lang.String text)