Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.ConnectionLayer


     * @param newGraph used to replace existing graph. if null then existing graph is simply redrawn.
     */
    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() );
        }

View Full Code Here


    Figure panel = new ScalableFreeformLayeredPane();
    panel.setBackgroundColor(ColorConstants.listBackground);
    panel.setLayoutManager(new XYLayout());
    panel.setBorder(new MarginBorder(MARGIN_SIZE));
    
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(CONNECTION_LAYER);
        cLayer.setAntialias(SWT.ON);
   
    return panel;
  }
View Full Code Here

    };

    delegatingLayoutManager = new DelegatingLayoutManager(this);
    f.setLayoutManager(delegatingLayoutManager);
    f.setOpaque(true);
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    cLayer.setAntialias(SWT.ON);

    FanRouter fanRouter = new FanRouter();
    fanRouter.setSeparation(20);
    ShortestPathConnectionRouter router = new ShortestPathConnectionRouter(f);
    fanRouter.setNextRouter(router);
    cLayer.setConnectionRouter(fanRouter);
    return f;
  }
View Full Code Here

    return true;
  }

  protected void refreshVisuals() {

    ConnectionLayer cLayer = (ConnectionLayer) getLayer(CONNECTION_LAYER);
    cLayer.setAntialias(SWT.ON);
    if (fanRouter == null && router == null) {
      fanRouter = new AnimatedFanConnectionRouter();
      fanRouter.setSeparation(20);
      router = new ShortestPathConnectionRouter(getFigure());
    }
   
    //addFlowRootLabel(getFigure());

    fanRouter.setNextRouter(router);
    cLayer.setConnectionRouter(fanRouter);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.ConnectionLayer

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.