public class DateTitle extends TextTitle implements Serializable
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.
DEFAULT_FONT, DEFAULT_TEXT_PAINT
DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_PADDING, DEFAULT_POSITION, DEFAULT_VERTICAL_ALIGNMENT, visible
Constructor and 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,
Locale locale,
Font font,
Paint paint)
Creates a new chart title that displays the current date.
|
DateTitle(int style,
Locale locale,
Font font,
Paint paint,
org.jfree.ui.RectangleEdge position,
org.jfree.ui.HorizontalAlignment horizontalAlignment,
org.jfree.ui.VerticalAlignment verticalAlignment,
org.jfree.ui.RectangleInsets padding)
Creates a new chart title that displays the current date.
|
Modifier and Type | Method and Description |
---|---|
void |
setDateFormat(int style,
Locale locale)
Set the format of the date.
|
arrange, clone, draw, draw, equals, getBackgroundPaint, getExpandToFitSpace, getFont, getMaximumLinesToDisplay, getPaint, getText, getTextAlignment, getToolTipText, getURLText, hashCode, setBackgroundPaint, setExpandToFitSpace, setFont, setMaximumLinesToDisplay, setPaint, setText, setTextAlignment, setToolTipText, setURLText
addChangeListener, getHorizontalAlignment, getNotify, getPosition, getVerticalAlignment, isVisible, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setVerticalAlignment, setVisible
arrange, getBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth
public DateTitle()
The color will be black in 12 point, plain Helvetica font (maps to Arial on Win32 systems without Helvetica).
public DateTitle(int style)
The date style should be one of: SHORT
,
MEDIUM
, LONG
or FULL
(defined in java.util.DateFormat
).
style
- the date style.public DateTitle(int style, Locale locale, Font font, Paint paint)
The date style should be one of: SHORT
,
MEDIUM
, LONG
or FULL
(defined
in java.util.DateFormat
).
For the locale, you can use Locale.getDefault()
for the
default locale.
style
- the date style.locale
- the locale.font
- the font.paint
- the text color.public DateTitle(int style, Locale locale, Font font, Paint paint, org.jfree.ui.RectangleEdge position, org.jfree.ui.HorizontalAlignment horizontalAlignment, org.jfree.ui.VerticalAlignment verticalAlignment, org.jfree.ui.RectangleInsets padding)
The date style should be one of: SHORT
,
MEDIUM
, LONG
or FULL
(defined
in java.util.DateFormat
).
For the locale, you can use Locale.getDefault()
for the
default locale.
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).public void setDateFormat(int style, Locale locale)
The date style should be one of: SHORT
,
MEDIUM
, LONG
or FULL
(defined
in java.util.DateFormat
).
For the locale, you can use Locale.getDefault()
for the
default locale.
style
- the date style.locale
- the locale.Jas4pp 1.5 © Java Analysis Studio for Particle Physics