Search in sources :

Example 1 with FanRouter

use of org.eclipse.draw2d.FanRouter in project jbosstools-hibernate by jbosstools.

the class DiagramEditPart method setupFanConnectionRouter.

public void setupFanConnectionRouter() {
    ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    connLayer.setConnectionRouter(new FanRouter());
    getOrmDiagram().setupFanConnectionRouter();
}
Also used : FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 2 with FanRouter

use of org.eclipse.draw2d.FanRouter 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 3 with FanRouter

use of org.eclipse.draw2d.FanRouter 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)

Example 4 with FanRouter

use of org.eclipse.draw2d.FanRouter in project archi by archimatetool.

the class AbstractDiagramPart method refreshVisuals.

@Override
public void refreshVisuals() {
    // on the connection figures - see AbstractConnectionFigure
    if (AnimationUtil.doAnimate()) {
        Animation.markBegin();
    }
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    switch(getModel().getConnectionRouterType()) {
        case IDiagramModel.CONNECTION_ROUTER_MANHATTAN:
            cLayer.setConnectionRouter(new ManhattanConnectionRouter());
            break;
        case IDiagramModel.CONNECTION_ROUTER_BENDPOINT:
        default:
            AutomaticRouter router = new FanRouter();
            router.setNextRouter(new BendpointConnectionRouter());
            cLayer.setConnectionRouter(router);
            break;
    }
    if (AnimationUtil.doAnimate()) {
        Animation.run(AnimationUtil.animationSpeed());
    }
}
Also used : AutomaticRouter(org.eclipse.draw2d.AutomaticRouter) BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) ManhattanConnectionRouter(org.eclipse.draw2d.ManhattanConnectionRouter) FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 5 with FanRouter

use of org.eclipse.draw2d.FanRouter in project archi by archimatetool.

the class AbstractDiagramPart method setConnectionRouter.

/**
 * Set Connection Router type for the whole diagram
 */
protected void setConnectionRouter(boolean withAnimation) {
    // Animation
    if (withAnimation && AnimationUtil.doAnimate()) {
        Animation.markBegin();
    }
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    switch(getModel().getConnectionRouterType()) {
        case IDiagramModel.CONNECTION_ROUTER_MANHATTAN:
            cLayer.setConnectionRouter(new ManhattanConnectionRouter());
            break;
        case IDiagramModel.CONNECTION_ROUTER_BENDPOINT:
        default:
            AutomaticRouter router = new FanRouter();
            router.setNextRouter(new BendpointConnectionRouter());
            cLayer.setConnectionRouter(router);
            break;
    }
    if (withAnimation && AnimationUtil.doAnimate()) {
        Animation.run(AnimationUtil.animationSpeed());
    }
}
Also used : AutomaticRouter(org.eclipse.draw2d.AutomaticRouter) BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) ManhattanConnectionRouter(org.eclipse.draw2d.ManhattanConnectionRouter) FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Aggregations

ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)5 FanRouter (org.eclipse.draw2d.FanRouter)5 AutomaticRouter (org.eclipse.draw2d.AutomaticRouter)2 BendpointConnectionRouter (org.eclipse.draw2d.BendpointConnectionRouter)2 ManhattanConnectionRouter (org.eclipse.draw2d.ManhattanConnectionRouter)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