Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EuGENia] Issue with the generated editor(Appear in the editor two gmf.links (instead of one) between two gmf.nodes )
[EuGENia] Issue with the generated editor [message #981591] Mon, 12 November 2012 09:41 Go to next message
Mirco Franzago is currently offline Mirco Franzago
Messages: 12
Registered: November 2012
Junior Member
Hi all,
I'm new here and I hope this is the right place to say my problem.
This is the Emfatic source of my metamodel with the annotating elements:

@gmf(foo="bar")
@namespace(uri="mandml", prefix="mandml")
package mandml;

@gmf.diagram(foo="bar")
class MandML {
  attr String[1] name;
  val Element[*] elements;
}

abstract class Element {
  attr String[1] name;
}

@gmf.link(label="name", source="source", target="target", target.decoration="arrow")
class Connector extends AreaElement, Element {
  attr String condition;
  ref Linkable[1] source;
  ref Linkable[1] target;
  attr ConnectorType[1] type;
}

abstract class Linkable extends Element {
}

@gmf.node(label="name")
class AreaDefinition extends Element {

  @gmf.compartment(foo="bar")
  val AreaElement[*] innerElements;

  @gmf.affixed(foo="bar")
  val InteractionPoint[*] interactionPoints;
}

@gmf.node(label="name", figure="rectangle", border.width="2", border.style="solid", label.placement="internal", size="100,50")
class View extends Linkable, AreaLinkableElement {
}

@gmf.node(label="name", label.placement="external", figure="polygon", polygon.x="0 100 80 20", polygon.y="20 20 0 0")
class ConditionalBranch extends Linkable, AreaLinkableElement {
}

abstract class AreaElement {
}

@gmf.node(label="name")
class Area extends Linkable {
  ref AreaDefinition[1] def;
}

enum ConnectorType {
  unidirectional = 0;
  bidirectional = 1;
  forcedUnidirectional = 2;
}

class AreaConnector extends Connector {
  ref InteractionPoint[1] interactionPoint;
}

abstract class InteractionPoint {
  attr String[1] name;
}

@gmf.node(figure="rectangle", size="20,20", label="name", label.placement="external", label.icon="false")
class EntryPoint extends InteractionPoint {
  ref AreaLinkableElement[1] target;
}

@gmf.node(figure="rectangle", size="20,20", label="name", label.placement="external", label.icon="false")
class ExitPoint extends InteractionPoint {
  ref AreaLinkableElement[1] source;
}

abstract class AreaLinkableElement extends AreaElement {
}


I can generate the diagram editor with no errors, but using the diagram editor I have the issue showed here

index.php/fa/12312/0/

I wanna draw an AreaDefinition and inside it I would to draw a Connector (gmf.link) between two Views (gmf.node), but the editor show to me two different choices (instead of only one) of the Create Connector context menu.

1) If I click on the first one the editor draws two Connectors as shown here

index.php/fa/12313/0/

2) If I click on the second one the editor draws nothing and the eclipse console show to me the follow exception:
!ENTRY org.eclipse.gmf.runtime.diagram.ui 4 4 2012-11-10 01:04:29.047
!MESSAGE execute
!STACK 0
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:169)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
	at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
	at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
	at org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool.handleCreateConnection(ConnectionCreationTool.java:342)
	at org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationTool.handleButtonUp(ConnectionCreationTool.java:182)
	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: org.eclipse.core.runtime.AssertionFailedException: null argument:failed to create a view
	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
	at org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.doExecuteWithResult(CreateCommand.java:96)
	at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy.execute(ICommandProxy.java:68)
	at org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy.doExecuteWithResult(CommandProxy.java:50)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy.execute(ICommandProxy.java:68)
	at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCommand.java:111)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy$PromptAndCreateConnectionCommand.doExecuteWithResult(GraphicalNodeEditPolicy.java:154)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
	at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	... 38 more


I don't know why that happens and I don't know if the problem went from my metamodel or if there is something wrong in the generated code. I hope someone can help me.
Thank you so much!

PS I'm using this distributions: http://www.eclipse.org/epsilon/download/
  • Attachment: Capture1.JPG
    (Size: 31.49KB, Downloaded 268 times)
  • Attachment: Capture2.JPG
    (Size: 28.99KB, Downloaded 266 times)
Re: [EuGENia] Issue with the generated editor [message #981616 is a reply to message #981591] Mon, 12 November 2012 10:06 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 794
Registered: July 2009
Senior Member
Hi,

Eugenia seems to be generating two extraneous LinkMappings in the .gmfgraph model (see screenshot) which appear to be causing the problem. Deleting them and regenerating the .gmfgen model and then regenerating the diagram code (you'll need to delete your .diagram project first) seems to be fixing the problem. Instead of deleting these manually every time, you can write a small script that does this automatically every time you run Eugenia (see [1]).

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/eugenia-polishing/

index.php/fa/12314/0/

Re: [EuGENia] Issue with the generated editor [message #981618 is a reply to message #981616] Mon, 12 November 2012 10:07 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 794
Registered: July 2009
Senior Member
Could you perhaps also file a bug report so that we can get this fixed properly?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT.Epsilon

Cheers,
Dimitris
Re: [EuGENia] Issue with the generated editor [message #981686 is a reply to message #981616] Mon, 12 November 2012 11:13 Go to previous messageGo to next message
Mirco Franzago is currently offline Mirco Franzago
Messages: 12
Registered: November 2012
Junior Member
Modifing the .gmfmap manually as you suggested, the editor don't show anymore the double choices in a context menu, perhaps the editor draws two links between the nodes anyway. After some attemps I noticed that selecting a new "create tool" (from the right side of the editor) one of the two links disappears. What a strange behaviour! Do you have the same?

[Updated on: Mon, 12 November 2012 19:14]

Report message to a moderator

Re: [EuGENia] Issue with the generated editor [message #981693 is a reply to message #981618] Mon, 12 November 2012 11:15 Go to previous message
Mirco Franzago is currently offline Mirco Franzago
Messages: 12
Registered: November 2012
Junior Member
Meanwhile this is the bug report:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=394111
Previous Topic:Customizing ModeLink/Exeed Editor
Next Topic:[EVL] Quick Fix is disabled
Goto Forum:
  


Current Time: Tue Jul 22 21:45:45 EDT 2014

Powered by FUDForum. Page generated in 0.03389 seconds