com.orsoncharts.table

## Class AbstractTableElement

- java.lang.Object
- - com.orsoncharts.table.AbstractTableElement

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    ColorScaleElement, FlowElement, GridElement, ShapeElement, TextElement, VerticalFlowElement

      public abstract class AbstractTableElement
      extends java.lang.Object
      implements java.io.Serializable

  A base class that can be used to implement a `TableElement`.
  NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTableElement()` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Tests this instance for equality with an arbitrary object.
    `RectanglePainter` | `getBackground()` Returns the background painter for the element.
    `java.awt.Insets` | `getInsets()` Returns the insets.
    `java.lang.Object` | `getProperty(java.lang.String key)` Returns the value of the property with the specified key, or `null`.
    `RefPt2D` | `getRefPoint()` Returns the anchor point used to align the element with the bounding rectangle within which it is drawn.
    `java.lang.String` | `getTag()` Returns the tag for this element.
    `java.awt.geom.Dimension2D` | `preferredSize(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)` Returns the preferred size of the element (including insets).
    `abstract java.awt.geom.Dimension2D` | `preferredSize(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)` Returns the preferred size of the element (including insets).
    `void` | `setBackground(RectanglePainter background)` Sets the background for the element.
    `void` | `setBackgroundColor(java.awt.Color color)` Sets the background painter to fill the element with the specified color.
    `void` | `setInsets(java.awt.Insets insets)` Sets the insets.
    `void` | `setProperty(java.lang.String key, java.lang.Object value)` Sets the value of the property with the specified key.
    `void` | `setRefPoint(RefPt2D refPt)` Sets the reference point.
    `void` | `setTag(java.lang.String tag)` Sets the tag.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractTableElement

          public AbstractTableElement()

      Creates a new instance.

  - ### Method Detail

    - #### getRefPoint

          public RefPt2D getRefPoint()

      Returns the anchor point used to align the element with the bounding rectangle within which it is drawn. The default value is `RefPt2D.CENTER`.
      Returns:
        The anchor point (never `null`).
      Since:
        1.1

    - #### setRefPoint

          public void setRefPoint(RefPt2D refPt)

      Sets the reference point.
      Parameters:
        `refPt` - the reference point (`null` not permitted).
      Since:
        1.1

    - #### getInsets

          public java.awt.Insets getInsets()

      Returns the insets. The default value is `Insets(2, 2, 2, 2)`.
      Returns:
        The insets (never `null`).

    - #### setInsets

          public void setInsets(java.awt.Insets insets)

      Sets the insets.
      Parameters:
        `insets` - the insets (`null` not permitted).

    - #### getBackground

          public RectanglePainter getBackground()

      Returns the background painter for the element.
      Returns:
        The background painter (possibly `null`).

    - #### setBackground

          public void setBackground(RectanglePainter background)

      Sets the background for the element.
      Parameters:
        `background` - the new background (`null` permitted).

    - #### setBackgroundColor

          public void setBackgroundColor(java.awt.Color color)

      Sets the background painter to fill the element with the specified color. If the color is `null`, the background painter will be set to `null`.
      Parameters:
        `color` - the color (`null` permitted).
      Since:
        1.2

    - #### getTag

          public java.lang.String getTag()

      Returns the tag for this element. The default value is an empty string.
      Returns:
        The tag (never `null`).
      Since:
        1.2

    - #### setTag

          public void setTag(java.lang.String tag)

      Sets the tag.
      Parameters:
        `tag` - the tag (`null` not permitted).
      Since:
        1.2

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String key)

      Returns the value of the property with the specified key, or `null`.
      Parameters:
        `key` - the key (`null` not permitted).
      Returns:
        The property value or `null`.
      Since:
        1.3

    - #### setProperty

          public void setProperty(java.lang.String key,
                                  java.lang.Object value)

      Sets the value of the property with the specified key.
      Parameters:
        `key` - the key (`null` not permitted).
        `value` - the value (`null` permitted).
      Since:
        1.3

    - #### preferredSize

          public java.awt.geom.Dimension2D preferredSize(java.awt.Graphics2D g2,
                                                         java.awt.geom.Rectangle2D bounds)

      Returns the preferred size of the element (including insets).
      Parameters:
        `g2` - the graphics target.
        `bounds` - the bounds.
      Returns:
        The preferred size.

    - #### preferredSize

          public abstract java.awt.geom.Dimension2D preferredSize(java.awt.Graphics2D g2,
                                                                  java.awt.geom.Rectangle2D bounds,
                                                                  java.util.Map<java.lang.String,java.lang.Object> constraints)

      Returns the preferred size of the element (including insets).
      Parameters:
        `g2` - the graphics target.
        `bounds` - the bounds.
        `constraints` - the constraints (ignored for now).
      Returns:
        The preferred size.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this instance for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object (`null` permitted).
      Returns:
        A boolean.