Package org.jfree.chart.axis
Class PeriodAxisLabelInfo
- java.lang.Object
-
- org.jfree.chart.axis.PeriodAxisLabelInfo
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class PeriodAxisLabelInfo extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableA record that contains information for one "band" of date labels in aPeriodAxis.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.text.DateFormatdateFormatThe date formatter.static java.awt.PaintDEFAULT_DIVIDER_PAINTThe default divider paint.static java.awt.StrokeDEFAULT_DIVIDER_STROKEThe default divider stroke.static java.awt.FontDEFAULT_FONTThe default font.static RectangleInsetsDEFAULT_INSETSThe default insets.static java.awt.PaintDEFAULT_LABEL_PAINTThe default label paint.private java.awt.PaintdividerPaintThe paint used to draw the dividers.private java.awt.StrokedividerStrokeThe stroke used to draw the dividers.private booleandrawDividersA flag that controls whether or not dividers are visible.private java.awt.FontlabelFontThe label font.private java.awt.PaintlabelPaintThe label paint.private RectangleInsetspaddingControls the gaps around the band.private java.lang.ClassperiodClassThe subclass ofRegularTimePeriodto use for this band.private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Constructor Description PeriodAxisLabelInfo(java.lang.Class periodClass, java.text.DateFormat dateFormat)Creates a new instance.PeriodAxisLabelInfo(java.lang.Class periodClass, java.text.DateFormat dateFormat, RectangleInsets padding, java.awt.Font labelFont, java.awt.Paint labelPaint, boolean drawDividers, java.awt.Stroke dividerStroke, java.awt.Paint dividerPaint)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a clone of the object.RegularTimePeriodcreateInstance(java.util.Date millisecond, java.util.TimeZone zone, java.util.Locale locale)Creates a time period that includes the specified millisecond, assuming the given time zone.booleanequals(java.lang.Object obj)Tests this object for equality with an arbitrary object.java.text.DateFormatgetDateFormat()Returns a copy of the date formatter.java.awt.PaintgetDividerPaint()Returns the paint used to draw the dividers.java.awt.StrokegetDividerStroke()Returns the stroke used to draw the dividers.booleangetDrawDividers()Returns a flag that controls whether or not dividers are drawn.java.awt.FontgetLabelFont()Returns the label font.java.awt.PaintgetLabelPaint()Returns the label paint.RectangleInsetsgetPadding()Returns the padding for the band.java.lang.ClassgetPeriodClass()Returns the subclass ofRegularTimePeriodthat should be used to generate the date labels.inthashCode()Returns a hash code for this object.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
DEFAULT_INSETS
public static final RectangleInsets DEFAULT_INSETS
The default insets.
-
DEFAULT_FONT
public static final java.awt.Font DEFAULT_FONT
The default font.
-
DEFAULT_LABEL_PAINT
public static final java.awt.Paint DEFAULT_LABEL_PAINT
The default label paint.
-
DEFAULT_DIVIDER_STROKE
public static final java.awt.Stroke DEFAULT_DIVIDER_STROKE
The default divider stroke.
-
DEFAULT_DIVIDER_PAINT
public static final java.awt.Paint DEFAULT_DIVIDER_PAINT
The default divider paint.
-
periodClass
private java.lang.Class periodClass
The subclass ofRegularTimePeriodto use for this band.
-
padding
private RectangleInsets padding
Controls the gaps around the band.
-
dateFormat
private java.text.DateFormat dateFormat
The date formatter.
-
labelFont
private java.awt.Font labelFont
The label font.
-
labelPaint
private transient java.awt.Paint labelPaint
The label paint.
-
drawDividers
private boolean drawDividers
A flag that controls whether or not dividers are visible.
-
dividerStroke
private transient java.awt.Stroke dividerStroke
The stroke used to draw the dividers.
-
dividerPaint
private transient java.awt.Paint dividerPaint
The paint used to draw the dividers.
-
-
Constructor Detail
-
PeriodAxisLabelInfo
public PeriodAxisLabelInfo(java.lang.Class periodClass, java.text.DateFormat dateFormat)Creates a new instance.- Parameters:
periodClass- the subclass ofRegularTimePeriodto use (nullnot permitted).dateFormat- the date format (nullnot permitted).
-
PeriodAxisLabelInfo
public PeriodAxisLabelInfo(java.lang.Class periodClass, java.text.DateFormat dateFormat, RectangleInsets padding, java.awt.Font labelFont, java.awt.Paint labelPaint, boolean drawDividers, java.awt.Stroke dividerStroke, java.awt.Paint dividerPaint)Creates a new instance.- Parameters:
periodClass- the subclass ofRegularTimePeriodto use (nullnot permitted).dateFormat- the date format (nullnot permitted).padding- controls the space around the band (nullnot permitted).labelFont- the label font (nullnot permitted).labelPaint- the label paint (nullnot permitted).drawDividers- a flag that controls whether dividers are drawn.dividerStroke- the stroke used to draw the dividers (nullnot permitted).dividerPaint- the paint used to draw the dividers (nullnot permitted).
-
-
Method Detail
-
getPeriodClass
public java.lang.Class getPeriodClass()
Returns the subclass ofRegularTimePeriodthat should be used to generate the date labels.- Returns:
- The class.
-
getDateFormat
public java.text.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 java.awt.Font getLabelFont()
Returns the label font.- Returns:
- The label font (never
null).
-
getLabelPaint
public java.awt.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 java.awt.Stroke getDividerStroke()
Returns the stroke used to draw the dividers.- Returns:
- The stroke.
-
getDividerPaint
public java.awt.Paint getDividerPaint()
Returns the paint used to draw the dividers.- Returns:
- The paint.
-
createInstance
public RegularTimePeriod createInstance(java.util.Date millisecond, java.util.TimeZone zone, java.util.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(java.lang.Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to test against (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the object.- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if cloning is not supported.
-
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.
-
-