com.jrefinery.report.targets.table
Class TableCellBackground

java.lang.Object
  extended bycom.jrefinery.report.targets.table.TableCellData
      extended bycom.jrefinery.report.targets.table.TableCellBackground
Direct Known Subclasses:
TableBandArea

public class TableCellBackground
extends TableCellData

Encapsulates all TableCellBackground informations, such as borders and background color.

The TableCellBackground contains the format information for the table cells. Background information is used to format the tablecells in the TableWriter. CellBackgrounds can be shared for multiple cells.

Author:
Thomas Morgner

Constructor Summary
TableCellBackground(java.awt.geom.Rectangle2D outerBounds, java.awt.Color color)
          Creates a table cell background with the given bounds, no borders and the specified color as background.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests this object for equality with another object.
 float getBorderSizeBottom()
          Returns the line width of the bottom border.
 float getBorderSizeLeft()
          Returns the line width of the left border.
 float getBorderSizeRight()
          Returns the line width of the right border.
 float getBorderSizeTop()
          Returns the line width of the top border.
 java.awt.Color getColor()
          Gets the background color for this cell, or null if this cell has no background.
 java.awt.Color getColorBottom()
          Returns the line color of the bottom border.
 java.awt.Color getColorLeft()
          Returns the line color of the left border.
 java.awt.Color getColorRight()
          Returns the line color of the right border.
 java.awt.Color getColorTop()
          Returns the line color of the top border.
 int hashCode()
          Returns a hash code for this object.
 boolean isBackground()
          Returns true, as this is a cell background definition.
 TableCellBackground merge(TableCellBackground background)
          Merges this background with the given background and returns the result.
 void setBorderBottom(java.awt.Color color, float size)
          Defines the bottom border.
 void setBorderLeft(java.awt.Color color, float size)
          Defines the left border.
 void setBorderRight(java.awt.Color color, float size)
          Defines the right border.
 void setBorderTop(java.awt.Color color, float size)
          Defines the top border.
 java.lang.String toString()
          Returns an String representation of this table cell background.
 
Methods inherited from class com.jrefinery.report.targets.table.TableCellData
getBounds
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableCellBackground

public TableCellBackground(java.awt.geom.Rectangle2D outerBounds,
                           java.awt.Color color)
Creates a table cell background with the given bounds, no borders and the specified color as background. If the color is null, no background is set.

Parameters:
outerBounds - the background cell size
color - the background color, null for no background.
Method Detail

isBackground

public boolean isBackground()
Returns true, as this is a cell background definition.

Specified by:
isBackground in class TableCellData
Returns:
always true, this is a data cell.
See Also:
TableCellData.isBackground()

getColor

public java.awt.Color getColor()
Gets the background color for this cell, or null if this cell has no background.

Returns:
the background color or null.

setBorderTop

public void setBorderTop(java.awt.Color color,
                         float size)
Defines the top border. If color is null or the size is 0, then no top border is drawn.

Parameters:
color - the color of the top border.
size - the line width of the top border.

setBorderLeft

public void setBorderLeft(java.awt.Color color,
                          float size)
Defines the left border. If color is null or the size is 0, then no left border is drawn.

Parameters:
color - the color of the left border.
size - the line width of the left border.

setBorderBottom

public void setBorderBottom(java.awt.Color color,
                            float size)
Defines the bottom border. If color is null or the size is 0, then no bottom border is drawn.

Parameters:
color - the color of the bottom border.
size - the line width of the bottom border.

setBorderRight

public void setBorderRight(java.awt.Color color,
                           float size)
Defines the right border. If color is null or the size is 0, then no right border is drawn.

Parameters:
color - the color of the right border.
size - the line width of the right border.

getBorderSizeTop

public float getBorderSizeTop()
Returns the line width of the top border.

Returns:
the line width of the top border.

getBorderSizeBottom

public float getBorderSizeBottom()
Returns the line width of the bottom border.

Returns:
the line width of the bottom border.

getBorderSizeLeft

public float getBorderSizeLeft()
Returns the line width of the left border.

Returns:
the line width of the left border.

getBorderSizeRight

public float getBorderSizeRight()
Returns the line width of the right border.

Returns:
the line width of the right border.

getColorTop

public java.awt.Color getColorTop()
Returns the line color of the top border.

Returns:
the color of the top border.

getColorLeft

public java.awt.Color getColorLeft()
Returns the line color of the left border.

Returns:
the color of the left border.

getColorBottom

public java.awt.Color getColorBottom()
Returns the line color of the bottom border.

Returns:
the color of the bottom border.

getColorRight

public java.awt.Color getColorRight()
Returns the line color of the right border.

Returns:
the color of the right border.

merge

public TableCellBackground merge(TableCellBackground background)
Merges this background with the given background and returns the result. The given background is considered to be overlayed by this background.

Parameters:
background - the other background cell
Returns:
a union of the background informations.

toString

public java.lang.String toString()
Returns an String representation of this table cell background.

Returns:
the string representation of this cell background.

equals

public boolean equals(java.lang.Object o)
Tests this object for equality with another object.

Parameters:
o - the other object.
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code for this object.

Returns:
A hash code.