Package edu.indiana.extreme.xbaya.graph

Examples of edu.indiana.extreme.xbaya.graph.DataPort


      }
    }
    // none found, so make a new one.
    CepComponentPort comPort = new CepComponentPort(getComponent());
    getComponent().addInputPort(comPort);
    DataPort port = comPort.createPort();
    ((CepPort) port).setNode(this);
    this.addInputPort(port);

    return port;
  }
View Full Code Here


      }
    }
    // none found, so make a new one.
    CepComponentPort comPort = new CepComponentPort(getComponent());
    getComponent().addOutputPort(comPort);
    DataPort port = comPort.createPort();
    ((CepPort) port).setNode(this);
    this.addOutputPort(port);

    return port;
  }
View Full Code Here

    List<DataPort> inputPorts = this.getInputPorts();
    if (inputPorts.size() == 1) {
      // This is the initial port, so leave it alone
      return;
    }
    DataPort portToBeRemoved = null;
    for (DataPort dataPort : inputPorts) {
      if (null == dataPort.getFromNode()) {
        getComponent().removeInputPort(
            (CepComponentPort) dataPort.getComponentPort());
        portToBeRemoved = dataPort;
View Full Code Here

      }
    }
      //none found, so make a new one.
      DynamicComponentPort comPort = new DynamicComponentPort(getComponent());
      getComponent().addInputPort(comPort);
      DataPort port = comPort.createPort();
      ((DynamicPort)port).setNode(this);
      this.addInputPort(port);     
  
      return port;
    }
View Full Code Here

      List<DataPort> inputPorts = this.getInputPorts();
      if(inputPorts.size() == 1){
        //This is the initial port, so leave it alone
        return;
      }
      DataPort portToBeRemoved = null;
      for (DataPort dataPort : inputPorts) {
      if(null == dataPort.getFromNode()){
        getComponent().removeInputPort((DynamicComponentPort) dataPort.getComponentPort());
        portToBeRemoved = dataPort;
        break;
View Full Code Here

    for (Node node : subworkflowNodes) {
      Node newNode = nodeMap.get(node);

      List<DataPort> inputPorts = node.getInputPorts();
      for (DataPort dataPort : inputPorts) {
        DataPort newPort = newNode.getInputPort(dataPort.getID());
        Node fromNode = dataPort.getFromNode();
        Node newFromNode = nodeMap.get(fromNode);
        if (null == newFromNode) {
          // input to this subworkflow
          InputNode inputNode = new InputComponent().createNode(this);
          addEdge(inputNode.getOutputPort(0), newPort);
        } else {
          String fromPortID = dataPort.getFromPort().getID();
          addEdge(newFromNode.getOutputPort(fromPortID), newPort);
        }
      }

      List<DataPort> outputPorts = node.getOutputPorts();
      for (DataPort dataPort : outputPorts) {
        DataPort newPort = newNode.getOutputPort(dataPort.getID());

        List<Port> toNodes = dataPort.getToPorts();
        for (Port toPort : toNodes) {
          Node newToNode = nodeMap.get(toPort.getNode());
          if (null == newToNode) {
View Full Code Here

    createPorts(exitNode);
    return exitNode;
  }
  protected void createPorts(NodeImpl node) {
        for (ComponentDataPort input : getInputPorts()) {
            DataPort port = input.createPort();
            node.addInputPort(port);
        }

        for (ComponentDataPort output : getOutputPorts()) {
            DataPort port = output.createPort();
            node.addOutputPort(port);
        }

        if (this.controlInPort != null) {
            ControlPort port = this.controlInPort.createPort();
View Full Code Here

  /**
   * @see edu.indiana.extreme.xbaya.component.ComponentDataPort#createPort()
   */
  @Override
  public DataPort createPort() {
    DataPort n = new InstanceDataPort();
    n.setName(PORT_NAME);
    return n;
  }
View Full Code Here

     * @throws GraphException
     */
    public void removeInputPort() throws GraphException {
        List<DataPort> inputPorts = getInputPorts();
        // Remove the last one.
        DataPort inputPort = inputPorts.get(inputPorts.size() - 1);
        removeInputPort(inputPort);
    }
View Full Code Here

        // The extended for loop cannot be used to remove the elements.

        // Remove edges connected to input ports.
        for (Iterator<DataPort> portItr = nodeImpl.getInputPorts().iterator(); portItr
                .hasNext();) {
            DataPort port = portItr.next();
            for (Iterator<DataEdge> edgeItr = port.getEdges().iterator(); edgeItr
                    .hasNext();) {
                DataEdge edge = edgeItr.next();
                // Remove the edge from from-port.
                DataPort fromPort = edge.getFromPort();
                fromPort.removeEdge(edge);
                // remove the edge from this port. This is necessary so that
                // type update works properly.
                edgeItr.remove();

                // Remove the edge from the graph.
                this.edges.remove(edge);
                fromPort.getNode().edgeWasRemoved(edge);
            }
            // Remove the port from the node.
            portItr.remove();
            // Remove the port from the graph.
            this.ports.remove(port);
        }

        // Remove edges connected to output ports.
        for (Iterator<DataPort> portItr = nodeImpl.getOutputPorts().iterator(); portItr
                .hasNext();) {
            DataPort port = portItr.next();
            for (Iterator<DataEdge> edgeItr = port.getEdges().iterator(); edgeItr
                    .hasNext();) {
                DataEdge edge = edgeItr.next();
                DataPort toPort = edge.getToPort();
                toPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                toPort.getNode().edgeWasRemoved(edge);
            }
            portItr.remove();
            this.ports.remove(port);
        }

        for (Iterator<ControlPort> portItr = nodeImpl.getControlOutPorts()
                .iterator(); portItr.hasNext();) {
            PortImpl port = portItr.next();
            for (Iterator<? extends EdgeImpl> edgeItr = port.getEdges()
                    .iterator(); edgeItr.hasNext();) {
                EdgeImpl edge = edgeItr.next();
                PortImpl toPort = edge.getToPort();
                toPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                toPort.getNode().edgeWasRemoved(edge);
            }
            portItr.remove();
            this.ports.remove(port);
        }

        PortImpl controlInPort = nodeImpl.getControlInPort();
        if (controlInPort != null) {
            for (Iterator<? extends EdgeImpl> edgeItr = controlInPort
                    .getEdges().iterator(); edgeItr.hasNext();) {
                EdgeImpl edge = edgeItr.next();
                PortImpl fromPort = edge.getFromPort();
                fromPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                fromPort.getNode().edgeWasRemoved(edge);
            }
            this.ports.remove(controlInPort);
        }

        PortImpl eprPort = nodeImpl.getEPRPort();
        if (eprPort != null) {
            for (Iterator<? extends EdgeImpl> edgeItr = eprPort.getEdges()
                    .iterator(); edgeItr.hasNext();) {
                EdgeImpl edge = edgeItr.next();
                PortImpl toPort = edge.getToPort();
                toPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                toPort.getNode().edgeWasRemoved(edge);
            }
            this.ports.remove(eprPort);
        }

        this.nodes.remove(node);
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.graph.DataPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.