public class ColorScaleElement extends AbstractTableElement implements TableElement
TableElement that displays a ColorScale.
CLASS| Constructor and Description |
|---|
ColorScaleElement(ColorScale scale,
Orientation orientation,
double barWidth,
double barLength,
java.awt.Font font,
java.awt.Color textColor)
Creates a new
ColorScaleElement with the specified
attributes. |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds)
Draws the element within the specified bounds.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
TableElementOnDraw onDrawHandler)
Draws the element within the specified bounds.
|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
double |
getBarLength()
Returns the bar length.
|
double |
getBarWidth()
Returns the bar width.
|
ColorScale |
getColorScale()
Returns the color scale.
|
java.awt.Font |
getFont()
Returns the font used to display the labels on the color scale.
|
Orientation |
getOrientation()
Returns the orientation.
|
java.awt.Color |
getTextColor()
Returns the text color.
|
java.util.List<java.awt.geom.Rectangle2D> |
layoutElements(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
java.util.Map<java.lang.String,java.lang.Object> constraints)
Performs a layout of this table element, returning a list of bounding
rectangles for the element and its subelements.
|
java.awt.geom.Dimension2D |
preferredSize(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds)
Returns the preferred size for this element.
|
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 for this element.
|
void |
receive(TableElementVisitor visitor)
Receives a visitor.
|
getBackground, getInsets, getProperty, getRefPoint, getTag, setBackground, setBackgroundColor, setInsets, setProperty, setRefPoint, setTagclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProperty, getRefPoint, setPropertypublic ColorScaleElement(ColorScale scale, Orientation orientation, double barWidth, double barLength, java.awt.Font font, java.awt.Color textColor)
ColorScaleElement with the specified
attributes.scale - the color scale (null not permitted).orientation - the orientation (null not permitted).barWidth - the bar width (in Java2D units).barLength - the bar length (in Java2D units).font - the font (null not permitted).textColor - the text color (null not permitted).public ColorScale getColorScale()
null).public Orientation getOrientation()
null).public double getBarWidth()
public double getBarLength()
public java.awt.Font getFont()
null).public java.awt.Color getTextColor()
null).public void receive(TableElementVisitor visitor)
receive in interface TableElementvisitor - the visitor (null not permitted).public java.awt.geom.Dimension2D preferredSize(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)
preferredSize in interface TableElementpreferredSize in class AbstractTableElementg2 - the graphics target.bounds - the available drawing space.null).public java.awt.geom.Dimension2D preferredSize(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)
preferredSize in interface TableElementpreferredSize in class AbstractTableElementg2 - the graphics target.bounds - the available drawing space.constraints - layout constraints (ignored here).null).public java.util.List<java.awt.geom.Rectangle2D> layoutElements(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)
TableElementTableElement.draw(java.awt.Graphics2D,
java.awt.geom.Rectangle2D) method.layoutElements in interface TableElementg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).constraints - the constraints (if any).public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)
draw in interface TableElementg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, TableElementOnDraw onDrawHandler)
draw in interface TableElementg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).onDrawHandler - receives notification before and after the element
is drawn (null permitted);public boolean equals(java.lang.Object obj)
AbstractTableElementequals in class AbstractTableElementobj - the object (null permitted).