Module org.jfree.chart3d
Package org.jfree.chart3d.table

# Class AbstractTableElement

java.lang.Object
org.jfree.chart3d.table.AbstractTableElement

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `ColorScaleElement`, `FlowElement`, `GridElement`, `ShapeElement`, `TextElement`, `VerticalFlowElement`

public abstract class AbstractTableElement extends Object implements 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
Description
`AbstractTableElement()`
Creates a new instance.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this instance for equality with an arbitrary object.
`RectanglePainter`
`getBackground()`
Returns the background painter for the element.
`Insets`
`getInsets()`
Returns the insets.
`Object`
`getProperty(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.
`String`
`getTag()`
Returns the tag for this element.
`Dimension2D`
`preferredSize(Graphics2D g2, Rectangle2D bounds)`
Returns the preferred size of the element (including insets).
`abstract Dimension2D`
`preferredSize(Graphics2D g2, Rectangle2D bounds, Map<String,Object> constraints)`
Returns the preferred size of the element (including insets).
`void`
`setBackground(RectanglePainter background)`
Sets the background for the element.
`void`
`setBackgroundColor(Color color)`
Sets the background painter to fill the element with the specified color.
`void`
`setInsets(Insets insets)`
Sets the insets.
`void`
`setProperty(String key, Object value)`
Sets the value of the property with the specified key.
`void`
`setRefPoint(RefPt2D refPt)`
Sets the reference point.
`void`
`setTag(String tag)`
Sets the tag.

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

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

## Constructor Details

### AbstractTableElement

public AbstractTableElement()
Creates a new instance.

## Method Details

### 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 Insets getInsets()
Returns the insets. The default value is `Insets(2, 2, 2, 2)`.

Returns:
  The insets (never `null`).

### setInsets

public void setInsets(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(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 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(String tag)
Sets the tag.

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

### getProperty

public Object getProperty(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(String key, 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 Dimension2D preferredSize(Graphics2D g2, 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 Dimension2D preferredSize(Graphics2D g2, Rectangle2D bounds, Map<String,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(Object obj)
Tests this instance for equality with an arbitrary object.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object (`null` permitted).
Returns:
  A boolean.