org.jfree.chart.axis
Class SymbolAxis
- java.lang.Object
-
- org.jfree.chart.axis.Axis
-
- org.jfree.chart.axis.ValueAxis
-
- org.jfree.chart.axis.NumberAxis
-
- org.jfree.chart.axis.SymbolAxis
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, org.jfree.util.PublicCloneable
- Direct Known Subclasses:
- CustomSymbolAxis
public class SymbolAxis extends NumberAxis implements java.io.Serializable
A standard linear value axis that replaces integer values with symbols.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.awt.PaintDEFAULT_GRID_BAND_ALTERNATE_PAINTThe default paint for alternate grid bands.static java.awt.PaintDEFAULT_GRID_BAND_PAINTThe default grid band paint.-
Fields inherited from class org.jfree.chart.axis.NumberAxis
DEFAULT_AUTO_RANGE_INCLUDES_ZERO, DEFAULT_AUTO_RANGE_STICKY_ZERO, DEFAULT_TICK_UNIT, DEFAULT_VERTICAL_TICK_LABELS
-
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 class org.jfree.chart.axis.Axis
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_LINE_PAINT, DEFAULT_AXIS_LINE_STROKE, 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
-
-
Constructor Summary
Constructors Constructor and Description SymbolAxis(java.lang.String label, java.lang.String[] sv)Constructs a symbol axis, using default attribute values where necessary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AxisStatedraw(java.awt.Graphics2D g2, double cursor, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D dataArea, org.jfree.ui.RectangleEdge edge, PlotRenderingInfo plotState)Draws the axis on a Java 2D graphics device (such as the screen or a printer).booleanequals(java.lang.Object obj)Tests this axis for equality with an arbitrary object.java.awt.PaintgetGridBandAlternatePaint()Returns the paint used for alternate grid bands.java.awt.PaintgetGridBandPaint()Returns the paint used to color the grid bands.java.lang.String[]getSymbols()Returns an array of the symbols for the axis.booleanisGridBandsVisible()Returnstrueif the grid bands are showing, andfalseotherwise.java.util.ListrefreshTicks(java.awt.Graphics2D g2, AxisState state, java.awt.geom.Rectangle2D dataArea, org.jfree.ui.RectangleEdge edge)Calculates the positions of the tick labels for the axis, storing the results in the tick label list (ready for drawing).voidsetGridBandAlternatePaint(java.awt.Paint paint)Sets the paint used for alternate grid bands and sends aAxisChangeEventto all registered listeners.voidsetGridBandPaint(java.awt.Paint paint)Sets the grid band paint and sends anAxisChangeEventto all registered listeners.voidsetGridBandsVisible(boolean flag)Sets the visibility of the grid bands and notifies registered listeners that the axis has been modified.java.lang.StringvalueToString(double value)Converts a value to a string, using the list of symbols.-
Methods inherited from class org.jfree.chart.axis.NumberAxis
clone, configure, createIntegerTickUnits, createIntegerTickUnits, createStandardTickUnits, createStandardTickUnits, getAutoRangeIncludesZero, getAutoRangeStickyZero, getMarkerBand, getNumberFormatOverride, getRangeType, getTickUnit, hashCode, java2DToValue, setAutoRangeIncludesZero, setAutoRangeStickyZero, setMarkerBand, setNumberFormatOverride, setRangeType, setTickUnit, setTickUnit, valueToJava2D
-
Methods inherited from class org.jfree.chart.axis.ValueAxis
centerRange, getAutoRangeMinimumSize, getDefaultAutoRange, getDownArrow, getFixedAutoRange, getLeftArrow, getLowerBound, getLowerMargin, getMinorTickCount, getRange, getRightArrow, getStandardTickUnits, getUpArrow, getUpperBound, getUpperMargin, isAutoRange, isAutoTickUnitSelection, isInverted, isNegativeArrowVisible, isPositiveArrowVisible, isVerticalTickLabels, lengthToJava2D, pan, reserveSpace, resizeRange, resizeRange, resizeRange2, setAutoRange, setAutoRangeMinimumSize, setAutoRangeMinimumSize, setAutoTickUnitSelection, setAutoTickUnitSelection, setDefaultAutoRange, setDownArrow, setFixedAutoRange, setInverted, setLeftArrow, setLowerBound, setLowerMargin, setMinorTickCount, setNegativeArrowVisible, setPositiveArrowVisible, setRange, setRange, setRange, setRangeAboutValue, setRangeWithMargins, setRangeWithMargins, setRangeWithMargins, setRightArrow, setStandardTickUnits, setUpArrow, setUpperBound, setUpperMargin, setVerticalTickLabels, zoomRange
-
Methods inherited from class org.jfree.chart.axis.Axis
addChangeListener, createAttributedLabel, getAttributedLabel, getAxisLinePaint, getAxisLineStroke, getFixedDimension, getLabel, getLabelAngle, getLabelFont, getLabelInsets, getLabelLocation, getLabelPaint, getMinorTickMarkInsideLength, getMinorTickMarkOutsideLength, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkInsideLength, getTickMarkOutsideLength, getTickMarkPaint, getTickMarkStroke, hasListener, isAxisLineVisible, isMinorTickMarksVisible, isTickLabelsVisible, isTickMarksVisible, isVisible, removeChangeListener, setAttributedLabel, setAttributedLabel, setAxisLinePaint, setAxisLineStroke, setAxisLineVisible, setFixedDimension, setLabel, setLabelAngle, setLabelFont, setLabelInsets, setLabelInsets, setLabelLocation, setLabelPaint, setMinorTickMarkInsideLength, setMinorTickMarkOutsideLength, setMinorTickMarksVisible, setPlot, setTickLabelFont, setTickLabelInsets, setTickLabelPaint, setTickLabelsVisible, setTickMarkInsideLength, setTickMarkOutsideLength, setTickMarkPaint, setTickMarkStroke, setTickMarksVisible, setVisible
-
-
-
-
Field Detail
-
DEFAULT_GRID_BAND_PAINT
public static final java.awt.Paint DEFAULT_GRID_BAND_PAINT
The default grid band paint.
-
DEFAULT_GRID_BAND_ALTERNATE_PAINT
public static final java.awt.Paint DEFAULT_GRID_BAND_ALTERNATE_PAINT
The default paint for alternate grid bands.- Since:
- 1.0.7
-
-
Constructor Detail
-
SymbolAxis
public SymbolAxis(java.lang.String label, java.lang.String[] sv)Constructs a symbol axis, using default attribute values where necessary.- Parameters:
label- the axis label (nullpermitted).sv- the list of symbols to display instead of the numeric values.
-
-
Method Detail
-
getSymbols
public java.lang.String[] getSymbols()
Returns an array of the symbols for the axis.- Returns:
- The symbols.
-
isGridBandsVisible
public boolean isGridBandsVisible()
Returnstrueif the grid bands are showing, andfalseotherwise.- Returns:
trueif the grid bands are showing, andfalseotherwise.- See Also:
setGridBandsVisible(boolean)
-
setGridBandsVisible
public void setGridBandsVisible(boolean flag)
Sets the visibility of the grid bands and notifies registered listeners that the axis has been modified.- Parameters:
flag- the new setting.- See Also:
isGridBandsVisible()
-
getGridBandPaint
public java.awt.Paint getGridBandPaint()
Returns the paint used to color the grid bands.- Returns:
- The grid band paint (never
null). - See Also:
setGridBandPaint(Paint),isGridBandsVisible()
-
setGridBandPaint
public void setGridBandPaint(java.awt.Paint paint)
Sets the grid band paint and sends anAxisChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getGridBandPaint()
-
getGridBandAlternatePaint
public java.awt.Paint getGridBandAlternatePaint()
Returns the paint used for alternate grid bands.- Returns:
- The paint (never
null). - Since:
- 1.0.7
- See Also:
setGridBandAlternatePaint(Paint),getGridBandPaint()
-
setGridBandAlternatePaint
public void setGridBandAlternatePaint(java.awt.Paint paint)
Sets the paint used for alternate grid bands and sends aAxisChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- Since:
- 1.0.7
- See Also:
getGridBandAlternatePaint(),setGridBandPaint(Paint)
-
draw
public AxisState draw(java.awt.Graphics2D g2, double cursor, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D dataArea, org.jfree.ui.RectangleEdge edge, PlotRenderingInfo plotState)
Draws the axis on a Java 2D graphics device (such as the screen or a printer).- Overrides:
drawin classNumberAxis- Parameters:
g2- the graphics device (nullnot permitted).cursor- the cursor location.plotArea- the area within which the plot and axes should be drawn (nullnot permitted).dataArea- the area within which the data should be drawn (nullnot permitted).edge- the axis location (nullnot permitted).plotState- collects information about the plot (nullpermitted).- Returns:
- The axis state (never
null).
-
refreshTicks
public java.util.List refreshTicks(java.awt.Graphics2D g2, AxisState state, java.awt.geom.Rectangle2D dataArea, org.jfree.ui.RectangleEdge edge)Calculates the positions of the tick labels for the axis, storing the results in the tick label list (ready for drawing).- Overrides:
refreshTicksin classNumberAxis- Parameters:
g2- the graphics device.state- the axis state.dataArea- the area in which the data should be drawn.edge- the location of the axis.- Returns:
- A list of ticks.
-
valueToString
public java.lang.String valueToString(double value)
Converts a value to a string, using the list of symbols.- Parameters:
value- value to convert.- Returns:
- The symbol.
-
equals
public boolean equals(java.lang.Object obj)
Tests this axis for equality with an arbitrary object.- Overrides:
equalsin classNumberAxis- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
-
DMelt 3.0 © DataMelt by jWork.ORG