本文整理汇总了Java中org.eclipse.gmf.runtime.notation.Node.getLayoutConstraint方法的典型用法代码示例。如果您正苦于以下问题:Java Node.getLayoutConstraint方法的具体用法?Java Node.getLayoutConstraint怎么用?Java Node.getLayoutConstraint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.notation.Node
的用法示例。
在下文中一共展示了Node.getLayoutConstraint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decorateView
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的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);
}
示例2: createView
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
@Override
protected final Node createView(final EObject theElement, final View theContainer) {
final Point theNextCoordinate = getTheNextCoordinate(theContainer);
final Node theNode = super.createView(theElement, theContainer);
final Bounds b = (Bounds) theNode.getLayoutConstraint();
b.setX(theNextCoordinate.x);
b.setY(theNextCoordinate.y);
b.setWidth(getPreference(P_CLASS_DIAGRAM_ELEMENT_WIDTH));
if (!diagrams2Nodes.containsKey(theContainer)) {
diagrams2Nodes.put(theContainer, new ArrayList<Node>());
}
diagrams2Nodes.get(theContainer).add(theNode);
return theNode;
}
示例3: getTheNextCoordinate
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
private Point getTheNextCoordinate(final View inTheContainer) {
final int verticalPadding = getPreference(P_CLASS_DIAGRAM_VERTICAL_PADDING);
final int column = diagrams2Nodes.containsKey(inTheContainer) ? diagrams2Nodes.get(inTheContainer).size()
% getPreference(P_CLASS_DIAGRAM_COLUMNS) : 0;
int theLowestBound = Math.max(DEFAULT_ORIGIN.y, DEFAULT_ORIGIN.y - verticalPadding);
int theLeftMargin = DEFAULT_ORIGIN.x;
for (final Node n : EcoreUtil.<Node> getObjectsByType(inTheContainer.getVisibleChildren(),
NotationPackage.Literals.NODE)) {
final LayoutConstraint l = n.getLayoutConstraint();
if (NotationPackage.Literals.BOUNDS.isInstance(l)) {
final Bounds b = (Bounds) l;
final int aLowerBound;
if (column == 0) {
aLowerBound = b.getY() + verticalPadding
+ (b.getHeight() < 0 ? getPreferredDimension(n).height : b.getHeight());
} else {
aLowerBound = b.getY();
}
theLowestBound = Math.max(theLowestBound, aLowerBound);
theLeftMargin = Math.min(theLeftMargin, b.getX());
}
}
return new Point(column * getPreference(P_CLASS_DIAGRAM_COLUMN_WIDTH) + theLeftMargin, theLowestBound);
}
示例4: moveSelectedStateNodesTo
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
protected void moveSelectedStateNodesTo(View containerView, Bounds compositeBounds) {
for (GraphicalEditPart editPart : getContextObjects()) {
Node stateNode = (Node)editPart.getNotationView();
ViewUtil.insertChildView(containerView, stateNode, ViewUtil.APPEND, true);
Bounds newBounds = NotationFactory.eINSTANCE.createBounds();
Bounds oldBounds = (Bounds)stateNode.getLayoutConstraint();
newBounds.setX(oldBounds.getX() - compositeBounds.getX() - 7); //FIXME use bounds of region view
newBounds.setY(oldBounds.getY() - compositeBounds.getY() - 34); //FIXME use bounds of region view
((Node)editPart.getNotationView()).setLayoutConstraint(newBounds);
}
}
示例5: addLayoutConstraintForAllChildren
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
private void addLayoutConstraintForAllChildren(View state) {
Iterator<?> it = state.getChildren().iterator();
while (it.hasNext()) {
Object next = it.next();
if (next instanceof Node) {
Node currentNode = (Node) next;
if (currentNode.getLayoutConstraint() == null) {
currentNode.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
}
}
}
}
示例6: createModelEndpoint_4004
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的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;
}
示例7: createParentRequirement_4005
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的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;
}
示例8: setPreferredSize
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
protected void setPreferredSize() {
Node node = (Node) getContextObject();
Bounds bounds = (Bounds) node.getLayoutConstraint();
bounds.setWidth(-1);
bounds.setHeight(-1);
}
示例9: createSMC_2001
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Node createSMC_2001(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SmcVisualIDRegistry.getType(SMCEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// 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, SmcVisualIDRegistry
.getType(SMCNameEditPart.VISUAL_ID));
label5003.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location5003 = (Location) label5003.getLayoutConstraint();
location5003.setX(0);
location5003.setY(5);
createCompartment(node, SmcVisualIDRegistry
.getType(SMCSMCCompartmentEditPart.VISUAL_ID), false, false,
false, false);
return node;
}
示例10: createPlayer_2002
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Node createPlayer_2002(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SmcVisualIDRegistry.getType(PlayerEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// 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 label5004 = createLabel(node, SmcVisualIDRegistry
.getType(WrappingLabelEditPart.VISUAL_ID));
label5004.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location5004 = (Location) label5004.getLayoutConstraint();
location5004.setX(0);
location5004.setY(5);
return node;
}
示例11: createContract_3002
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Node createContract_3002(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SmcVisualIDRegistry.getType(ContractEditPart.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 label5005 = createLabel(node, SmcVisualIDRegistry
.getType(ContractNameEditPart.VISUAL_ID));
label5005.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location5005 = (Location) label5005.getLayoutConstraint();
location5005.setX(0);
location5005.setY(5);
return node;
}
示例12: createFact_3003
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Node createFact_3003(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SmcVisualIDRegistry.getType(FactEditPart.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 label5002 = createLabel(node, SmcVisualIDRegistry
.getType(WrappingLabel3EditPart.VISUAL_ID));
label5002.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location5002 = (Location) label5002.getLayoutConstraint();
location5002.setX(0);
location5002.setY(5);
return node;
}
示例13: createXOR_2001
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Node createXOR_2001(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(SimpleBPMN.diagram.edit.parts.XOREditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// 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,
SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(SimpleBPMN.diagram.edit.parts.XORNameEditPart.VISUAL_ID));
label5001.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location5001 = (Location) label5001.getLayoutConstraint();
location5001.setX(0);
location5001.setY(5);
return node;
}
示例14: createOR_2002
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Node createOR_2002(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(SimpleBPMN.diagram.edit.parts.OREditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// 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 label5002 = createLabel(
node,
SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(SimpleBPMN.diagram.edit.parts.ORNameEditPart.VISUAL_ID));
label5002.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location5002 = (Location) label5002.getLayoutConstraint();
location5002.setX(0);
location5002.setY(5);
return node;
}
示例15: createSequenceFlow_4005
import org.eclipse.gmf.runtime.notation.Node; //导入方法依赖的package包/类
/**
* @generated
*/
public Edge createSequenceFlow_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(SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(SimpleBPMN.diagram.edit.parts.SequenceFlow2EditPart.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,
SimpleBPMN.diagram.part.SimpleBPMNVisualIDRegistry
.getType(SimpleBPMN.diagram.edit.parts.SequenceFlowNameEditPart.VISUAL_ID));
label6005.setLayoutConstraint(NotationFactory.eINSTANCE
.createLocation());
Location location6005 = (Location) label6005.getLayoutConstraint();
location6005.setX(0);
location6005.setY(40);
return edge;
}