Class ExtendedCategoryAxis

All Implemented Interfaces:
Serializable, Cloneable

public class ExtendedCategoryAxis extends CategoryAxis
An extended version of the CategoryAxis class that supports sublabels on the axis.
See Also:
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      For serialization.
      See Also:
    • sublabels

      private Map sublabels
      Storage for the sublabels.
    • sublabelFont

      private Font sublabelFont
      The sublabel font.
    • sublabelPaint

      private transient Paint sublabelPaint
      The sublabel paint.
  • Constructor Details

    • ExtendedCategoryAxis

      public ExtendedCategoryAxis(String label)
      Creates a new axis.
      Parameters:
      label - the axis label.
  • Method Details

    • getSubLabelFont

      public Font getSubLabelFont()
      Returns the font for the sublabels.
      Returns:
      The font (never null).
      See Also:
    • setSubLabelFont

      public void setSubLabelFont(Font font)
      Sets the font for the sublabels and sends an AxisChangeEvent to all registered listeners.
      Parameters:
      font - the font (null not permitted).
      See Also:
    • getSubLabelPaint

      public Paint getSubLabelPaint()
      Returns the paint for the sublabels.
      Returns:
      The paint (never null).
      See Also:
    • setSubLabelPaint

      public void setSubLabelPaint(Paint paint)
      Sets the paint for the sublabels and sends an AxisChangeEvent to all registered listeners.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • addSubLabel

      public void addSubLabel(Comparable category, String label)
      Adds a sublabel for a category.
      Parameters:
      category - the category.
      label - the label.
    • createLabel

      protected TextBlock createLabel(Comparable category, float width, RectangleEdge edge, 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.
    • equals

      public boolean equals(Object obj)
      Tests this axis for equality with an arbitrary object.
      Overrides:
      equals in class CategoryAxis
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of this axis.
      Overrides:
      clone in class CategoryAxis
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if there is a problem cloning.
    • writeObject

      private void writeObject(ObjectOutputStream stream) throws IOException
      Provides serialization support.
      Parameters:
      stream - the output stream.
      Throws:
      IOException - if there is an I/O error.
    • readObject

      private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
      Provides serialization support.
      Parameters:
      stream - the input stream.
      Throws:
      IOException - if there is an I/O error.
      ClassNotFoundException - if there is a classpath problem.