|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.chart.Axis
com.jrefinery.chart.ValueAxis
com.jrefinery.chart.NumberAxis
com.jrefinery.chart.HorizontalNumberAxis
public class HorizontalNumberAxis
A horizontal axis that displays numerical values.
XYPlot| Field Summary | |
|---|---|
protected boolean |
verticalTickLabels
A flag indicating whether or not tick labels are drawn vertically. |
| Fields inherited from class com.jrefinery.chart.NumberAxis |
|---|
autoRangeIncludesZero, autoRangeMinimumSize, autoRangeStickyZero, DEFAULT_AUTO_RANGE_INCLUDES_ZERO, DEFAULT_AUTO_RANGE_STICKY_ZERO, DEFAULT_LOWER_MARGIN, DEFAULT_MINIMUM_AUTO_RANGE, DEFAULT_TICK_UNIT, DEFAULT_UPPER_MARGIN, inverted, lowerMargin, standardTickUnits, tickUnit, upperMargin |
| Fields inherited from class com.jrefinery.chart.Axis |
|---|
fixedDimension, label, labelFont, labelInsets, labelPaint, listeners, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkStroke, tickMarksVisible, ticks, visible |
| Fields inherited from interface com.jrefinery.chart.AxisConstants |
|---|
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_STROKE |
| Constructor Summary | |
|---|---|
HorizontalNumberAxis(java.lang.String label)
Constructs a horizontal number axis, using default values where necessary. |
|
HorizontalNumberAxis(java.lang.String label,
java.awt.Font labelFont,
double minimumAxisValue,
double maximumAxisValue)
Constructs a horizontal number axis. |
|
HorizontalNumberAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean tickLabelsVisible,
java.awt.Font tickLabelFont,
java.awt.Paint tickLabelPaint,
java.awt.Insets tickLabelInsets,
boolean verticalTickLabels,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke,
boolean autoRange,
boolean autoRangeIncludesZero,
boolean autoRangeStickyZero,
java.lang.Number autoRangeMinimumSize,
double minimumAxisValue,
double maximumAxisValue,
boolean inverted,
boolean autoTickUnitSelection,
NumberTickUnit tickUnit,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
boolean crosshairVisible,
double crosshairValue,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
Constructs a horizontal number axis. |
|
| Method Summary | |
|---|---|
protected void |
autoAdjustRange()
Rescales the axis to ensure that all data is visible. |
void |
configure()
Configures the axis to work with the specified plot. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
boolean |
getVerticalTickLabels()
Returns a flag indicating whether the tick labels are drawn 'vertically'. |
protected boolean |
isCompatiblePlot(Plot plot)
Returns true if a plot is compatible with the axis, and false otherwise. |
void |
refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Calculates the positions of the tick labels for the axis, storing the results in the tick label list (ready for drawing). |
java.awt.geom.Rectangle2D |
reserveAxisArea(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
double reservedWidth)
Returns area in which the axis will be displayed. |
double |
reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea)
Returns the height required to draw the axis in the specified draw area. |
void |
setVerticalTickLabels(boolean flag)
Sets the flag that determines whether the tick labels are drawn 'vertically'. |
double |
translateJava2DtoValue(float java2DValue,
java.awt.geom.Rectangle2D dataArea)
Converts a coordinate in Java2D space to the corresponding data value, assuming that the axis runs along one edge of the specified dataArea. |
double |
translateValueToJava2D(double value,
java.awt.geom.Rectangle2D dataArea)
Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified dataArea. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean verticalTickLabels
| Constructor Detail |
|---|
public HorizontalNumberAxis(java.lang.String label)
label - The axis label.
public HorizontalNumberAxis(java.lang.String label,
java.awt.Font labelFont,
double minimumAxisValue,
double maximumAxisValue)
label - The axis label.labelFont - The font for displaying the axis label.minimumAxisValue - The lowest value shown on the axis.maximumAxisValue - The highest value shown on the axis.
public HorizontalNumberAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean tickLabelsVisible,
java.awt.Font tickLabelFont,
java.awt.Paint tickLabelPaint,
java.awt.Insets tickLabelInsets,
boolean verticalTickLabels,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke,
boolean autoRange,
boolean autoRangeIncludesZero,
boolean autoRangeStickyZero,
java.lang.Number autoRangeMinimumSize,
double minimumAxisValue,
double maximumAxisValue,
boolean inverted,
boolean autoTickUnitSelection,
NumberTickUnit tickUnit,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
boolean crosshairVisible,
double crosshairValue,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
label - The axis label.labelFont - The font for displaying the axis label.labelPaint - The color used to draw the axis label.labelInsets - The blank space around the axis label.tickLabelsVisible - Flag indicating whether or not the tick labels are visible.tickLabelFont - Font for displaying the tick labels.tickLabelPaint - The color used to display the tick labels.tickLabelInsets - The blank space around the tick labels.verticalTickLabels - A flag indicating whether or not tick labels are drawn vertically.tickMarksVisible - Flag indicating whether or not tick marks are visible.tickMarkStroke - The stroke used to draw tick marks (if visible).autoRange - Flag indicating whether or not the axis range is automatically determined to
fit the data.autoRangeIncludesZero - A flag indicating whether or not the axis range *must* include
zero.autoRangeMinimum - The smallest axis range permitted (avoids problems with a 'zero'
range).minimumAxisValue - The lowest value shown on the axis.maximumAxisValue - The highest value shown on the axis.inverted - A flag indicating whether the axis is normal or inverted (inverted means
running from positive to negative).autoTickUnit - A flag indicating whether or not the tick value is automatically
selected from the range of standard tick units.tickUnit - The tick unit.gridLinesVisible - Flag indicating whether or not grid lines are visible for this axis;gridStroke - The Stroke used to display grid lines (if visible);gridPaint - The Paint used to display grid lines (if visible).crosshairValue - The value at which to draw an optional crosshair (null permitted).crosshairStroke - The pen/brush used to draw the crosshair.crosshairPaint - The color used to draw the crosshair.| Method Detail |
|---|
public boolean getVerticalTickLabels()
public void setVerticalTickLabels(boolean flag)
flag - The new value of the flag.public void configure()
configure in class Axis
public double translateValueToJava2D(double value,
java.awt.geom.Rectangle2D dataArea)
Note that it is possible for the coordinate to fall outside the plotArea.
translateValueToJava2D in class ValueAxisdataValue - The data value.dataArea - The area for plotting the data.
public double translateJava2DtoValue(float java2DValue,
java.awt.geom.Rectangle2D dataArea)
translateJava2DtoValue in class ValueAxisjava2DValue - The coordinate in Java2D space.dataArea - The area in which the data is plotted.
protected void autoAdjustRange()
autoAdjustRange in class ValueAxis
public void refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
refreshTicks in class Axisg2 - The graphics device.drawArea - The area in which the plot and the axes should be drawn.plotArea - The area in which the plot should be drawn.
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
draw in class Axisg2 - The graphics device.drawArea - The area within which the chart should be drawn.plotArea - The area within which the plot should be drawn (a subset of the drawArea).
public double reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea)
reserveHeight in interface HorizontalAxisg2 - The graphics device.plot - The plot that the axis belongs to.drawArea - The area within which the plot should be drawn.
public java.awt.geom.Rectangle2D reserveAxisArea(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
double reservedWidth)
reserveAxisArea in interface HorizontalAxisg2 - The graphics device.plot - A reference to the plot.drawArea - The area within which the plot and axes should be drawn.reservedWidth - The space already reserved for the vertical axis.protected boolean isCompatiblePlot(Plot plot)
For this axis, the requirement is that the plot implements the HorizontalValuePlot interface.
isCompatiblePlot in class Axisplot - The plot.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||