Java 类org.eclipse.draw2d.ConnectionEndpointLocator 实例源码

项目:jive    文件:MessageFigure.java   
FoundMessageFigure(final boolean isTransparent)
{
  super(isTransparent);
  final Ellipse circle = new Ellipse();
  circle.setBackgroundColor(ColorConstants.lightGray);
  circle.setLineWidth(1);
  final Rectangle bounds = Rectangle.SINGLETON;
  final int diameter = PreferencesPlugin.getDefault().eventHeight();
  bounds.x = 0;
  bounds.y = 0;
  bounds.width = diameter;
  bounds.height = diameter;
  circle.setBounds(bounds);
  final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(this, false);
  locator.setUDistance(0);
  locator.setVDistance(0);
  add(circle, locator);
}
项目:jive    文件:MessageFigure.java   
LostMessageFigure(final boolean isTransparent, final boolean isException)
{
  super(isTransparent, isException);
  final Ellipse circle = new Ellipse();
  circle.setBackgroundColor(ColorConstants.lightGray);
  circle.setLineWidth(1);
  final Rectangle bounds = Rectangle.SINGLETON;
  final int diameter = PreferencesPlugin.getDefault().eventHeight();
  bounds.x = 0;
  bounds.y = 0;
  bounds.width = diameter;
  bounds.height = diameter;
  circle.setBounds(bounds);
  final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(this, true);
  locator.setUDistance(0);
  locator.setVDistance(0);
  add(circle, locator);
}
项目:seg.jUCMNav    文件:KPIModelLinkRefEditPart.java   
/**
 * Creates a Connection and adds appropriate decorations.
 * 
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    KPIModelLinkRefConnection connection = new KPIModelLinkRefConnection();
    connection.setRoutingConstraint(getKPIModelLinkRef());

    ConnectionEndpointLocator ce = new ConnectionEndpointLocator(connection, true);
    ce.setUDistance(0);
    ce.setVDistance(0);

    // Create the kpiModelLink label
    ConnectionEndpointLocator kpiModelLinkce = new ConnectionEndpointLocator(connection, true);
    kpiModelLinkce.setUDistance(10);
    kpiModelLinkce.setVDistance(10);

    kpiModelLinkLabel = new Label();
    kpiModelLinkLabel.setForegroundColor(ColorManager.KPIMODELLINKREFLABEL);
    connection.add(kpiModelLinkLabel, kpiModelLinkce);
    kpiModelLinkLabel.setVisible(false);

    return connection;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:LabeledConnection.java   
public void redraw() {
    ConnectionEndpointLocator teLoc = new ConnectionEndpointLocator(this, true);
    teLoc.setVDistance(15);
    label.setText(display);
    label.setOpaque(true);
    setLineWidth(2);
    add(label, teLoc);
}
项目:ermasterr    文件:RelationEditPart.java   
/**
 * {@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;
}
项目:ermaster-k    文件:RelationEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
protected IFigure createFigure() {
    ERDiagramConnection connection = this.createERDiagramConnection();

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

    return connection;
}
项目:erflute    文件:RelationEditPart.java   
@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;
}
项目:ermaster-nhit    文件:RelationEditPart.java   
/**
 * {@inheritDoc}
 */
@Override
protected IFigure createFigure() {
    ERDiagramConnection connection = this.createERDiagramConnection();

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

    return connection;
}
项目:FRaMED    文件:ORMRelationshipEditPart.java   
/**
 * This method returns a {@link ConnectionEndpointLocator} for this {@link Relation} from type
 * relationship.
 * 
 * @return locator org.eclipse.draw2d.ConnectionEndpointLocator
 * */
private Locator getConnectionLocator(final PolylineConnection connection, final boolean isEnd) {
  final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(connection, isEnd);
  locator.setVDistance(-1);
  locator.setUDistance(1);
  return locator;
}
项目:jive    文件:TerminatorMessageEditPart.java   
private void addTargetLabel(final Connection connection)
{
  final SequenceDiagramEditPart contents = (SequenceDiagramEditPart) getRoot().getContents();
  final TerminatorMessage message = (TerminatorMessage) getModel();
  if (contents.isCollapsed(message.target()))
  {
    final Label label = new Label("+");
    label.setForegroundColor(ColorConstants.gray);
    final ConnectionEndpointLocator endpointLocator = new ConnectionEndpointLocator(connection,
        true);
    endpointLocator.setUDistance(5);
    endpointLocator.setVDistance(-4);
    connection.add(label, endpointLocator);
  }
}
项目:seg.jUCMNav    文件:LinkRefEditPart.java   
/**
 * Creates a Connection and adds appropriate decorations.
 * 
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    LinkRefConnection connection = new LinkRefConnection();
    connection.setRoutingConstraint(getLinkRef());

    ConnectionEndpointLocator ce = new ConnectionEndpointLocator(connection, true);
    ce.setUDistance(0);
    ce.setVDistance(0);

    decompLabel = new Label();
    decompLabel.setForegroundColor(ColorManager.LINKREFLABEL);
    decompLabel.setOpaque(true);
    connection.add(decompLabel, ce);
    decompLabel.setVisible(false);

    // Create the contribution label
    ConnectionEndpointLocator contribce = new ConnectionEndpointLocator(connection, true);
    contribce.setUDistance(10);
    contribce.setVDistance(10);

    contributionLabel = new Label();
    contributionLabel.setForegroundColor(ColorManager.LINKREFLABEL);
    connection.add(contributionLabel, contribce);
    contributionLabel.setVisible(false);

    // Create the stereotype label
    ConnectionEndpointLocator stereotypece = new ConnectionEndpointLocator(connection, false);
    stereotypece.setUDistance(20);
    stereotypece.setVDistance(10);

    stereotypeLabel = new Label();
    stereotypeLabel.setForegroundColor(ColorManager.LINKREFLABEL);
    connection.add(stereotypeLabel, stereotypece);
    stereotypeLabel.setVisible(false);

    return connection;
}
项目:FRaMED    文件:ORMConnectionFigureFactory.java   
/**
 * {@link Relation}s from type fulfillment have as figure a drawn through line with a
 * {@link Label} at the connection end that contains the names of the {@link Shape}s from type
 * roletype and rolegroup that are fulfilled from the source of this fulfillment and a black arrow
 * tip at the target end of the connection.
 * 
 * @return conn org.eclipse.draw2d.PolylineConnection
 */
private static Figure createFulfillmentFigure(Relation relation, EditPart editPart) {
  PartFigure tooltipTarget = new PartFigure();

  PolylineConnection conn = new PolylineConnection();
  conn.setAntialias(SWT.ON);

  // create the black arrow tip
  PolygonDecoration poly = new PolygonDecoration();
  poly.setAntialias(SWT.ON);
  poly.setBackgroundColor(ColorConstants.black);
  poly.setScale(5, 5);

  // add the the black arrow tip
  conn.setTargetDecoration(poly);
  conn.setConnectionRouter(new BendpointConnectionRouter());

  // add target Label
  ConnectionEndpointLocator targetEndL = new ConnectionEndpointLocator(conn, true);
  targetEndL.setVDistance(-1);
  targetEndL.setUDistance(1);

  // add to the targetLabel the initial roletype and the rolegroup names in the fulfilledrole list
  Label label = new Label("<...>");
  int roleCount = 0;
  for (Shape role : relation.getReferencedRoles()) {
    if (label.getText().equals("<...>")) {
      label.setText(role.getName());
    } else {
      if (roleCount > 2) {
        tooltipTarget.add(new Label(role.getName()));
      } else {
        label.setText(label.getText() + ", " + role.getName());
      }
    }
    roleCount++;
  }

  label.setToolTip(tooltipTarget);
  conn.add(label, targetEndL);

  if (editPart instanceof ORMFulfillmentEditPart) {
    ((ORMFulfillmentEditPart) editPart).setTargetLabel(label);
    ((ORMFulfillmentEditPart) editPart).setTargetToolTip(tooltipTarget);
  }
  return conn;
}