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


Java IGaService.findStyle方法代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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