public void drawGraph ( ReteGraph newGraph ) { LayerManager manager = ( LayerManager ) getGraphicalViewer ( ) . getEditPartRegistry ( ) . get ( LayerManager . ID ) ; ConnectionLayer connLayer = ( ConnectionLayer ) manager . getLayer ( LayerConstants . CONNECTION_LAYER ) ; // Lazy-init model initialization if ( getGraphicalViewer ( ) . getContents ( ) == null ) { getGraphicalViewer ( ) . setContents ( getModel ( ) ) ; } final boolean isNewDiagram = newGraph != null && newGraph != diagram ; if ( isNewDiagram ) { diagram . removeAll ( ) ; } // Update connection router according to new model size ConnectionRouter router ; if ( ( isNewDiagram && newGraph . getChildren ( ) . size ( ) < SIMPLE_ROUTER_MIN_NODES ) || ( ! isNewDiagram && getModel ( ) . getChildren ( ) . size ( ) < SIMPLE_ROUTER_MIN_NODES ) ) { router = new ShortestPathConnectionRouter ( ( IFigure ) rootEditPart . getContentPane ( ) . getChildren ( ) . get ( 0 ) ) ; } else { router = ConnectionRouter . NULL ; } connLayer . setConnectionRouter ( router ) ; if ( newGraph != null && newGraph != diagram ) { diagram . addAll ( newGraph . getChildren ( ) ) ; } }
Draws graph .