Class PeriodAxisLabelInfo

java.lang.Object
org.jfree.chart.axis.PeriodAxisLabelInfo
All Implemented Interfaces:
Serializable, Cloneable

public class PeriodAxisLabelInfo extends Object implements Cloneable, Serializable
A record that contains information for one "band" of date labels in a PeriodAxis.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For serialization.
      See Also:
    • DEFAULT_INSETS

      public static final RectangleInsets DEFAULT_INSETS
      The default insets.
    • DEFAULT_FONT

      public static final Font DEFAULT_FONT
      The default font.
    • DEFAULT_LABEL_PAINT

      public static final Paint DEFAULT_LABEL_PAINT
      The default label paint.
    • DEFAULT_DIVIDER_STROKE

      public static final Stroke DEFAULT_DIVIDER_STROKE
      The default divider stroke.
    • DEFAULT_DIVIDER_PAINT

      public static final Paint DEFAULT_DIVIDER_PAINT
      The default divider paint.
    • periodClass

      private Class periodClass
      The subclass of RegularTimePeriod to use for this band.
    • padding

      private RectangleInsets padding
      Controls the gaps around the band.
    • dateFormat

      private DateFormat dateFormat
      The date formatter.
    • labelFont

      private Font labelFont
      The label font.
    • labelPaint

      private transient Paint labelPaint
      The label paint.
    • drawDividers

      private boolean drawDividers
      A flag that controls whether or not dividers are visible.
    • dividerStroke

      private transient Stroke dividerStroke
      The stroke used to draw the dividers.
    • dividerPaint

      private transient Paint dividerPaint
      The paint used to draw the dividers.
  • Constructor Details

    • PeriodAxisLabelInfo

      public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat)
      Creates a new instance.
      Parameters:
      periodClass - the subclass of RegularTimePeriod to use (null not permitted).
      dateFormat - the date format (null not permitted).
    • PeriodAxisLabelInfo

      public PeriodAxisLabelInfo(Class periodClass, DateFormat dateFormat, RectangleInsets padding, Font labelFont, Paint labelPaint, boolean drawDividers, Stroke dividerStroke, Paint dividerPaint)
      Creates a new instance.
      Parameters:
      periodClass - the subclass of RegularTimePeriod to use (null not permitted).
      dateFormat - the date format (null not permitted).
      padding - controls the space around the band (null not permitted).
      labelFont - the label font (null not permitted).
      labelPaint - the label paint (null not permitted).
      drawDividers - a flag that controls whether dividers are drawn.
      dividerStroke - the stroke used to draw the dividers (null not permitted).
      dividerPaint - the paint used to draw the dividers (null not permitted).
  • Method Details

    • getPeriodClass

      public Class getPeriodClass()
      Returns the subclass of RegularTimePeriod that should be used to generate the date labels.
      Returns:
      The class.
    • getDateFormat

      public DateFormat getDateFormat()
      Returns a copy of the date formatter.
      Returns:
      A copy of the date formatter (never null).
    • getPadding

      public RectangleInsets getPadding()
      Returns the padding for the band.
      Returns:
      The padding.
    • getLabelFont

      public Font getLabelFont()
      Returns the label font.
      Returns:
      The label font (never null).
    • getLabelPaint

      public Paint getLabelPaint()
      Returns the label paint.
      Returns:
      The label paint.
    • getDrawDividers

      public boolean getDrawDividers()
      Returns a flag that controls whether or not dividers are drawn.
      Returns:
      A flag.
    • getDividerStroke

      public Stroke getDividerStroke()
      Returns the stroke used to draw the dividers.
      Returns:
      The stroke.
    • getDividerPaint

      public Paint getDividerPaint()
      Returns the paint used to draw the dividers.
      Returns:
      The paint.
    • createInstance

      public RegularTimePeriod createInstance(Date millisecond, TimeZone zone, Locale locale)
      Creates a time period that includes the specified millisecond, assuming the given time zone.
      Parameters:
      millisecond - the time.
      zone - the time zone.
      locale - the locale.
      Returns:
      The time period.
    • equals

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

      public int hashCode()
      Returns a hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of the object.
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if cloning is not supported.
    • 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.