Class 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)
    • 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 attribute
        NameDuplicationException - 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 class EditorIcon
        Returns:
        A new figure.