Package org.jfree.chart.axis
Class ExtendedCategoryAxis
- java.lang.Object
-
- org.jfree.chart.axis.Axis
-
- org.jfree.chart.axis.CategoryAxis
-
- org.jfree.chart.axis.ExtendedCategoryAxis
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class ExtendedCategoryAxis extends CategoryAxis
An extended version of theCategoryAxisclass that supports sublabels on the axis.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static longserialVersionUIDFor serialization.private java.awt.FontsublabelFontThe sublabel font.private java.awt.PaintsublabelPaintThe sublabel paint.private java.util.MapsublabelsStorage for the sublabels.-
Fields inherited from class org.jfree.chart.axis.CategoryAxis
DEFAULT_AXIS_MARGIN, DEFAULT_CATEGORY_MARGIN
-
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 Description ExtendedCategoryAxis(java.lang.String label)Creates a new axis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubLabel(java.lang.Comparable category, java.lang.String label)Adds a sublabel for a category.java.lang.Objectclone()Returns a clone of this axis.protected TextBlockcreateLabel(java.lang.Comparable category, float width, RectangleEdge edge, java.awt.Graphics2D g2)Overrides the default behaviour by adding the sublabel to the text block that is used for the category label.booleanequals(java.lang.Object obj)Tests this axis for equality with an arbitrary object.java.awt.FontgetSubLabelFont()Returns the font for the sublabels.java.awt.PaintgetSubLabelPaint()Returns the paint for the sublabels.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetSubLabelFont(java.awt.Font font)Sets the font for the sublabels and sends anAxisChangeEventto all registered listeners.voidsetSubLabelPaint(java.awt.Paint paint)Sets the paint for the sublabels and sends anAxisChangeEventto all registered listeners.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.-
Methods inherited from class org.jfree.chart.axis.CategoryAxis
addCategoryLabelToolTip, addCategoryLabelURL, calculateCategoryGapSize, calculateCategorySize, calculateTextBlockHeight, calculateTextBlockWidth, clearCategoryLabelToolTips, clearCategoryLabelURLs, configure, draw, drawCategoryLabels, drawTickMarks, getCategoryEnd, getCategoryJava2DCoordinate, getCategoryLabelPositionOffset, getCategoryLabelPositions, getCategoryLabelToolTip, getCategoryLabelURL, getCategoryMargin, getCategoryMiddle, getCategoryMiddle, getCategorySeriesMiddle, getCategorySeriesMiddle, getCategoryStart, getLowerMargin, getMaximumCategoryLabelLines, getMaximumCategoryLabelWidthRatio, getTickLabelFont, getTickLabelPaint, getUpperMargin, hashCode, refreshTicks, removeCategoryLabelToolTip, removeCategoryLabelURL, reserveSpace, setCategoryLabelPositionOffset, setCategoryLabelPositions, setCategoryMargin, setLowerMargin, setMaximumCategoryLabelLines, setMaximumCategoryLabelWidthRatio, setTickLabelFont, setTickLabelPaint, setUpperMargin
-
Methods inherited from class org.jfree.chart.axis.Axis
addChangeListener, createAndAddEntity, createAttributedLabel, drawAttributedLabel, drawAxisLine, drawLabel, fireChangeEvent, getAttributedLabel, getAxisLinePaint, getAxisLineStroke, getFixedDimension, getLabel, getLabelAngle, getLabelEnclosure, getLabelFont, getLabelInsets, getLabelLocation, getLabelPaint, getMinorTickMarkInsideLength, getMinorTickMarkOutsideLength, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkInsideLength, getTickMarkOutsideLength, getTickMarkPaint, getTickMarkStroke, hasListener, isAxisLineVisible, isMinorTickMarksVisible, isTickLabelsVisible, isTickMarksVisible, isVisible, labelAnchorH, labelAnchorV, labelLocationX, labelLocationY, notifyListeners, 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
-
serialVersionUID
static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
sublabels
private java.util.Map sublabels
Storage for the sublabels.
-
sublabelFont
private java.awt.Font sublabelFont
The sublabel font.
-
sublabelPaint
private transient java.awt.Paint sublabelPaint
The sublabel paint.
-
-
Method Detail
-
getSubLabelFont
public java.awt.Font getSubLabelFont()
Returns the font for the sublabels.- Returns:
- The font (never
null). - See Also:
setSubLabelFont(Font)
-
setSubLabelFont
public void setSubLabelFont(java.awt.Font font)
Sets the font for the sublabels and sends anAxisChangeEventto all registered listeners.- Parameters:
font- the font (nullnot permitted).- See Also:
getSubLabelFont()
-
getSubLabelPaint
public java.awt.Paint getSubLabelPaint()
Returns the paint for the sublabels.- Returns:
- The paint (never
null). - See Also:
setSubLabelPaint(Paint)
-
setSubLabelPaint
public void setSubLabelPaint(java.awt.Paint paint)
Sets the paint for the sublabels and sends anAxisChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getSubLabelPaint()
-
addSubLabel
public void addSubLabel(java.lang.Comparable category, java.lang.String label)Adds a sublabel for a category.- Parameters:
category- the category.label- the label.
-
createLabel
protected TextBlock createLabel(java.lang.Comparable category, float width, RectangleEdge edge, java.awt.Graphics2D g2)
Overrides the default behaviour by adding the sublabel to the text block that is used for the category label.- Overrides:
createLabelin classCategoryAxis- Parameters:
category- the category.width- the width (not used yet).edge- the location of the axis.g2- the graphics device.- Returns:
- A label.
-
equals
public boolean equals(java.lang.Object obj)
Tests this axis for equality with an arbitrary object.- Overrides:
equalsin classCategoryAxis- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this axis.- Overrides:
clonein classCategoryAxis- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem cloning.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-