[SOLVED] Adding specific nodes from palette [message #1786908] |
Tue, 15 May 2018 07:39  |
Eclipse User |
|
|
|
Hi,
I'm a rookie with Sirius, so maybe my question is a bit stupid (I also tried to find an answer to it in the already stated questions but I couldn't). I created a palette section and some of the nodes in this palette can be dragged and dropped into the diagram, but others not. I suspect it is related to the Reference name in the instance of the node creation item.
The Node creation items that work are directly connected to the main class of my ecore (Mission) by the feature operator. However, the second group of items that inherit from the Pattern abstract class don't. Anyway, the error that I get when I try to add a new node (let's say, createVisit) is the following:
Message: execute
Exception Stack Trace: org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:71)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:52)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.handleDrop(AbstractTransferDropTargetListener.java:339)
at org.eclipse.gef.dnd.TemplateTransferDropTargetListener.handleDrop(TemplateTransferDropTargetListener.java:115)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.SiriusPaletteToolDropTargetListener.handleDrop(SiriusPaletteToolDropTargetListener.java:117)
at org.eclipse.gef.dnd.AbstractTransferDropTargetListener.drop(AbstractTransferDropTargetListener.java:183)
at org.eclipse.jface.util.DelegatingDropAdapter$3.run(DelegatingDropAdapter.java:219)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.util.DelegatingDropAdapter.drop(DelegatingDropAdapter.java:216)
at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:91)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
at org.eclipse.swt.dnd.DropTarget.drop(DropTarget.java:723)
at org.eclipse.swt.dnd.DropTarget.performDragOperation(DropTarget.java:737)
at org.eclipse.swt.dnd.DropTarget.dropTargetProc(DropTarget.java:451)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSView.dragImage(NSView.java:159)
at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:394)
at org.eclipse.swt.dnd.DragSource.lambda$0(DragSource.java:219)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4082)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3699)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.ArrayStoreException
Thank you in advance,
Sergio
PS: I'm uploading the ecore and odesign files, if you require anything else just ask me.
[Updated on: Mon, 17 September 2018 09:22] by Moderator
|
|
|
|
|
|
|
|
|
|
Re: Adding specific nodes from palette [message #1787308 is a reply to message #1787180] |
Wed, 23 May 2018 09:31   |
Eclipse User |
|
|
|
Hello,
The border node mapping VisitNode has no style, you probably forgot it when you moved the mapping.
By the way, I recommand:
- to fill the semantic candidates expressions of the other mappings, for instance for DelegateOpNode, it should be "feature:operator" (you should probably name it operators in your metamodel as it is multi-valued). If this field is not filled then Sirius will look for candidate anywhere in the current project, so you can have unexpected result, like showing an element from a different model of the project. Furthermore, it is far better in performance.
- to define mapping on abstract metaclasses when possible. It looks like some of your mappings are identical for domain classes with a common super class, like StrictOrderedVisitNode, SequenceVisitNode, PattrolingNode etc). You can define a single mapping on "MouvementPattern" or even "Pattern". If you need different display depending on the kind of "Pattern" subclass it is, you can define conditional style. It will be easier to manage your diagram description, create tools etc this way.
Regards,
Steve
|
|
|
|
Powered by
FUDForum. Page generated in 0.05278 seconds