use of org.eclipse.draw2d.ConnectionLayer 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();
}
use of org.eclipse.draw2d.ConnectionLayer in project jbosstools-hibernate by jbosstools.
the class GEFRootEditPart method setToFront.
@SuppressWarnings("unchecked")
public void setToFront(AbstractConnectionEditPart editpart) {
ConnectionLayer layer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
IFigure fig = editpart.getFigure();
layer.getChildren().remove(fig);
layer.getChildren().add(fig);
}
use of org.eclipse.draw2d.ConnectionLayer in project statecharts by Yakindu.
the class TreeLayoutUtil method getOrderedTreeChildren.
public static ArrayList<IGraphicalEditPart> getOrderedTreeChildren(IGraphicalEditPart parentTreeNodeEditPart) {
final List<IGraphicalEditPart> children = new ArrayList<IGraphicalEditPart>();
final DiagramEditPart diagramEditPart = UIUtils.getDiagramEditPart();
if (diagramEditPart != null) {
final ConnectionLayer connectionLayer = (ConnectionLayer) diagramEditPart.getLayer(LayerConstants.CONNECTION_LAYER);
for (final Connection connection : getTreeFigureIncomingConnections(connectionLayer, parentTreeNodeEditPart.getFigure())) {
final Object object = parentTreeNodeEditPart.getParent().getViewer().getVisualPartMap().get(connection.getSourceAnchor().getOwner());
if (object instanceof IGraphicalEditPart) {
children.add((IGraphicalEditPart) object);
}
}
}
final IGraphicalEditPart[] orderedChildren = new IGraphicalEditPart[children.size()];
final List<IGraphicalEditPart> unorderedChildren = new ArrayList<IGraphicalEditPart>();
for (final IGraphicalEditPart editPart : children) {
final int treePosition = getTreeNodePosition(editPart);
if (treePosition == -1 || treePosition >= orderedChildren.length || orderedChildren[treePosition] != null) {
unorderedChildren.add(editPart);
} else {
orderedChildren[treePosition] = editPart;
}
}
for (final IGraphicalEditPart editPart : unorderedChildren) {
orderedChildren[getNextEmptyIndex(orderedChildren)] = editPart;
}
return new ArrayList<IGraphicalEditPart>(Arrays.asList(orderedChildren));
}
use of org.eclipse.draw2d.ConnectionLayer 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;
}
use of org.eclipse.draw2d.ConnectionLayer 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;
}
Aggregations