|
|||||||||
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.vergil.icon.EditorIcon
ptolemy.vergil.icon.NameIcon
public class NameIcon
An icon that displays the name of the container in an appropriately sized box. Put this into a composite actor or in any actor to convert the icon for that actor into a simple box with the name of the actor instance. You will probably also want to set the actor instance to not display its name above its icon. You can do that via the Customize Name dialog (obtained by right clicking on the icon) or by creating a parameter named "_hideName" with value true.
Red (johnr) |
Yellow (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
protected static java.awt.Font |
_labelFont
The font used. |
protected double |
_roundingValue
Most recent value of the rounding parameter. |
protected double |
_spacingValue
Most recent value of the spacing parameter. |
protected double |
_xPadding
The horizontal padding on the left and right sides of the name. |
protected double |
_yPadding
The vertical padding above and below the name. |
Parameter |
rounding
The amount of rounding of the corners. |
Parameter |
spacing
If greater than zero, then use a double box where the outside one is the specified size larger than the inside one. |
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 | |
---|---|
NameIcon(NamedObj container,
java.lang.String name)
Create a new icon with the given name in the given container. |
Method Summary | |
---|---|
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. |
void |
attributeChanged(Attribute attribute)
React to a changes in the attributes by changing the icon. |
Figure |
createBackgroundFigure()
Create a new background figure. |
Figure |
createFigure()
Create a new Diva figure that visually represents this icon. |
void |
setContainer(NamedObj container)
Override the base class to add or set a _hideName parameter. |
Methods inherited from class ptolemy.vergil.icon.EditorIcon |
---|
_createDefaultBackgroundFigure, _isPropertySet, _recreateFigure, clone, createIcon, 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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Parameter rounding
public Parameter spacing
protected static final java.awt.Font _labelFont
protected double _roundingValue
protected double _spacingValue
protected double _xPadding
protected double _yPadding
Constructor Detail |
---|
public NameIcon(NamedObj container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container for this attribute.name
- The name of this attribute.
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 |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If the change is not acceptable
to this container (should not be thrown).public Figure createBackgroundFigure()
createBackgroundFigure
in class EditorIcon
public Figure createFigure()
createFigure
in class EditorIcon
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
setContainer
in class Attribute
container
- The container to attach this attribute to..
IllegalActionException
- If this attribute is not of the
expected class for the container, or it has no name,
or the attribute and container are not in the same workspace, or
the proposed container would result in recursive containment.
NameDuplicationException
- If the container already has
an attribute with the name of this attribute.Attribute.getContainer()
protected java.awt.geom.Point2D _getBackgroundSize()
protected java.awt.Paint _getFill()
protected float _getLineWidth()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |