本文整理汇总了Java中org.eclipse.graphiti.services.IGaService.createPolyline方法的典型用法代码示例。如果您正苦于以下问题:Java IGaService.createPolyline方法的具体用法?Java IGaService.createPolyline怎么用?Java IGaService.createPolyline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.graphiti.services.IGaService
的用法示例。
在下文中一共展示了IGaService.createPolyline方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
@Override
public PictogramElement add(IAddContext context) {
final IAddConnectionContext addConContext = (IAddConnectionContext) context;
final Link addedConnection = (Link) context.getNewObject();
final IPeCreateService peCreateService = Graphiti.getPeCreateService();
final IGaService gaService = Graphiti.getGaService();
// Create the connection
final FreeFormConnection connection = peCreateService.createFreeFormConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());
// Create the line corresponding to the connection
final Polyline polyline = gaService.createPolyline(connection);
// final ConnectionDecorator cd =
// peCreateService.createConnectionDecorator(connection, false, 1.0,
// true);
// Draw the arrow on the target side of the connection
// Setup styles
polyline.setStyle(StyleUtils.linkShape(getDiagram()));
// create link and wire it
link(connection, addedConnection);
return connection;
}
示例2: add
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
@Override
public PictogramElement add(IAddContext context) {
IAddConnectionContext addConContext = (IAddConnectionContext) context;
Relation addedRelation = (Relation) context.getNewObject();
IPeCreateService peCreateService = Graphiti.getPeCreateService();
// CONNECTION WITH POLYLINE
Connection connection = peCreateService.createFreeFormConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());
IGaService gaService = Graphiti.getGaService();
Polyline polyline = gaService.createPolyline(connection);
polyline.setLineWidth(2);
polyline.setForeground(manageColor(CONNECTION_FOREGROUND));
// create link and wire it
link(connection, addedRelation);
return connection;
}
示例3: add
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
@Override
public PictogramElement add(IAddContext context) {
IAddConnectionContext addConContext = (IAddConnectionContext) context;
IPeCreateService peCreateService = Graphiti.getPeCreateService();
Link connector = (Link) context.getNewObject();
// CONNECTION WITH POLYLINE
Connection connection = peCreateService.createFreeFormConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());
IGaService gaService = Graphiti.getGaService();
Polyline line = gaService.createPolyline(connection);
line.setLineWidth(2);
if(connector.isRequired()){
line.setLineStyle(LineStyle.SOLID);
}
else{
line.setLineStyle(LineStyle.DASH);
};
ConnectionDecorator cd;
cd = peCreateService.createConnectionDecorator(connection, false, 1.0, true);
createArrow(cd);
link(connection, connector);
return connection;
}
示例4: add
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
@Override
public PictogramElement add(final IAddContext context) {
LOGGER.entry(context);
IAddConnectionContext addConContext = (IAddConnectionContext) context;
IPeCreateService peCreateService = Graphiti.getPeCreateService();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Connecting {} and {}", getBusinessObjectForPictogramElement(addConContext.getSourceAnchor()),
getBusinessObjectForPictogramElement(addConContext.getTargetAnchor()));
}
// CONNECTION WITH POLYLINE
LOGGER.debug("creating polyline");
Connection connection = peCreateService.createFreeFormConnection(getDiagram());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());
LOGGER.debug("Connection is {}", connection);
IGaService gaService = Graphiti.getGaService();
Polyline polyline = gaService.createPolyline(connection);
polyline.setLineWidth(2);
polyline.setForeground(manageColor(IColorConstant.RED));
LOGGER.debug("Polyline is {}", polyline);
LOGGER.exit(connection);
return connection;
}