Package org.apache.airavata.workflow.model.graph

Examples of org.apache.airavata.workflow.model.graph.Port


        }
    }

    private void writeOutput(OutputNode node, PrintWriter pw) throws GraphException {
        String id = node.getID();
        Port port = node.getPort();

        Node fromNode = port.getFromNode();
        if (fromNode == null) {
            throw new GraphException("Output parameter has to be connected to some node.");
        }
        Port fromPort = port.getFromPort();
        if (fromNode instanceof InputNode) {
            // The OutputNode is directly connected to an InputNode.
            pw.println(TAB + id + VALUE_SUFFIX + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
                    + fromNode.getID() + "')");
        } else {
            pw.println(TAB + "# Wait output " + id);
            pw.println(TAB + id + VALUE_SUFFIX + " = " + fromNode.getID() + INVOKER_SUFFIX + "." + GET_OUTPUT_METHOD
                    + "('" + fromPort.getName() + "')");
        }
        pw.println(TAB + "print '" + id + " = ', " + id + VALUE_SUFFIX);

        // This might try to remove a node that has been removed
        // already, but it's OK.
View Full Code Here


                        return false;
                    }
                }
            }
        }
        Port port = node.getControlInPort();
        if (port != null) {
            Collection<Node> fromNodes = port.getFromNodes();
            for (Node fromNode : fromNodes) {
                if (this.notYetInvokedNodes.contains(fromNode)) {
                    return false;
                }
            }
View Full Code Here

    private void activeTabChanged() {
        GraphCanvas graphPanel = getGraphCanvas();

        if (graphPanel!=null) {
      // Reset the port viewers.
      Port inputPort = graphPanel.getSelectedInputPort();
      Port outputPort = graphPanel.getSelectedOutputPort();
      this.portViewer.setInputPort(inputPort);
      this.portViewer.setOutputPort(outputPort);
      // Reset component viewer.
      Node node = graphPanel.getSelectedNode();
      Component component;
View Full Code Here

    @Override
    protected void setPortPositions() {
        // inputs
        List<? extends Port> inputPorts = this.node.getInputPorts();
        for (int i = 0; i < inputPorts.size(); i++) {
            Port port = inputPorts.get(i);
            Point offset;
            if (i < inputPorts.size() / 2) {
                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
            } else {
                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * (i + 1));
            }
            NodeController.getGUI(port).setOffset(offset);
        }

        // outputs
        List<? extends Port> outputPorts = this.node.getOutputPorts();
        for (int i = 0; i < outputPorts.size(); i++) {
            Port port = outputPorts.get(i);
            Point offset = new Point(this.getBounds().width - PortGUI.DATA_PORT_SIZE / 2, (int) (this.headHeight
                    + PORT_INITIAL_GAP + PORT_GAP * (outputPorts.size() / 2.0 + i)));
            NodeController.getGUI(port).setOffset(offset);
        }

        // control-in
        Port controlInPort = this.node.getControlInPort();
        if (controlInPort != null) {
          NodeController.getGUI(controlInPort).setOffset(new Point(0, 0));
        }

        // control-out
View Full Code Here

        List<DataPort> inputPorts = this.node.getInputPorts();
        boolean first = true;

        // variable list in function prototype
        for (DataPort inPort : inputPorts) {
            Port fromPort = inPort.getFromPort();
            if (fromPort instanceof WSPort) {
                WSPort wsPort = (WSPort) fromPort;
                XmlElement element = wsPort.getComponentPort().getElement();

                // QName inType = ((DataPort) fromPort).getType();
View Full Code Here

    private void initSchema(File rootDir, File srcDir, File classesDir) {

        List<DataPort> inputPorts = node.getInputPorts();
        for (DataPort inPort : inputPorts) {
            Port fromPort = inPort.getFromPort();
            Node fromNode = inPort.getFromNode();
            if (fromNode instanceof WSNode) {
                WSNode fromWsNode = (WSNode) fromNode;
                if (null != fromPort && fromPort instanceof DataPort) {
                    DataPort fromDataPort = (DataPort) fromPort;
View Full Code Here

    }

    private boolean hasComplexTypes() {
        List<DataPort> inputPorts = node.getInputPorts();
        for (DataPort inPort : inputPorts) {
            Port fromPort = inPort.getFromPort();
            Node fromNode = inPort.getFromNode();
            if (fromNode instanceof WSNode) {
                if (null != fromPort && fromPort instanceof DataPort) {

                } else {
View Full Code Here

        for (Port controlOutPort : this.node.getControlOutPorts()) {
          NodeController.getGUI(controlOutPort).setOffset(new Point(getBounds().width, getBounds().height - this.headHeight / 2));
            break; // Has only one
        }

        Port port = this.node.getEPRPort();
        NodeController.getGUI(port).setOffset(new Point(getBounds().width / 2, this.headHeight / 4));
    }
View Full Code Here

    @Override
    protected void setPortPositions() {
        // inputs
        List<? extends Port> inputPorts = this.node.getInputPorts();
        for (int i = 0; i < inputPorts.size(); i++) {
            Port port = inputPorts.get(i);
            Point offset;
            if (i < inputPorts.size() / 2) {
                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight
                        + PORT_INITIAL_GAP + PORT_GAP * i);
            } else {
                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight
                        + PORT_INITIAL_GAP + PORT_GAP * (i + 1));
            }
            NodeController.getGUI(port).setOffset(offset);
        }

        // outputs
        List<? extends Port> outputPorts = this.node.getOutputPorts();
        for (int i = 0; i < outputPorts.size(); i++) {
            Port port = outputPorts.get(i);
            Point offset = new Point(this.getBounds().width
                    - PortGUI.DATA_PORT_SIZE / 2, (int) (this.headHeight
                    + PORT_INITIAL_GAP + PORT_GAP
                    * (outputPorts.size() / 2.0 + i)));
            NodeController.getGUI(port).setOffset(offset);
View Full Code Here

                NodeController.getGUI(node).setDraggedFlag(true);
                this.panel.setCursor(SwingUtil.MOVE_CURSOR);
            }

        } else if (selected instanceof Port) {
            Port port = (Port) selected;
            NodeController.getGUI(port).setSelectedFlag(true);
            switch (port.getKind()) {
            case DATA_IN:
            case CONTROL_IN:
                selectInputPort(port);
                break;
            case CONTROL_OUT:
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.Port

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.