public interface IGanttPropertySet
The axis scales can be set using the time based class "java.util.Date" and/or its extended classes: "java.sql.Date", "java.sql.Time", and "java.sql.Timestamp". Setting the axis scales when the labels are displayed in the numeric format can be done through the IAxis class. The handle to it can be obtained by calling the gethXAxis method. eg. IAxis xAxis = chart.gethXAxis().
Graphics needs to be initialized before the "get" methods for the axis scaling can be called. Otherwise, the methods would return the perspective default values.
eg.Frame frame = new Frame(); frame.addNotify(); // draw a frame chart of the same size as the chart chart.draw(frame.getGraphics(), frame, 500, 400); frame.removeNotify();
Modifier and Type | Method and Description |
---|---|
IFormat |
getAxisLabelFormat()
Returns the IFormat object that is used for formatting the value axis labels.
|
long |
getMaxScale()
Returns the maximum scale milliseconds value that was defined for this axis.
|
long |
getMinScale()
Returns the minimum scale milliseconds value that was defined for this axis.
|
long |
getScaleStep()
Returns the scaleStep milliseconds value that was defined for this axis.
|
boolean |
isArrowsDrawn()
Returns the state of the arrows that link Gantt chart data.
|
boolean |
isDateTimeDisplay()
Returns the state of value axis label display in DateTimeFormat, as opposed to NumericFormat.
|
boolean |
isDisplayByWeek()
Returns the state of the x-axis label display in day of the week fashion.
|
boolean |
isOriginAutomatic()
This function is used to check if the origin is calculated automatically or not
|
boolean |
isScaleAutomatic()
This function is used to check if the scale min, max, and step sizes are calculated
automatically or not.
|
boolean |
isTranslucent()
Returns if translucent GIF is used.
|
void |
setArrowsDrawn(boolean state)
Sets the state of the arrows that link Gantt chart data.
|
void |
setAxisLabelFormat(IFormat format)
Specifies the IFormat object to be used for formatting the value axis labels.
|
void |
setDateTimeDisplay(boolean state)
Specifies the if the value axis labels are displayed in the DateTimeFormat
|
void |
setDisplayByWeek(boolean state)
Sets the state of the x-axis label display in day of the week fashion.
|
void |
setMaxScale(java.util.Date maxScale)
Sets the maximum scale value for this axis.
|
void |
setMinScale(java.util.Date minScale)
Sets the minimum scale value for this axis.
|
void |
setOriginAutomatic(boolean b)
This function is used to enable/disable auto calculation of origin.
|
void |
setScaleAutomatic(boolean b)
This function is used to enable/disable auto calculation of scales.
|
void |
setScaleStep(java.util.Date scaleStep)
Sets the scalestep value for this axis.
|
void |
setScaleStep(int yr,
int mo,
int dd,
int hr,
int min)
Sets the scalestep value for this axis.
|
void |
setTranslucent(boolean state)
Specifies if translucent GIF is used.
|
boolean isTranslucent()
void setTranslucent(boolean state)
state
- the new state, default is false.boolean isDateTimeDisplay()
void setDateTimeDisplay(boolean state)
state
- the new state, default is true.IFormat getAxisLabelFormat()
void setAxisLabelFormat(IFormat format)
boolean isOriginAutomatic()
void setOriginAutomatic(boolean b)
b
- True if auto origin is desired, false otherwise.boolean isScaleAutomatic()
void setScaleAutomatic(boolean b)
b
- True if auto scale is desired, false otherwise.long getMinScale()
void setMinScale(java.util.Date minScale)
minScale
- The minimum scale to use.long getMaxScale()
void setMaxScale(java.util.Date maxScale)
maxScale
- The maximum scale to use.long getScaleStep()
void setScaleStep(java.util.Date scaleStep)
Note on setting scalestep in units of "days":
Use "setScaleStep(new java.util.Date(70, 0, D, 24 + Offset, 0, 0));" to set the scalestep to
"D" number of days, where "Offset" is the offset from the GMT. For example, to have a scale
step of 1 day when you are in the locale of Pacific Standard Timezone--GMT offset is "-8",
the constructor to use is "new java.util.Date(70, 0, 1, 16, 0, 0)".
Note on setting scalestep in units of "hours":
Use "setScaleStep(new java.sql.TimeStamp(H + Offset, 0, 0);" to set the scalestep to "H"
number of hours, where "Offset" is the offset from the GMT. For example, to have a scalestep
of 12 hours when you are in the Pacific Standard Timezone--where GMT offset is "-8", the
TimeStamp constructor to use is "new java.sql.TimeStamp(4,0,0)".
Alternatively, you may turn the time zone offset off with the following code snippet. You do not need to correct JDK1.2 GMT offset as explained in the previous two paragraphs if you insert the following code in the beginning of your program.
// Turn TimeZone Off SimpleTimeZone timeZone = new SimpleTimeZone(0, //set the RawOffset to 0, TimeZone.getDefault().getID()); TimeZone.setDefault(timeZone);
scaleStep
- The scalestep to use.void setScaleStep(int yr, int mo, int dd, int hr, int min)
yr
- The scalestep in yearmo
- The scalestep in monthdd
- The scalestep in dayhr
- The scalestep in hourmin
- The scalestep in minuteboolean isDisplayByWeek()
void setDisplayByWeek(boolean state)
state
- the new state.boolean isArrowsDrawn()
void setArrowsDrawn(boolean state)
state
- the new state.