Examples of mxGraphHierarchyNode


Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

    for (mxGraphAbstractHierarchyCell cell : rank)
    {
      if (cell.isVertex())
      {
        mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
        mxRectangle bounds = layout.getVertexBounds(node.cell);

        if (bounds != null)
        {
          if (orientation == SwingConstants.NORTH
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

      {
        mxGraphAbstractHierarchyCell cell = iter.next();

        if (cell.isVertex())
        {
          mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
          mxRectangle bounds = layout.getVertexBounds(node.cell);

          if (bounds != null)
          {
            if (orientation == SwingConstants.NORTH
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

   * Fixes the position of the specified vertex
   * @param cell the vertex to position
   */
  protected void setVertexLocation(mxGraphAbstractHierarchyCell cell)
  {
    mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
    Object realCell = node.cell;
    double positionX = node.x[0] - node.width / 2;
    double positionY = node.y[0] - node.height / 2;

    rankTopY[cell.minRank] = Math.min(rankTopY[cell.minRank], positionY);
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

      rootsArray = new mxGraphHierarchyNode[modelRoots.length];

      for (int i = 0; i < modelRoots.length; i++)
      {
        Object node = modelRoots[i];
        mxGraphHierarchyNode internalNode = model
            .getVertexMapper().get(node);
        rootsArray[i] = internalNode;
      }
    }

    model.visit(new mxGraphHierarchyModel.CellVisitor()
    {
      public void visit(mxGraphHierarchyNode parent,
          mxGraphHierarchyNode cell,
          mxGraphHierarchyEdge connectingEdge, int layer, int seen)
      {
        // Check if the cell is in it's own ancestor list, if so
        // invert the connecting edge and reverse the target/source
        // relationship to that edge in the parent and the cell
        if ((cell)
            .isAncestor(parent))
        {
          connectingEdge.invert();
          parent.connectsAsSource.remove(connectingEdge);
          parent.connectsAsTarget.add(connectingEdge);
          cell.connectsAsTarget.remove(connectingEdge);
          cell.connectsAsSource.add(connectingEdge);
        }
        seenNodes.add(cell);
        unseenNodes.remove(cell);
      }
    }, rootsArray, true, null);

    Set<Object> possibleNewRoots = null;

    if (unseenNodes.size() > 0)
    {
      possibleNewRoots = new HashSet<Object>(unseenNodes);
    }

    // If there are any nodes that should be nodes that the dfs can miss
    // these need to be processed with the dfs and the roots assigned
    // correctly to form a correct internal model
    Set<mxGraphHierarchyNode> seenNodesCopy = new HashSet<mxGraphHierarchyNode>(
        seenNodes);

    // Pick a random cell and dfs from it
    mxGraphHierarchyNode[] unseenNodesArray = new mxGraphHierarchyNode[1];
    unseenNodes.toArray(unseenNodesArray);
   
    model.visit(new mxGraphHierarchyModel.CellVisitor()
    {
      public void visit(mxGraphHierarchyNode parent,
          mxGraphHierarchyNode cell,
          mxGraphHierarchyEdge connectingEdge, int layer, int seen)
      {
        // Check if the cell is in it's own ancestor list, if so
        // invert the connecting edge and reverse the target/source
        // relationship to that edge in the parent and the cell
        if ((cell)
            .isAncestor(parent))
        {
          connectingEdge.invert();
          parent.connectsAsSource.remove(connectingEdge);
          parent.connectsAsTarget.add(connectingEdge);
          cell.connectsAsTarget.remove(connectingEdge);
          cell.connectsAsSource.add(connectingEdge);
        }
        seenNodes.add(cell);
        unseenNodes.remove(cell);
      }
    }, unseenNodesArray, true, seenNodesCopy);

    mxGraph graph = layout.getGraph();

    if (possibleNewRoots != null && possibleNewRoots.size() > 0)
    {
      Iterator<Object> iter = possibleNewRoots.iterator();
      List<Object> roots = model.roots;

      while (iter.hasNext())
      {
        mxGraphHierarchyNode node = (mxGraphHierarchyNode) iter.next();
        Object realNode = node.cell;
        int numIncomingEdges = graph.getIncomingEdges(realNode).length;

        if (numIncomingEdges == 0)
        {
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

    for (mxGraphAbstractHierarchyCell cell : rank)
    {
      if (cell.isVertex())
      {
        mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
        mxRectangle bounds = layout.getVertexBounds(node.cell);

        if (bounds != null)
        {
          if (orientation == SwingConstants.NORTH
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

      {
        mxGraphAbstractHierarchyCell cell = iter.next();

        if (cell.isVertex())
        {
          mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
          mxRectangle bounds = layout.getVertexBounds(node.cell);

          if (bounds != null)
          {
            if (orientation == SwingConstants.NORTH
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

                    -(int) currentCells[j].getX(currentRank));
              }

              Arrays.sort(sortedCells);

              mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
              double leftLimit = node.x[0] - node.width / 2;
              double rightLimit = leftLimit + node.width;

              // Connected edge count starts at 1 to allow for buffer
              // with edge of vertex
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

   * Fixes the position of the specified vertex
   * @param cell the vertex to position
   */
  protected void setVertexLocation(mxGraphAbstractHierarchyCell cell)
  {
    mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
    Object realCell = node.cell;
    double positionX = node.x[0] - node.width / 2;
    double positionY = node.y[0] - node.height / 2;

//    if (cell.minRank == -1)
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

    for (mxGraphAbstractHierarchyCell cell : rank)
    {
      if (cell.isVertex())
      {
        mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
        mxRectangle bounds = layout.getVertexBounds(node.cell);

        if (bounds != null)
        {
          if (orientation == SwingConstants.NORTH
View Full Code Here

Examples of com.mxgraph.layout.hierarchical.model.mxGraphHierarchyNode

      {
        mxGraphAbstractHierarchyCell cell = iter.next();

        if (cell.isVertex())
        {
          mxGraphHierarchyNode node = (mxGraphHierarchyNode) cell;
          mxRectangle bounds = layout.getVertexBounds(node.cell);

          if (bounds != null)
          {
            if (orientation == SwingConstants.NORTH
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.