本文整理汇总了Java中org.eclipse.gmf.runtime.notation.NotationPackage类的典型用法代码示例。如果您正苦于以下问题:Java NotationPackage类的具体用法?Java NotationPackage怎么用?Java NotationPackage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotationPackage类属于org.eclipse.gmf.runtime.notation包,在下文中一共展示了NotationPackage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCrossReferencingViews
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
public static Set<View> getCrossReferencingViews(EObject referencedObject) {
Set<View> referencingObjects = new HashSet<>();
CrossReferenceAdapter crossReferenceAdapter = getCrossReferenceAdapter(referencedObject);
if (crossReferenceAdapter != null) {
// Retrieve all views referencing the referencedObject
Iterator<?> views = crossReferenceAdapter.getInverseReferencers(referencedObject,
NotationPackage.eINSTANCE.getView_Element(), NotationPackage.eINSTANCE.getView()).iterator();
while (views.hasNext()) {
View view = (View) views.next();
if (!(view instanceof Diagram)) {
referencingObjects.add(view);
}
}
}
return referencingObjects;
}
开发者ID:bmaggi,项目名称:library-training,代码行数:17,代码来源:NoBookTwiceOneShellModelConstraint.java
示例2: getDiagramContaining
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
/**
* Returns the {@link Diagram} that contains a given semantic element.
*/
public static Diagram getDiagramContaining(EObject element) {
Assert.isNotNull(element);
Resource eResource = element.eResource();
Collection<Diagram> objects = EcoreUtil.getObjectsByType(eResource.getContents(),
NotationPackage.Literals.DIAGRAM);
for (Diagram diagram : objects) {
TreeIterator<EObject> eAllContents = diagram.eAllContents();
while (eAllContents.hasNext()) {
EObject next = eAllContents.next();
if (next instanceof View) {
if (EcoreUtil.equals(((View) next).getElement(), element)) {
return ((View) next).getDiagram();
}
}
}
}
return null;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:22,代码来源:DiagramPartitioningUtil.java
示例3: findNotationView
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
public static View findNotationView(EObject semanticElement) {
Collection<Diagram> objects = EcoreUtil.getObjectsByType(semanticElement.eResource().getContents(),
NotationPackage.Literals.DIAGRAM);
for (Diagram diagram : objects) {
TreeIterator<EObject> eAllContents = diagram.eAllContents();
while (eAllContents.hasNext()) {
EObject next = eAllContents.next();
if (next instanceof View) {
if (((View) next).getElement() == semanticElement) {
return ((View) next);
}
}
}
}
return null;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:DiagramPartitioningUtil.java
示例4: toggleDocumentation
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
public static void toggleDocumentation(List<View> views) {
CompositeCommand command = new CompositeCommand("toggle documentation");
for (View view : views) {
StringValueStyle style = GMFNotationUtil.getStringValueStyle(view, FEATURE_TO_SHOW);
if (style == null) {
style = createInitialStyle(view);
}
String featureName = style.getStringValue()
.equals(SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName())
? BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION.getName()
: SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName();
command.add(new SetValueCommand(
new SetRequest(style, NotationPackage.Literals.STRING_VALUE_STYLE__STRING_VALUE, featureName)));
}
executeCommand(command);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:ToggleShowDocumentationCommand.java
示例5: hasPasteOption
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
/**
* By default, the following paste options are supported:
* <ul>
* <li>{@link PasteOption#NORMAL}: always</li>
* <li>{@link PasteOption#PARENT}: never</li>
* <li>{@link PasteOption#DISTANT}: if and only only if the
* <code>eStructuralFeature</code> is a
* {@link org.eclipse.gmf.runtime.notation.View}'s reference to its semantic
* {@linkplain org.eclipse.gmf.runtime.notation.View#getElement() element}</li>
* </ul>
*/
public boolean hasPasteOption(EObject contextEObject,
EStructuralFeature eStructuralFeature, PasteOption pasteOption) {
if (pasteOption.equals(PasteOption.NORMAL)) {
return true;
} else if (pasteOption.equals(PasteOption.PARENT)) {
// disable the copy-parent functionality completely.
return false;
} else if (pasteOption.equals(PasteOption.DISTANT)) {
if (eStructuralFeature == null) {
return false;
} else {
return NotationPackage.eINSTANCE.getView_Element().equals(
eStructuralFeature);
}
} else {
return false;
}
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:30,代码来源:NotationClipboardOperationHelper.java
示例6: initializeFromPreferences
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例7: match
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
@Override
public Comparison match(IComparisonScope scope, Monitor monitor) {
Predicate<EObject> predicate = new Predicate<EObject>() {
@Override
public boolean apply(EObject eobject) {
// We only want to diff the SGraph and notation elements,
// not the transient palceholders for concrete languages
EPackage ePackage = eobject.eClass().getEPackage();
return ePackage == SGraphPackage.eINSTANCE || ePackage == NotationPackage.eINSTANCE;
}
};
if (scope instanceof DefaultComparisonScope) {
DefaultComparisonScope defaultScope = (DefaultComparisonScope) scope;
defaultScope.setEObjectContentFilter(predicate);
defaultScope.setResourceContentFilter(predicate);
}
return super.match(scope, monitor);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:SCTMatchEngineFactory.java
示例8: getOrCreateTheDiagram
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
Diagram getOrCreateTheDiagram(final Package thePackage) {
if (packages2Diagrams.containsKey(thePackage)) {
return packages2Diagrams.get(thePackage);
}
for (final Diagram aDiagram : EcoreUtil.<Diagram> getObjectsByType(theDiagramResource.getContents(),
NotationPackage.Literals.DIAGRAM)) {
if (thePackage == aDiagram.getElement()) {
packages2Diagrams.put(thePackage, aDiagram);
return aDiagram;
}
}
final Diagram theNewDiagram = createTheDiagram(thePackage);
link(theNewDiagram);
packages2Diagrams.put(thePackage, theNewDiagram);
return theNewDiagram;
}
开发者ID:GRA-UML,项目名称:tool,代码行数:17,代码来源:DiagramSynchronizer.java
示例9: getTheNextCoordinate
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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);
}
开发者ID:GRA-UML,项目名称:tool,代码行数:25,代码来源:DiagramSynchronizer.java
示例10: refreshUnderline
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例11: refreshStrikeThrough
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例12: refreshFont
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例13: handleNotificationEvent
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
/**
* @generated
*/
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
Integer c = (Integer) event.getNewValue();
setFontColor(DiagramColorRegistry.getInstance().getColor(c));
} else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(
feature)) {
refreshUnderline();
} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough()
.equals(feature)) {
refreshStrikeThrough();
} else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(
feature)
|| NotationPackage.eINSTANCE.getFontStyle_FontName().equals(
feature)
|| NotationPackage.eINSTANCE.getFontStyle_Bold()
.equals(feature)
|| NotationPackage.eINSTANCE.getFontStyle_Italic().equals(
feature)) {
refreshFont();
} else {
if (getParser() != null
&& getParser().isAffectingEvent(event,
getParserOptions().intValue())) {
refreshLabel();
}
if (getParser() instanceof ISemanticParser) {
ISemanticParser modelParser = (ISemanticParser) getParser();
if (modelParser.areSemanticElementsAffected(null, event)) {
removeSemanticListeners();
if (resolveSemanticElement() != null) {
addSemanticListeners();
}
refreshLabel();
}
}
}
super.handleNotificationEvent(event);
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:43,代码来源:StateNameEditPart.java
示例14: createState_2001
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例15: handleNotificationEvent
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
@Override
protected void handleNotificationEvent(final Notification notification) {
if (notification.getNotifier() instanceof ShapeStyle) {
refreshVisuals();
} else if (NotationPackage.eINSTANCE.getFontStyle().getEAllAttributes().contains(notification.getFeature())) {
refreshFont();
} else {
super.handleNotificationEvent(notification);
}
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:11,代码来源:ExternalXtextLabelEditPart.java
示例16: handleNotificationEvent
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
@Override
protected void handleNotificationEvent(Notification notification) {
if (notification.getFeature() == getAttribute()
|| notification.getFeature() == NotationPackage.Literals.STRING_VALUE_STYLE__STRING_VALUE) {
refreshVisuals();
}
super.handleNotificationEvent(notification);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:9,代码来源:PlugableExternalXtextLabelEditPart.java
示例17: getPreferredValue
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例18: handleNotificationEvent
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的package包/类
@Override
protected void handleNotificationEvent(Notification notification) {
if (notification.getFeature() == NotationPackage.Literals.BOOLEAN_VALUE_STYLE__BOOLEAN_VALUE) {
refresh();
}
if (notification.getFeature() == NotationPackage.Literals.DRAWER_STYLE__COLLAPSED) {
refreshVisuals();
}
if (notification.getFeature() == SGraphPackage.Literals.COMPOSITE_ELEMENT__REGIONS) {
refreshVisuals();
}
super.handleNotificationEvent(notification);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:14,代码来源:StateEditPart.java
示例19: getPreferredValue
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
示例20: getPreferredValue
import org.eclipse.gmf.runtime.notation.NotationPackage; //导入依赖的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
注:本文中的org.eclipse.gmf.runtime.notation.NotationPackage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论