Package ptolemy.vergil.icon
Class TableIcon
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.vergil.icon.EditorIcon
-
- ptolemy.vergil.icon.DynamicEditorIcon
-
- ptolemy.vergil.icon.TableIcon
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,IconAttribute
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class TableIcon extends DynamicEditorIcon
An icon that displays the value of a variable of the container in a table. The attribute is assumed to be an instance of Variable, and its name is given by the parameter variableName. Its value must be an array of records. A subset of the fields in the records given by the fields parameter is displayed in the icon.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- 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 protected static double
_HORIZONTAL_PADDING
The amount of padding to use around the edges.protected static java.awt.Font
_labelFont
The font used.protected static double
_VERTICAL_PADDING
The amount of padding to use around the edges.ColorAttribute
boxColor
Color of the box.StringParameter
colorKey
A column name to use as a color key.Parameter
fields
The fields to display in the table.Parameter
maxRows
The maximum number of rows to display.StringParameter
variableName
The name of the variable in the container whose value should be displayed in the 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Figure
createBackgroundFigure()
Create a new background figure.-
Methods inherited from class ptolemy.vergil.icon.DynamicEditorIcon
_addLiveFigure, _liveFigureIterator, _trimLiveFigures, clone
-
Methods inherited from class ptolemy.vergil.icon.EditorIcon
_createDefaultBackgroundFigure, _isPropertySet, _recreateFigure, createFigure, createIcon, 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, _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
-
-
-
-
Field Detail
-
boxColor
public ColorAttribute boxColor
Color of the box. This defaults to white.
-
colorKey
public StringParameter colorKey
A column name to use as a color key. If this string is non-empty, then it specifies a column name that is used to determine a color for each row. The value in that row and column determines the color via a hash function, so that if two rows are identical in that column, then they are also identical in color. This is a string that defaults to empty, indicating that all rows should be displayed in black.
-
fields
public Parameter fields
The fields to display in the table. This is an array of strings specifying the field names to display. It defaults to ALL, which indicates that all fields should be displayed.
-
maxRows
public Parameter maxRows
The maximum number of rows to display. This is an integer, with default value UNBOUNDED.
-
variableName
public StringParameter variableName
The name of the variable in the container whose value should be displayed in the icon. The variable value must be an array of records. This is a string that defaults to the empty string.
-
_labelFont
protected static final java.awt.Font _labelFont
The font used.
-
_HORIZONTAL_PADDING
protected static final double _HORIZONTAL_PADDING
The amount of padding to use around the edges.- See Also:
- Constant Field Values
-
_VERTICAL_PADDING
protected static final double _VERTICAL_PADDING
The amount of padding to use around the edges.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TableIcon
public TableIcon(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 attributeNameDuplicationException
- If the name coincides with an attribute already in the container.
-
-
Method Detail
-
createBackgroundFigure
public Figure createBackgroundFigure()
Create a new background figure. This overrides the base class to draw a box around the value display, where the width of the box depends on the value.- Overrides:
createBackgroundFigure
in classEditorIcon
- Returns:
- A new figure.
-
-