Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.ConnectionEndpointLocator


        String label = (String) getConnectionWrapper().getConnection().getMetaData("label");
        if (sourceLabel != null) {
            sourceLabel.setText(label == null ? "" : label);
        } else if (label != null) {
            Connection connection = (Connection) getFigure();
            ConnectionEndpointLocator endpointLocator = new ConnectionEndpointLocator(connection, true);
            endpointLocator.setVDistance(15);
            sourceLabel = new Label(label);
            connection.add(sourceLabel, endpointLocator);
        }
    }
View Full Code Here


    try {
      if (marker.isSubtypeOf(IModelMarkerConstants.DECORATION_GRAPHICAL_MARKER_ID)) {
        String anchorString = (String)marker.getAttribute(IModelMarkerConstants.DECORATION_GRAPHICAL_MARKER_ANCHOR_POINT_ATTR);
        if (anchorString != null) {
          if (anchorString.equals(IMarkerConstants.MARKER_ANCHORPOINT_SOURCE)) {
            ConnectionEndpointLocator locator = new ConnectionEndpointLocator(fConnection, false);
            locator.setUDistance(4);
            locator.setVDistance(0);
            return locator;
          }
          if (anchorString.equals(IMarkerConstants.MARKER_ANCHORPOINT_TARGET)) {
            ConnectionEndpointLocator locator = new ConnectionEndpointLocator(fConnection, true);
            locator.setUDistance(4);
            locator.setVDistance(0);
            return locator;
          }
          if (anchorString.equals(IMarkerConstants.MARKER_ANCHORPOINT_CENTRE)) return new ConnectionLocator(fConnection, ConnectionLocator.MIDDLE);
        }
      }
View Full Code Here

    protected IFigure createFigure() {
        Connection result = (Connection) super.createFigure();
        // add connection label
        String label = (String) getConnectionWrapper().getConnection().getMetaData().get("label");
        if (label != null) {
            ConnectionEndpointLocator sourceEndpointLocator = new ConnectionEndpointLocator(result, true);
            sourceEndpointLocator.setVDistance(15);
            sourceLabel = new Label(label);
            result.add(sourceLabel, sourceEndpointLocator);
        }
        return result;
    }
View Full Code Here

        String label = (String) getConnectionWrapper().getConnection().getMetaData().get("label");
        if (sourceLabel != null) {
            sourceLabel.setText(label == null ? "" : label);
        } else if (label != null) {
            Connection connection = (Connection) getFigure();
            ConnectionEndpointLocator endpointLocator = new ConnectionEndpointLocator(connection, true);
            endpointLocator.setVDistance(15);
            sourceLabel = new Label(label);
            connection.add(sourceLabel, endpointLocator);
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.ConnectionEndpointLocator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.