T
- the type of the granularity objectpublic interface IDatelineModel<T extends IGranularity>
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
int |
getSpreadsheetCellWidth()
Returns the width used for spreadsheet cells.
|
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.
|
String |
getTimeString(long time)
Returns a textual representation for the givent time point.
|
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 |
setSpreadsheetCellWidth(int width)
Sets the width used for spreadsheet cells.
|
void |
setTimeSpan(ITimeSpan span)
Sets the total time span covered by the model / dateline.
|
void |
setTimeZone(TimeZone timeZone)
Sets the time zone represented by the dateline.
|
void |
setZoom(double zoom)
Sets a zoom factor on the model / dateline.
|
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 datelineDatelineModelException
getTimeSpan()
void setGranularity(T granularity) throws DatelineModelException
granularity
- the granularity requested for the minor time gridDatelineModelException
- if the requested time granularity can not be appliedT getGranularity()
TimeZone getTimeZone()
setTimeZone(TimeZone)
void setTimeZone(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 factorDatelineModelException
- if the requested zoom factor can not be appliedgetZoom()
double getZoom()
setZoom(double)
void setSpreadsheetCellWidth(int width) throws DatelineModelException
width
- the cell width used when showing a spreadsheetDatelineModelException
- if the cell width causes a conflictint getSpreadsheetCellWidth()
int getTimeLocation(long time)
getTimeAt(int)
method (example: x = getTimeLocation(getTimeAt(x))
).time
- the time for which to return a coordinategetTimeAt(int)
long getTimeAt(int x)
x
- the x-coordinate for which to return a time pointgetTimeLocation(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 datelineString getTimeString(long time)
time
- the time for which to return a textual representationITimeSpan getSelectedTimeSpan()
setSelectedTimeSpan(ITimeSpan)
void setSelectedTimeSpan(ITimeSpan span)
span
- the selected time spangetSelectedTimeSpan()
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 linesGridLayer
void requestVisibleTimeSpan(ITimeSpan span) throws DatelineModelException
span
- the requested time spanDatelineModelException
- 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)
Copyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.