本文整理汇总了Java中org.eclipse.graphiti.services.IGaService类的典型用法代码示例。如果您正苦于以下问题:Java IGaService类的具体用法?Java IGaService怎么用?Java IGaService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IGaService类属于org.eclipse.graphiti.services包,在下文中一共展示了IGaService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}