use of org.eclipse.draw2d.PolylineConnection in project cogtool by cogtool.
the class DesignEditorMouseState method ensureDynamicTransition.
protected void ensureDynamicTransition(int startX, int startY) {
if (potentialTransition == null) {
potentialTransition = new PolylineConnection();
endPtDecoration = new PolygonDecoration();
endPtDecoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
potentialTransition.setStart(new Point(startX, startY));
ui.getViewEditor().addInteractionFigure(potentialTransition);
} else if (!potentialTransition.isVisible()) {
potentialTransition.setVisible(true);
potentialTransition.setStart(new Point(startX, startY));
}
}
use of org.eclipse.draw2d.PolylineConnection in project tdi-studio-se by Talend.
the class ConnectionPerformanceEditPart method refreshVisuals.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
*/
@Override
protected void refreshVisuals() {
SimpleHtmlFigure htmlFigure = (SimpleHtmlFigure) getFigure();
ConnectionPerformance pefModel = (ConnectionPerformance) getModel();
ConnectionPart parent = (ConnectionPart) getParent();
PolylineConnection connFigure = (PolylineConnection) parent.getFigure();
htmlFigure.setText(pefModel.getLabel());
Point offset = pefModel.getOffset();
//$NON-NLS-1$
ConnLabelConstraint constraint = new ConnLabelConstraint(htmlFigure.getPreferredSize(), "middle", offset, connFigure);
parent.setLayoutConstraint(this, htmlFigure, constraint);
}
use of org.eclipse.draw2d.PolylineConnection in project tdi-studio-se by Talend.
the class MonitorConnectionLabelPart method refreshVisuals.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
*/
@Override
protected void refreshVisuals() {
String text = ((MonitorConnectionLabel) getModel()).getLabelText();
Label figure = (Label) getFigure();
// figure.setIcon(null); //TODO add icon to it
figure.setText(text);
figure.setForegroundColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
ConnectionPart parent = (ConnectionPart) getParent();
PolylineConnection connFigure = (PolylineConnection) parent.getFigure();
//$NON-NLS-1$
MonitorConnectionLabelConstraint constraint = new MonitorConnectionLabelConstraint(text, "center", null, connFigure);
parent.setLayoutConstraint(this, getFigure(), constraint);
}
use of org.eclipse.draw2d.PolylineConnection in project tdi-studio-se by Talend.
the class LookupConnectionRouter method route.
public void route(Connection conn) {
PointList points = conn.getPoints();
points.removeAllPoints();
Point p;
Point startPoint = getStartPoint(conn);
Point endPoint = getEndPoint(conn);
conn.translateToRelative(p = startPoint);
points.addPoint(p);
if (conn instanceof PolylineConnection) {
PolylineConnection polylineConn = (PolylineConnection) conn;
// polylineConn.getta
}
// conn.getTargetDecoration()
conn.translateToRelative(p = getReferrencedPoint(startPoint));
points.addPoint(p);
conn.translateToRelative(p = getReferrencedPoint(endPoint));
points.addPoint(p);
conn.translateToRelative(p = endPoint);
points.addPoint(p);
conn.setPoints(points);
}
use of org.eclipse.draw2d.PolylineConnection in project tdi-studio-se by Talend.
the class ConnectionEditPart method createFigure.
@Override
protected IFigure createFigure() {
PolylineConnection connection = new PolylineConnection();
connection.setTargetDecoration(new PolygonDecoration());
curvrRouter = new CurveConnectionRouter();
connection.setForegroundColor(ColorConstants.gray);
connection.setLineWidth(2);
connection.setConnectionRouter(curvrRouter);
return connection;
}
Aggregations