|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of the granularity objectpublic interface IDatelineModel<T extends IGranularity>
A dateline model provides essential information for the dateline, the dateline renderer, the grid layer. The model can be queried to translate coordinates to time points and time points to coordinates. The time span in combination with the dateline width are used as a basis for the calculations required to perform the translations. The time zone is used to calculate the offset between the data stored on the Gantt chart nodes (each node can have its own time zone) and the time that is shown in the dateline.
Method Summary | |
---|---|
void |
addDatelineModelListener(IDatelineModelListener l)
Adds a listener to the dateline model. |
int |
getDatelineWidth()
Returns the width of the dateline that is required based on the current settings of the dateline model. |
T |
getGranularity()
Returns the time granularity that the dateline model is using for calculating its minor grid. |
java.util.List<GridLine> |
getGrid(int x1,
int x2,
boolean major)
Returns a list of grid line coordinates for the given coordinate interval. |
ITimeSpan |
getSelectedTimeSpan()
Returns the currently selected time span. |
long |
getTimeAt(int x)
Returns the time for the given x-coordinate. |
int |
getTimeLocation(long time)
Returns the location of the given time point. |
ITimeSpan |
getTimeSpan()
Returns the total time span covered by the model / dateline. |
ITimeSpan |
getTimeSpanAt(int x,
boolean major)
Returns the time span that gets defined by the grid lines to the left and the right of the given x-coordinate. |
java.lang.String |
getTimeString(long time)
Returns a textual representation for the givent time point. |
java.util.TimeZone |
getTimeZone()
Returns the time zone represented by the dateline. |
double |
getZoom()
Returns the zoom factor of the model / dateline. |
void |
removeDatelineModelListener(IDatelineModelListener l)
Removes a listener from the dateline model. |
void |
requestVisibleTimeSpan(ITimeSpan span)
A request that asks the model to change its settings in such a way that the requested time span will become visible in the viewport on the right-hand side of the Gantt chart. |
void |
setGranularity(T granularity)
Specifies the time granularity that the dateline model should use for calculating its minor grid. |
void |
setSelectedTimeSpan(ITimeSpan span)
Sets a time span selection. |
void |
setTimeSpan(ITimeSpan span)
Sets the total time span covered by the model / dateline. |
void |
setTimeZone(java.util.TimeZone timeZone)
Sets the time zone represented by the dateline. |
void |
setZoom(double zoom)
Sets a zoom factor on the model / dateline. |
Method Detail |
---|
ITimeSpan getTimeSpan()
TimeGranularityDatelineModel
for example uses the currently used TimeGranularity
while the
SimpleGranularityDatelineModel
uses the currently active
SimpleGranularity
.
setTimeSpan(ITimeSpan)
void setTimeSpan(ITimeSpan span) throws DatelineModelException
TimeGranularityDatelineModel
for example uses the currently used TimeGranularity
while the
SimpleGranularityDatelineModel
uses the currently active
SimpleGranularity
.
span
- the total time span covered by the dateline
DatelineModelException
getTimeSpan()
void setGranularity(T granularity) throws DatelineModelException
granularity
- the granularity requested for the minor time grid
DatelineModelException
- if the requested time granularity can not be appliedT getGranularity()
java.util.TimeZone getTimeZone()
setTimeZone(TimeZone)
void setTimeZone(java.util.TimeZone timeZone) throws DatelineModelException
timeZone
- the time zone represented by the dateline (model)
DatelineModelException
getTimeZone()
int getDatelineWidth()
void setZoom(double zoom) throws DatelineModelException
zoom
- the zoom factor
DatelineModelException
- if the requested zoom factor can not be appliedgetZoom()
double getZoom()
setZoom(double)
int getTimeLocation(long time)
getTimeAt(int)
method (example: x = getTimeLocation(getTimeAt(x))
).
time
- the time for which to return a coordinate
getTimeAt(int)
long getTimeAt(int x)
x
- the x-coordinate for which to return a time point
getTimeLocation(long)
ITimeSpan getTimeSpanAt(int x, boolean major)
x
- the location for which to return a time spanmajor
- a flag controlling whether to return the time span of the
major or the minor part of the dateline
java.lang.String getTimeString(long time)
time
- the time for which to return a textual representation
ITimeSpan getSelectedTimeSpan()
setSelectedTimeSpan(ITimeSpan)
void setSelectedTimeSpan(ITimeSpan span)
span
- the selected time spangetSelectedTimeSpan()
java.util.List<GridLine> getGrid(int x1, int x2, boolean major)
x1
- the start coordinatex2
- the end coordinatemajor
- if TRUE the method needs to return the major grid lines
GridLayer
void requestVisibleTimeSpan(ITimeSpan span) throws DatelineModelException
span
- the requested time span
DatelineModelException
- if the model can not satisfy the requestvoid addDatelineModelListener(IDatelineModelListener l)
l
- the listener to addremoveDatelineModelListener(IDatelineModelListener)
void removeDatelineModelListener(IDatelineModelListener l)
l
- the listener to removeaddDatelineModelListener(IDatelineModelListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |