public class TextIcon extends DynamicEditorIcon
NamedObj.ContainedObjectsIterator
_figures
_containerToBe, _iconCache
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
TextIcon(NamedObj container,
java.lang.String name)
Create a new icon with the given name in the given container.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
Figure |
createBackgroundFigure()
Create a new default background figure, which is the text set
by setText, if it has been called, or default text if not.
|
javax.swing.Icon |
createIcon()
Create a new Swing icon.
|
void |
setAnchor(int anchor)
Specify origin of the text.
|
void |
setFont(java.awt.Font font)
Specify the font to use.
|
void |
setIconText(java.lang.String text)
Specify the text to display in the icon.
|
void |
setText(java.lang.String text)
Specify text to display.
|
void |
setTextColor(java.awt.Color textColor)
Specify the text color to use.
|
_addLiveFigure, _liveFigureIterator, _trimLiveFigures
_createDefaultBackgroundFigure, _isPropertySet, _recreateFigure, createFigure, getContainerOrContainerToBe, setContainerToBe
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, 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, 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
public TextIcon(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of the attribute.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.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class DynamicEditorIcon
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown in this base classNamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public Figure createBackgroundFigure()
createBackgroundFigure
in class EditorIcon
public javax.swing.Icon createIcon()
createIcon
in class EditorIcon
setIconText(String)
public void setAnchor(int anchor)
SwingConstants
.anchor
- The anchor of the text.public void setFont(java.awt.Font font)
font
- The font to use.public void setIconText(java.lang.String text)
text
- The text to display in the icon.public void setText(java.lang.String text)
text
- The text to display.public void setTextColor(java.awt.Color textColor)
textColor
- The fill color to use.