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:
- AxisConstants, java.lang.Cloneable, java.io.Serializable
- public class ExtendedCategoryAxis
- extends CategoryAxis
An extended version of the CategoryAxis
class that supports sublabels on
the axis.
- See Also:
- Serialized Form
Fields inherited from interface org.jfree.chart.axis.AxisConstants |
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 |
Method Summary |
void |
addSubLabel(java.lang.Comparable category,
java.lang.String label)
Adds a sublabel for a category. |
protected org.jfree.text.TextBlock |
createLabel(java.lang.Comparable category,
float width,
org.jfree.ui.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. |
java.awt.Font |
getSubLabelFont()
Returns the font for the sublabels. |
void |
setSubLabelFont(java.awt.Font font)
Sets the font for the sublabels. |
Methods inherited from class org.jfree.chart.axis.CategoryAxis |
calculateCategoryGapSize, calculateCategorySize, calculateTextBlockHeight, calculateTextBlockWidth, clone, configure, draw, drawCategoryLabels, equals, getBottomCategoryLabelPosition, getCategoryEnd, getCategoryJava2DCoordinate, getCategoryLabelPositionOffset, getCategoryLabelPositions, getCategoryMargin, getCategoryMiddle, getCategoryStart, getLeftCategoryLabelPosition, getLowerMargin, getMaxCategoryLabelWidthRatio, getRightCategoryLabelPosition, getSkipCategoryLabelsToFit, getTopCategoryLabelPosition, getUpperMargin, isVerticalCategoryLabels, refreshTicks, reserveSpace, setBottomCategoryLabelPosition, setCategoryLabelPositionOffset, setCategoryLabelPositions, setCategoryMargin, setLeftCategoryLabelPosition, setLowerMargin, setMaxCategoryLabelWidthRatio, setRightCategoryLabelPosition, setSkipCategoryLabelsToFit, setTopCategoryLabelPosition, setUpperMargin, setVerticalCategoryLabels |
Methods inherited from class org.jfree.chart.axis.Axis |
addChangeListener, drawAxisLine, drawLabel, getAxisLinePaint, getAxisLineStroke, getFixedDimension, getLabel, getLabelAngle, getLabelEnclosure, getLabelFont, getLabelInsets, getLabelPaint, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkInsideLength, getTickMarkOutsideLength, getTickMarkPaint, getTickMarkStroke, isAxisLineVisible, isTickLabelsVisible, isTickMarksVisible, isVisible, notifyListeners, removeChangeListener, setAxisLinePaint, setAxisLineStroke, setAxisLineVisible, setFixedDimension, setLabel, setLabelAngle, setLabelFont, setLabelInsets, setLabelPaint, setPlot, setTickLabelFont, setTickLabelInsets, setTickLabelPaint, setTickLabelsVisible, setTickMarkInsideLength, setTickMarkOutsideLength, setTickMarkPaint, setTickMarkStroke, setTickMarksVisible, setVisible |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExtendedCategoryAxis
public ExtendedCategoryAxis(java.lang.String label)
- Creates a new axis.
- Parameters:
label
- the axis label.
getSubLabelFont
public java.awt.Font getSubLabelFont()
- Returns the font for the sublabels.
- Returns:
- the font.
setSubLabelFont
public void setSubLabelFont(java.awt.Font font)
- Sets the font for the sublabels.
- Parameters:
font
- the font.
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 org.jfree.text.TextBlock createLabel(java.lang.Comparable category,
float width,
org.jfree.ui.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:
createLabel
in class CategoryAxis
- Parameters:
category
- the category.width
- the width (not used yet).edge
- the location of the axis.g2
- the graphics device.
- Returns:
- a label.