|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.chart.axis.Axis | +--org.jfree.chart.axis.ValueAxis | +--org.jfree.chart.axis.NumberAxis | +--org.jfree.chart.axis.HorizontalNumberAxis | +--org.jfree.chart.axis.HorizontalColorBarAxis
A horizontal ColorBar. This class extends the HorizontalNumberAxis to provide a) tickmarks, b) ticklabels, c) axis label, d) mapping between java2D and plot units.
Field Summary | |
static int |
DEFAULT_COLORBAR_THICKNESS
The default color bar thickness. |
static double |
DEFAULT_COLORBAR_THICKNESS_PCT
The default color bar thickness percentage. |
static int |
DEFAULT_OUTERGAP
The default outer gap. |
Fields inherited from class org.jfree.chart.axis.HorizontalNumberAxis |
DEFAULT_VERTICAL_TICK_LABELS |
Fields inherited from class org.jfree.chart.axis.NumberAxis |
DEFAULT_AUTO_RANGE_INCLUDES_ZERO, DEFAULT_AUTO_RANGE_STICKY_ZERO, DEFAULT_TICK_UNIT |
Fields inherited from class org.jfree.chart.axis.ValueAxis |
DEFAULT_AUTO_RANGE, DEFAULT_AUTO_RANGE_MINIMUM_SIZE, DEFAULT_AUTO_TICK_UNIT_SELECTION, DEFAULT_INVERTED, DEFAULT_LOWER_BOUND, DEFAULT_LOWER_MARGIN, DEFAULT_RANGE, DEFAULT_UPPER_BOUND, DEFAULT_UPPER_MARGIN, MAXIMUM_TICK_COUNT |
Constructor Summary | |
HorizontalColorBarAxis(java.lang.String label)
Constructs a horizontal colorbar axis, using default values where necessary. |
Method Summary | |
protected void |
autoAdjustRange()
Rescales the axis to ensure that all data are visible. |
void |
doAutoRange()
This is cheat to make autoAdjustRange public. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D dataArea,
int location)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
void |
drawColorBar(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D colorBarArea)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
ColorPalette |
getColorPalette()
Returns the color palette. |
java.awt.Paint |
getPaint(double value)
Returns the Paint associated with a value. |
protected boolean |
isCompatiblePlot(Plot plot)
Returns true if a plot is compatible with the axis, and false otherwise. |
double |
reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
int location)
Returns the height required to draw the axis in the specified draw area. |
double |
reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
int location,
double reservedWidth,
int verticalAxisLocation)
Returns area in which the axis will be displayed. |
void |
setColorPalette(ColorPalette palette)
Sets the color palette. |
void |
setMaximumAxisValue(double value)
Sets the maximum axis value. |
void |
setMinimumAxisValue(double value)
Sets the minimum axis value. |
Methods inherited from class org.jfree.chart.axis.HorizontalNumberAxis |
configure, getMarkerBand, isVerticalTickLabels, refreshTicks, selectAutoTickUnit, setMarkerBand, setVerticalTickLabels, translateJava2DtoValue, translateValueToJava2D |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_COLORBAR_THICKNESS
public static final double DEFAULT_COLORBAR_THICKNESS_PCT
public static final int DEFAULT_OUTERGAP
Constructor Detail |
public HorizontalColorBarAxis(java.lang.String label)
label
- the axis label.Method Detail |
protected void autoAdjustRange()
autoAdjustRange
in class HorizontalNumberAxis
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea, java.awt.geom.Rectangle2D dataArea, int location)
draw
in class HorizontalNumberAxis
g2
- the graphics device.drawArea
- the area within which the chart should be drawn.dataArea
- the area within which the plot should be drawn (a
subset of the drawArea).location
- the axis location.public void drawColorBar(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D colorBarArea)
g2
- the graphics device.colorBarArea
- the area within which the axis should be drawn.public ColorPalette getColorPalette()
getColorPalette
in interface ColorBarAxis
public java.awt.Paint getPaint(double value)
getPaint
in interface ColorBarAxis
value
- the value.
protected boolean isCompatiblePlot(Plot plot)
The requirement is that the plot implements the ContourValuePlot interface.
isCompatiblePlot
in class HorizontalNumberAxis
plot
- the plot.
public void setColorPalette(ColorPalette palette)
setColorPalette
in interface ColorBarAxis
palette
- the new palette.public void setMaximumAxisValue(double value)
setMaximumAxisValue
in class ValueAxis
value
- the maximum value.public void setMinimumAxisValue(double value)
setMinimumAxisValue
in class ValueAxis
value
- the minimum value.public double reserveHeight(java.awt.Graphics2D g2, Plot plot, java.awt.geom.Rectangle2D drawArea, int location)
reserveHeight
in interface HorizontalAxis
reserveHeight
in class HorizontalNumberAxis
g2
- the graphics device.plot
- the plot that the axis belongs to.drawArea
- the area within which the plot should be drawn.location
- the axis location (top or bottom).
public double reserveHeight(java.awt.Graphics2D g2, Plot plot, java.awt.geom.Rectangle2D drawArea, int location, double reservedWidth, int verticalAxisLocation)
reserveHeight
in interface HorizontalAxis
reserveHeight
in class HorizontalNumberAxis
g2
- the graphics device.plot
- a reference to the plot.drawArea
- the area within which the plot and axes should be drawn.location
- the axis location.reservedWidth
- the space already reserved for the vertical axis.verticalAxisLocation
- the vertical axis location.
public void doAutoRange()
doAutoRange
in interface ColorBarAxis
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |