org.eclipse.draw2d.ConnectionEndpointLocator Java Examples

The following examples show how to use org.eclipse.draw2d.ConnectionEndpointLocator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RelationEditPart.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected IFigure createFigure() {
    final ERDiagramConnection connection = createERDiagramConnection();

    final ConnectionEndpointLocator targetLocator = new ConnectionEndpointLocator(connection, true);
    targetLabel = new Label("");
    connection.add(targetLabel, targetLocator);

    return connection;
}
 
Example #2
Source File: RelationEditPart.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
protected IFigure createFigure() {
    final boolean bezier = getDiagram().getDiagramContents().getSettings().isUseBezierCurve();
    final PolylineConnection connection = new ERDiagramConnection(bezier);
    connection.setConnectionRouter(new BendpointConnectionRouter());
    final ConnectionEndpointLocator targetLocator = new ConnectionEndpointLocator(connection, true);
    this.targetLabel = new Label("");
    connection.add(targetLabel, targetLocator);
    return connection;
}
 
Example #3
Source File: EntityFigureListener.java    From JDeodorant with MIT License 5 votes vote down vote up
public void mouseEntered(MouseEvent me) {

		List<JConnection> connections = figure.getOutgoingConnections();
		for(JConnection connection: connections){

			connection.setLineWidth(3);
			Label l = connection.getLabel();

			if(l != null){

				//String fontStyle = "Arial";
				ConnectionEndpointLocator locator = new ConnectionEndpointLocator(connection, true);

				if(connection.isWrite()){
					locator.setUDistance(95);
					locator.setVDistance(0);
				} else{
					locator.setUDistance(42);
					locator.setVDistance(0);
				}


				//l.setFont(new Font(null, fontStyle, 14 , SWT.BOLD));
				l.setFont(DecorationConstants.highlightFont);

				connection.add(l, locator);
			}

			PolygonDecoration decoration = new PolygonDecoration();
			decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
			decoration.setSize(20, 20);
			decoration.setBackgroundColor(connection.getForegroundColor());
			connection.setTargetDecoration(decoration);
		}
	}
 
Example #4
Source File: RelationEditPart.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected IFigure createFigure() {
	boolean bezier = this.getDiagram().getDiagramContents().getSettings()
			.isUseBezierCurve();
	PolylineConnection connection = new ERDiagramConnection(bezier);
	connection.setConnectionRouter(new BendpointConnectionRouter());

	ConnectionEndpointLocator targetLocator = new ConnectionEndpointLocator(
			connection, true);
	this.targetLabel = new Label("");
	connection.add(targetLabel, targetLocator);

	return connection;
}