public class Timeline extends
Modifier and Type | Class and Description |
---|---|
class |
Timeline.DateRange
DateRange contains a start date and an end date
|
static class |
Timeline.Options
Options for drawing the timeline.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PACKAGE |
Constructor and Description |
---|
Timeline()
Constructor
|
Timeline(AbstractDataTable data,
Timeline.Options options)
Constructor
|
Timeline(JavaScriptObject data,
Timeline.Options options)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addAddHandler(AddHandler handler)
Add an add handler.
|
void |
addChangeHandler(ChangeHandler handler)
Add a change handler.
|
void |
addDeleteHandler(DeleteHandler handler)
Add an delete handler.
|
void |
addEditHandler(EditHandler handler)
Add an edit handler.
|
void |
addItem(int index,
JavaScriptObject item)
Add an item to the timeline
|
void |
addRangeChangedHandler(RangeChangedHandler handler)
Add a changeranged handler.
|
void |
addRangeChangeHandler(com.google.gwt.visualization.client.events.RangeChangeHandler handler)
Add a changerange handler.
|
void |
addReadyHandler(com.google.gwt.visualization.client.events.ReadyHandler handler)
Add a ready handler.
|
void |
addSelectHandler(com.google.gwt.visualization.client.events.SelectHandler handler)
Add a select handler.
|
void |
addTimeChangedHandler(TimeChangedHandler handler)
Add a timechanged handler.
|
void |
addTimeChangeHandler(TimeChangeHandler handler)
Add a timechange handler.
|
void |
cancelAdd()
Cancel adding an event.
|
void |
cancelChange()
Cancel a change event.
|
void |
cancelDelete()
Cancel deleting an event.
|
void |
changeItem(int index,
JavaScriptObject item)
Update an existing item in the timeline
|
void |
checkResize()
Resize the timeline when the container element has been resized
|
protected JavaScriptObject |
createJso(Element parent) |
void |
deleteAllItems()
Delete all items from the Timeline
|
void |
deleteItem(int index)
Delete an item from the Timeline
|
void |
draw(JavaScriptObject data,
Timeline.Options options)
Draws the visualization.
|
java.util.Date |
getCustomTime()
Retrieve the custom time.
|
JavaScriptObject |
getData()
Get the current data from the Timeline
|
JavaScriptObject |
getItem(int index)
Get an item from the timeline
|
|
getSelections()
Returns a selection array containing the selected row
|
Timeline.DateRange |
getVisibleChartRange()
returns the current value of the start Date
|
void |
move(double moveFactor)
Move the timeline the given movefactor to the left or right.
|
protected void |
onLoad() |
void |
onResize() |
void |
redraw()
Reload data and redraw the timeline Remark: you can only use this
function after the timeline is drawn once
|
void |
setAutoScale(boolean enable)
Enable or disable autoscaling.
|
void |
setCurrentTime(java.util.Date time)
Set the current time in the timeline.
|
void |
setCustomTime(java.util.Date time)
Adjust the custom time in the timeline.
|
void |
setData(AbstractDataTable data)
Draw a new set of data in the timeline The current status of the timeline
will be preserved (in contrast with the method draw)
|
void |
setData(JavaScriptObject data)
Draw a new set of data in the timeline The current status of the timeline
will be preserved (in contrast with the method draw)
|
void |
setScale(Timeline.Options.SCALE scale,
double step)
Set a custom scale.
|
void |
setSelections(
Set a new selection
|
void |
setVisibleChartRange(java.util.Date start,
java.util.Date end)
Set a new start and end date Use the function redraw() to redraw after
changing the time
|
void |
setVisibleChartRangeAuto()
Move the visible range such that all loaded events are within the visible
range.
|
void |
setVisibleChartRangeNow()
Move the visible range such that the current time is located in the
center of the timeline.
|
void |
unselectItem()
Unselect the currently selected event (if any)
|
void |
zoom(double zoomFactor)
Zoom the timeline the given zoomfactor in or out.
|
void |
zoom(double zoomFactor,
java.util.Date zoomAroundDate)
Zoom the timeline the given zoomfactor in or out.
|
public static final java.lang.String PACKAGE
public Timeline()
public Timeline(AbstractDataTable data, Timeline.Options options)
data
- A google visualisation datatable containing the events. The
table has three columns: start (type DATETIME), end (type
DATETIME), content (type STRING)options
- A name/value map containing settings for the timeline. See the
class Timeline.Options for all available optionspublic Timeline(JavaScriptObject data, Timeline.Options options)
data
- A google visualisation datatable containing the events. The
table has three columns: start (type DATETIME), end (type
DATETIME), content (type STRING)options
- A name/value map containing settings for the timeline. See the
class Timeline.Options for all available optionspublic void setData(AbstractDataTable data)
data
- public void setData(JavaScriptObject data)
data
- public JavaScriptObject getData()
public JavaScriptObject getItem(int index)
index
- public void addItem(int index, JavaScriptObject item)
index
- item
- public void changeItem(int index, JavaScriptObject item)
index
- item
- public void deleteItem(int index)
index
- public void deleteAllItems()
public void redraw()
public void checkResize()
public final void addSelectHandler(com.google.gwt.visualization.client.events.SelectHandler handler)
handler
- A select handlerpublic final void addRangeChangeHandler(com.google.gwt.visualization.client.events.RangeChangeHandler handler)
handler
- A select handlerpublic final void addRangeChangedHandler(RangeChangedHandler handler)
handler
- A select handlerpublic final void addAddHandler(AddHandler handler)
handler
- An add handlerpublic final void addChangeHandler(ChangeHandler handler)
handler
- A change handlerpublic final void addDeleteHandler(DeleteHandler handler)
handler
- A delete handlerpublic final void addEditHandler(EditHandler handler)
handler
- An edit handlerpublic final void addTimeChangeHandler(TimeChangeHandler handler)
handler
- A change handlerpublic final void addTimeChangedHandler(TimeChangedHandler handler)
handler
- A change handlerpublic final void addReadyHandler(com.google.gwt.visualization.client.events.ReadyHandler handler)
handler
- A ready handlerpublic void cancelChange()
public void cancelAdd()
public void cancelDelete()
public finalgetSelections()
public final void setSelections(sel)
sel
- A Selection array containing one selection. The timeline
accepts only one selection element, which must have the
property row.public void setVisibleChartRange(java.util.Date start, java.util.Date end)
start
- A Date object containing the start date.end
- A Date object containing the end date.public void setCurrentTime(java.util.Date time)
time
- public void setCustomTime(java.util.Date time)
time
- public java.util.Date getCustomTime()
public void setVisibleChartRangeNow()
start
- A Date object containing the start date.end
- A Date object containing the end date.public void setVisibleChartRangeAuto()
start
- A Date object containing the start date.end
- A Date object containing the end date.public Timeline.DateRange getVisibleChartRange()
public void setAutoScale(boolean enable)
enable
- public void setScale(Timeline.Options.SCALE scale, double step)
scale
- step
- protected JavaScriptObject createJso(Element parent)
public void draw(JavaScriptObject data, Timeline.Options options)
data
- The DataTable with the itemsoptions
- The options for drawing this visualization.protected void onLoad()
public void onResize()
public void unselectItem()
public void zoom(double zoomFactor, java.util.Date zoomAroundDate)
zoomFactor
- Zooming amount. Positive value will zoom in, negative value
will zoom outzoomAroundDate
- Date around which will be zoomed. Optionalpublic void zoom(double zoomFactor)
zoomFactor
- Zooming amount. Positive value will zoom in, negative value
will zoom outpublic void move(double moveFactor)
moveFactor
- Moving amount. Positive value will move right, negative value
will move left