|
|||||||||
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.Axis
com.quinncurtis.chart2djava.TimeAxis
public class TimeAxis
The TimeAxis class implements a linear axis that has major and minor tick marks at time and date intervals. It is a concrete subclass of the abstract Axis class.
Field Summary |
---|
Constructor Summary | |
---|---|
TimeAxis()
The default TimeAxis constructor. |
|
TimeAxis(TimeCoordinates transform)
This constructor creates a new TimeAxis object and scales it to match the minimum and maximum values of the specified TimeCoordinates object. |
|
TimeAxis(TimeCoordinates transform,
java.util.GregorianCalendar dstart,
java.util.GregorianCalendar dstop)
This constructor creates a new TimeAxis object and scales it to match the specified calendar values. |
|
TimeAxis(TimeCoordinates transform,
int axtype)
This constructor creates a new TimeAxis object using the specified tick mark time base and minor tick mark interval and scales it to match the minimum and maximum values of the specified TimeCoordinates object. |
|
TimeAxis(TimeCoordinates transform,
int axtype,
int ntickmarkbase)
This constructor creates a new TimeAxis object using the specified tick mark time base and minor tick mark interval and scales it to match the minimum and maximum values of the specified TimeCoordinates object. |
|
TimeAxis(TimeCoordinates transform,
int axtype,
int ntickmarkbase,
int nminornthtick)
This constructor creates a new TimeAxis object using the specified tick mark time base and minor tick mark interval and scales it to match the minimum and maximum values of the specified TimeCoordinates object. |
Method Summary | |
---|---|
void |
calcAutoAxis()
This auto-axis method uses the current minimum and maximum values in the theTimeCoords.theTimeScale object to determine the minimum and maximum value for the axis, and the appropriate minor and major tick mark spacing. |
void |
calcAutoAxis(java.util.GregorianCalendar dstart,
java.util.GregorianCalendar dstop)
This auto-axis method uses the current minimum and maximum values in the theTimeCoords.theTimeScale object to determine the minimum and maximum value for the axis, and the appropriate minor and major tick mark spacing. |
int |
calcAxisLabelsDecimalPos()
Returns an integer value that is the number of digits that should be displayed to the right of the decimal point when labeling the major axis tick marks. |
boolean |
checkIntersection(ChartPoint2D testpoint,
NearestPointData np)
The checkIntersection method. |
java.lang.Object |
clone()
Returns an object that is a clone of this TimeAxis object. |
void |
copy(TimeAxis source)
Copies the source axis. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the current axis object for common errors. |
int |
getAxisTickMarkTimeBase()
Returns the time axis tick mark time super. |
double |
getAxisTickSpace()
Returns the minor tick mark spacing. |
AxisLabels |
getCompatibleAxisLabels()
This method returns an AxisLabels object that is compatible with this TimeAxis object. |
java.util.GregorianCalendar |
getTimeAxisMax()
Returns the time axis ending date value. |
java.util.GregorianCalendar |
getTimeAxisMin()
Returns the time axis starting date value. |
TimeCoordinates |
getTimeCoordinates()
Returns the current coordinate system as TimeCoordinates object. |
java.util.GregorianCalendar |
getTimeLabelsOrigin()
Returns the time axis tick mark origin. |
void |
initTimeAxis(TimeCoordinates transform,
int axtype)
This method initializes a new TimeAxis object and scales it to match the minimum and maximum values of the specified TimeCoordinates object. |
void |
setAxisTickMarkTimeBase(int ntickmarkbase)
Sets the time axis tick mark time super. |
void |
setAxisTickSpace(double tickspace)
Sets the minor tick mark spacing, used only in millisecond mode. |
void |
setTimeAxisMax(java.util.GregorianCalendar stop)
Sets the time axis ending date value. |
void |
setTimeAxisMin(java.util.GregorianCalendar start)
Sets the time axis starting date value. |
void |
setTimeLabelsOrigin(java.util.GregorianCalendar origin)
Sets the time axis tick mark origin. |
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 TimeAxis()
public TimeAxis(TimeCoordinates transform)
transform
- Sets the minimum and maximum value of the axis to the associated minimum and
maximum value of the coordinate system transform.public TimeAxis(TimeCoordinates transform, java.util.GregorianCalendar dstart, java.util.GregorianCalendar dstop)
transform
- Sets the minimum and maximum value of the axis to the associated minimum and
maximum value of the coordinate system transform.dstart
- Specifies the starting calendar value.dstop
- Specifies the ending calendar value.public TimeAxis(TimeCoordinates transform, int axtype)
transform
- Sets the minimum and maximum value of the axis to the associated minimum and
maximum value of the coordinate system transform.axtype
- Specifies if the axis is an x-axis (X_AXIS), or a y-axis (Y_AXIS).public TimeAxis(TimeCoordinates transform, int axtype, int ntickmarkbase)
transform
- Sets the minimum and maximum value of the axis to the associated minimum and
maximum value of the coordinate system transform.axtype
- Specifies if the axis is an x-axis (X_AXIS), or a y-axis (Y_AXIS).ntickmarkbase
- This field defines the major and minor tick mark spacing for a time axis.
Use one of the Time/Date axis tick mark mode constants : TIMEAXIS_SECOND ... TIMEAXIS_50YEAR10YEAR.public TimeAxis(TimeCoordinates transform, int axtype, int ntickmarkbase, int nminornthtick)
transform
- Sets the minimum and maximum value of the axis to the associated minimum and
maximum value of the coordinate system transform.axtype
- Specifies if the axis is an x-axis (X_AXIS), or a y-axis (Y_AXIS).ntickmarkbase
- This field defines the major and minor tick mark spacing for a time axis.
Use one of the Time/Date axis tick mark mode constants : TIMEAXIS_SECOND ... TIMEAXIS_50YEAR10YEAR.nminornthtick
- Draws every nminornthtick when drawing the tick marks for time axes (TimeAxis)
where the number of minor tick marks between major tick marks is larger than what is wanted.Method Detail |
---|
public void calcAutoAxis()
calcAutoAxis
in class Axis
public void calcAutoAxis(java.util.GregorianCalendar dstart, java.util.GregorianCalendar dstop)
dstart
- Sets the time axis starting date value.dstop
- Sets the time axis ending date value.public int calcAxisLabelsDecimalPos()
calcAxisLabelsDecimalPos
in class Axis
public boolean checkIntersection(ChartPoint2D testpoint, NearestPointData np)
checkIntersection
in class Axis
testpoint
- The test pointnp
- Nearest point information for data based objects.
public java.lang.Object clone()
clone
in class GraphObj
public void copy(TimeAxis source)
source
- The source axis object.public void draw(java.awt.Graphics2D g2)
draw
in class GraphObj
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class Axis
nerror
- Current error state
public int getAxisTickMarkTimeBase()
public double getAxisTickSpace()
public AxisLabels getCompatibleAxisLabels()
getCompatibleAxisLabels
in class Axis
public java.util.GregorianCalendar getTimeAxisMax()
public java.util.GregorianCalendar getTimeAxisMin()
public TimeCoordinates getTimeCoordinates()
public java.util.GregorianCalendar getTimeLabelsOrigin()
public void initTimeAxis(TimeCoordinates transform, int axtype)
transform
- Sets the minimum and maximum value of the axis to the associated minimum and
maximum value of the coordinate system transform.axtype
- Specifies if the axis is an x-axis (X_AXIS), or a y-axis (Y_AXIS).public void setAxisTickMarkTimeBase(int ntickmarkbase)
ntickmarkbase
- Sets the time axis tick mark time super.public void setAxisTickSpace(double tickspace)
tickspace
- Sets the minor tick mark spacing.public void setTimeAxisMax(java.util.GregorianCalendar stop)
stop
- Sets the time axis ending date value.public void setTimeAxisMin(java.util.GregorianCalendar start)
start
- Sets the time axis starting date value.public void setTimeLabelsOrigin(java.util.GregorianCalendar origin)
origin
- Sets the time axis tick mark origin.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |