org.jfree.chart.axis

Class ColorBar

public class ColorBar extends Object implements Cloneable, Serializable

Deprecated: This class is no longer supported. If you are creating contour plots, please try to use XYPlot and XYBlockRenderer.

A color bar.
Field Summary
static intDEFAULT_COLORBAR_THICKNESS
The default color bar thickness.
static doubleDEFAULT_COLORBAR_THICKNESS_PERCENT
The default color bar thickness percentage.
static intDEFAULT_OUTERGAP
The default outer gap.
Constructor Summary
ColorBar(String label)
Constructs a horizontal colorbar axis, using default values where necessary.
Method Summary
voidautoAdjustRange()
Rescales the axis to ensure that all data are visible.
Objectclone()
Returns a clone of the object.
voidconfigure(ContourPlot plot)
Configures the color bar.
doubledraw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, Rectangle2D reservedArea, RectangleEdge edge)
Draws the plot on a Java 2D graphics device (such as the screen or a printer).
voiddrawColorBar(Graphics2D g2, Rectangle2D colorBarArea, RectangleEdge edge)
Draws the plot on a Java 2D graphics device (such as the screen or a printer).
booleanequals(Object obj)
Tests this object for equality with another.
ValueAxisgetAxis()
Returns the axis.
ColorPalettegetColorPalette()
Returns the color palette.
PaintgetPaint(double value)
Returns the Paint associated with a value.
inthashCode()
Returns a hash code for this object.
AxisSpacereserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, AxisSpace space)
Reserves the space required to draw the color bar.
voidsetAxis(ValueAxis axis)
Sets the axis.
voidsetColorPalette(ColorPalette palette)
Sets the color palette.
voidsetMaximumValue(double value)
Sets the maximum value.
voidsetMinimumValue(double value)
Sets the minimum value.

Field Detail

DEFAULT_COLORBAR_THICKNESS

public static final int DEFAULT_COLORBAR_THICKNESS
The default color bar thickness.

DEFAULT_COLORBAR_THICKNESS_PERCENT

public static final double DEFAULT_COLORBAR_THICKNESS_PERCENT
The default color bar thickness percentage.

DEFAULT_OUTERGAP

public static final int DEFAULT_OUTERGAP
The default outer gap.

Constructor Detail

ColorBar

public ColorBar(String label)
Constructs a horizontal colorbar axis, using default values where necessary.

Parameters: label the axis label.

Method Detail

autoAdjustRange

public void autoAdjustRange()
Rescales the axis to ensure that all data are visible.

clone

public Object clone()
Returns a clone of the object.

Returns: A clone.

Throws: CloneNotSupportedException if some component of the color bar does not support cloning.

configure

public void configure(ContourPlot plot)
Configures the color bar.

Parameters: plot the plot.

draw

public double draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, Rectangle2D reservedArea, RectangleEdge edge)
Draws the plot on a Java 2D graphics device (such as the screen or a printer).

Parameters: g2 the graphics device. cursor the cursor. plotArea the area within which the chart should be drawn. dataArea the area within which the plot should be drawn (a subset of the drawArea). reservedArea the reserved area. edge the color bar location.

Returns: The new cursor location.

drawColorBar

public void drawColorBar(Graphics2D g2, Rectangle2D colorBarArea, RectangleEdge edge)
Draws the plot on a Java 2D graphics device (such as the screen or a printer).

Parameters: g2 the graphics device. colorBarArea the area within which the axis should be drawn. edge the location.

equals

public boolean equals(Object obj)
Tests this object for equality with another.

Parameters: obj the object to test against.

Returns: A boolean.

getAxis

public ValueAxis getAxis()
Returns the axis.

Returns: The axis.

getColorPalette

public ColorPalette getColorPalette()
Returns the color palette.

Returns: The color palette.

getPaint

public Paint getPaint(double value)
Returns the Paint associated with a value.

Parameters: value the value.

Returns: The paint.

hashCode

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

Returns: A hash code.

reserveSpace

public AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, AxisSpace space)
Reserves the space required to draw the color bar.

Parameters: g2 the graphics device. plot the plot that the axis belongs to. plotArea the area within which the plot should be drawn. dataArea the data area. edge the axis location. space the space already reserved.

Returns: The space required to draw the axis in the specified plot area.

setAxis

public void setAxis(ValueAxis axis)
Sets the axis.

Parameters: axis the axis.

setColorPalette

public void setColorPalette(ColorPalette palette)
Sets the color palette.

Parameters: palette the new palette.

setMaximumValue

public void setMaximumValue(double value)
Sets the maximum value.

Parameters: value the maximum value.

setMinimumValue

public void setMinimumValue(double value)
Sets the minimum value.

Parameters: value the minimum value.