Package edu.indiana.extreme.xbaya.graph

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


   * @param graph
   */
  private void handleEvent(MonitorEvent event, boolean forward, Graph graph) {
    EventType type = event.getType();
    String nodeID = event.getNodeID();
    Node node = graph.getNode(nodeID);

    // logger.finest("type: " + type);
    if (type == MonitorUtil.EventType.WORKFLOW_INVOKED) {
      workflowStarted(graph, forward);
    } else if (type == MonitorUtil.EventType.WORKFLOW_TERMINATED) {
View Full Code Here


  private void finishPredecessorNodes(Node node) {
    for (Port inputPort : node.getInputPorts()) {
      for (Edge edge : inputPort.getEdges()) {
        Port fromPort = edge.getFromPort();
        if (!(fromPort instanceof EPRPort)) {
          Node fromNode = fromPort.getNode();
          finishNode(fromNode);
          finishPredecessorNodes(fromNode);
        }
      }
    }
View Full Code Here

        throw new XBayaRuntimeException("Specifies Port was not found:"
            + pair.getRight());
      }
      if (!(candidatePort.getFromNode() instanceof InputNode)) {
        removeUnnecessaryNodes(node, candidatePort, clone);
        Node input = clone.addNode(new InputComponent());
        input.setPosition(new Point(Math.max(0,
            node.getPosition().x - 150), node.getPosition().y));

        // the returned workflows size should be less than that of the
        // original
        if (clone.getGraph().getNodes().size() < workflow.getGraph()
            .getNodes().size()
            // if the sizes the different its a candidate, but need
            // to make sure
            // its not the same as one already harvested
            && !isWorkflowAlreadyHarvested(harvest, clone)) {
          try {
            clone.getGraph().addEdge(input.getOutputPort(0),
                candidatePort);
            cleanLeftOverInputNodes(clone);
          } catch (GraphException e) {
            throw new RuntimeException(e);
          }
View Full Code Here

//    candidatePort.getFromNode().getID()
//        .equals("CrossCuttingConfigurations")) {
//      System.out.println("Crosscuting");
//    }
    if (candidatePort.getFromPort().getEdges().size() == 1) {
      Node fromNode = candidatePort.getFromNode();
      try {
        List<DataPort> inputPorts = fromNode.getInputPorts();
        for (DataPort dataPort : inputPorts) {
          removeUnnecessaryNodes(fromNode, dataPort, workflow);
        }
        workflow.removeNode(fromNode);
      } catch (GraphException e) {
View Full Code Here

    Collection<Port> inputPorts = GraphUtil.getPorts(this.graph,
        Port.Kind.DATA_IN);
    for (Port inputPort : inputPorts) {
      Collection<Port> fromPorts = inputPort.getFromPorts();
      if (fromPorts.size() == 0) {
        Node node = inputPort.getNode();
        String message = node.getID() + " has an unconnected input "
            + inputPort.getName();
        warnings.add(message);
      }
    }
View Full Code Here

   

    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;
          WsdlDefinitions wsdl = engine.getWorkflow().getWSDLs().get(
View Full Code Here

  private boolean hasComplexTypes() {
    List<DataPort> inputPorts = node.getInputPorts();
    boolean ret = true;
    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

      URLComponentRegistry registry = null;
      Thread.sleep(10000);
      registry = new URLComponentRegistry(new URI("http://129.79.246.108:8080/axis2/services/"+getClassName(code)+"?wsdl"));
      new ComponentRegistryLoader(engine).load(registry);
   
      Node newNode = this.engine.getGUI().getGraphCanvas().addNode(((ComponentTreeNode)registry.getComponentTree().getFirstLeaf()).getComponentReference().getComponent(), this.node.getPosition());
      List<DataPort> inputPorts = newNode.getInputPorts();
      Graph graph = this.engine.getGUI().getGraphCanvas().getGraph();
      for (int i=0; i<inputPorts.size(); ++i) {
        graph.addEdge(this.node.getInputPort(i).getFromPort(), inputPorts.get(i));
      }
      List<DataPort> outputPorts = newNode.getOutputPorts();
     
      for (int i=0; i<outputPorts.size(); ++i) {
        List<Port> toPorts = this.node.getOutputPort(i).getToPorts();
        for (Port port : toPorts) {
          graph.removeEdge(this.node.getOutputPort(i), port);
View Full Code Here

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry
                .getComponent(Adder.WSDL_PATH);
        Node adderNode = workflow.addNode(adderComp);
        adderNode.setPosition(new Point(250, 100));

        // Input parameter node 1
        InputNode paramNode1 = (InputNode) workflow
                .addNode(this.inputComponent);
        paramNode1.setPosition(new Point(50, 50));

        // Input parameter node 2
        InputNode paramNode2 = (InputNode) workflow
                .addNode(this.inputComponent);
        paramNode2.setPosition(new Point(50, 120));

        // Output parameter
        OutputNode outParamNode = (OutputNode) workflow
                .addNode(this.outputComponent);
        outParamNode.setPosition(new Point(300, 220));

        // Connect ports
        graph.addEdge(paramNode1.getOutputPort(0), adderNode.getInputPort(0));
        graph.addEdge(paramNode2.getOutputPort(0), adderNode.getInputPort(1));
        graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        String paramValue1 = "2";
        paramNode1.setDefaultValue(paramValue1);
View Full Code Here

        // Adder node
        Component adderComp = this.componentRegistry
                .getComponent(Adder.WSDL_PATH);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        // Multiplier node
        Component multiComp = this.componentRegistry
                .getComponent(Multiplier.WSDL_PATH);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Input node 1
        InputNode inputNode1 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode1.setPosition(new Point(20, 30));

        // Input node 2
        InputNode inputNode2 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode2.setPosition(new Point(20, 100));

        // Input node 3
        InputNode inputNode3 = (InputNode) workflow
                .addNode(this.inputComponent);
        inputNode3.setPosition(new Point(20, 170));

        // Output
        OutputNode outputNode = (OutputNode) workflow
                .addNode(this.outputComponent);
        outputNode.setPosition(new Point(500, 130));

        // Connect ports
        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
        graph.addEdge(inputNode3.getOutputPort(0), multiNode.getInputPort(1));
        graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        inputNode1.setConfiguredName("a");
        inputNode2.setConfiguredName("b");
View Full Code Here

TOP

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

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.