|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.AbstractTitle | +--com.jrefinery.chart.TextTitle | +--com.jrefinery.chart.DateTitle
DateTitle (an extension of TextTitle) is a simple convenience class to easily add the text of the date to a chart. 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.
Fields inherited from class com.jrefinery.chart.TextTitle |
DEFAULT_FONT, DEFAULT_TEXT_PAINT |
Fields inherited from class com.jrefinery.chart.AbstractTitle |
BOTTOM, CENTER, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_POSITION, DEFAULT_SPACER, DEFAULT_VERTICAL_ALIGNMENT, EAST, LEFT, MIDDLE, NORTH, RIGHT, SOUTH, TOP, WEST |
Constructor Summary | |
DateTitle()
Constructs a new DateTitle that displays the current date in the default (LONG) format for the locale, positioned to the bottom right of the chart. |
|
DateTitle(int style)
Constructs a new DateTitle with the specified style (for the default locale). |
|
DateTitle(int style,
java.util.Locale locale,
java.awt.Font font,
java.awt.Paint paint)
Constructs a new DateTitle object with the specified attributes and the following defaults: |
|
DateTitle(int style,
java.util.Locale locale,
java.awt.Font font,
java.awt.Paint paint,
int position,
int horizontalAlignment,
int verticalAlignment,
Spacer spacer)
Constructs a new DateTitle with the specified attributes. |
Method Summary | |
void |
setDateFormat(int style,
java.util.Locale locale)
Set the format of the date. |
Methods inherited from class com.jrefinery.chart.TextTitle |
draw, drawHorizontal, getFont, getPaint, getPreferredHeight, getPreferredWidth, getText, isValidPosition, setFont, setPaint, setText |
Methods inherited from class com.jrefinery.chart.AbstractTitle |
addChangeListener, clone, getHorizontalAlignment, getNotify, getPosition, getSpacer, getVerticalAlignment, isValidHorizontalAlignment, isValidVerticalAlignment, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setSpacer, setVerticalAlignment |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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, java.util.Locale locale, java.awt.Font font, java.awt.Paint paint)
location = BOTTOM, alignment = RIGHT, insets = new Insets(2, 2, 2, 2).
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, java.util.Locale locale, java.awt.Font font, java.awt.Paint paint, int position, int horizontalAlignment, int verticalAlignment, Spacer spacer)
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.position
- the relative location of this title (use constants in AbstractTitle).horizontalAlignment
- the horizontal text alignment of this title (use constants
in AbstractTitle).verticalAlignment
- the vertical text alignment of this title (use constants in
AbstractTitle).spacer
- determines the blank space around the outside of the title.Method Detail |
public void setDateFormat(int style, java.util.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |