org.jfree.chart.axis
Class HorizontalLogarithmicColorBarAxis

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.HorizontalLogarithmicAxis
                                |
                                +--org.jfree.chart.axis.HorizontalLogarithmicColorBarAxis
All Implemented Interfaces:
AxisConstants, ColorBarAxis, HorizontalAxis, java.io.Serializable

public class HorizontalLogarithmicColorBarAxis
extends HorizontalLogarithmicAxis
implements ColorBarAxis, java.io.Serializable

A horizontal logarithmic ColorBar. This class extends the HorizontalLogarithmicAxis to provide a) tickmarks, b) ticklabels, c) axis label, d) mapping between java2D and plot units.

Author:
David M. O'Donnell
See Also:
Serialized Form

Field Summary
static int DEFAULT_COLORBAR_THICKNESS
          The default color bar thickness.
static double DEFAULT_COLORBAR_THICKNESS_PCT
          The default color bar thickness as a percentage.
static int DEFAULT_OUTERGAP
          The default outer gap.
 
Fields inherited from class org.jfree.chart.axis.HorizontalLogarithmicAxis
LOG10_VALUE, SMALL_LOG_VALUE
 
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
 
Fields inherited from interface org.jfree.chart.axis.AxisConstants
BOTTOM, DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_VISIBLE, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_LABELS_VISIBLE, DEFAULT_TICK_MARK_INSIDE_LENGTH, DEFAULT_TICK_MARK_OUTSIDE_LENGTH, DEFAULT_TICK_MARK_PAINT, DEFAULT_TICK_MARK_STROKE, DEFAULT_TICK_MARKS_VISIBLE, LEFT, RIGHT, TOP
 
Constructor Summary
HorizontalLogarithmicColorBarAxis(java.lang.String label)
          Constructor for HorizontalLogarithmicColorBarAxis.
 
Method Summary
 void autoAdjustRange()
          Rescales the axis to ensure that all data is 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 current ColorPalette.
 java.awt.Paint getPaint(double value)
          Returns the Paint associated with the 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 current ColorPalette.
 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.HorizontalLogarithmicAxis
adjustedLog10, computeLogCeil, computeLogFloor, getAllowNegativesFlag, refreshTicks, setAllowNegativesFlag, setRange, setupSmallLogFlag, switchedLog10, translateJava2DtoValue, translateValueToJava2D
 
Methods inherited from class org.jfree.chart.axis.HorizontalNumberAxis
configure, getMarkerBand, isVerticalTickLabels, selectAutoTickUnit, setMarkerBand, setVerticalTickLabels
 
Methods inherited from class org.jfree.chart.axis.NumberAxis
autoRangeIncludesZero, autoRangeStickyZero, calculateHighestVisibleTickValue, calculateLowestVisibleTickValue, calculateVisibleTickCount, createIntegerTickUnits, createIntegerTickUnits, createStandardTickUnits, createStandardTickUnits, getNumberFormatOverride, getTickUnit, setAutoRangeIncludesZero, setAutoRangeStickyZero, setNumberFormatOverride, setTickUnit, setTickUnit
 
Methods inherited from class org.jfree.chart.axis.ValueAxis
centerRange, getAnchorValue, getAutoRangeMinimumSize, getAutoTickIndex, getFixedAutoRange, getLowerMargin, getMaximumAxisValue, getMinimumAxisValue, getRange, getStandardTickUnits, getUpperMargin, isAutoRange, isAutoTickUnitSelection, isInverted, resizeRange, resizeRange, setAnchoredRange, setAnchorValue, setAnchorValueAttribute, setAutoRange, setAutoRange, setAutoRangeMinimumSize, setAutoRangeMinimumSize, setAutoTickIndex, setAutoTickUnitSelection, setAutoTickUnitSelection, setFixedAutoRange, setInverted, setLowerMargin, setRange, setRangeAboutValue, setRangeAttribute, setStandardTickUnits, setUpperMargin
 
Methods inherited from class org.jfree.chart.axis.Axis
addChangeListener, drawHorizontalLabel, drawVerticalLabel, equals, getFixedDimension, getLabel, getLabelFont, getLabelInsets, getLabelPaint, getMaxTickLabelWidth, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkInsideLength, getTickMarkOutsideLength, getTickMarkPaint, getTickMarkStroke, getTicks, isTickLabelsVisible, isTickMarksVisible, isVisible, notifyListeners, removeChangeListener, setFixedDimension, setLabel, setLabelFont, setLabelInsets, setLabelPaint, setPlot, setTickLabelFont, setTickLabelInsets, setTickLabelPaint, setTickLabelsVisible, setTickMarkInsideLength, setTickMarkOutsideLength, setTickMarkPaint, setTickMarkStroke, setTickMarksVisible, setVisible
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLORBAR_THICKNESS

public static final int DEFAULT_COLORBAR_THICKNESS
The default color bar thickness.

See Also:
Constant Field Values

DEFAULT_COLORBAR_THICKNESS_PCT

public static final double DEFAULT_COLORBAR_THICKNESS_PCT
The default color bar thickness as a percentage.

See Also:
Constant Field Values

DEFAULT_OUTERGAP

public static final int DEFAULT_OUTERGAP
The default outer gap.

See Also:
Constant Field Values
Constructor Detail

HorizontalLogarithmicColorBarAxis

public HorizontalLogarithmicColorBarAxis(java.lang.String label)
Constructor for HorizontalLogarithmicColorBarAxis.

Parameters:
label - the axis label.
Method Detail

draw

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).

Overrides:
draw in class HorizontalNumberAxis
Parameters:
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 location of the axis.

drawColorBar

public 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).

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

getColorPalette

public ColorPalette getColorPalette()
Returns the current ColorPalette.

Specified by:
getColorPalette in interface ColorBarAxis
Returns:
the palette.

getPaint

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

Specified by:
getPaint in interface ColorBarAxis
Parameters:
value - the value.
Returns:
the paint.

isCompatiblePlot

protected boolean isCompatiblePlot(Plot plot)
Returns true if a plot is compatible with the axis, and false otherwise.

For this axis, the requirement is that the plot implements the ContourValuePlot interface.

Overrides:
isCompatiblePlot in class HorizontalNumberAxis
Parameters:
plot - the plot.
Returns:
boolean.

setColorPalette

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

Specified by:
setColorPalette in interface ColorBarAxis
Parameters:
palette - the palette.

setMaximumAxisValue

public void setMaximumAxisValue(double value)
Sets the maximum axis value.

Overrides:
setMaximumAxisValue in class ValueAxis
Parameters:
value - the value.

setMinimumAxisValue

public void setMinimumAxisValue(double value)
Sets the minimum axis value.

Overrides:
setMinimumAxisValue in class ValueAxis
Parameters:
value - the value.

autoAdjustRange

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

Overrides:
autoAdjustRange in class HorizontalLogarithmicAxis

reserveHeight

public 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.

Specified by:
reserveHeight in interface HorizontalAxis
Overrides:
reserveHeight in class HorizontalNumberAxis
Parameters:
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).
Returns:
the height required to draw the axis in the specified draw area.

reserveHeight

public 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.

Specified by:
reserveHeight in interface HorizontalAxis
Overrides:
reserveHeight in class HorizontalNumberAxis
Parameters:
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.
Returns:
area in which the axis will be displayed.

doAutoRange

public void doAutoRange()
This is cheat to make autoAdjustRange public.

Specified by:
doAutoRange in interface ColorBarAxis