use of org.eclipse.draw2d.PolylineConnection in project tdi-studio-se by Talend.
the class LookupConnectionPart method createFigure.
@Override
protected IFigure createFigure() {
PolylineConnection connection = new PolylineConnection();
connection.setTargetDecoration(new PolygonDecoration());
// connection.setBackgroundColor(ColorConstants.yellow);
connection.setForegroundColor(ColorProviderMapper.getColor(ColorInfo.COLOR_UNSELECTED_LOOKUP_LINKS));
connection.setLineWidth(2);
cr = new LookupConnectionRouter();
connection.setConnectionRouter(cr);
return connection;
}
use of org.eclipse.draw2d.PolylineConnection in project tdi-studio-se by Talend.
the class TableEntityPart method refreshChildrenSourceConnections.
public void refreshChildrenSourceConnections(TableEntityPart rootPart, boolean expanded) {
for (Object obj : getChildren()) {
if (obj instanceof TableEntityPart) {
TableEntityPart part = (TableEntityPart) obj;
if (expanded) {
// do collapse
part.setRootAnchor(rootPart.getFigure());
} else {
part.setRootAnchor(null);
}
if (part.getSourceConnections() != null) {
for (Object conn : part.getSourceConnections()) {
if (conn instanceof BaseConnectionEditPart) {
BaseConnectionEditPart connectionEditPart = (BaseConnectionEditPart) conn;
if (connectionEditPart.getFigure() instanceof PolylineConnection) {
PolylineConnection connFigure = (PolylineConnection) connectionEditPart.getFigure();
if (expanded) {
connectionEditPart.setNodeCollapsed(true);
connFigure.setLineStyle(SWT.LINE_DASHDOTDOT);
} else {
connectionEditPart.setNodeCollapsed(false);
if (!connectionEditPart.isDOTStyle()) {
connFigure.setLineStyle(SWT.LINE_SOLID);
} else {
connFigure.setLineStyle(SWT.LINE_DASHDOTDOT);
}
}
}
connectionEditPart.refresh();
}
}
}
part.refreshChildrenSourceConnections(rootPart, expanded);
}
}
}
use of org.eclipse.draw2d.PolylineConnection in project whole by wholeplatform.
the class GraphLayoutStrategy method applyLayout.
public void applyLayout(DirectedGraph graph) {
NodeList nodes = graph.nodes;
for (int i = 0; i < nodes.size(); i++) {
Node node = (Node) nodes.get(i);
GraphicalEditPart part = (GraphicalEditPart) node.data;
part.getFigure().setBounds(new Rectangle(node.x, node.y, node.width, node.height));
}
EdgeList edges = graph.edges;
for (int i = 0; i < edges.size(); i++) {
Edge edge = (Edge) edges.get(i);
ConnectionEditPart connectionPart = (ConnectionEditPart) edge.data;
nodes = edge.vNodes;
PolylineConnection conn = (PolylineConnection) connectionPart.getFigure();
if (nodes != null) {
List<AbsoluteBendpoint> bends = new ArrayList<AbsoluteBendpoint>();
for (int j = 0; j < nodes.size(); j++) {
Node vn = nodes.getNode(j);
if (edge.isFeedback) {
bends.add(new AbsoluteBendpoint(vn.x, vn.y + vn.height));
bends.add(new AbsoluteBendpoint(vn.x, vn.y));
} else {
bends.add(new AbsoluteBendpoint(vn.x, vn.y));
bends.add(new AbsoluteBendpoint(vn.x, vn.y + vn.height));
}
}
conn.setRoutingConstraint(bends);
} else
conn.setRoutingConstraint(Collections.EMPTY_LIST);
}
}
use of org.eclipse.draw2d.PolylineConnection in project dbeaver by serge-rider.
the class DummyEdgePart method createFigure.
/**
* @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
*/
protected IFigure createFigure() {
PolylineConnection conn = new PolylineConnection();
conn.setConnectionRouter(new BendpointConnectionRouter());
conn.setVisible(true);
return conn;
}
use of org.eclipse.draw2d.PolylineConnection in project dbeaver by serge-rider.
the class LockGraphEdgeEditPart method createFigure.
@Override
protected IFigure createFigure() {
PolylineConnection connection = (PolylineConnection) super.createFigure();
connection.setLineWidth(1);
PolygonDecoration decoration = new PolygonDecoration();
decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
connection.setSourceDecoration(decoration);
return connection;
}
Aggregations