|
||||||||||
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 | +--com.jrefinery.chart.NumberAxis | +--com.jrefinery.chart.HorizontalNumberAxis | +--com.jrefinery.chart.HorizontalSymbolicAxis
A standard linear value axis, for SYMBOLIC values displayed horizontally.
Field Summary | |
static java.awt.Paint |
DEFAULT_SYMBOLIC_GRID_LINE_PAINT
The default symbolic grid line paint. |
Fields inherited from class com.jrefinery.chart.NumberAxis |
DEFAULT_AUTO_RANGE_INCLUDES_ZERO, DEFAULT_AUTO_RANGE_STICKY_ZERO, DEFAULT_TICK_UNIT |
Fields inherited from class com.jrefinery.chart.ValueAxis |
DEFAULT_AUTO_RANGE, DEFAULT_AUTO_RANGE_MINIMUM_SIZE, DEFAULT_CROSSHAIR_PAINT, DEFAULT_CROSSHAIR_STROKE, DEFAULT_CROSSHAIR_VISIBLE, DEFAULT_GRID_LINE_PAINT, DEFAULT_GRID_LINE_STROKE, DEFAULT_LOWER_BOUND, DEFAULT_LOWER_MARGIN, DEFAULT_RANGE, DEFAULT_UPPER_BOUND, DEFAULT_UPPER_MARGIN, 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 | |
HorizontalSymbolicAxis(java.lang.String label,
java.lang.String[] sv)
Constructs a horizontal symbolic axis, using default attribute values where necessary. |
|
HorizontalSymbolicAxis(java.lang.String label,
java.lang.String[] sv,
java.awt.Font labelFont,
boolean symbolicGridLinesVisible,
java.awt.Paint symbolicGridPaint)
Constructs a horizontal symbolic axis, using default attribute values where necessary. |
|
HorizontalSymbolicAxis(java.lang.String label,
java.lang.String[] sv,
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,
java.awt.Paint tickMarkPaint,
boolean autoRange,
java.lang.Number autoRangeMinimumSize,
boolean autoRangeIncludesZero,
boolean autoRangeStickyZero,
double lowerBound,
double upperBound,
boolean inverted,
boolean autoTickUnitSelection,
NumberTickUnit tickUnit,
boolean gridLinesVisible,
java.awt.Stroke gridStroke,
java.awt.Paint gridPaint,
double anchorValue,
boolean crosshairVisible,
double crosshairValue,
java.awt.Stroke crosshairStroke,
java.awt.Paint crosshairPaint,
boolean symbolicGridLinesVisible,
java.awt.Paint symbolicGridPaint)
Constructs a new horizontal symbolic axis. |
Method Summary | |
protected void |
autoAdjustRange()
Rescales the axis to ensure that all data is visible. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Draws the axis on a Java 2D graphics device (such as the screen or a printer). |
void |
drawSymbolicGridLines(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Draws the symbolic grid lines. |
void |
drawSymbolicGridLines(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea,
boolean firstGridLineIsDark)
Draws the symbolic grid lines. |
java.awt.geom.Rectangle2D.Double |
getSymbolicGridLine(int position)
Get the symbolic grid line corresponding to the specified position. |
java.awt.Paint |
getSymbolicGridPaint()
Returns the symbolic grid line color. |
java.lang.String[] |
getSymbolicValue()
Returns the list of the symbolic values to display. |
boolean |
isGridLinesVisible()
Returns true if the symbolic grid lines are showing, and
false otherwise. |
protected void |
selectAutoTickUnit(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
This operation is not supported by the symbolic values. |
void |
setAnchoredRange(double range)
Redefinition of setAnchoredRange for the symbolicvalues. |
void |
setSymbolicGridLinesVisible(boolean flag)
Sets the visibility of the symbolic grid lines and notifies registered listeners that the axis has been modified. |
Methods inherited from class com.jrefinery.chart.HorizontalNumberAxis |
configure, getMarkerBand, getVerticalTickLabels, isCompatiblePlot, refreshTicks, reserveAxisArea, reserveHeight, setMarkerBand, setVerticalTickLabels, translateJava2DtoValue, translateValueToJava2D |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jrefinery.chart.HorizontalAxis |
reserveAxisArea, reserveHeight |
Field Detail |
public static final java.awt.Paint DEFAULT_SYMBOLIC_GRID_LINE_PAINT
Constructor Detail |
public HorizontalSymbolicAxis(java.lang.String label, java.lang.String[] sv)
label
- the axis label (null permitted).sv
- the list of symbolic values to display instead of the numeric value.public HorizontalSymbolicAxis(java.lang.String label, java.lang.String[] sv, java.awt.Font labelFont, boolean symbolicGridLinesVisible, java.awt.Paint symbolicGridPaint)
label
- the axis label (null permitted).sv
- the list of symbolic value to display instead of the numeric value.labelFont
- the font for displaying the axis label.symbolicGridLinesVisible
- flag that indicates whether or not symbolic grid lines are
visible.symbolicGridPaint
- color of the dark part of the symbolic grid line.public HorizontalSymbolicAxis(java.lang.String label, java.lang.String[] sv, 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, java.awt.Paint tickMarkPaint, boolean autoRange, java.lang.Number autoRangeMinimumSize, boolean autoRangeIncludesZero, boolean autoRangeStickyZero, double lowerBound, double upperBound, boolean inverted, boolean autoTickUnitSelection, NumberTickUnit tickUnit, boolean gridLinesVisible, java.awt.Stroke gridStroke, java.awt.Paint gridPaint, double anchorValue, boolean crosshairVisible, double crosshairValue, java.awt.Stroke crosshairStroke, java.awt.Paint crosshairPaint, boolean symbolicGridLinesVisible, java.awt.Paint symbolicGridPaint)
label
- the axis label (null permitted).sv
- the list of symbolic value to display instead of the numeric valuelabelFont
- 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 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.verticalTickLabels
- flag indicating whether or not the label is drawn vertically.tickMarksVisible
- flag indicating whether or not tick marks are visible.tickMarkStroke
- the stroke used to draw tick marks (if visible).tickMarkPaint
- the paint used to draw tick marks (if visible).autoRange
- flag indicating whether or not the axis is automatically scaled to fit
the data.autoRangeMinimumSize
- the smallest range allowed when the axis range is calculated
to fit the data.autoRangeIncludesZero
- a flag indicating whether zero *must* be displayed on axis.autoRangeStickyZero
- a flag that affects the size of the margins added to the axis
range when the range is determined automatically. If the value
0 falls within the margin and this flag is true
,
then the margin is truncated at zero.lowerBound
- the lowest value shown on the axis.upperBound
- 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).autoTickUnitSelection
- a flag indicating whether or not the tick units are selected
automatically.tickUnit
- the tick unit.gridLinesVisible
- flag indicating whether grid lines are visible for this axis.gridStroke
- the pen/brush used to display grid lines (if visible).gridPaint
- the color used to display grid lines (if visible).anchorValue
- the anchor value.crosshairVisible
- a flag indicating whether or not a crosshair is 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.symbolicGridLinesVisible
- flag that indicates whether or not symbolic grid lines are
visible.symbolicGridPaint
- color of the dark part of the symbolic grid line.Method Detail |
public java.lang.String[] getSymbolicValue()
public java.awt.Paint getSymbolicGridPaint()
public boolean isGridLinesVisible()
true
if the symbolic grid lines are showing, and
false otherwise.isGridLinesVisible
in class ValueAxis
public void setSymbolicGridLinesVisible(boolean flag)
flag
- the new setting.public void setAnchoredRange(double range)
setAnchoredRange
in class ValueAxis
range
- the new range.protected void selectAutoTickUnit(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea, java.awt.geom.Rectangle2D plotArea)
selectAutoTickUnit
in class HorizontalNumberAxis
g2
- the graphics device.drawArea
- the area in which the plot and 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 HorizontalNumberAxis
g2
- 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 void drawSymbolicGridLines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea, java.awt.geom.Rectangle2D plotArea)
The colors are consecutively the color specified by
symbolicGridPaint
(
DEFAULT_SYMBOLIC_GRID_LINE_PAINT
by default) and white.
g2
- 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 void drawSymbolicGridLines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea, java.awt.geom.Rectangle2D plotArea, boolean firstGridLineIsDark)
The colors are consecutively the color specified by
symbolicGridPaint
(
DEFAULT_SYMBOLIC_GRID_LINE_PAINT
by default) and white.
or if firstGridLineIsDark
is true
white and
the color specified by symbolicGridPaint
.
g2
- 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).firstGridLineIsDark
- True: the first symbolic grid line take the
color of symbolicGridPaint
.
False: the first symbolic grid line is white.
public java.awt.geom.Rectangle2D.Double getSymbolicGridLine(int position)
position
- position of the grid line, startinf from 0.protected void autoAdjustRange()
autoAdjustRange
in class HorizontalNumberAxis
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |