• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IGaService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IGaService类属于org.eclipse.graphiti.services包,在下文中一共展示了IGaService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: commonStyle

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
/**
 * Return the style used for all elements with no specific style.
 * 
 * @param diagram
 * @return
 */
public static Style commonStyle(final Diagram diagram) {
	final String styleId = "COMMON_GENERIC";
	final IGaService gaService = Graphiti.getGaService();

	// Is style already persisted?
	Style style = gaService.findStyle(diagram, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(diagram, styleId);
		style.setLineStyle(LineStyle.SOLID);
		style.setLineVisible(true);
		style.setLineWidth(1);
		style.setTransparency(0.0);
	}
	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:23,代码来源:StyleUtils.java


示例3: commonTextStyle

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
private static Style commonTextStyle(final Diagram diagram) {
	final String styleId = "COMMON_TEXT";
	final IGaService gaService = Graphiti.getGaService();

	// Is style already persisted?
	Style style = gaService.findStyle(diagram, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(diagram, styleId);
		style.setFilled(false);
		style.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
		style.setVerticalAlignment(Orientation.ALIGNMENT_MIDDLE);
		style.setForeground(gaService.manageColor(diagram, IColorConstant.BLACK));
		style.setFont(gaService.manageDefaultFont(diagram, false, false));
	}
	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:18,代码来源:StyleUtils.java


示例4: linkShape

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
/**
 * Return the style used for connections.
 * 
 * @param diagram
 * @return
 */
public static Style linkShape(final Diagram diagram) {
	final String styleId = "LINK";
	final IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	final Style parentStyle = commonStyle(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setLineVisible(true);
		style.setLineWidth(10);
		style.setForeground(gaService.manageColor(diagram, IColorConstant.BLACK));
		style.setBackground(gaService.manageColor(diagram, IColorConstant.BLACK));
	}
	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:24,代码来源:StyleUtils.java


示例5: mediumShape

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
/**
 * Return the style used for Instance shapes.
 * 
 * @param diagram
 * @return
 */
public static Style mediumShape(final Diagram diagram) {
	final String styleId = Medium.class.getName();
	final IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	final Style parentStyle = commonStyle(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(true);
		// gaService.setRenderingStyle(style,
		// PredefinedColoredAreas.getLightYellowAdaptions());
		style.setBackground(gaService.manageColor(diagram, IColorConstant.CYAN));

	}

	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:26,代码来源:StyleUtils.java


示例6: mediumText

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Style mediumText(final Diagram diagram) {
	final String styleId = "MEDIUM_TEXT";
	final IGaService gaService = Graphiti.getGaService();

	final Style parentStyle = commonTextStyle(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) {
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(false);
		style.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
		style.setVerticalAlignment(Orientation.ALIGNMENT_MIDDLE);
		style.setFont(gaService.manageFont(diagram, "Arial", 9, false, true));
	}
	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:17,代码来源:StyleUtils.java


示例7: processingUnitText

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
/**
 * Return the style used for the text displaying name of an Instance.
 * 
 * @param diagram
 * @return
 */
public static Style processingUnitText(final Diagram diagram) {
	final String styleId = "PU_TEXT";
	final IGaService gaService = Graphiti.getGaService();

	final Style parentStyle = commonTextStyle(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) {
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(false);
		style.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
		style.setVerticalAlignment(Orientation.ALIGNMENT_MIDDLE);
		style.setFont(gaService.manageFont(diagram, "Arial", 9, false, true));
	}
	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:23,代码来源:StyleUtils.java


示例8: 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


示例9: createInvisibleEllipse

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Ellipse createInvisibleEllipse(GraphicsAlgorithmContainer gaContainer, IGaService gaService) {
  Ellipse ret = AlgorithmsFactory.eINSTANCE.createEllipse();
  ret.setX(0);
  ret.setY(0);
  ret.setWidth(0);
  ret.setHeight(0);
  ret.setFilled(false);
  ret.setLineVisible(false);
  if (gaContainer instanceof PictogramElement) {
    PictogramElement pe = (PictogramElement) gaContainer;
    pe.setGraphicsAlgorithm(ret);
  } else if (gaContainer instanceof GraphicsAlgorithm) {
    GraphicsAlgorithm parentGa = (GraphicsAlgorithm) gaContainer;
    parentGa.getGraphicsAlgorithmChildren().add(ret);
  }
  return ret;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:18,代码来源:ActivitiUiUtil.java


示例10: getStyleForService

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Style getStyleForService(Diagram diagram) {
	
	final String styleId = "SERVICE";
	IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	Style parentStyle = getStyleForCommonValues(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(true);
		style.setForeground(gaService.manageColor(diagram, SERVICE_FOREGROUND));
		gaService.setRenderingStyle(style, ServiceColoredAreas.getServiceAdaptions());
	}
	return style;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:18,代码来源:StyleUtil.java


示例11: getStyleForNode

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Style getStyleForNode(Diagram diagram) {
	
	final String styleId = "NODE";
	IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	Style parentStyle = getStyleForCommonValues(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(true);
		style.setForeground(gaService.manageColor(diagram, NODE_FOREGROUND));
		gaService.setRenderingStyle(style, NodeColoredAreas.getNodeAdaptions());
	}
	return style;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:18,代码来源:StyleUtil.java


示例12: getStyleForCloudProvider

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Style getStyleForCloudProvider(Diagram diagram) {
	final String styleId = "CLOUDPROVIDER"; //$NON-NLS-1$
	IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	Style parentStyle = getStyleForCommonValues(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(true);
		style.setForeground(gaService.manageColor(diagram, CLOUDPROVIDER_FOREGROUND));

		gaService.setRenderingStyle(style, CloudProviderColoredAreas.getCloudProviderAdaptions());
	}
	return style;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:18,代码来源:StyleUtil.java


示例13: getStyleForConnector

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Style getStyleForConnector (Diagram diagram) {
	final String styleId = "CONNECTOR"; //$NON-NLS-1$
	IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	Style parentStyle = getStyleForCommonValues(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(true);
		style.setForeground(gaService.manageColor(diagram, CLOUDPROVIDER_FOREGROUND));

		gaService.setRenderingStyle(style, CloudProviderColoredAreas.getLightYellowAdaptions());
	}
	return style;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:18,代码来源:StyleUtil.java


示例14: addNode

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
protected ContainerShape addNode(Node node, ContainerShape parent, int x, int y, int w, int h){
	// Get Graphiti services for easier access
	IPeService peService = Graphiti.getPeService();
	IGaService gaService = Graphiti.getGaService();
			
	ContainerShape containerShape = peService.createContainerShape(parent, true);
	PatternUtil.addShapeID(containerShape, "node");

	link(containerShape, node);

	RoundedRectangle roundedRectangle = gaService.createRoundedRectangle(containerShape, 15, 15);
	gaService.setLocationAndSize(roundedRectangle, x, y, w, h);
	//roundedRectangle.setBackground(getColorBackground(node));
	roundedRectangle.setBackground(manageColor(ColorConstant.GREEN));
	roundedRectangle.setForeground(getColorForeground(node));
		
	addName(node, containerShape, 5, 5, w-5, 20);
	
	return containerShape;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:21,代码来源:NodePattern.java


示例15: addNode

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
protected ContainerShape addNode(Node node, ContainerShape parent, int x, int y, int w, int h){
	// Get Graphiti services for easier access
	IPeService peService = Graphiti.getPeService();
	IGaService gaService = Graphiti.getGaService();
			
	ContainerShape containerShape = peService.createContainerShape(parent, true);
	PatternUtil.addShapeID(containerShape, "node");

	link(containerShape, node);

	RoundedRectangle roundedRectangle = gaService.createRoundedRectangle(containerShape, 5, 5);
	gaService.setLocationAndSize(roundedRectangle, x, y, w, h);
	roundedRectangle.setBackground(getColorBackground(node));
	roundedRectangle.setForeground(getColorForeground(node));
		
	addName(node, containerShape, 5, 5, w-5, 20);
	
	return containerShape;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:20,代码来源:RequirementPattern.java


示例16: addNode

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
@Override
protected ContainerShape addNode(Node node, ContainerShape parent, int x, int y, int w, int h){
	// Get Graphiti services for easier access
	IPeService peService = Graphiti.getPeService();
	IGaService gaService = Graphiti.getGaService();
			
	ContainerShape containerShape = peService.createContainerShape(parent, true);
	PatternUtil.addShapeID(containerShape, "node");

	link(containerShape, node);

	RoundedRectangle roundedRectangle = gaService.createRoundedRectangle(containerShape, 5, 5);
	gaService.setLocationAndSize(roundedRectangle, x, y, w, h);
	roundedRectangle.setBackground(getColorBackground(node));
	roundedRectangle.setForeground(getColorForeground(node));
		
	addName(node, containerShape, 5, 5, w-5, 20);
	
	return containerShape;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:21,代码来源:CommandPattern.java


示例17: addNode

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
protected ContainerShape addNode(Node node, ContainerShape parent, int x, int y, int w, int h){
	// Get Graphiti services for easier access
	IPeService peService = Graphiti.getPeService();
	IGaService gaService = Graphiti.getGaService();
			
	ContainerShape containerShape = peService.createContainerShape(parent, true);
	PatternUtil.addShapeID(containerShape, "node");

	link(containerShape, node);

	Polygon polygon = gaService.createPolygon(containerShape, new int[]{0,0, w,0, w+30,h/2, w,h, 0,h});
			//createRoundedRectangle(containerShape, 15, 15);
	gaService.setLocationAndSize(polygon, x, y, w, h);
	polygon.setBackground(getColorBackground(node));
	polygon.setForeground(getColorForeground(node));
		
	addName(node, containerShape, 5, 0, w-5, h);
	
	return containerShape;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:21,代码来源:ActionPattern.java


示例18: processingUnitShape

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
public static Style processingUnitShape(final Diagram diagram, Class<?> type) {
	final String styleId = type.getName();
	final IGaService gaService = Graphiti.getGaService();

	// this is a child style of the common-values-style
	final Style parentStyle = commonStyle(diagram);
	Style style = gaService.findStyle(parentStyle, styleId);

	if (style == null) { // style not found - create new style
		style = gaService.createPlainStyle(parentStyle, styleId);
		style.setFilled(true);
		IColorConstant color = IColorConstant.LIGHT_GRAY;
		if (type == CPU.class) {
			color = IColorConstant.LIGHT_GREEN;
		} else if (type == DSP.class) {
			color = IColorConstant.LIGHT_ORANGE;
		} else if (type == FPGA.class) {
			color = IColorConstant.LIGHT_BLUE;
		}
		// gaService.setRenderingStyle(style,
		// PredefinedColoredAreas.getCopperWhiteGlossAdaptions());
		style.setBackground(gaService.manageColor(diagram, color));

	}

	return style;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:28,代码来源:StyleUtils.java


示例19: createPortShape

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
/**
 * Creates a port shape matching the direction along its actor shape, the single/multi and the input/output types.
 * 
 * @param diagram
 * @param anchor the anchor on which the port shape must be created
 * @param direction
 * @param p
 * @return
 */
public static Polygon createPortShape(Diagram diagram, Anchor anchor, Direction direction, Port p) {
  IGaService gaService = Graphiti.getGaService();

  Collection<Point> portShapePoints = getPortShapeDefinition(direction, p);
  
  final Polygon portShape = gaService.createPlainPolygon(anchor, portShapePoints);
  portShape.setForeground(gaService.manageColor(diagram, PORT_FOREGROUND));
  IColorConstant portColour = p.isMultiPort() ? PORT_BACKGROUND_MULTIPORT : PORT_BACKGROUND_SINGLEPORT;
  portShape.setBackground(gaService.manageColor(diagram, portColour));
  portShape.setLineWidth(1);
  gaService.setLocationAndSize(portShape, 0, 0, PORT_SIZE, PORT_SIZE);
  
  return portShape;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:24,代码来源:PortShapes.java


示例20: add

import org.eclipse.graphiti.services.IGaService; //导入依赖的package包/类
@Override
public PictogramElement add(IAddContext context) {
  Entity addedActor = (Entity) context.getNewObject();
  ContainerShape targetContainer = context.getTargetContainer();

  int xLocation = context.getX();
  int yLocation = context.getY();

  IPeCreateService peCreateService = Graphiti.getPeCreateService();
  IGaService gaService = Graphiti.getGaService();
  ContainerShape containerShape = peCreateService.createContainerShape(targetContainer, true);
  link(context, containerShape, addedActor, BoCategory.CompositeActor);

  GraphicsAlgorithm invisibleRectangle = null;
  invisibleRectangle = gaService.createInvisibleRectangle(containerShape);

  GraphicsAlgorithm actorShapeGA = null;

  String iconResource = (String) context.getProperty("icon");
  String iconType = (String) context.getProperty("iconType");

  switch (iconType) {
  case TriqFeatureProvider.ICONTYPE_SVG:
  case TriqFeatureProvider.ICONTYPE_PTOLEMY:
    actorShapeGA = buildExternallyDefinedShape(context, gaService, invisibleRectangle, containerShape, iconType, iconResource);
    break;
  default:
    actorShapeGA = buildDefaultShape(context, gaService, invisibleRectangle, containerShape, addedActor, iconResource);
  }

  int width = actorShapeGA.getWidth();
  int height = actorShapeGA.getHeight();
  gaService.setLocationAndSize(invisibleRectangle, xLocation, yLocation, width + 15, height);

  layoutPictogramElement(containerShape);

  return containerShape;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:39,代码来源:CompositeActorAddFeature.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Pair类代码示例发布时间:2022-05-22
下一篇:
Java ResourceSet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap