java.lang.Object
org.jfree.chart3d.table.AbstractTableElement
org.jfree.chart3d.legend.ColorScaleElement
- All Implemented Interfaces:
Serializable
,TableElement
A
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.
TableElement
that displays a ColorScale
.
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.
- Since:
- 1.1
- See Also:
-
Field Summary
Fields inherited from interface org.jfree.chart3d.table.TableElement
CLASS
-
Constructor Summary
ConstructorsConstructorDescriptionColorScaleElement
(ColorScale scale, Orientation orientation, double barWidth, double barLength, Font font, Color textColor) Creates a newColorScaleElement
with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Graphics2D g2, Rectangle2D bounds) Draws the element within the specified bounds.void
draw
(Graphics2D g2, Rectangle2D bounds, TableElementOnDraw onDrawHandler) Draws the element within the specified bounds.boolean
Tests this instance for equality with an arbitrary object.double
Returns the bar length.double
Returns the bar width.Returns the color scale.getFont()
Returns the font used to display the labels on the color scale.Returns the orientation.Returns the text color.layoutElements
(Graphics2D g2, Rectangle2D bounds, Map<String, Object> constraints) Performs a layout of this table element, returning a list of bounding rectangles for the element and its subelements.preferredSize
(Graphics2D g2, Rectangle2D bounds) Returns the preferred size for this element.preferredSize
(Graphics2D g2, Rectangle2D bounds, Map<String, Object> constraints) Returns the preferred size for this element.void
receive
(TableElementVisitor visitor) Receives a visitor.Methods inherited from class org.jfree.chart3d.table.AbstractTableElement
getBackground, getInsets, getProperty, getRefPoint, getTag, setBackground, setBackgroundColor, setInsets, setProperty, setRefPoint, setTag
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.chart3d.table.TableElement
getProperty, getRefPoint, setProperty
-
Constructor Details
-
ColorScaleElement
public ColorScaleElement(ColorScale scale, Orientation orientation, double barWidth, double barLength, Font font, Color textColor) Creates a newColorScaleElement
with the specified attributes.- Parameters:
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).- Since:
- 1.2
-
-
Method Details
-
getColorScale
Returns the color scale.- Returns:
- The color scale (never
null
).
-
getOrientation
Returns the orientation.- Returns:
- The orientation (never
null
).
-
getBarWidth
Returns the bar width.- Returns:
- The bar width.
-
getBarLength
Returns the bar length.- Returns:
- The bar length.
-
getFont
Returns the font used to display the labels on the color scale.- Returns:
- The font (never
null
).
-
getTextColor
Returns the text color.- Returns:
- The text color (never
null
).
-
receive
Receives a visitor. This is part of a general mechanism to perform operations on an arbitrary hierarchy of table elements. You will not normally call this method directly.- Specified by:
receive
in interfaceTableElement
- Parameters:
visitor
- the visitor (null
not permitted).- Since:
- 1.2
-
preferredSize
Returns the preferred size for this element.- Specified by:
preferredSize
in interfaceTableElement
- Overrides:
preferredSize
in classAbstractTableElement
- Parameters:
g2
- the graphics target.bounds
- the available drawing space.- Returns:
- The preferred size (never
null
).
-
preferredSize
Returns the preferred size for this element.- Specified by:
preferredSize
in interfaceTableElement
- Specified by:
preferredSize
in classAbstractTableElement
- Parameters:
g2
- the graphics target.bounds
- the available drawing space.constraints
- layout constraints (ignored here).- Returns:
- The preferred size (never
null
).
-
layoutElements
public List<Rectangle2D> layoutElements(Graphics2D g2, Rectangle2D bounds, Map<String, Object> constraints) Description copied from interface:TableElement
Performs a layout of this table element, returning a list of bounding rectangles for the element and its subelements. This method is typically called by theTableElement.draw(java.awt.Graphics2D, java.awt.geom.Rectangle2D)
method.- Specified by:
layoutElements
in interfaceTableElement
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).constraints
- the constraints (if any).- Returns:
- A list of bounding rectangles.
-
draw
Draws the element within the specified bounds.- Specified by:
draw
in interfaceTableElement
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).
-
draw
Draws the element within the specified bounds.- Specified by:
draw
in interfaceTableElement
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).onDrawHandler
- receives notification before and after the element is drawn (null
permitted);- Since:
- 1.3
-
equals
Description copied from class:AbstractTableElement
Tests this instance for equality with an arbitrary object.- Overrides:
equals
in classAbstractTableElement
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-