|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Axis | +--com.jrefinery.chart.ValueAxis
The base class for axes that display value data (a "value" can be a Number or a Date).
Field Summary | |
static boolean |
DEFAULT_AUTO_RANGE
The default auto-range value. |
static java.lang.Number |
DEFAULT_AUTO_RANGE_MINIMUM_SIZE
The default minimum auto range. |
static java.awt.Paint |
DEFAULT_CROSSHAIR_PAINT
The default crosshair paint. |
static java.awt.Stroke |
DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke. |
static boolean |
DEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility. |
static java.awt.Paint |
DEFAULT_GRID_LINE_PAINT
The default grid line paint. |
static java.awt.Stroke |
DEFAULT_GRID_LINE_STROKE
The default grid line stroke. |
static double |
DEFAULT_LOWER_BOUND
The default lower bound for the axis. |
static double |
DEFAULT_LOWER_MARGIN
The default value for the lower margin (0.05 = 5%). |
static Range |
DEFAULT_RANGE
The default axis range. |
static double |
DEFAULT_UPPER_BOUND
The default upper bound for the axis. |
static double |
DEFAULT_UPPER_MARGIN
The default value for the upper margin (0.05 = 5%). |
static int |
MAXIMUM_TICK_COUNT
The maximum tick count. |
Fields inherited from class com.jrefinery.chart.Axis |
fixedDimension, label, labelFont, labelInsets, labelPaint, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkPaint, 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_PAINT, DEFAULT_TICK_STROKE |
Constructor Summary | |
protected |
ValueAxis(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 tickMarksVisible,
java.awt.Stroke tickMarkStroke,
java.awt.Paint tickMarkPaint,
Range range,
boolean autoRange,
java.lang.Number autoRangeMinimumSize,
boolean autoTickUnitSelection,
TickUnits standardTickUnits,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
double anchorValue,
boolean crosshairVisible,
double crosshairValue,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint)
Constructs a value axis. |
Method Summary | |
protected abstract void |
autoAdjustRange()
Automatically determines the maximum and minimum values on the axis to 'fit' the data. |
void |
centerRange(double value)
Centers the axis range about the specified value. |
double |
getAnchorValue()
Returns the anchor value for this axis. |
java.lang.Number |
getAutoRangeMinimumSize()
Returns the minimum size of the automatic axis range (if indeed it is determined automatically). |
protected int |
getAutoTickIndex()
Returns the auto tick index. |
java.awt.Paint |
getCrosshairPaint()
Returns the crosshair color. |
java.awt.Stroke |
getCrosshairStroke()
Returns the Stroke used to draw the crosshair (if visible). |
double |
getCrosshairValue()
Returns the crosshair value. |
double |
getFixedAutoRange()
Returns the fixed auto range. |
java.awt.Paint |
getGridPaint()
Returns the grid line color. |
java.awt.Stroke |
getGridStroke()
Returns the Stroke used to draw the grid lines (if visible). |
double |
getLowerMargin()
Returns the margin (a percentage of the current range) by which the lower bound for the axis is less than the minimum data value. |
double |
getMaximumAxisValue()
Returns the maximum value for the axis. |
double |
getMinimumAxisValue()
Returns the minimum value for the axis. |
Range |
getRange()
Returns the range for the axis. |
TickUnits |
getStandardTickUnits()
Returns the standard tick units for the axis. |
double |
getUpperMargin()
Returns the margin (a percentage of the current range) by which the upper bound for the axis exceeds the maximum data value. |
boolean |
isAutoRange()
Returns true if the axis range is automatically adjusted to fit the data. |
boolean |
isAutoTickUnitSelection()
Returns a flag indicating whether or not the tick unit is automatically selected from a range of standard tick units. |
boolean |
isCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values. |
boolean |
isCrosshairVisible()
Returns a flag indicating whether or not a crosshair is visible for this axis. |
boolean |
isGridLinesVisible()
Returns true if the grid lines are showing, and false otherwise. |
void |
resizeRange(double percent)
Increases or decreases the axis range by the specified percentage, about the central value. |
void |
resizeRange(double percent,
double anchorValue)
Increases or decreases the axis range by the specified percentage, about the specified anchor value. |
void |
setAnchoredRange(double range)
Sets the axis range so the the anchor value is in the middle of the axis, and the overall range is equal to the value specified. |
void |
setAnchorValue(double value)
Sets the anchor value for this axis. |
protected void |
setAnchorValueAttribute(double value)
Sets the anchor value, with no other side effects. |
void |
setAutoRange(boolean auto)
Sets a flag that determines whether or not the axis range is automatically adjusted to fit the data, and notifies registered listeners that the axis has been modified. |
protected void |
setAutoRangeAttribute(boolean auto)
Sets the auto range attribute, with no other side effects. |
void |
setAutoRangeMinimumSize(java.lang.Number size)
Sets the minimum size of the automatic axis range. |
protected void |
setAutoRangeMinimumSizeAttribute(java.lang.Number size)
Sets the auto range minimum size, with no other side effects. |
protected void |
setAutoTickIndex(int index)
Sets the auto tick index. |
void |
setAutoTickUnitSelection(boolean flag)
Sets a flag indicating whether or not the tick unit is automatically selected from a range of standard tick units. |
protected void |
setAutoTickUnitSelectionAttribute(boolean flag)
Sets the auto tick unit selection flag without any side effects. |
void |
setCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the crosshair should "lock-on" to actual data values. |
void |
setCrosshairPaint(java.awt.Paint paint)
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
void |
setCrosshairStroke(java.awt.Stroke stroke)
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
void |
setCrosshairValue(double value)
Sets the crosshair value for the axis. |
void |
setCrosshairValue(double value,
boolean notify)
Sets the crosshair value for the axis. |
protected void |
setCrosshairValueAttribute(double value)
Sets the crosshair value, with no other side effects. |
void |
setCrosshairVisible(boolean flag)
Sets the flag indicating whether or not a crosshair is visible for this axis. |
void |
setFixedAutoRange(double length)
Sets the fixed auto range for the axis. |
void |
setGridLinesVisible(boolean flag)
Sets the visibility of the grid lines and notifies registered listeners that the axis has been modified. |
void |
setGridPaint(java.awt.Paint paint)
Sets the Paint used to color the grid lines (if visible) and notifies registered listeners that the axis has been modified. |
void |
setGridStroke(java.awt.Stroke stroke)
Sets the Stroke used to draw the grid lines (if visible) and notifies registered listeners that the axis has been modified. |
void |
setLowerMargin(double margin)
Sets the lower margin for the axis, as a percentage of the current range. |
void |
setMaximumAxisValue(double max)
Sets the maximum value for the axis. |
void |
setMinimumAxisValue(double min)
Sets the minimum value for the axis. |
void |
setRange(double lower,
double upper)
Sets the axis range. |
void |
setRange(Range range)
Sets the upper and lower bounds for the axis. |
void |
setRangeAboutValue(double value,
double length)
Sets the axis range, where the new range is 'size' in length, and centered on 'value'. |
protected void |
setRangeAttribute(Range range)
Sets the range attribute without any other side effects. |
void |
setStandardTickUnits(TickUnits collection)
Sets the collection of tick units for the axis, and notifies registered listeners that the axis has changed. |
void |
setUpperMargin(double margin)
Sets the upper margin for the axis, as a percentage of the current range. |
abstract 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. |
abstract double |
translateValueToJava2D(double dataValue,
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 |
public static final Range DEFAULT_RANGE
public static final boolean DEFAULT_AUTO_RANGE
public static final java.lang.Number DEFAULT_AUTO_RANGE_MINIMUM_SIZE
public static final double DEFAULT_LOWER_MARGIN
public static final double DEFAULT_UPPER_MARGIN
public static final double DEFAULT_LOWER_BOUND
public static final double DEFAULT_UPPER_BOUND
public static final int MAXIMUM_TICK_COUNT
public static final java.awt.Stroke DEFAULT_GRID_LINE_STROKE
public static final java.awt.Paint DEFAULT_GRID_LINE_PAINT
public static final boolean DEFAULT_CROSSHAIR_VISIBLE
public static final java.awt.Stroke DEFAULT_CROSSHAIR_STROKE
public static final java.awt.Paint DEFAULT_CROSSHAIR_PAINT
Constructor Detail |
protected ValueAxis(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 tickMarksVisible, java.awt.Stroke tickMarkStroke, java.awt.Paint tickMarkPaint, Range range, boolean autoRange, java.lang.Number autoRangeMinimumSize, boolean autoTickUnitSelection, TickUnits standardTickUnits, boolean gridLinesVisible, java.awt.Stroke gridStroke, java.awt.Paint gridPaint, double anchorValue, 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 paint used to draw the axis label.labelInsets
- determines the amount of blank space around the label.tickLabelsVisible
- flag indicating whether or not the tick labels are visible.tickLabelFont
- the font used to display tick labels.tickLabelPaint
- the paint used to draw tick labels.tickLabelInsets
- determines the amount of blank space around tick labels.tickMarksVisible
- flag indicating whether or not the tick marks are visible.tickMarkStroke
- the stroke used to draw tick marks (if visible).tickMarkPaint
- the paint used to draw tick marks (if visible).range
- the axis range.autoRange
- a flag indicating whether or not the axis range is automatically adjusted
to fit the data.autoRangeMinimumSize
- the smallest range allowed when the axis range is calculated to
fit the data.autoTickUnitSelection
- a flag indicating whether or not the tick unit is
automatically selected.standardTickUnits
- a collection of standard tick units.gridLinesVisible
- flag indicating whether or not grid lines are visible.gridStroke
- the Stroke used to display grid lines (if visible).gridPaint
- the Paint used to display grid lines (if visible).anchorValue
- the anchor value.crosshairVisible
- whether to show a crosshair.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 isAutoRange()
public void setAutoRange(boolean auto)
auto
- Flag indicating whether or not the axis is automatically
scaled to fit the data.protected void setAutoRangeAttribute(boolean auto)
auto
- the new value of the flag.public java.lang.Number getAutoRangeMinimumSize()
public void setAutoRangeMinimumSize(java.lang.Number size)
size
- The new minimum.protected void setAutoRangeMinimumSizeAttribute(java.lang.Number size)
size
- the new size.public double getUpperMargin()
public void setUpperMargin(double margin)
This margin is added only when the axis range is auto-calculated.
The default is 5 percent.
margin
- the new margin.public double getLowerMargin()
public void setLowerMargin(double margin)
This margin is added only when the axis range is auto-calculated.
The default is 5 percent.
margin
- the new margin.public double getFixedAutoRange()
public void setFixedAutoRange(double length)
length
- the range length.public double getMinimumAxisValue()
public void setMinimumAxisValue(double min)
Registered listeners are notified that the axis has been modified.
min
- The new minimum.public double getMaximumAxisValue()
public void setMaximumAxisValue(double max)
Registered listeners are notified that the axis has been modified.
max
- The new maximum.public Range getRange()
public void setRange(Range range)
As a side-effect, the auto-range flag is set to false.
range
- The new range.protected void setRangeAttribute(Range range)
range
- the range.public void setRange(double lower, double upper)
lower
- The lower axis limit.upper
- The upper axis limit.public void setRangeAboutValue(double value, double length)
value
- the central value.length
- the range length.public boolean isAutoTickUnitSelection()
public void setAutoTickUnitSelection(boolean flag)
Registered listeners are notified of a change to the axis.
flag
- The new value of the flag.protected void setAutoTickUnitSelectionAttribute(boolean flag)
flag
- the new value of the flag.public TickUnits getStandardTickUnits()
If autoTickUnitSelection is on, the tick unit for the axis will be automatically selected from this collection.
public void setStandardTickUnits(TickUnits collection)
If the autoTickUnitSelection flag is true, a tick unit will be selected from this collection automatically (to ensure that labels do not overlap).
collection
- The tick unit collection.public boolean isGridLinesVisible()
public void setGridLinesVisible(boolean flag)
flag
- The new setting.public java.awt.Stroke getGridStroke()
public void setGridStroke(java.awt.Stroke stroke)
stroke
- The new grid line stroke.public java.awt.Paint getGridPaint()
public void setGridPaint(java.awt.Paint paint)
paint
- The new grid paint.public double getAnchorValue()
public void setAnchorValue(double value)
value
- The new anchor value.protected void setAnchorValueAttribute(double value)
value
- the value.public boolean isCrosshairVisible()
public void setCrosshairVisible(boolean flag)
flag
- The new value of the flag.public boolean isCrosshairLockedOnData()
public void setCrosshairLockedOnData(boolean flag)
flag
- The flag.public double getCrosshairValue()
public void setCrosshairValue(double value)
Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.
value
- The new value (null permitted).protected void setCrosshairValueAttribute(double value)
value
- the value.public void setCrosshairValue(double value, boolean notify)
Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.
value
- The new value.notify
- a flag that controls whether or not listeners are notified.public java.awt.Stroke getCrosshairStroke()
public void setCrosshairStroke(java.awt.Stroke stroke)
stroke
- The new crosshair stroke.public java.awt.Paint getCrosshairPaint()
public void setCrosshairPaint(java.awt.Paint paint)
paint
- The new crosshair paint.public abstract double translateValueToJava2D(double dataValue, java.awt.geom.Rectangle2D dataArea)
Note that it is possible for the coordinate to fall outside the plotArea.
dataValue
- The data value.dataArea
- The area for plotting the data.public abstract double translateJava2DtoValue(float java2DValue, java.awt.geom.Rectangle2D dataArea)
java2DValue
- The coordinate in Java2D space.dataArea
- The area in which the data is plotted.protected abstract void autoAdjustRange()
public void setAnchoredRange(double range)
range
- The range.public void centerRange(double value)
value
- The center value.public void resizeRange(double percent)
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent
- The resize factor.public void resizeRange(double percent, double anchorValue)
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent
- The resize factor.anchorValue
- The new central value after the resize.protected int getAutoTickIndex()
protected void setAutoTickIndex(int index)
index
- the new value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |