public class IlvQuarterTimeScaleRow extends IlvBasicTimeScaleRow
IlvBasicTimeScaleRow to provide a complete scale displaying
quarter intervals.
By default, each quarter interval is displayed with a text partly formatted
using a java.text.SimpleDateFormat created with the "yyyy"
string.
The exact result depends on the year mode and on the string chosen to
display the "Quarter" text.
For example, by default, if year mode is set, the result will be
"Qtr. 1 1998" for January 1998.
The Quarter timescale row supports alternate locales by utilizing resource files. The resource files are documented here.
LEADING_TICKBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| Constructor and Description |
|---|
IlvQuarterTimeScaleRow()
This constructor creates and initializes an
IlvQuarterTimeScaleRow object. |
| Modifier and Type | Method and Description |
|---|---|
protected String |
computeDateText(Date time)
Computes and returns the text that should be drawn for the interval
beginning at the specified
time. |
protected IlvTimeIncrementPolicy |
createTimeIncrementPolicy()
Creates the time increment policy for the row.
|
String |
getQuarterLongString()
Returns the string that will be used in non-year mode.
|
String |
getQuarterShortString()
Returns the string that will be used in year mode.
|
boolean |
isYearMode()
Returns whether the displayed label contains the year or not.
|
void |
setQuarterLongString(String str)
Sets the string that will be used in non-year mode.
|
void |
setQuarterShortString(String str)
This method sets the string that will be used in year mode.
|
void |
setYearMode(boolean val)
Toggles the year mode to display labels.
|
getAdditionalString, getDateFormat, getFormatString, getHeight, getIntervalMinWidth, getPreferredHeight, getTextColor, getTextFont, getTextPosition, getTickColor, getTimeIncrementPolicy, incrementTime, invalidateDateTextCache, isOverlappingLabelAllowed, nextUnitTime, paint, paintRow, paintText, paintText, paintTick, paintTick, previousUnitTime, setAdditionalString, setFormatString, setHeight, setIntervalMinWidth, setOverlappingLabelAllowed, setTextColor, setTextFont, setTextPosition, setTickColorgetComponentOrientation, getLocale, getTimeScale, getULocale, isVisible, setVisiblepublic IlvQuarterTimeScaleRow()
IlvQuarterTimeScaleRow object.public void setYearMode(boolean val)
If the val argument is true, the label is displayed as
follows:
Qtr. 1 1998
Otherwise, it will be displayed like this : Quarter 1
By default, val is true.
val - the value of the year mode.setQuarterShortString(java.lang.String),
setQuarterLongString(java.lang.String)public boolean isYearMode()
setYearMode(boolean)public void setQuarterShortString(String str)
str - The string to be set.setYearMode(boolean)public String getQuarterShortString()
setQuarterShortString(java.lang.String)public void setQuarterLongString(String str)
str - The string to be set.setYearMode(boolean)public String getQuarterLongString()
setQuarterLongString(java.lang.String)protected IlvTimeIncrementPolicy createTimeIncrementPolicy()
IlvTimeIncrementPolicy.Month that has a
monthStep
value of 3.createTimeIncrementPolicy in class IlvBasicTimeScaleRowIlvBasicTimeScaleRow.getTimeIncrementPolicy()protected String computeDateText(Date time)
time. The row's current
DateFormat is used to format the time.
IlvBasicTimeScaleRow.invalidateDateTextCache()
must be invoked whenever a row property changes which affects how this
method formats the text.computeDateText in class IlvBasicTimeScaleRowtime - The start time of the scale interval.IlvBasicTimeScaleRow.getDateFormat()© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.