Package org.gvt.util

Examples of org.gvt.util.ChsTransform


    double radialSep = Math.max(maxDiagonalInTree(tree),
      CoSELayout.DEFAULT_RADIAL_SEPARATION);
    CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);
    Rectangle bounds = LGraph.calculateBounds(tree);

    ChsTransform chsTransform = new ChsTransform();
    chsTransform.setDeviceOrgX(bounds.getLeft().x);
    chsTransform.setDeviceOrgY(bounds.getTop().y);
    chsTransform.setWorldOrgX(startingPoint.x);
    chsTransform.setWorldOrgY(startingPoint.y);

    for (int i = 0; i < tree.size(); i++)
    {
      LNode node = tree.get(i);
      node.transform(chsTransform);
    }

    PrecisionPoint bottomRight =
      new PrecisionPoint(bounds.getBottomRight());

    return chsTransform.inverseTransformPoint(bottomRight);
  }
View Full Code Here


    // create a transformation object (from Eclipse to layout). When an
    // inverse transform is applied, we get upper-left coordinate of the
    // drawing or the root graph at given input coordinate (some margins
    // already included in calculation of left-top).

    ChsTransform trans = new ChsTransform();
    Point leftTop = this.lGraphManager.getRoot().updateLeftTop();

    if (leftTop != null)
    {
      trans.setWorldOrgX(newLeftTop.preciseX);
      trans.setWorldOrgY(newLeftTop.preciseY);

      trans.setDeviceOrgX(leftTop.x);
      trans.setDeviceOrgY(leftTop.y);

      List nodes = this.lGraphManager.getNodeList();
      Iterator iter = nodes.iterator();

      while (iter.hasNext())
View Full Code Here

    double radialSep = Math.max(maxDiagonalInTree(tree),
      CoSELayout.DEFAULT_RADIAL_SEPARATION);
    CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);
    Rectangle bounds = LGraph.calculateBounds(tree);

    ChsTransform chsTransform = new ChsTransform();
    chsTransform.setDeviceOrgX(bounds.getLeft().x);
    chsTransform.setDeviceOrgY(bounds.getTop().y);
    chsTransform.setWorldOrgX(startingPoint.x);
    chsTransform.setWorldOrgY(startingPoint.y);

    for (int i = 0; i < tree.size(); i++)
    {
      LNode node = tree.get(i);
      node.transform(chsTransform);
    }

    PrecisionPoint bottomRight =
      new PrecisionPoint(bounds.getBottomRight());

    return chsTransform.inverseTransformPoint(bottomRight);
  }
View Full Code Here

TOP

Related Classes of org.gvt.util.ChsTransform

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.