Package edu.indiana.extreme.xbaya.graph

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


            return false;
        }
        for (Port port : node.getInputPorts()) {
            Collection<Node> fromNodes = port.getFromNodes();
            if (fromNodes.isEmpty()) {
                throw new GraphException(
                        "There is a port that is not connected to any.");
            } else {
                for (Node fromNode : fromNodes) {
                    if (this.notYetInvokedNodes.contains(fromNode)) {
                        // There is a node that should be executed before this
View Full Code Here


    public void removeNode(Node node) throws GraphException {
        if (node == null) {
            throw new IllegalArgumentException("null");
        }
        if (!this.nodes.contains(node)) {
            throw new GraphException(
                    "The graph doesn't contain the node that is being removed.");
        }

        NodeImpl nodeImpl = (NodeImpl) node;
View Full Code Here

    public void removePort(Port port) throws GraphException {
        if (port == null) {
            throw new IllegalArgumentException("null");
        }
        if (!this.ports.contains(port)) {
            throw new GraphException(
                    "The graph doesn't contain the port that is being removed.");
        }

        // copy it so that we can remove edge without worrying about the
        // iteration issue.
View Full Code Here

            return null;
        }

        if (!this.ports.contains(fromPort) || !this.ports.contains(toPort)) {
            // The specified port doesn't belong to the graph.
            throw new GraphException(
                    "The graph doesn't contain the specified port.");
        }

        PortImpl fromPortImpl = (PortImpl) fromPort;
        PortImpl toPortImpl = (PortImpl) toPort;
View Full Code Here

     * @throws GraphException
     * @see edu.indiana.extreme.xbaya.graph.Graph#removeEdge(edu.indiana.extreme.xbaya.graph.Edge)
     */
    public void removeEdge(Edge edge) throws GraphException {
        if (!this.edges.contains(edge)) {
            throw new GraphException(
                    "The graph doesn't contain the specified edge.");
        }
        EdgeImpl edgeImpl = (EdgeImpl) edge;

        PortImpl fromPort = edgeImpl.getFromPort();
View Full Code Here

     */
    public void importGraph(Graph graph) throws GraphException {

        // Does not support other implementations.
        if (!(graph instanceof GraphImpl)) {
            throw new GraphException("Cannot import this graph implementation");
        }

        GraphImpl graphImpl = (GraphImpl) graph;

        for (NodeImpl node : graphImpl.getNodes()) {
View Full Code Here

            WsdlMessage inputMessage = createInputMessage();
            WsdlMessage outputMessage = createOutputMessage();
            createPortType(inputMessage, outputMessage);
            addComment();
        } catch (RuntimeException e) {
            throw new GraphException(e);
        }
    }
View Full Code Here

            } 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()
                        + " must be same as the type of output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }
        } else if (port == outputPort) {
            // output -> 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 output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }
            // output -> 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 + size) + " ("
                        + inputType2 + ") of " + getID()
                        + " must be same as the type of input " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }
        } else {
            throw new XBayaRuntimeException();
        }
    }
View Full Code Here

      Node toNode = toPort.getNode();
      Port fromPort = edge.getFromPort();
      Node fromNode = fromPort.getNode();
     
       if(!(toNode instanceof ResourceNode && fromNode instanceof ResourceNode)){
         throw new GraphException("Cannot connect Resource Node to other type of nodes");   
       }
    }   
  }
View Full Code Here

    }

    protected void indexToPointer() throws GraphException {
        this.fromPort = this.graph.getPort(this.fromPortID);
        if (this.fromPort == null) {
            throw new GraphException("Cannot find a port with the ID, "
                    + this.fromPortID + ".");
        }
        this.toPort = this.graph.getPort(this.toPortID);
        if (this.toPort == null) {
            throw new GraphException("Cannot find a port with the ID, "
                    + this.toPortID + ".");
        }

        // Has to do the above first because they are used in the edgeWasAdded
        // method.
View Full Code Here

TOP

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

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.