use of org.knime.workbench.editor2.figures.CurvedPolylineConnection in project knime-core by knime.
the class ConnectionContainerEditPart method refreshVisuals.
/**
* {@inheritDoc}
*/
@Override
protected void refreshVisuals() {
super.refreshVisuals();
LOGGER.debug("refreshing visuals for: " + getModel());
ConnectionUIInformation ei = null;
ei = getModel().getUIInfo();
LOGGER.debug("modelling info: " + ei);
// make flow variable port connections look red.
CurvedPolylineConnection fig = (CurvedPolylineConnection) getFigure();
if (getModel().isFlowVariablePortConnection()) {
fig.setForegroundColor(AbstractPortFigure.getFlowVarPortColor());
}
// update 'curved' settings and line width
EditorUIInformation uiInfo = getCurrentEditorSettings();
fig.setCurved(uiInfo.getHasCurvedConnections());
fig.setLineWidth(uiInfo.getConnectionLineWidth());
// recreate list of bendpoints
ArrayList<AbsoluteBendpoint> constraint = new ArrayList<AbsoluteBendpoint>();
if (ei != null) {
int[][] p = ei.getAllBendpoints();
for (int i = 0; i < p.length; i++) {
AbsoluteBendpoint bp = new AbsoluteBendpoint(p[i][0], p[i][1]);
constraint.add(bp);
}
}
fig.setRoutingConstraint(constraint);
}
use of org.knime.workbench.editor2.figures.CurvedPolylineConnection in project knime-core by knime.
the class ConnectionContainerEditPart method createFigure.
/**
* {@inheritDoc}
*/
@Override
protected IFigure createFigure() {
ProgressPolylineConnection conn = new CurvedPolylineConnection(false);
// Bendpoints
SnapOffBendPointConnectionRouter router = new SnapOffBendPointConnectionRouter();
conn.setConnectionRouter(router);
conn.setRoutingConstraint(new ArrayList());
conn.setLineWidth(getCurrentEditorSettings().getConnectionLineWidth());
// make flow variable port connections look red.
if (getModel().isFlowVariablePortConnection()) {
conn.setForegroundColor(AbstractPortFigure.getFlowVarPortColor());
}
return conn;
}
Aggregations