コード例 #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.gef.commands.Command#undo()
  */
 @Override
 public void undo() {
   jrGroup.removeGanttSeries(jrElement);
   if (oldIndex >= 0 && oldIndex < jrGroup.getSeriesList().size())
     jrGroup.addGanttSeries(oldIndex, jrElement);
   else jrGroup.addGanttSeries(jrElement);
 }
コード例 #2
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.gef.commands.Command#execute()
   */
  @Override
  public void execute() {
    oldIndex = jrGroup.getSeriesList().indexOf(jrElement);

    jrGroup.removeGanttSeries(jrElement);
    if (newIndex >= 0 && newIndex < jrGroup.getSeriesList().size())
      jrGroup.addGanttSeries(newIndex, jrElement);
    else jrGroup.addGanttSeries(jrElement);
  }