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 cubrid-manager by CUBRID.
the class Host2ChildConnectionPart method createFigure.
/**
* create figure used by edit part.
*
* @return IFigure connectin figure
*/
protected IFigure createFigure() {
PolylineConnection conn = new PolylineConnection();
conn.setLineStyle(SWT.LINE_DASH);
conn.setConnectionRouter(new ManhattanConnectionRouter());
conn.setSourceAnchor(getSourceConnectionAnchor());
conn.setTargetAnchor(getTargetConnectionAnchor());
conn.setForegroundColor(CONNECTION_DEFAULT_COLOR);
return conn;
}
use of org.eclipse.draw2d.PolylineConnection in project knime-core by knime.
the class WorkflowMarqueeSelectionTool method calculateNewSelection.
private void calculateNewSelection(final Collection<GraphicalEditPart> newSelections, final Collection<GraphicalEditPart> deselections) {
Rectangle marqueeRect = getMarqueeSelectionRectangle();
for (Iterator<GraphicalEditPart> itr = getAllChildren().iterator(); itr.hasNext(); ) {
GraphicalEditPart child = itr.next();
IFigure figure = child.getFigure();
if (!child.isSelectable() || child.getTargetEditPart(MARQUEE_REQUEST) != child || !isFigureVisible(figure) || !figure.isShowing()) {
continue;
}
if (!(child instanceof NodeContainerEditPart || child instanceof ConnectionContainerEditPart || child instanceof AbstractWorkflowPortBarEditPart || child instanceof AnnotationEditPart)) {
continue;
}
Rectangle r = figure.getBounds().getCopy();
figure.translateToAbsolute(r);
boolean included = false;
if (child instanceof ConnectionEditPart && marqueeRect.intersects(r)) {
Rectangle relMarqueeRect = Rectangle.SINGLETON;
figure.translateToRelative(relMarqueeRect.setBounds(marqueeRect));
included = ((PolylineConnection) figure).getPoints().intersects(relMarqueeRect);
} else if (child instanceof AnnotationEditPart) {
// select WorkflowAnnotations only if they are fully included in the selection
if (figure instanceof WorkflowAnnotationFigure) {
included = marqueeRect.contains(r);
}
} else if (marqueeBehavior == BEHAVIOR_NODES_AND_CONNECTIONS_TOUCHED) {
included = marqueeRect.intersects(r);
} else {
included = marqueeRect.contains(r);
}
if (included) {
if (isToggle()) {
if (wasSelected(child)) {
deselections.add(child);
} else {
newSelections.add(child);
}
} else {
newSelections.add(child);
}
} else if (isToggle()) {
// readded if it was in the selection before
if (wasSelected(child)) {
newSelections.add(child);
} else {
deselections.add(child);
}
}
}
if (marqueeBehavior == BEHAVIOR_NODES_AND_CONNECTIONS_TOUCHED) {
calculateConnections(newSelections, deselections);
}
}
use of org.eclipse.draw2d.PolylineConnection in project dbeaver by dbeaver.
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 archi by archimatetool.
the class GraphConnection method doUpdateFigure.
private void doUpdateFigure(Connection connection) {
if (connection == null || this.isDisposed()) {
return;
}
Shape connectionShape = (Shape) connection;
connectionShape.setLineStyle(getLineStyle());
if (this.getText() != null || this.getImage() != null) {
// Label l = new Label(this.getText(), this.getImage());
if (this.getImage() != null) {
this.connectionLabel.setIcon(this.getImage());
}
if (this.getText() != null) {
this.connectionLabel.setText(this.getText());
}
this.connectionLabel.setFont(this.getFont());
}
if (highlighted) {
connectionShape.setForegroundColor(getHighlightColor());
connectionShape.setLineWidth(getLineWidth() * 2);
} else {
connectionShape.setForegroundColor(getLineColor());
connectionShape.setLineWidth(getLineWidth());
}
if (connection instanceof PolylineArcConnection) {
PolylineArcConnection arcConnection = (PolylineArcConnection) connection;
arcConnection.setDepth(curveDepth);
}
if ((connectionStyle & ZestStyles.CONNECTIONS_DIRECTED) > 0) {
PolygonDecoration decoration = new PolygonDecoration();
if (getLineWidth() < 3) {
decoration.setScale(9, 3);
} else {
double logLineWith = getLineWidth() / 2.0;
decoration.setScale(7 * logLineWith, 3 * logLineWith);
}
((PolylineConnection) connection).setTargetDecoration(decoration);
}
IFigure toolTip;
if (this.getTooltip() == null && getText() != null && getText().length() > 0 && hasCustomTooltip == false) {
toolTip = new Label();
((Label) toolTip).setText(getText());
} else {
toolTip = this.getTooltip();
}
connection.setToolTip(toolTip);
}
Aggregations