Package org.patika.mada.graph

Examples of org.patika.mada.graph.Node


    {
      Object model = ((EditPart)selectedObjects.next()).getModel();

      if (model instanceof Node)
      {
        Node node = (Node) model;

        if (node instanceof ComplexMember)
        {
          node = node.getParents().iterator().next();
        }

        selectedNodes.add(node);
      }
    }
View Full Code Here


  {
    for (Object o : pgraph.getNodes())
    {
      if (o instanceof Node)
      {
        Node node = (Node) o;

        for (XRef ref : refs)
        {
          if (node.getReferences().contains(ref))
          {
            node.setHighlight(true);
          }
        }
      }
    }
  }
View Full Code Here

    // Process the queue

    while (!queue.isEmpty())
    {
      Node current = queue.remove(0);

      // Process edges towards the direction

      for (Edge edge : isFwd ? current.getDownstream() : current.getUpstream())
      {
        // Label the edge considering direction of traversal and type of current node

        if (isFwd || !current.isBreadthNode())
        {
          setLabel(edge, getLabel(current));
        }
        else
        {
          setLabel(edge, getLabel(current) + 1);
        }

        // Get the other end of the edge
        Node neigh = isFwd ? edge.getTargetNode() : edge.getSourceNode();

        // Process the neighbor if not processed or not in queue

        if (getColor(neigh) == WHITE)
        {
          // Label the neighbor according to the search direction and node type

          if (!neigh.isBreadthNode() || !isFwd)
          {
            setLabel(neigh, getLabel(edge));
          }
          else
          {
            setLabel(neigh, getLabel(current) + 1);
          }

          // Check if we need to stop traversing the neighbor, enqueue otherwise
         
          if ((stopSet == null || !stopSet.contains(neigh)) &&
            (!neigh.isBreadthNode() || getLabel(neigh) < limit))
          {
            setColor(neigh, GRAY);

            // Enqueue the node according to its type

            if (neigh.isBreadthNode())
            {
              queue.addLast(neigh);
            }
            else
            {
View Full Code Here

          int previousShortestDist;
          //shortest distance from current BFS
          int currentShortestDist;

          //element of resultant set of BFS
          Node nodeB = (Node) graphObject;

          //find label from result of BFS
          currentShortestDist = BFSResult.get(graphObject);

          //new distance between two nodes
          if(nodeB.isBreadthNode())
          {
            NodePair keyPair =
              new NodePair(entity, ((EntityAssociated) nodeB).getEntity(), currentShortestDist);

            //if shortest path is previously calculated
View Full Code Here

  {
    LinkedList<Node> tempNodeList = new LinkedList<Node>();

    for (Node node : nodes)
    {
      Node n = (Node) graph.getCorrespMember(node);
      assert n != null;
      tempNodeList.add(n);
    }
    nodes = tempNodeList;
View Full Code Here

TOP

Related Classes of org.patika.mada.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.