|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.quinncurtis.chart3djava.ChartObj
com.quinncurtis.chart3djava.ChartScale
com.quinncurtis.chart3djava.TimeScale
public class TimeScale
The TimeScale class implements a time based coordinate system for a single coordinate, x or y. Two such scales are used to provide the scaling routines for x and/or y in an PhysicalCoordinates derived class, TimeCoordinates, for example.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
TimeScale()
The default TimeScale constructor . |
|
TimeScale(java.util.GregorianCalendar startdate,
java.util.GregorianCalendar stopdate)
An TimeScale constructor is used to initialize the scale using a starting date and an ending date. |
|
TimeScale(int timeaxis)
An TimeScale constructor is used to initialize the scale for a specific axis. |
|
TimeScale(int timeaxis,
java.util.GregorianCalendar startdate,
java.util.GregorianCalendar stopdate)
An TimeScale constructor is used to initialize the scale using a starting date and an ending date. |
|
TimeScale(int timeaxis,
long nstartdate,
long nstopdate)
An TimeScale constructor is used to initialize the scale using a starting date and an ending date, both specified in milliseconds . |
|
TimeScale(long nstartdate,
long nstopdate)
An TimeScale constructor is used to initialize the scale using a starting date and an ending date, both specified in milliseconds . |
|
| Method Summary | |
|---|---|
void |
adjustTimeScaleEndpoints()
This method adjust the starting and ending dates of the scale, making sure that the dates do not fall on a weekend if the WEEK_5D mode is set. |
long |
calendarSecsDiff(java.util.GregorianCalendar datestart,
java.util.GregorianCalendar datestop)
Calculates the number of seconds between two GregorianCalendar dates, taking into account if the 5- or 7-day weeks, and days that have less than 24 hours. |
double |
checkTimeValue(java.util.GregorianCalendar cdate)
This method checks to see if the specified date is valid and returns a double values that represents the number of milliseconds in the date if the date is valid,, or the ChartSupport.rBarDataValue otherwise. |
double |
checkTimeValue(long ndate)
This method checks to see if the specified date is valid and returns a double values that represents the number of milliseconds in the date if the date is valid, or the ChartSupport.rBarDataValue otherwise. |
java.lang.Object |
clone()
Returns an object that is a clone of this TimeScale object. |
double |
coordinateAdd(double rdatevalue1,
double rsecs)
This method adds two values in the current physical coordinates. |
void |
copy(TimeScale source)
Copies the source scale. |
int |
errorCheck(int nerror)
Checks the current scale object for common errors. |
AutoScale |
getCompatibleAutoScale()
This method returns an AutoScale object that is compatible with this TimeScale object, an TimeAutoScale object. |
Axis |
getCompatibleAxis()
This method returns an Axis object that is compatible with this TimeScale object, an TimeAxis object. |
long |
getCountedDays()
This method returns the number of full days between the starting and ending date. |
long |
getMillisecondsPerDay()
This method returns the number of seconds in a day, taking into account non-24 hour day modes. |
java.util.GregorianCalendar |
getScaleDateMax()
Gets the maximum value of the TimeCoordinates time scale. |
java.util.GregorianCalendar |
getScaleDateMin()
Gets the minimum value of the TimeCoordinates time scale. |
java.util.GregorianCalendar |
getScaleDateStart()
This method returns the starting date of the time scale. |
java.util.GregorianCalendar |
getScaleDateStop()
This method returns the ending date of the time scale. |
long |
getScaleStartTOD()
This method returns the starting TOD value for the time scale. |
long |
getScaleStopTOD()
This method returns the ending TOD value for the time scale. |
long |
getTotalMilliseconds()
This method returns the total number of milliseconds in the scale, taking into account non-24 hour day modes. |
int |
getWeekType()
This method returns the week type. |
boolean |
isContinuousTime()
Returns true if the time scale has continuous time. |
double |
physToWorkingScale(double v)
This method converts an x- or y-coordinate from physical coordinates to working coordinates. |
double |
physToWorkingScale(java.util.GregorianCalendar tval)
This method converts an x- or y-coordinate from physical coordinates to working coordinates. |
double |
physToWorkingScale(long v)
This method converts an x- or y-coordinate from physical coordinates to working coordinates. |
void |
setScaleDateStart(java.util.GregorianCalendar startdate)
Sets the starting date of the time scale. |
void |
setScaleDateStop(java.util.GregorianCalendar stopdate)
Sets the ending date of the time scale. |
void |
setScaleStartTOD(long starttime)
Sets the starting TOD value for the time scale. |
void |
setScaleStopTOD(long stoptime)
Sets the ending TOD value for the time scale. |
void |
setWeekType(int weektype)
Sets the week type. |
boolean |
timeValueGood(java.util.GregorianCalendar cdate)
This method checks to see if the specified date is valid, checking to see if it within the specified time of day limits. |
boolean |
timeValueGood(long ndate)
This method checks to see if the specified date is valid, checking to see if it within the specified time of day limits. |
double |
workingToPhysScale(double v)
This method converts an x- or y-coordinate from working coordinates to physical coordinates. |
void |
workingToPhysScale(java.util.GregorianCalendar d,
double v)
This method converts an x- or y-coordinate from working coordinates to physical coordinates. |
| Methods inherited from class com.quinncurtis.chart3djava.ChartScale |
|---|
copy, getMax, getMidpoint, getMin, getRange, getScaleStart, getScaleStop, setRangeFromStart, setRangeFromStop, setScale, setScaleStart, setScaleStop |
| Methods inherited from class com.quinncurtis.chart3djava.ChartObj |
|---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimeScale()
public TimeScale(int timeaxis)
timeaxis - Specifies what axis the time scale is for. Use one of the axis constants:
X_AXIS or Y_AXIS.
public TimeScale(java.util.GregorianCalendar startdate,
java.util.GregorianCalendar stopdate)
startdate - The starting date of the scale.stopdate - The ending date of the scale.
public TimeScale(int timeaxis,
java.util.GregorianCalendar startdate,
java.util.GregorianCalendar stopdate)
timeaxis - Specifies what axis the time scale is for. Use one of the axis constants:
X_AXIS or Y_AXIS.startdate - The starting date of the scale.stopdate - The ending date of the scale.
public TimeScale(long nstartdate,
long nstopdate)
nstartdate - The starting date of the scale.nstopdate - The ending date of the scale.
public TimeScale(int timeaxis,
long nstartdate,
long nstopdate)
timeaxis - Specifies what axis the time scale is for. Use one of the axis constants:
X_AXIS or Y_AXIS.nstartdate - The starting date of the scale.nstopdate - The ending date of the scale.| Method Detail |
|---|
public int errorCheck(int nerror)
errorCheck in class ChartScalenerror - Current error state
public void copy(TimeScale source)
source - The source scale object.public java.lang.Object clone()
clone in class ChartScalepublic AutoScale getCompatibleAutoScale()
getCompatibleAutoScale in class ChartScalepublic Axis getCompatibleAxis()
getCompatibleAxis in class ChartScalepublic boolean timeValueGood(java.util.GregorianCalendar cdate)
cdate - The date that is checked.
public boolean timeValueGood(long ndate)
ndate - The date, in milliseconds, that is checked.
public double checkTimeValue(long ndate)
ndate - The date, in milliseconds, that is checked.
public double checkTimeValue(java.util.GregorianCalendar cdate)
cdate - The date that is checked.
public double physToWorkingScale(double v)
physToWorkingScale in class ChartScalev - The coordinate value that is converted from physical coordinates to working coordinates.
public double workingToPhysScale(double v)
workingToPhysScale in class ChartScalev - The coordinate value that is converted from working coordinates to physical coordinates.
public double physToWorkingScale(long v)
v - The coordinate value that is converted from physical coordinates to working coordinates.
public double physToWorkingScale(java.util.GregorianCalendar tval)
tval - The coordinate value that is converted from physical coordinates to working coordinates.
public void workingToPhysScale(java.util.GregorianCalendar d,
double v)
v - The coordinate value that is converted from working coordinates to physical coordinates.d - Returns the value of the coordinate in physical coordinates as a GregorianCalendar date.public void adjustTimeScaleEndpoints()
public double coordinateAdd(double rdatevalue1,
double rsecs)
coordinateAdd in class ChartScalerdatevalue1 - The source coordinate value that is added to.rsecs - This value is added to the source value, in milliseconds.
public long calendarSecsDiff(java.util.GregorianCalendar datestart,
java.util.GregorianCalendar datestop)
datestart - The starting date.datestop - The ending date.
public void setScaleStartTOD(long starttime)
starttime - Sets the starting TOD value for the time scale.public void setScaleStopTOD(long stoptime)
stoptime - Sets the ending TOD value for the time scale.public long getScaleStartTOD()
public long getScaleStopTOD()
public void setScaleDateStart(java.util.GregorianCalendar startdate)
startdate - The starting date of the scale.public void setScaleDateStop(java.util.GregorianCalendar stopdate)
stopdate - The ending date of the scale.public java.util.GregorianCalendar getScaleDateStart()
public java.util.GregorianCalendar getScaleDateStop()
public void setWeekType(int weektype)
weektype - Sets the week type.public int getWeekType()
public long getCountedDays()
public long getMillisecondsPerDay()
public long getTotalMilliseconds()
public java.util.GregorianCalendar getScaleDateMin()
public java.util.GregorianCalendar getScaleDateMax()
public boolean isContinuousTime()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||