Interface IGanttEventListener
- All Known Implementing Classes:
GanttEventListenerAdapter
public interface IGanttEventListener
This interface is used by adding your implementation of it via
GanttChart.addGanttEventListener(IGanttEventListener)
to listen to events that happen in the chart.-
Method Summary
Modifier and Type Method Description void
eventDoubleClicked(GanttEvent event, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when an event is doubleclicked.void
eventHeaderSelected(java.util.Calendar newlySelectedDate, java.util.List allSelectedDates)
Fires when a header section becomes selected (days in the header are clicked etc).void
eventMovedToNewSection(GanttEvent event, GanttSection oldSection, GanttSection newSection)
This is called when an event is moved (vertical DND) from one section to another.void
eventPropertiesSelected(java.util.List events)
Fires when the "properties" menu item is selected on an event (assuming it's visible).void
eventReordered(GanttEvent event)
This is called when an event was reordered vertically in the chart (via DND).void
eventsDeleteRequest(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when the built-in delete action is run on an event.void
eventsDroppedOrResizedOntoUnallowedDateRange(java.util.List events, GanttSpecialDateRange range)
This is called when one or more events were either dropped or resized over aGanttSpecialDateRange
which does not allow events on its dates.void
eventSelected(GanttEvent event, java.util.List allSelectedEvents, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when an event is selected.void
eventsMoved(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when one or more events were moved.void
eventsMoveFinished(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when a move has finished (the mouse button is let go).void
eventsResized(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when one or more events were resized.void
eventsResizeFinished(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when a resize has finished (the mouse button is let go).void
lastDraw(org.eclipse.swt.graphics.GC gc)
This method will be called when the chart has finished drawing.void
phaseMoved(GanttPhase phase, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when a GanttPhase was moved.void
phaseMoveFinished(GanttPhase phase, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when a move has finished on a GanttPhase (the mouse button is let go).void
phaseResized(GanttPhase phase, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when a GanttPhase was resized.void
phaseResizeFinished(GanttPhase phase, org.eclipse.swt.events.MouseEvent mouseEvent)
Fires when a resize has finished on a GanttPhase (the mouse button is let go).void
zoomedIn(int newZoomLevel)
Fires when user zoomed in.void
zoomedOut(int newZoomLevel)
Fires when user zoomed out.void
zoomReset()
Fires when the zoom level has been reset.
-
Method Details
-
eventsMoved
void eventsMoved(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)Fires when one or more events were moved.- Parameters:
events
- List of modified events (post modification)mouseEvent
- MouseEvent
-
eventsResized
void eventsResized(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)Fires when one or more events were resized.- Parameters:
events
- List of modified events (post modification)mouseEvent
- MouseEvent
-
eventsMoveFinished
void eventsMoveFinished(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)Fires when a move has finished (the mouse button is let go).- Parameters:
events
- List of modified events (post modification)mouseEvent
- MouseEvent
-
eventsResizeFinished
void eventsResizeFinished(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)Fires when a resize has finished (the mouse button is let go).- Parameters:
events
- List of modified events (post modification)mouseEvent
- MouseEvent
-
phaseMoved
Fires when a GanttPhase was moved.- Parameters:
phase
- GanttPhase that was movedmouseEvent
- MouseEvent
-
phaseResized
Fires when a GanttPhase was resized.- Parameters:
phase
- GanttPhase that movedmouseEvent
- MouseEvent
-
phaseMoveFinished
Fires when a move has finished on a GanttPhase (the mouse button is let go).- Parameters:
phase
- GanttPhase that was movedmouseEvent
- MouseEvent
-
phaseResizeFinished
Fires when a resize has finished on a GanttPhase (the mouse button is let go).- Parameters:
phase
- GanttPhase that was resizedmouseEvent
- MouseEvent
-
eventSelected
void eventSelected(GanttEvent event, java.util.List allSelectedEvents, org.eclipse.swt.events.MouseEvent mouseEvent)Fires when an event is selected.- Parameters:
event
- Event that got selected.allSelectedEvents
- All currently selected events.mouseEvent
- MouseEvent
-
eventsDeleteRequest
void eventsDeleteRequest(java.util.List events, org.eclipse.swt.events.MouseEvent mouseEvent)Fires when the built-in delete action is run on an event.- Parameters:
events
- Events requested to be deletedmouseEvent
- MouseEvent
-
eventDoubleClicked
Fires when an event is doubleclicked.- Parameters:
event
- Event double clicked.mouseEvent
- MouseEvent
-
zoomedIn
void zoomedIn(int newZoomLevel)Fires when user zoomed in.- Parameters:
newZoomLevel
- The new zoom level.
-
zoomedOut
void zoomedOut(int newZoomLevel)Fires when user zoomed out.- Parameters:
newZoomLevel
- The new zoom level.
-
zoomReset
void zoomReset()Fires when the zoom level has been reset. -
eventPropertiesSelected
void eventPropertiesSelected(java.util.List events)Fires when the "properties" menu item is selected on an event (assuming it's visible).- Parameters:
events
- Events to show properties on.
-
eventHeaderSelected
void eventHeaderSelected(java.util.Calendar newlySelectedDate, java.util.List allSelectedDates)Fires when a header section becomes selected (days in the header are clicked etc).- Parameters:
newlySelectedDate
- The date that was just clickedallSelectedDates
- All dates that were selected previously including the currently added one
-
lastDraw
void lastDraw(org.eclipse.swt.graphics.GC gc)This method will be called when the chart has finished drawing. It passes along the GC object for any custom drawing you may wish to do on top of the currently drawn chart.- Parameters:
gc
- GC graphics object
-
eventMovedToNewSection
This is called when an event is moved (vertical DND) from one section to another.- Parameters:
event
- Event that was movedoldSection
- Section it used to belong tonewSection
- Section it belongs to now
-
eventReordered
This is called when an event was reordered vertically in the chart (via DND).- Parameters:
event
- Event that was reordered
-
eventsDroppedOrResizedOntoUnallowedDateRange
void eventsDroppedOrResizedOntoUnallowedDateRange(java.util.List events, GanttSpecialDateRange range)This is called when one or more events were either dropped or resized over aGanttSpecialDateRange
which does not allow events on its dates. Please note you should not try to undo any event resizing or moving when you are notified as this will take place automatically. Undo will also not contain the events that "crossed the bounds", only events that did not "cross" will be in the undo/redo event generated by the resize or DND.- Parameters:
events
- List of events that were not allowedrange
-GanttSpecialDateRange
on which events were dropped
-