本文整理汇总了Java中org.eclipse.gmf.runtime.notation.FontStyle类的典型用法代码示例。如果您正苦于以下问题:Java FontStyle类的具体用法?Java FontStyle怎么用?Java FontStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FontStyle类属于org.eclipse.gmf.runtime.notation包,在下文中一共展示了FontStyle类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: decorateView
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void decorateView(View containerView, View view,
IAdaptable element, String semanticHint, int index,
boolean persisted) {
FontStyle fontStyle = NotationFactory.eINSTANCE.createFontStyle();
view.getStyles().add(fontStyle);
super.decorateView(containerView, view, element, semanticHint, index,
persisted);
Node label = FactoryUtils.createLabel(view,
SemanticHints.TRANSITION_EXPRESSION);
Location location = (Location) label.getLayoutConstraint();
location.setX(0);
location.setY(10);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:20,代码来源:TransitionViewFactory.java
示例2: refreshUnderline
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
/**
* @generated
*/
protected void refreshUnderline() {
FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
}
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:11,代码来源:StateNameEditPart.java
示例3: refreshStrikeThrough
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
/**
* @generated
*/
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null && getFigure() instanceof WrappingLabel) {
((WrappingLabel) getFigure()).setTextStrikeThrough(style
.isStrikeThrough());
}
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:12,代码来源:StateNameEditPart.java
示例4: refreshFont
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
/**
* @generated
*/
protected void refreshFont() {
FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
FontData fontData = new FontData(style.getFontName(),
style.getFontHeight(), (style.isBold() ? SWT.BOLD
: SWT.NORMAL)
| (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:15,代码来源:StateNameEditPart.java
示例5: createState_2001
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
/**
* @generated
*/
public Node createState_2001(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.getStyles()
.add(NotationFactory.eINSTANCE.createDescriptionStyle());
node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(StatemachineVisualIDRegistry
.getType(StateEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
.getPreferenceStore();
FontStyle nodeFontStyle = (FontStyle) node
.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore,
IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
.intValue());
}
Node label5001 = createLabel(node,
StatemachineVisualIDRegistry
.getType(StateNameEditPart.VISUAL_ID));
return node;
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:38,代码来源:StatemachineViewProvider.java
示例6: refreshFont
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
/**
* @generated
*/
protected void refreshFont() {
FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
FontData fontData = new FontData(style.getFontName(), style
.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL)
| (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
setFont(fontData);
}
}
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:14,代码来源:ContractNameEditPart.java
示例7: createRole_3001
import org.eclipse.gmf.runtime.notation.FontStyle; //导入依赖的package包/类
/**
* @generated
*/
public Node createRole_3001(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SmcVisualIDRegistry.getType(RoleEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE
.getLineStyle_LineColor(), FigureUtilities
.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node
.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore,
IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
.intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(
prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE
.getFillStyle_FillColor(), FigureUtilities
.RGBToInteger(fillRGB));
Node label5001 = createLabel(node, SmcVisualIDRegistry
.getType(WrappingLabel2EditPart.VISUAL_ID));
return node;
}
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:43,代码来源:SmcViewProvider.java
注:本文中的org.eclipse.gmf.runtime.notation.FontStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论