Search in sources :

Example 1 with EntityDiagramFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityDiagramFigure in project dbeaver by serge-rider.

the class DiagramPart method createFigure.

@Override
protected IFigure createFigure() {
    EntityDiagramFigure figure = new EntityDiagramFigure(this);
    delegatingLayoutManager = new DelegatingLayoutManager(this);
    figure.setLayoutManager(delegatingLayoutManager);
    /*
        ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
        ViewportAwareConnectionLayerClippingStrategy clippingStrategy = new ViewportAwareConnectionLayerClippingStrategy(cLayer);
        figure.setClippingStrategy(clippingStrategy);
*/
    Control control = getViewer().getControl();
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    if ((control.getStyle() & SWT.MIRRORED) == 0) {
        cLayer.setAntialias(SWT.ON);
    }
    FanRouter router = new FanRouter();
    router.setSeparation(15);
    // router.setNextRouter(new BendpointConnectionRouter());
    router.setNextRouter(new ShortestPathConnectionRouter(figure));
    // router.setNextRouter(new ManhattanConnectionRouter());
    // router.setNextRouter(new BendpointConnectionRouter());
    cLayer.setConnectionRouter(router);
    return figure;
}
Also used : EntityDiagramFigure(org.jkiss.dbeaver.erd.ui.figures.EntityDiagramFigure) Control(org.eclipse.swt.widgets.Control) ShortestPathConnectionRouter(org.eclipse.draw2d.ShortestPathConnectionRouter) DelegatingLayoutManager(org.jkiss.dbeaver.erd.ui.layout.DelegatingLayoutManager) FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 2 with EntityDiagramFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityDiagramFigure in project dbeaver by dbeaver.

the class DiagramPart method createFigure.

@Override
protected IFigure createFigure() {
    EntityDiagramFigure figure = new EntityDiagramFigure(this);
    delegatingLayoutManager = new DelegatingLayoutManager(this);
    figure.setLayoutManager(delegatingLayoutManager);
    /*
        ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
        ViewportAwareConnectionLayerClippingStrategy clippingStrategy = new ViewportAwareConnectionLayerClippingStrategy(cLayer);
        figure.setClippingStrategy(clippingStrategy);
*/
    Control control = getViewer().getControl();
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    if ((control.getStyle() & SWT.MIRRORED) == 0) {
        cLayer.setAntialias(SWT.ON);
    }
    FanRouter router = new FanRouter();
    router.setSeparation(15);
    // router.setNextRouter(new BendpointConnectionRouter());
    router.setNextRouter(new ShortestPathConnectionRouter(figure));
    // router.setNextRouter(new ManhattanConnectionRouter());
    // router.setNextRouter(new BendpointConnectionRouter());
    cLayer.setConnectionRouter(router);
    return figure;
}
Also used : EntityDiagramFigure(org.jkiss.dbeaver.erd.ui.figures.EntityDiagramFigure) Control(org.eclipse.swt.widgets.Control) ShortestPathConnectionRouter(org.eclipse.draw2d.ShortestPathConnectionRouter) DelegatingLayoutManager(org.jkiss.dbeaver.erd.ui.layout.DelegatingLayoutManager) FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Aggregations

ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)2 FanRouter (org.eclipse.draw2d.FanRouter)2 ShortestPathConnectionRouter (org.eclipse.draw2d.ShortestPathConnectionRouter)2 Control (org.eclipse.swt.widgets.Control)2 EntityDiagramFigure (org.jkiss.dbeaver.erd.ui.figures.EntityDiagramFigure)2 DelegatingLayoutManager (org.jkiss.dbeaver.erd.ui.layout.DelegatingLayoutManager)2