Class DateTitle
- java.lang.Object
-
- org.jfree.chart.block.AbstractBlock
-
- org.jfree.chart.title.Title
-
- org.jfree.chart.title.TextTitle
-
- org.jfree.chart.title.DateTitle
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Block
,Drawable
,PublicCloneable
public class DateTitle extends TextTitle implements java.io.Serializable
A chart title that displays the date.Keep in mind that a chart can have several titles, and that they can appear at the top, left, right or bottom of the chart - a
DateTitle
will commonly appear at the bottom of a chart, although you can place it anywhere.By specifying the locale, dates are formatted to the correct standard for the given locale. For example, a date would appear as "January 17, 2000" in the US, but "17 January 2000" in most European locales.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
For serialization.-
Fields inherited from class org.jfree.chart.title.TextTitle
DEFAULT_FONT, DEFAULT_TEXT_PAINT
-
Fields inherited from class org.jfree.chart.title.Title
DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_PADDING, DEFAULT_POSITION, DEFAULT_VERTICAL_ALIGNMENT, visible
-
-
Constructor Summary
Constructors Constructor Description DateTitle()
Creates a new chart title that displays the current date in the default (LONG) format for the locale, positioned to the bottom right of the chart.DateTitle(int style)
Creates a new chart title that displays the current date with the specified style (for the default locale).DateTitle(int style, java.util.Locale locale, java.awt.Font font, java.awt.Paint paint)
Creates a new chart title that displays the current date.DateTitle(int style, java.util.Locale locale, java.awt.Font font, java.awt.Paint paint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
Creates a new chart title that displays the current date.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setDateFormat(int style, java.util.Locale locale)
Set the format of the date.-
Methods inherited from class org.jfree.chart.title.TextTitle
arrange, arrangeFN, arrangeNN, arrangeRN, arrangeRR, canEqual, clone, draw, draw, drawHorizontal, drawVertical, equals, getBackgroundPaint, getExpandToFitSpace, getFont, getMaximumLinesToDisplay, getPaint, getText, getTextAlignment, getToolTipText, getURLText, hashCode, setBackgroundPaint, setExpandToFitSpace, setFont, setMaximumLinesToDisplay, setPaint, setText, setTextAlignment, setToolTipText, setURLText
-
Methods inherited from class org.jfree.chart.title.Title
addChangeListener, getHorizontalAlignment, getNotify, getPosition, getVerticalAlignment, isVisible, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setVerticalAlignment, setVisible
-
Methods inherited from class org.jfree.chart.block.AbstractBlock
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DateTitle
public DateTitle()
Creates a new chart title that displays the current date in the default (LONG) format for the locale, positioned to the bottom right of the chart.The color will be black in 12 point, plain Helvetica font (maps to Arial on Win32 systems without Helvetica).
-
DateTitle
public DateTitle(int style)
Creates a new chart title that displays the current date with the specified style (for the default locale).The date style should be one of:
SHORT
,MEDIUM
,LONG
orFULL
(defined injava.util.DateFormat
).- Parameters:
style
- the date style.
-
DateTitle
public DateTitle(int style, java.util.Locale locale, java.awt.Font font, java.awt.Paint paint)
Creates a new chart title that displays the current date.The date style should be one of:
SHORT
,MEDIUM
,LONG
orFULL
(defined injava.util.DateFormat
).For the locale, you can use
Locale.getDefault()
for the default locale.- Parameters:
style
- the date style.locale
- the locale.font
- the font.paint
- the text color.
-
DateTitle
public DateTitle(int style, java.util.Locale locale, java.awt.Font font, java.awt.Paint paint, RectangleEdge position, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, RectangleInsets padding)
Creates a new chart title that displays the current date.The date style should be one of:
SHORT
,MEDIUM
,LONG
orFULL
(defined injava.util.DateFormat
).For the locale, you can use
Locale.getDefault()
for the default locale.- Parameters:
style
- the date style.locale
- the locale.font
- the font (not null).paint
- the text color (not null).position
- the relative location of this title (use constants in Title).horizontalAlignment
- the horizontal text alignment of this title (use constants in Title).verticalAlignment
- the vertical text alignment of this title (use constants in Title).padding
- determines the blank space around the outside of the title (not null).
-
-
Method Detail
-
setDateFormat
public void setDateFormat(int style, java.util.Locale locale)
Set the format of the date.The date style should be one of:
SHORT
,MEDIUM
,LONG
orFULL
(defined injava.util.DateFormat
).For the locale, you can use
Locale.getDefault()
for the default locale.- Parameters:
style
- the date style.locale
- the locale.
-
-