Package org.eclipse.gmf.runtime.notation

Examples of org.eclipse.gmf.runtime.notation.Bounds


          //check of root node
          if (level == 1) {
            rootNode = lnode.getNode();           
          }
          //set Y in node     
          Bounds bounds = (Bounds)lnode.getNode().getLayoutConstraint();
          bounds.setY((height + DISTANCE_Y)*(level));
          lnode.getNode().setLayoutConstraint(bounds);
        }
        //set X in node
        int[] levelspace = new int[numberOfLevels];
        for (int i=0; i<(numberOfLevels); i++) {
View Full Code Here


        width = lnode.getWidth();
        find = true;
      }
    }
    int level = checkLevel(node, 0);
    Bounds bounds = (Bounds)node.getLayoutConstraint();
    if (levelspace[level-1] == 0) {
           if (level == 1) {
             bounds.setX(0);
               levelspace[level-1] = bounds.getX() + width;
           }
           else {
             int sequence = getSequence(node);
               if (sequence == 0) {
                 Node parentNode = (Node)((Edge)node.getTargetEdges().get(0)).getSource();
                 int parentWidth = 100;
                 boolean findParent = false;
                 while ((find != true) & (li.hasNext())) {
                   ILayoutNode lnode = (ILayoutNode)li.next();
                   Node helpNode = lnode.getNode();
                   if (helpNode.equals(parentNode)) {
                     parentWidth = lnode.getWidth();
                     findParent = true;
                   }
                 }
                 Bounds parentBounds = (Bounds)parentNode.getLayoutConstraint();
                   int distance = checkChildrensDistance(parentNode, lnodes);
                 if (levelspace[level-1] < (parentBounds.getX() + parentWidth - distance)) {
                   bounds.setX(parentBounds.getX() + parentWidth - distance);
                 }
                 else {
                   bounds.setX(parentBounds.getX());
                 }
               }
               levelspace[level-1] = bounds.getX() + width;
           }
       }
       else {
           int sequence = getSequence(node);
           if (sequence == 0) {
             Node parentNode = (Node)((Edge)node.getTargetEdges().get(0)).getSource();
             int parentWidth = 100;
             boolean findParent = false;
             while ((find != true) & (li.hasNext())) {
               ILayoutNode lnode = (ILayoutNode)li.next();
               Node helpNode = lnode.getNode();
               if (helpNode.equals(parentNode)) {
                 parentWidth = lnode.getWidth();
                 findParent = true;
               }
             }
               Bounds parentBounds = (Bounds)parentNode.getLayoutConstraint();
               int distance = checkChildrensDistance(parentNode, lnodes);
             if (levelspace[level-1] < (parentBounds.getX() + parentWidth - distance - DISTANCE_X)) {
               bounds.setX(parentBounds.getX() + parentWidth - distance);
             }
             else {
                   bounds.setX(levelspace[level-1] + DISTANCE_X);
                 setXofMyParent(node, sequence, levelspace, lnodes);
             }
View Full Code Here

            Node parentNode = (Node)((Edge)node.getTargetEdges().get(0)).getSource();
            int level = checkLevel(parentNode, 0);
        //  int firstChild = ((Bounds)((Node)((Edge)parentNode.getSourceEdges().get(0)).getTarget()).getLayoutConstraint()).getX();
            Edge helpEdge = (Edge)parentNode.getSourceEdges().get(0);
            Node helpNode = (Node)helpEdge.getTarget();
            Bounds helpBounds = (Bounds)helpNode.getLayoutConstraint();
            int firstChild = helpBounds.getX();
           
            helpEdge = (Edge)parentNode.getSourceEdges().get(x);
            helpNode = (Node)helpEdge.getTarget();
            helpBounds = (Bounds)helpNode.getLayoutConstraint();
            int lastChild = helpBounds.getX();
           
            int distance = (lastChild - firstChild)/2 + firstChild;
            helpBounds = (Bounds)parentNode.getLayoutConstraint();
            helpBounds.setX(distance);
           
            int width = 100;
        ListIterator li = lnodes.listIterator();
        boolean find = false;
        while ((find != true) & (li.hasNext())) {
View Full Code Here

    finalHeight = (FIGURE_HEIGHT+DISTANCE_Y)*maxCount-DISTANCE_Y;
       
    return new Runnable() {
      public void run() {
       
        Bounds helpBounds = null;
        Node helpNode = null;
       
       
        // set X & Y position of column-nodes
        for (int column=0; column<lnodes.size(); column++) {
          int countOfNodes = ((Node)((ILayoutNode)lnodes.get(column)).getNode()).getVisibleChildren().size();
          helpNode = (Node)((ILayoutNode)lnodes.get(column)).getNode();
          helpBounds = (Bounds)(helpNode).getLayoutConstraint();
          if (column == 0)
            helpBounds.setX(0);
          else if (column == 1)
            helpBounds.setX(DISTANCE_INPUTS_X + FIGURE_WIDTH);
          else
            helpBounds.setX((DISTANCE_LAYERS_X + FIGURE_WIDTH)*column + DISTANCE_INPUTS_X - DISTANCE_LAYERS_X);
          helpBounds.setY(finalHeight/2 - ((FIGURE_HEIGHT+DISTANCE_Y)*countOfNodes-DISTANCE_Y)/2);
          helpNode.setLayoutConstraint(helpBounds)
        }
       
        // set X & Y position of nodes in clumon
        for (int column=0; column<lnodes.size(); column++) {
          int countOfNodes = ((Node)((ILayoutNode)lnodes.get(column)).getNode()).getVisibleChildren().size();
          for (int positionInCloumn=0; positionInCloumn < countOfNodes; positionInCloumn++) {
            helpNode = (Node)((Node)((ILayoutNode)lnodes.get(column)).getNode()).getVisibleChildren().get(positionInCloumn);
            helpBounds = (Bounds)(helpNode).getLayoutConstraint();
            helpBounds.setX(0);
            helpBounds.setY((FIGURE_HEIGHT+DISTANCE_Y)*positionInCloumn);
            //helpBounds.setY(finalHeight/2 - ((FIGURE_HEIGHT+DISTANCE_Y)*countOfNodes-DISTANCE_Y)/2 +
            //    (FIGURE_HEIGHT+DISTANCE_Y)*positionInCloumn);
            helpNode.setLayoutConstraint(helpBounds);
          }
        }
 
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.notation.Bounds

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.