本文整理汇总了Java中org.eclipse.graphiti.services.IGaService.findStyle方法的典型用法代码示例。如果您正苦于以下问题:Java IGaService.findStyle方法的具体用法?Java IGaService.findStyle怎么用?Java IGaService.findStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.graphiti.services.IGaService
的用法示例。
在下文中一共展示了IGaService.findStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: getStyleForCommonValues
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
public static Style getStyleForCommonValues(Diagram diagram) {
final String styleId = "COMMON-VALUES"; //$NON-NLS-1$
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);
setCommonValues(style);
}
return style;
}
示例13: getStyleForCloudProviderText
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
public static Style getStyleForCloudProviderText(Diagram diagram) {
final String styleId = "CLOUDPROVIDER-TEXT"; //$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);
setCommonTextValues(diagram, gaService, style);
style.setFont(gaService.manageDefaultFont(diagram, false, true));
}
return style;
}
示例14: getStyleForComponentText
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
public static Style getStyleForComponentText(Diagram diagram) {
final String styleId = "COMPONENT-TEXT"; //$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);
setCommonTextValues(diagram, gaService, style);
style.setFont(gaService.manageDefaultFont(diagram, false, true));
}
return style;
}
示例15: getStyleForTextDecorator
import org.eclipse.graphiti.services.IGaService; //导入方法依赖的package包/类
public static Style getStyleForTextDecorator(Diagram diagram) {
final String styleId = "TEXT-DECORATOR-TEXT"; //$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);
setCommonTextValues(diagram, gaService, style);
style.setFont(gaService.manageDefaultFont(diagram, true, false));
}
return style;
}