net.sf.taverna.t2.workflowmodel.Edit.undo()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中net.sf.taverna.t2.workflowmodel.Edit.undo()方法的一些代码示例,展示了Edit.undo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Edit.undo()方法的具体详情如下:
包路径:net.sf.taverna.t2.workflowmodel.Edit
类名称:Edit
方法名:undo

Edit.undo介绍

[英]Undo the edit, reverting the subject to the state it was in prior to the edit
[中]撤消编辑,将主题恢复到编辑之前的状态

代码示例

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@Override
protected void undoEditAction(ProcessorImpl processor) {
  compoundEdit.undo();
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@Override
protected void undoEditAction(ProcessorImpl processor) {
  compoundEdit.undo();
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@Override
protected void undoEditAction(MergeImpl mergeImpl) {
  if (connectOutLinkEdit!=null) connectOutLinkEdit.undo();
  connectInLinkEdit.undo();
  mergeImpl.removeInputPort(mergeInputPort);
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-api

/**
 * Rolls back all child edits in reverse order
 */
public synchronized void undo() {
  for (int i = (childEdits.size() - 1); i >= 0; i--) {
    // Undo child edits in reverse order
    childEdits.get(i).undo();
  }
  applied = false;
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-api

/**
 * Rolls back all child edits in reverse order
 */
public synchronized void undo() {
  for (int i = (childEdits.size() - 1); i >= 0; i--) {
    // Undo child edits in reverse order
    childEdits.get(i).undo();
  }
  applied = false;
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@Override
protected void undoEditAction(MergeImpl mergeImpl) {
  if (connectOutLinkEdit!=null) connectOutLinkEdit.undo();
  connectInLinkEdit.undo();
  mergeImpl.removeInputPort(mergeInputPort);
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

@Override
protected void undoEditAction(MergeImpl mergeImpl) {
  if (connectOutLinkEdit!=null) connectOutLinkEdit.undo();
  connectInLinkEdit.undo();
  mergeImpl.removeInputPort(mergeInputPort);
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-api

/**
 * Rolls back all child edits in reverse order
 */
public synchronized void undo() {
  for (int i = (childEdits.size() - 1); i >= 0; i--) {
    // Undo child edits in reverse order
    childEdits.get(i).undo();
  }
  applied = false;
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl dataflow) {
  if (linkEdit!=null && linkEdit.isApplied())
    linkEdit.undo();
  if (compoundEdit!=null && compoundEdit.isApplied())
    compoundEdit.undo();
  if (upstreamObjectEdit!=null && upstreamObjectEdit.isApplied()) {
    upstreamObjectEdit.undo();
  }
  
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl dataflow) {
  if (subEdits != null && subEdits.size() > 0) {
    for (int i = subEdits.size() - 1; i >= 0; i--) {
      Edit<?> edit = subEdits.get(i);
      if (edit.isApplied())
        edit.undo();
    }
  }
  
}

代码示例来源:origin: net.sf.taverna.t2.activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl dataflow) {
  if (linkEdit!=null && linkEdit.isApplied())
    linkEdit.undo();
  if (compoundEdit!=null && compoundEdit.isApplied())
    compoundEdit.undo();
  if (upstreamObjectEdit!=null && upstreamObjectEdit.isApplied()) {
    upstreamObjectEdit.undo();
  }
  
}

代码示例来源:origin: net.sf.taverna.t2.activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl subjectImpl) {
  if (linkEdit != null && linkEdit.isApplied())
    linkEdit.undo();
  if (compoundEdit != null && compoundEdit.isApplied())
    compoundEdit.undo();
}

代码示例来源:origin: net.sf.taverna.t2.activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl subjectImpl) {
  if (linkEdit!=null && linkEdit.isApplied())
    linkEdit.undo();
  if (compoundEdit!=null && compoundEdit.isApplied())
    compoundEdit.undo();
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl subjectImpl) {
  if (linkEdit != null && linkEdit.isApplied())
    linkEdit.undo();
  if (compoundEdit != null && compoundEdit.isApplied())
    compoundEdit.undo();
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/biomoby-activity-ui

@Override
protected void undoEditAction(DataflowImpl subjectImpl) {
  if (linkEdit!=null && linkEdit.isApplied())
    linkEdit.undo();
  if (compoundEdit!=null && compoundEdit.isApplied())
    compoundEdit.undo();
}

代码示例来源:origin: net.sf.taverna.t2.activities/wsdl-activity

@Override
public void undo() {
  if (!applied) {
    throw new RuntimeException(
        "Attempt to undo edit that was never applied");
  }
  if (linkUpEdit.isApplied())
    linkUpEdit.undo();
  if (compoundEdit1.isApplied())
    compoundEdit1.undo();
  applied = false;
}

代码示例来源:origin: net.sf.taverna.cagrid/cagrid-activity

@Override
protected void undoEditAction(DataflowImpl dataflow) {
  if (linkUpEdit.isApplied())
    linkUpEdit.undo();
  if (compoundEdit1.isApplied())
    compoundEdit1.undo();
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

@Test
public void undo() throws Exception {
  Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort);
  theEdit.doEdit();
  theEdit.undo();
  assertEquals(0,merge.getInputPorts().size());
  assertEquals(0,merge.getOutputPort().getOutgoingLinks().size());
  assertEquals(0,sourcePort.getOutgoingLinks().size());
  assertNull(sinkPort.getIncomingLink());
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

/**
 * Check that the outgoing link to the sink port is retained when undoing a second merged input.
 */
@Test
public void undoSecond() throws Exception {
  Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort);
  theEdit.doEdit();
  ProcessorImpl p3=new ProcessorImpl();
  ProcessorOutputPortImpl sourcePort2=new ProcessorOutputPortImpl(p3,"source_port2",0,0);
  Edit<Merge> theEdit2 = new ConnectMergedDatalinkEdit(merge,sourcePort2,sinkPort);
  theEdit2.doEdit();
  theEdit2.undo();
  assertEquals(1,merge.getInputPorts().size());
  assertEquals(1,merge.getOutputPort().getOutgoingLinks().size());
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

@Test
public void redo() throws Exception {
  Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort);
  theEdit.doEdit();
  theEdit.undo();
  theEdit.doEdit();
  
  assertEquals(1,merge.getInputPorts().size());
  assertTrue(merge.getInputPorts().get(0) instanceof MergeInputPort);
  assertSame(sourcePort,merge.getInputPorts().get(0).getIncomingLink().getSource());
  
  assertEquals(1,merge.getOutputPort().getOutgoingLinks().size());
  assertSame(sinkPort,merge.getOutputPort().getOutgoingLinks().toArray(new Datalink[]{})[0].getSink());
  
  assertEquals(1,sourcePort.getOutgoingLinks().size());
  assertTrue(sourcePort.getOutgoingLinks().toArray(new Datalink[]{})[0].getSink() instanceof MergeInputPort);
  assertTrue(sinkPort.getIncomingLink().getSource() instanceof MergeOutputPort);
  
  assertSame(merge.getInputPorts().get(0),sourcePort.getOutgoingLinks().toArray(new Datalink[]{})[0].getSink());
  assertSame(sinkPort.getIncomingLink().getSource(),merge.getOutputPort());
}

相关文章