本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}