当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionEndpointLocator类代码示例

本文整理汇总了Java中org.eclipse.draw2d.ConnectionEndpointLocator的典型用法代码示例。如果您正苦于以下问题:Java ConnectionEndpointLocator类的具体用法?Java ConnectionEndpointLocator怎么用?Java ConnectionEndpointLocator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConnectionEndpointLocator类属于org.eclipse.draw2d包,在下文中一共展示了ConnectionEndpointLocator类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FoundMessageFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
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);
}
 
开发者ID:UBPL,项目名称:jive,代码行数:19,代码来源:MessageFigure.java

示例2: LostMessageFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
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);
}
 
开发者ID:UBPL,项目名称:jive,代码行数:19,代码来源:MessageFigure.java

示例3: createFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:26,代码来源:KPIModelLinkRefEditPart.java

示例4: redraw

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
public void redraw() {
	ConnectionEndpointLocator teLoc = new ConnectionEndpointLocator(this, true);
	teLoc.setVDistance(15);
	label.setText(display);
	label.setOpaque(true);
	setLineWidth(2);
	add(label, teLoc);
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:9,代码来源:LabeledConnection.java

示例5: createFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
/**
 * {@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;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:14,代码来源:RelationEditPart.java

示例6: createFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
/**
 * {@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;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:15,代码来源:RelationEditPart.java

示例7: createFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
@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;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:11,代码来源:RelationEditPart.java

示例8: getConnectionLocator

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:13,代码来源:ORMRelationshipEditPart.java

示例9: addTargetLabel

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
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);
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:16,代码来源:TerminatorMessageEditPart.java

示例10: createFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:42,代码来源:LinkRefEditPart.java

示例11: createFulfillmentFigure

import org.eclipse.draw2d.ConnectionEndpointLocator; //导入依赖的package包/类
/**
 * {@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;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:55,代码来源:ORMConnectionFigureFactory.java


注:本文中的org.eclipse.draw2d.ConnectionEndpointLocator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。