|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.GraphObj
com.quinncurtis.chart2djava.ChartText
com.quinncurtis.chart2djava.ChartLabel
com.quinncurtis.chart2djava.TimeLabel
public class TimeLabel
The TimeLabel class is used to format GregorianCalendar objects as strings and position in a chart.
Field Summary |
---|
Constructor Summary | |
---|---|
TimeLabel()
The default TimeLabel constructor. |
|
TimeLabel(int timeformat)
This constructor creates a new TimeLabel object using the specified format. |
|
TimeLabel(PhysicalCoordinates transform)
This constructor creates a new TimeLabel object using the specified scale. |
|
TimeLabel(PhysicalCoordinates transform,
java.awt.Font tfont,
java.util.GregorianCalendar date,
double x,
double y,
int npostype,
int timeformat,
int xjust,
int yjust,
double rotation)
This constructor creates a new TimeLabel object using the specified scale, and initializes it with the specified calendar value and format. |
|
TimeLabel(PhysicalCoordinates transform,
java.util.GregorianCalendar date,
int timeformat)
This constructor creates a new TimeLabel object using the specified scale, and initializes it with the specified calendar value and format. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns an object that is a clone of this TimeLabel object. |
void |
copy(TimeLabel source)
Copies the source TimeLabel object. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the TimeLabel object for common errors. |
int |
getCrossoverTimeFormat()
Returns the current crossover time format. |
java.lang.String |
getCustomTimeFormatStrings()
This methods returns the custom format string for converting GregorianCalendar dates to text strings. |
java.lang.String |
getTextString()
This method returns current time value as a formatted string. |
int |
getTimeFormat()
Returns the current time format. |
java.lang.String |
getTimeFormatStrings(int index)
This methods returns the time/date format string at a specific index. |
double |
getTimeNumericValue()
Returns the current time value in milliseconds. |
java.util.GregorianCalendar |
getTimeValue()
Returns the current time value as a GregorianCalendar date. |
void |
makeLabel()
This method converts current time value to a formatted string, using the current time format, storing the result in the underlying ChartLabel.ChartText.textString |
void |
setCrossoverTimeFormat(int nformat)
Sets the current crossover time format. |
void |
setCustomTimeFormatString(java.lang.String formatstring1)
This methods sets the custom format string for converting GregorianCalendar dates to text strings. |
void |
setTimeFormat(int nformat)
Sets the current time format. |
void |
setTimeFormatStrings(int index,
java.lang.String formatstring1)
This methods sets the time/date format string at a specific index in the timeFormatString array. |
void |
setTimeNumericValue(double rvalue)
Sets the current time value using milliseconds. |
void |
setTimeValue(java.util.GregorianCalendar tdate)
Sets the current time value using a GregorianCalendar date. |
Methods inherited from class com.quinncurtis.chart2djava.ChartLabel |
---|
copy, setLabels, TypeSafeVectorCopy |
Methods inherited from class com.quinncurtis.chart2djava.ChartText |
---|
addNewLineTextString, checkIntersection, copy, drawText, drawTextBox, getLineLeading, getMultilineSubstring, getNumLines, getResizedTextFont, getTextBgColor, getTextBgMode, getTextBox, getTextBoxColor, getTextBoxMode, getTextDimension, getTextFont, getTextMaxSizeY, getTextNudge, getTextRotation, getTextSizeX, getTextSizeY, getXJust, getYJust, initChartText, preCalcTextBoundingBox, setLineLeading, setResizedTextFont, setTextBgColor, setTextBgMode, setTextBoxColor, setTextBoxMode, setTextFont, setTextNudge, setTextNudge, setTextRotation, setTextString, setXJust, setYJust, TypeSafeVectorCopy |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeLabel()
public TimeLabel(int timeformat)
timeformat
- The format used to convert the calendar value to a text string. Use one of
the calendar format constants, TIMEDATEFORMAT_XXX.public TimeLabel(PhysicalCoordinates transform)
transform
- The text object is placed in the coordinate system defined by transform.public TimeLabel(PhysicalCoordinates transform, java.awt.Font tfont, java.util.GregorianCalendar date, double x, double y, int npostype, int timeformat, int xjust, int yjust, double rotation)
transform
- The text object is placed in the coordinate system defined by transform.tfont
- A reference to a Font object.date
- The calendar value used to initialize the label.x
- Specifies the x-value of the text positiony
- Specifies the y-value of the text positionnpostype
- Specifies the if the position of the text is specified in physical coordinates,
normalized coordinates or window device coordinates. Use one of the position constants: DEV_POS, PHYS_POS,
NORM_GRAPH_POS, NORM_PLOT_POS.timeformat
- The format used to convert the calendar value to a text string. Use one of the
calendar format constants, TIMEDATEFORMAT_XXX.xjust
- Specifies the horizontal justification of the text. Use one of the text justification
constants: JUSTIFY_MIN, JUSTIFY_CENTER or JUSTIFY_MAX.yjust
- Specifies the vertical justification of the text. Use one of the text justification
constants: JUSTIFY_MIN, JUSTIFY_CENTER or JUSTIFY_MAX.rotation
- The rotation (-360 to 360 degrees) of the text in the normal viewing plane.public TimeLabel(PhysicalCoordinates transform, java.util.GregorianCalendar date, int timeformat)
transform
- The text object is placed in the coordinate system defined by transform.date
- The calendar value used to initialize the label.timeformat
- The format used to convert the calendar value to a text string. Use one
of the calendar format constants, TIMEDATEFORMAT_XXX.Method Detail |
---|
public java.lang.Object clone()
clone
in class ChartText
public void copy(TimeLabel source)
source
- The source TimeLabel object.public void draw(java.awt.Graphics2D g2)
draw
in class ChartText
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class ChartLabel
nerror
- Current error state
public int getCrossoverTimeFormat()
public java.lang.String getCustomTimeFormatStrings()
public java.lang.String getTextString()
getTextString
in class ChartText
public int getTimeFormat()
public java.lang.String getTimeFormatStrings(int index)
index
- The index of the string to return.
public double getTimeNumericValue()
public java.util.GregorianCalendar getTimeValue()
public void makeLabel()
makeLabel
in class ChartLabel
public void setCrossoverTimeFormat(int nformat)
nformat
- Sets the current time format.public void setCustomTimeFormatString(java.lang.String formatstring1)
formatstring1
- Specifies the custom time/date format string.public void setTimeFormat(int nformat)
nformat
- Sets the current time format.public void setTimeFormatStrings(int index, java.lang.String formatstring1)
index
- The index of the string to set.formatstring1
- Specifies the new time/date format string.public void setTimeNumericValue(double rvalue)
rvalue
- Sets the current time value using milliseconds.public void setTimeValue(java.util.GregorianCalendar tdate)
tdate
- The time value of the label.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |