drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/rete/ReteViewer.java
private void zeroBaseDiagram(ReteGraph graph) {

        Dimension dim = rootEditPart.getContentPane().getSize();

        int minx = 0, miny = 0, maxx = 0, x = dim.width;

        final Iterator<BaseVertex> nodeIter = graph.getChildren().iterator();
        while ( nodeIter.hasNext() ) {
            Point loc = nodeIter.next().getLocation();
            minx = Math.min( loc.x,
                             minx );
            maxx = Math.max( loc.x,
                             maxx );
            miny = Math.min( loc.y,
                             miny );
        }

        int delta = (x - (maxx - minx + 20)) / 2;
        minx = minx - (delta);

        final Iterator<BaseVertex> nodeIter2 = graph.getChildren().iterator();
        while ( nodeIter2.hasNext() ) {
            final BaseVertex vertex = nodeIter2.next();
            Point loc = vertex.getLocation();
            vertex.setLocation( new Point( loc.x - minx,
                                           loc.y - miny ) );
        }
    }
private void zeroBaseDiagram(ReteGraph graph) {

        Dimension dim = rootEditPart.getContentPane().getSize();

        int minx = 0, miny = 0, maxx = 0, x = dim.width;

        final Iterator<BaseVertex> nodeIter = graph.getChildren().iterator();
        while ( nodeIter.hasNext() ) {
            Point loc = nodeIter.next().getLocation();
            minx = Math.min( loc.x,
                             minx );
            maxx = Math.max( loc.x,
                             maxx );
            miny = Math.min( loc.y,
                             miny );
        }

        int delta = (x - (maxx - minx + 20)) / 2;
        minx = minx - (delta);

        final Iterator<BaseVertex> nodeIter2 = graph.getChildren().iterator();
        while ( nodeIter2.hasNext() ) {
            final BaseVertex vertex = nodeIter2.next();
            Point loc = vertex.getLocation();
            vertex.setLocation( new Point( loc.x - minx,
                                           loc.y - miny ) );
        }
    }
private void zeroBaseDiagram ( ReteGraph graph ) { Dimension dim = rootEditPart . getContentPane ( ) . getSize ( ) ; int minx = 0 , miny = 0 , maxx = 0 , x = dim . width ; final Iterator < BaseVertex > nodeIter = graph . getChildren ( ) . iterator ( ) ; while ( nodeIter . hasNext ( ) ) { Point loc = nodeIter . next ( ) . getLocation ( ) ; minx = Math . min ( loc . x , minx ) ; maxx = Math . max ( loc . x , maxx ) ; miny = Math . min ( loc . y , miny ) ; } int delta = ( x - ( maxx - minx + 20 ) ) / 2 ; minx = minx - ( delta ) ; final Iterator < BaseVertex > nodeIter2 = graph . getChildren ( ) . iterator ( ) ; while ( nodeIter2 . hasNext ( ) ) { final BaseVertex vertex = nodeIter2 . next ( ) ; Point loc = vertex . getLocation ( ) ; vertex . setLocation ( new Point ( loc . x - minx , loc . y - miny ) ) ; } }
Moves all <code>diagram</code> nodes to upper left corner
and shifting to right if neccessary to get rid of negative XY coordinates.
Moves all <code > diagram< / code > nodes to upper left corner and shifting to right if neccessary to get rid of negative XY coordinates .