Class EventMoveCommand
java.lang.Object
org.eclipse.nebula.widgets.ganttchart.undoredo.commands.AbstractUndoRedoCommand
org.eclipse.nebula.widgets.ganttchart.undoredo.commands.EventMoveCommand
- All Implemented Interfaces:
IUndoRedoCommand
- Direct Known Subclasses:
EventResizeCommand
public class EventMoveCommand extends AbstractUndoRedoCommand
Represents one GanttEvent DND action that can be undone/redone.
-
Constructor Summary
Constructors Constructor Description EventMoveCommand(GanttEvent event, java.util.Calendar startDateBefore, java.util.Calendar startDateAfter, java.util.Calendar endDateBefore, java.util.Calendar endDateAfter, java.util.Calendar revisedStartDateBefore, java.util.Calendar revisedStartDateAfter, java.util.Calendar revisedEndDateBefore, java.util.Calendar revisedEndDateAfter, GanttSection sectionBefore, GanttSection sectionAfter, int indexBefore, int indexAfter)
Creates a new undoable/redoable Move Event. -
Method Summary
Modifier and Type Method Description void
dispose()
Called when the event is about to be destroyed.java.util.Calendar
getEndDateAfter()
java.util.Calendar
getEndDateBefore()
GanttEvent
getEvent()
int
getIndexAfter()
int
getIndexBefore()
java.util.Calendar
getRevisedEndDateAfter()
java.util.Calendar
getRevisedEndDateBefore()
java.util.Calendar
getRevisedStartDateAfter()
java.util.Calendar
getRevisedStartDateBefore()
GanttSection
getSectionAfter()
GanttSection
getSectionBefore()
java.util.Calendar
getStartDateAfter()
java.util.Calendar
getStartDateBefore()
void
redo()
Redoes an event in the chart.void
setEndDateAfter(java.util.Calendar endDateAfter)
void
setEndDateBefore(java.util.Calendar endDateBefore)
void
setEvent(GanttEvent event)
void
setIndexAfter(int indexAfter)
void
setIndexBefore(int indexBefore)
void
setRevisedEndDateAfter(java.util.Calendar revisedEndDateAfter)
void
setRevisedEndDateBefore(java.util.Calendar revisedEndDateBefore)
void
setRevisedStartDateAfter(java.util.Calendar revisedStartDateAfter)
void
setRevisedStartDateBefore(java.util.Calendar revisedStartDateBefore)
void
setSectionAfter(GanttSection sectionAfter)
void
setSectionBefore(GanttSection sectionBefore)
void
setStartDateAfter(java.util.Calendar startDateAfter)
void
setStartDateBefore(java.util.Calendar startDateBefore)
java.lang.String
toString()
void
undo()
Undoes an event in the chart.
-
Constructor Details
-
EventMoveCommand
public EventMoveCommand(GanttEvent event, java.util.Calendar startDateBefore, java.util.Calendar startDateAfter, java.util.Calendar endDateBefore, java.util.Calendar endDateAfter, java.util.Calendar revisedStartDateBefore, java.util.Calendar revisedStartDateAfter, java.util.Calendar revisedEndDateBefore, java.util.Calendar revisedEndDateAfter, GanttSection sectionBefore, GanttSection sectionAfter, int indexBefore, int indexAfter)Creates a new undoable/redoable Move Event.- Parameters:
event
-GanttEvent
being movedstartDateBefore
- Estimated start date prior to movestartDateAfter
- Estimated start date after to moveendDateBefore
- Estimated end date before moveendDateAfter
- Estimated end date after moverevisedStartDateBefore
- Revised start date prior to moverevisedStartDateAfter
- Revised start date after moverevisedEndDateBefore
- Revised end date prior to moverevisedEndDateAfter
- Revised end date after movesectionBefore
-GanttSection
index (of all GanttSections) prior to movesectionAfter
-GanttSection
index (of all GanttSections) after moveindexBefore
- Index of event inGanttSection
sectionBefore prior to moveindexAfter
- Index of event inGanttSection
sectionAfter after to move
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:IUndoRedoCommand
Called when the event is about to be destroyed. If any resources need to be cleaned up you should do so here. -
redo
public void redo()Description copied from interface:IUndoRedoCommand
Redoes an event in the chart. This should put the event back to the state it was after the event took place. -
undo
public void undo()Description copied from interface:IUndoRedoCommand
Undoes an event in the chart. This should put the event back to the state it was prior to the event taking place. -
getEvent
-
setEvent
-
getStartDateBefore
public java.util.Calendar getStartDateBefore() -
setStartDateBefore
public void setStartDateBefore(java.util.Calendar startDateBefore) -
getStartDateAfter
public java.util.Calendar getStartDateAfter() -
setStartDateAfter
public void setStartDateAfter(java.util.Calendar startDateAfter) -
getEndDateBefore
public java.util.Calendar getEndDateBefore() -
setEndDateBefore
public void setEndDateBefore(java.util.Calendar endDateBefore) -
getEndDateAfter
public java.util.Calendar getEndDateAfter() -
setEndDateAfter
public void setEndDateAfter(java.util.Calendar endDateAfter) -
getIndexBefore
public int getIndexBefore() -
setIndexBefore
public void setIndexBefore(int indexBefore) -
getIndexAfter
public int getIndexAfter() -
setIndexAfter
public void setIndexAfter(int indexAfter) -
getSectionBefore
-
setSectionBefore
-
getSectionAfter
-
setSectionAfter
-
getRevisedStartDateBefore
public java.util.Calendar getRevisedStartDateBefore() -
setRevisedStartDateBefore
public void setRevisedStartDateBefore(java.util.Calendar revisedStartDateBefore) -
getRevisedStartDateAfter
public java.util.Calendar getRevisedStartDateAfter() -
setRevisedStartDateAfter
public void setRevisedStartDateAfter(java.util.Calendar revisedStartDateAfter) -
getRevisedEndDateBefore
public java.util.Calendar getRevisedEndDateBefore() -
setRevisedEndDateBefore
public void setRevisedEndDateBefore(java.util.Calendar revisedEndDateBefore) -
getRevisedEndDateAfter
public java.util.Calendar getRevisedEndDateAfter() -
setRevisedEndDateAfter
public void setRevisedEndDateAfter(java.util.Calendar revisedEndDateAfter) -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-