public class NameIcon extends EditorIcon
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
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.
|
ColorAttribute |
color
The background color to use in the box.
|
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.
|
_containerToBe, _iconCache
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
NameIcon(NamedObj container,
java.lang.String name)
Create a new icon with the given name in the given container.
|
Modifier and Type | Method and Description |
---|---|
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 LabelFigure |
_getLabel(CompositeFigure background,
java.lang.String name)
Get the label to put on the specified background
figure based on the specified name.
|
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.
|
javax.swing.Icon |
createIcon()
Create an icon.
|
void |
setContainer(NamedObj container)
Override the base class to add or set a _hideName parameter.
|
_createDefaultBackgroundFigure, _isPropertySet, _recreateFigure, clone, getContainerOrContainerToBe, setContainerToBe
_checkContainer, _getContainedObject, _propagateExistence, 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, 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
public ColorAttribute color
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
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.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 javax.swing.Icon createIcon()
createIcon
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 LabelFigure _getLabel(CompositeFigure background, java.lang.String name)
background
- The background figure on which to put the label.name
- The name on which to base the label.protected float _getLineWidth()