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

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

Best Java code snippets using net.sf.taverna.t2.workflowmodel.MergeInputPort (Showing top 15 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 static String getUniqueMergeInputPortName(Merge merge, String name,
    int count) {
  String uniqueName = name + count;
  for (MergeInputPort mergeInputPort : merge.getInputPorts()) {
    if (mergeInputPort.getName().equals(uniqueName)) {
      return getUniqueMergeInputPortName(merge, name, ++count);
    }
  }
  return uniqueName;
}
origin: net.sf.taverna.t2.ui-activities/component-activity-ui

private void transferMerge(List<Edit<?>> editList,
    Map<Object, Object> oldNewMapping, Dataflow nestedDataflow,
    Merge merge) throws EditException {
  editList.add(edits.getRemoveMergeEdit(currentDataflow, merge));
  Merge newMerge = edits.createMerge(nestedDataflow);
  edits.getAddMergeEdit(nestedDataflow, newMerge).doEdit();
  oldNewMapping.put(merge, newMerge);
  for (MergeInputPort mip : merge.getInputPorts()) {
    MergeInputPort newMip = edits.createMergeInputPort(newMerge,
        mip.getName(), mip.getDepth());
    edits.getAddMergeInputPortEdit(newMerge, newMip).doEdit();
    oldNewMapping.put(mip, newMip);
  }
  oldNewMapping.put(merge.getOutputPort(), newMerge.getOutputPort());
}
origin: net.sf.taverna.t2/maelstrom-impl

assertEquals(1,merge.getInputPorts().size());
assertTrue(merge.getInputPorts().get(0) instanceof MergeInputPort);
assertEquals("source_port_tomerge",merge.getInputPorts().get(0).getName());
assertSame(sourcePort,merge.getInputPorts().get(0).getIncomingLink().getSource());
assertEquals(2,merge.getInputPorts().size());
assertTrue(merge.getInputPorts().get(1) instanceof MergeInputPort);
assertEquals("source_port2_tomerge",merge.getInputPorts().get(1).getName());
assertSame(sourcePort2,merge.getInputPorts().get(1).getIncomingLink().getSource());
origin: net.sf.taverna.t2.core/workflowmodel-api

Merge merge = ((MergeInputPort) sink).getMerge();
queue.add(merge);
origin: net.sf.taverna.t2.ui-activities/component-activity-ui

private void considerNearestDownstream(TokenProcessingEntity investigate) {
  if (investigate instanceof Processor)
    for (Condition condition : ((Processor) investigate)
        .getControlledPreconditionList())
      considerInclusion(condition.getTarget());
  for (EventForwardingOutputPort outputPort : investigate
      .getOutputPorts())
    for (Datalink datalink : outputPort.getOutgoingLinks()) {
      EventHandlingInputPort sink = datalink.getSink();
      if (sink instanceof ProcessorInputPort)
        considerInclusion(((ProcessorInputPort) sink)
            .getProcessor());
      else if (sink instanceof MergeInputPort)
        considerInclusion(((MergeInputPort) sink).getMerge());
      // The merge it self doesn't count as a processor
      else {
        // Ignore dataflow ports
      }
    }
}
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-api

public static String getUniqueMergeInputPortName(Merge merge, String name,
    int count) {
  String uniqueName = name + count;
  for (MergeInputPort mergeInputPort : merge.getInputPorts()) {
    if (mergeInputPort.getName().equals(uniqueName)) {
      return getUniqueMergeInputPortName(merge, name, ++count);
    }
  }
  return uniqueName;
}
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.workbench/contextual-views-impl

  @Override
  public void refreshView() {
    
    mergeView = new JPanel();
    mergeView.setLayout(new BoxLayout(mergeView, BoxLayout.PAGE_AXIS));
    mergeView.setBorder(new EmptyBorder(5, 5, 5, 5));
    mergeView.add(new JLabel("Merge: " + merge.getLocalName()));
    mergeView.add(Box.createRigidArea(new Dimension(0,5)));
    mergeView.add(new JLabel("Inputs: "));
    for (MergeInputPort mergeInputPort : merge.getInputPorts()) {
      mergeView.add(new JLabel(mergeInputPort.getName()));
    }
    mergeView.add(Box.createRigidArea(new Dimension(0,5)));
    mergeView.add(new JLabel("Outputs: "));
    mergeView.add(new JLabel(merge.getOutputPort().getName()));
  }
}
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-components/graph-model

portNode.setId("i" + inputPort.getName());
portNode.setLabel(inputPort.getName());
ports.put(inputPort, portNode);
node.addSinkNode(portNode);
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-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());
}

net.sf.taverna.t2.workflowmodelMergeInputPort

Javadoc

Input port on a Merge object

Most used methods

  • getIncomingLink
  • getName
  • getMerge
  • getDepth

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Permission (java.security)
    Legacy security code; do not use.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JOptionPane (javax.swing)
  • Best IntelliJ plugins
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