本文整理汇总了Java中org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities类的典型用法代码示例。如果您正苦于以下问题:Java FigureUtilities类的具体用法?Java FigureUtilities怎么用?Java FigureUtilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FigureUtilities类属于org.eclipse.gmf.runtime.draw2d.ui.figures包,在下文中一共展示了FigureUtilities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initializeFromPreferences
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
@Override
protected void initializeFromPreferences(View view) {
super.initializeFromPreferences(view);
IPreferenceStore store = (IPreferenceStore) getPreferencesHint()
.getPreferenceStore();
if (store == null) {
return;
}
// Create region default styles
ShapeStyle style = (ShapeStyle) view
.getStyle(NotationPackage.Literals.SHAPE_STYLE);
RGB fillRGB = PreferenceConverter.getColor(store,
StatechartPreferenceConstants.PREF_REGION_BACKGROUND);
style.setFillColor(FigureUtilities.RGBToInteger(fillRGB));
RGB lineRGB = PreferenceConverter.getColor(store,
StatechartPreferenceConstants.PREF_REGION_LINE);
style.setLineColor(FigureUtilities.RGBToInteger(lineRGB));
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:20,代码来源:RegionViewFactory.java
示例2: createState_2001
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的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
示例3: getPreferredValue
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* Returns the default background color for states
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
return FigureUtilities.RGBToInteger(StatechartColorConstants.STATE_LINE_COLOR.getRGB());
} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
return FigureUtilities.RGBToInteger(StatechartColorConstants.STATE_BG_COLOR.getRGB());
}
return super.getPreferredValue(feature);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:13,代码来源:StateEditPart.java
示例4: getPreferredValue
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
@Override
public Object getPreferredValue(EStructuralFeature feature) {
if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
return FigureUtilities.RGBToInteger(ColorConstants.white.getRGB());
} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
return FigureUtilities.RGBToInteger(ColorConstants.black.getRGB());
}
return super.getPreferredValue(feature);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:10,代码来源:EntryEditPart.java
示例5: getPreferredValue
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* Returns the default background color for states
*/
@Override
public Object getPreferredValue(EStructuralFeature feature) {
if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
return FigureUtilities.RGBToInteger(StatechartColorConstants.REGION_LINE_COLOR.getRGB());
} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
return FigureUtilities.RGBToInteger(StatechartColorConstants.REGION_BG_COLOR.getRGB());
}
return super.getPreferredValue(feature);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:13,代码来源:RegionEditPart.java
示例6: createLabel
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* Creates a Label view
*
* @param owner
* @param hint
* @return
*/
@SuppressWarnings("unchecked")
public static Node createLabel(View owner, String hint) {
DecorationNode nameLabel = NotationFactory.eINSTANCE.createDecorationNode();
nameLabel.setType(hint);
ShapeStyle style = NotationFactory.eINSTANCE.createShapeStyle();
style.setFontColor(FigureUtilities.RGBToInteger(ColorConstants.black.getRGB()));
nameLabel.getStyles().add(style);
ViewUtil.insertChildView(owner, nameLabel, ViewUtil.APPEND, true);
nameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
return nameLabel;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:21,代码来源:FactoryUtils.java
示例7: initializeFromPreferences
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
@Override
protected void initializeFromPreferences(View view) {
super.initializeFromPreferences(view);
ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
style.setFillColor(FigureUtilities.RGBToInteger(ColorConstants.black.getRGB()));
style.setLineColor(FigureUtilities.RGBToInteger(ColorConstants.white.getRGB()));
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:8,代码来源:EntryViewFactory.java
示例8: createRole_3001
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的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
示例9: createOperation_3002
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createOperation_3002(EObject domainElement, View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.part.ClassDiagram_MAVOVisualIDRegistry.getType(
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.edit.parts.OperationEditPart.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 label5003 = createLabel(node,
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.part.ClassDiagram_MAVOVisualIDRegistry.getType(
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.edit.parts.OperationNameEditPart.VISUAL_ID));
Node label5004 = createLabel(node,
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.part.ClassDiagram_MAVOVisualIDRegistry.getType(
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.edit.parts.WrappingLabel3EditPart.VISUAL_ID));
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:43,代码来源:ClassDiagram_MAVOViewProvider.java
示例10: createParentRequirement_4005
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Edge createParentRequirement_4005(EObject domainElement, View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
Edge edge = NotationFactory.eINSTANCE.createEdge();
edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(TransformationDependencyVisualIDRegistry.getType(ParentRequirementEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
Node label6005 = createLabel(edge,
TransformationDependencyVisualIDRegistry.getType(ParentRequirementLabelEditPart.VISUAL_ID));
label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6005 = (Location) label6005.getLayoutConstraint();
location6005.setX(0);
location6005.setY(40);
return edge;
}
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:43,代码来源:TransformationDependencyViewProvider.java
示例11: createModel_2001
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createModel_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());
{
HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE.createHintedDiagramLinkStyle();
diagramFacet.setHint("Mid"); //$NON-NLS-1$
node.getStyles().add(diagramFacet);
}
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(MIDVisualIDRegistry.getType(ModelEditPart.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, MIDVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
Node label5002 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel2EditPart.VISUAL_ID));
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:36,代码来源:MIDViewProvider.java
示例12: createModel_2002
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createModel_2002(
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());
{
HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE.createHintedDiagramLinkStyle();
diagramFacet.setHint("Mid"); //$NON-NLS-1$
node.getStyles().add(diagramFacet);
}
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(MIDVisualIDRegistry.getType(Model2EditPart.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 label5003 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel3EditPart.VISUAL_ID));
Node label5004 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel4EditPart.VISUAL_ID));
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:36,代码来源:MIDViewProvider.java
示例13: createModelRel_2003
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createModelRel_2003(
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());
{
HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE.createHintedDiagramLinkStyle();
diagramFacet.setHint("Relationship"); //$NON-NLS-1$
node.getStyles().add(diagramFacet);
}
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(MIDVisualIDRegistry.getType(ModelRelEditPart.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 label5005 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel5EditPart.VISUAL_ID));
Node label5006 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel6EditPart.VISUAL_ID));
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:36,代码来源:MIDViewProvider.java
示例14: createModelRel_2004
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createModelRel_2004(
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());
{
HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE.createHintedDiagramLinkStyle();
diagramFacet.setHint("Relationship"); //$NON-NLS-1$
node.getStyles().add(diagramFacet);
}
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(MIDVisualIDRegistry.getType(ModelRel2EditPart.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 label5007 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel7EditPart.VISUAL_ID));
Node label5008 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel8EditPart.VISUAL_ID));
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:36,代码来源:MIDViewProvider.java
示例15: createOperator_2005
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createOperator_2005(
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());
{
HintedDiagramLinkStyle diagramFacet = NotationFactory.eINSTANCE.createHintedDiagramLinkStyle();
diagramFacet.setHint("Mid"); //$NON-NLS-1$
node.getStyles().add(diagramFacet);
}
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(MIDVisualIDRegistry.getType(OperatorEditPart.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 label5009 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel9EditPart.VISUAL_ID));
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:35,代码来源:MIDViewProvider.java
示例16: createExtendibleElementSupertype_4001
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Edge createExtendibleElementSupertype_4001(
View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Edge edge = NotationFactory.eINSTANCE.createEdge();
edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(MIDVisualIDRegistry.getType(ExtendibleElementSupertypeEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
return edge;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:37,代码来源:MIDViewProvider.java
示例17: createModelEndpoint_4004
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Edge createModelEndpoint_4004(
EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Edge edge = NotationFactory.eINSTANCE.createEdge();
edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(MIDVisualIDRegistry.getType(ModelEndpoint2EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
Node label6007 = createLabel(edge, MIDVisualIDRegistry.getType(ModelEndpointNameEditPart.VISUAL_ID));
label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6007 = (Location) label6007.getLayoutConstraint();
location6007.setX(0);
location6007.setY(40);
return edge;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:42,代码来源:MIDViewProvider.java
示例18: createModelEndpoint_4005
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Edge createModelEndpoint_4005(
EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Edge edge = NotationFactory.eINSTANCE.createEdge();
edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(MIDVisualIDRegistry.getType(ModelEndpoint3EditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
Node label6008 = createLabel(edge, MIDVisualIDRegistry.getType(ModelEndpointName2EditPart.VISUAL_ID));
label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6008 = (Location) label6008.getLayoutConstraint();
location6008.setX(0);
location6008.setY(40);
return edge;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:42,代码来源:MIDViewProvider.java
示例19: createExternalTransformation_2006
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createExternalTransformation_2006(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(TransformationDependencyVisualIDRegistry.getType(ExternalTransformationEditPart.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 label5010 = createLabel(node,
TransformationDependencyVisualIDRegistry.getType(ExternalTransformationNameEditPart.VISUAL_ID));
return node;
}
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:31,代码来源:TransformationDependencyViewProvider.java
示例20: createModelEndpointReference_2001
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; //导入依赖的package包/类
/**
* @generated
*/
public Node createModelEndpointReference_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(MIDVisualIDRegistry.getType(ModelEndpointReferenceEditPart.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 label5003 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
Node label5004 = createLabel(node, MIDVisualIDRegistry.getType(WrappingLabel2EditPart.VISUAL_ID));
createCompartment(node,
MIDVisualIDRegistry.getType(ModelEndpointReferenceModelEndpointReferenceCompartmentEditPart.VISUAL_ID),
false, false, true, true);
return node;
}
开发者ID:adisandro,项目名称:MMINT,代码行数:34,代码来源:MIDViewProvider.java
注:本文中的org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论