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


Java IGaService.createPolyline方法代码示例

本文整理汇总了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;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:27,代码来源:LinkPattern.java

示例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;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:22,代码来源:ConnectionAddFeature.java

示例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;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:32,代码来源:ConnectorPattern.java

示例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;
}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:28,代码来源:AddDataConnectionFeature.java


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