Tabnine Logo
MergeInputPort.getIncomingLink
Code IndexAdd Tabnine to your IDE (free)

How to use
getIncomingLink
method
in
net.sf.taverna.t2.workflowmodel.MergeInputPort

Best Java code snippets using net.sf.taverna.t2.workflowmodel.MergeInputPort.getIncomingLink (Showing top 8 results out of 315)

origin: net.sf.taverna.t2/maelstrom-impl

  public boolean doTypeCheck() throws IterationTypeMismatchException {
    if (inputs.size() == 0) {
      // Arguable, but technically a merge with no inputs is valid, it may
      // make more sense to throw an exception here though as it has no
      // actual meaning.
      return true;
    }
    // Return false if we have unbound input ports or bound ports where the
    // resolved depth hasn't been calculated yet
    for (MergeInputPort ip : inputs) {
      if (ip.getIncomingLink() == null
          || ip.getIncomingLink().getResolvedDepth() == -1) {
        return false;
      }
    }
    // Got all input ports, now scan for input depths
    int inputDepth = inputs.get(0).getIncomingLink().getResolvedDepth();
    for (MergeInputPort ip : inputs) {
      if (ip.getIncomingLink().getResolvedDepth() != inputDepth) {
        throw new IterationTypeMismatchException();
      }
    }
    // Got to here so all the input resolved depths match, push depth+1 to
    // all outgoing links and return true
    for (DatalinkImpl dli : output.outgoingLinks) {
      dli.setResolvedDepth(inputDepth+1);
    }
    return true;
  }
}
origin: net.sf.taverna.t2/workflowmodel-impl

  public boolean doTypeCheck() throws IterationTypeMismatchException {
    if (inputs.size() == 0) {
      // Arguable, but technically a merge with no inputs is valid, it may
      // make more sense to throw an exception here though as it has no
      // actual meaning.
      return true;
    }
    // Return false if we have unbound input ports or bound ports where the
    // resolved depth hasn't been calculated yet
    for (MergeInputPort ip : inputs) {
      if (ip.getIncomingLink() == null
          || ip.getIncomingLink().getResolvedDepth() == -1) {
        return false;
      }
    }
    // Got all input ports, now scan for input depths
    int inputDepth = inputs.get(0).getIncomingLink().getResolvedDepth();
    for (MergeInputPort ip : inputs) {
      if (ip.getIncomingLink().getResolvedDepth() != inputDepth) {
        throw new IterationTypeMismatchException();
      }
    }
    // Got to here so all the input resolved depths match, push depth+1 to
    // all outgoing links and return true
    for (DatalinkImpl dli : output.outgoingLinks) {
      dli.setResolvedDepth(inputDepth+1);
    }
    return true;
  }
}
origin: net.sf.taverna.t2.core/workflowmodel-impl

if (ip.getIncomingLink() == null
    || ip.getIncomingLink().getResolvedDepth() == -1) {
  return false;
if (ip.getIncomingLink().getResolvedDepth() != inputDepth) {
  throw new IterationTypeMismatchException();
origin: net.sf.taverna.t2.ui-impl/contextual-views-impl

public MergeConfigurationView(Merge merge){
  
  super((Frame)null, "Merge Configuration", true);
  
  this.merge = merge;
  // Ordered list of merge's input ports
  inputPortsList = new ArrayList<MergeInputPort>(merge.getInputPorts());
  // Generate labels for the input ports (label displays a link from a workflow entity 
  // towards the merge's input port)
  labelListModel = new DefaultListModel();
  String maxLabel = "Order of incoming links (entity.port -> merge):"+"Push";
  for (MergeInputPort mergeInputPort : inputPortsList){	
    EventForwardingOutputPort sourcePort = mergeInputPort.getIncomingLink().getSource();
    // Get the name TokenProcessingEntity (Processor or another Merge or Dataflow) and 
    // its port that contains the source EventForwardingOutputPort
    Dataflow workflow = FileManager.getInstance().getCurrentDataflow();
    TokenProcessingEntity entity = Tools.getTokenProcessingEntityWithEventForwardingOutputPort(sourcePort, workflow);
    if (entity != null){
      String link = entity.getLocalName() + "."
          + sourcePort.getName() + " -> " + merge.getLocalName();
      if (link.length() > maxLabel.length())
        maxLabel = link;
      labelListModel.addElement(link);
    }
  }
    
  initComponents();
}

origin: net.sf.taverna.t2.ui-components/design-ui

public void actionPerformed(ActionEvent e) {
  try {
    List<? extends MergeInputPort> inputPorts = merge.getInputPorts();
    EventForwardingOutputPort outputPort = merge.getOutputPort();
    List<Edit<?>> editList = new ArrayList<Edit<?>>();
    for (MergeInputPort inputPort : inputPorts) {
      Datalink datalink = inputPort.getIncomingLink();
      if (datalink != null) {
        editList.add(Tools.getDisconnectDatalinkAndRemovePortsEdit(datalink));
      }
    }
    for (Datalink datalink : outputPort.getOutgoingLinks()) {
      editList.add(Tools.getDisconnectDatalinkAndRemovePortsEdit(datalink));
    }
    if (editList.isEmpty()) {
      editManager.doDataflowEdit(dataflow, edits.getRemoveMergeEdit(dataflow, merge));
    } else {
      editList.add(edits.getRemoveMergeEdit(dataflow, merge));
      editManager.doDataflowEdit(dataflow, new CompoundEdit(editList));
    }
    dataflowSelectionModel.removeSelection(merge);
  } catch (EditException e1) {
    logger.debug("Delete merge failed", e1);
  }
}
origin: net.sf.taverna.t2.ui-impl/contextual-views-impl

EventForwardingOutputPort sourcePort = mergeInputPort.getIncomingLink().getSource();
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());
}

origin: net.sf.taverna.t2/maelstrom-impl

assertTrue(merge.getInputPorts().get(0) instanceof MergeInputPort);
assertEquals("source_port_tomerge",merge.getInputPorts().get(0).getName());
assertSame(sourcePort,merge.getInputPorts().get(0).getIncomingLink().getSource());
assertTrue(merge.getInputPorts().get(1) instanceof MergeInputPort);
assertEquals("source_port2_tomerge",merge.getInputPorts().get(1).getName());
assertSame(sourcePort2,merge.getInputPorts().get(1).getIncomingLink().getSource());
net.sf.taverna.t2.workflowmodelMergeInputPortgetIncomingLink

Popular methods of MergeInputPort

  • getName
  • getMerge
  • getDepth

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • startActivity (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Path (java.nio.file)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now