Package edu.indiana.extreme.xbaya.graph

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


        .getComponentTree().getChildAt(0);

    Node cepNode = canvas.addNode(cepComponent.getComponentReference()
        .getComponent(), new Point(300, 50));

    Graph graph = this.engine.getGUI().getGraphCanvas().getGraph();
    List<DataPort> cepOutPorts = cepNode.getOutputPorts();
    int count = 0;
    InputComponent inputComponent = new InputComponent();
    LinkedList<InputNode> inputNodes = getStaticInputNodes(oldWorkflow);
    List<DataPort> workflowInPorts = workflowNode.getInputPorts();

    for (InputNode inputNode : inputNodes) {

      List<Port> streamedInputOutPorts = inputNode.getOutputPort(0)
          .getToPorts();
      for (Port streamedInputOutPort : streamedInputOutPorts) {
        for (DataPort dataPort : workflowInPorts) {
          if (dataPort.getName().equals(
              ((DataPort) streamedInputOutPort).getName())) {
            InputNode newNode = (InputNode) canvas.addNode(
                inputComponent, new Point(250 + 5 * count,
                    200 + count * 50));
            graph.addEdge(newNode.getOutputPort(0), dataPort);
            newNode.setDefaultValue(inputNode.getDefaultValue());
            break;
          }
        }

      }
      ++count;
    }
    for (DataPort dataPort : workflowInPorts) {
      if (dataPort.getFromNode() == null) {
        graph.addEdge(cepOutPorts.get(0), dataPort);
      }
    }

    List<DataPort> inputs = cepNode.getInputPorts();
    count = 0;
    for (DataPort dataPort : inputs) {
      Node inputNode = canvas.addNode(inputComponent, new Point(
          5 + 5 * count, 5 + count * 50));
      graph.addEdge(inputNode.getOutputPort(0), dataPort);
      ++count;
    }
    OutputComponent outputComponent = new OutputComponent();
    List<DataPort> outputPorts = workflowNode.getOutputPorts();

    count = 0;
    for (DataPort dataPort : outputPorts) {
      Node outNode = canvas.addNode(outputComponent, new Point(
          900 + count * 5, 100 + count * 50));
      graph.addEdge(dataPort, outNode.getInputPort(0));
      ++count;
    }

  }
View Full Code Here


        URI newTemplateID = newComponent.getTemplateID();

        List<GraphCanvas> graphCanvases = this.engine.getGUI()
                .getGraphCanvases();
        for (GraphCanvas graphCanvas : graphCanvases) {
            Graph graph = graphCanvas.getGraph();
            List<WorkflowNode> updatingNodes = new LinkedList<WorkflowNode>();
            for (Node node : graph.getNodes()) {
                if (node instanceof WorkflowNode) {
                    WorkflowNode workflowNode = (WorkflowNode) node;
                    WorkflowComponent workflowComponent = workflowNode
                            .getComponent();
                    URI templateID = workflowComponent.getTemplateID();
                    if (templateID.equals(newTemplateID)) {
                        updatingNodes.add(workflowNode);
                    }
                }
            }
            for (WorkflowNode node : updatingNodes) {
                Point position = node.getPosition();
                // TODO remember connections too
                graph.removeNode(node);

                WorkflowNode newNode = newComponent.createNode(graph);
                newNode.setPosition(position);
            }
        }
View Full Code Here

TOP

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

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.