Package edu.indiana.extreme.xbaya.graph

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


     * @throws GraphException
     */
    public void fixParameterNodes() {
        // XXX fix the ports of parameter nodes for 2.6.3 or before.
        for (InputNode node : GraphUtil.getNodes(this, InputNode.class)) {
            DataPort oldPort = node.getOutputPort(0);
            if (oldPort instanceof WSPort) {
                node.getOutputPorts().remove(oldPort);
                this.ports.remove(oldPort);
                SystemDataPort newPort = new SystemDataPort();
                this.ports.add(newPort);
                newPort.setKind(Kind.DATA_OUT);
                newPort.setName(oldPort.getName());
                newPort.setGraph(this);
                newPort.setNode(node);
                newPort.createID();
                node.getOutputPorts().add(newPort);
                for (DataEdge edge : oldPort.getEdges()) {
                    edge.setFromPort(newPort);
                    newPort.getEdges().add(edge);
                }
            }
        }
        for (OutputNode node : GraphUtil.getNodes(this, OutputNode.class)) {
            DataPort oldPort = node.getInputPort(0);
            if (oldPort instanceof WSPort) {
                node.getInputPorts().remove(oldPort);
                this.ports.remove(oldPort);
                SystemDataPort newPort = new SystemDataPort();
                this.ports.add(newPort);
                newPort.setKind(Kind.DATA_IN);
                newPort.setName(oldPort.getName());
                newPort.setGraph(this);
                newPort.setNode(node);
                newPort.createID();
                node.getInputPorts().add(newPort);
                for (DataEdge edge : oldPort.getEdges()) {
                    edge.setToPort(newPort);
                    newPort.getEdges().add(edge);
                }
            }
        }
View Full Code Here


     * Adds additional input port.
     */
    public void addInputPort() {
        EndBlockComponent component = getComponent();
        ComponentDataPort input = component.getInputPort();
        DataPort port = input.createPort();
        addInputPort(port);
    }
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

     * Adds additional output port.
     */
    public void addOutputPort() {
        EndBlockComponent component = getComponent();
        ComponentDataPort outputPort = component.getOutputPort();
        DataPort port = outputPort.createPort();
        addOutputPort(port);
    }
View Full Code Here

     * @throws GraphException
     */
    public void removeOutputPort() throws GraphException {
        List<DataPort> outputPorts = getOutputPorts();
        // Remove the last one.
        DataPort outputPort = outputPorts.get(outputPorts.size() - 1);
        removeOutputPort(outputPort);
    }
View Full Code Here

            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of input "
                        + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of input "
                        + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " ("
                        + inputType2 + ") of " + getID()
View Full Code Here

     * Adds additional input port.
     */
    public void addInputPort() {
        EndifComponent component = getComponent();
        ComponentDataPort input = component.getInputPort();
        DataPort port = input.createPort();
        addInputPort(port);
    }
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

     * Adds additional output port.
     */
    public void addOutputPort() {
        EndifComponent component = getComponent();
        ComponentDataPort outputPort = component.getOutputPort();
        DataPort port = outputPort.createPort();
        addOutputPort(port);
    }
View Full Code Here

     * @throws GraphException
     */
    public void removeOutputPort() throws GraphException {
        List<DataPort> outputPorts = getOutputPorts();
        // Remove the last one.
        DataPort outputPort = outputPorts.get(outputPorts.size() - 1);
        removeOutputPort(outputPort);
    }
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.