Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Link Mapping problem in eclipse 3.4
Link Mapping problem in eclipse 3.4 [message #218527] Thu, 12 February 2009 15:40 Go to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi All..

I am using eclipse 3.4 ganymede which which has GMF 2.1.0

In my link mapping i want to create a link between say Figure 'A'source and
'A'destination.

Also want to create a link between say 'x'source and 'x'destination which
is child of figure 'A'

In my gmf map..1.)i give link mapping for 'x'source to 'x'destination.
2.)i give link mapping for 'A'source to 'A'destination.

It creates link for first ie. x to x but not for A to A

One thing which i noticed is if i interchange the order say
1.)i give link mapping for 'A'source to 'A'destination.
2.)i give link mapping for 'x'source to 'x'destination.

It creates link for first ie. A to A but not for x to x


When i try do the second connection(link) it gives me.
org.eclipse.core.commands.ExecutionException: While executing the
operation, an exception occurred
at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:519)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:205)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:168)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:155)
at
org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTo ol.java:399)
at
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(Abs tractTool.java:411)
at
org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationT ool.handleCreateConnection(ConnectionCreationTool.java:341)
at
org.eclipse.gmf.runtime.diagram.ui.tools.ConnectionCreationT ool.handleButtonUp(ConnectionCreationTool.java:181)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java :1064)
at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:263)
at
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse Released(DomainEventDispatcher.java:374)
at
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(Li ghtweightSystem.java:538)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:207)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
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(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.core.runtime.AssertionFailedException: null
argument:failed to create a view
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:86)
at
org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.do ExecuteWithResult(CreateCommand.java:99)


Plz help

Regards
Govind R
at
org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTr ansactionalCommand.doExecute(AbstractTransactionalCommand.ja va:247)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:157)
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:135)
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:135)
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:135)
at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:511)
... 37 more
Re: Link Mapping problem in eclipse 3.4 [message #218642 is a reply to message #218527] Fri, 13 February 2009 11:15 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

Are there any common superclasses for 'x' and 'A' in the meta-model?
Do you use 'x'/'A' features to sescribe a link(s) or do you use some features
from 'x'/'A' superclasses?

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #218665 is a reply to message #218642] Fri, 13 February 2009 11:41 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex

I have a Main Class 'R' in model which contains 'A'(Containing class is
'R' ) and the class A contains 'x' (Containing class is 'A').

This is basically to make R as my main editor where in i can add
A(Figure) on editor and x(Figure) can be added in 'A'

Actually i had the same model and mapping in my previous version.which is
working(Eclipse europa)..Now i am moved to eclipse ganymede version 3.4
and latest version 2.1.0 of gmf and having this problem..

What is suggested for gmf projects ganymede or europa..

Please help..

Regards
Govind R
Re: Link Mapping problem in eclipse 3.4 [message #218680 is a reply to message #218665] Fri, 13 February 2009 11:48 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

> What is suggested for gmf projects ganymede or europa..
Latest one. :-)
What was the difference in the generated code?

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #218688 is a reply to message #218680] Fri, 13 February 2009 12:13 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex,,.

That i asked bcoz one change what i did was moving to ganymede.

I think there is no much difference in code.but addFixedChild method
which checks for the instance . it returns false. and the exception. :(


Regards
Govind R .
Re: Link Mapping problem in eclipse 3.4 [message #218696 is a reply to message #218688] Fri, 13 February 2009 12:56 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

Can you please describe this difference more specifically? (post a code snippet
here)

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #218704 is a reply to message #218696] Fri, 13 February 2009 13:06 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex,

i have one Editpart for link to to be connected between X and X
and one Editpart for link to be connected between A and A.


For A- A

protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof ABCOperator2EditPart) {
((ABCOperator2EditPart) childEditPart).setLabel(getPrimaryShape()
.getFigureABCOperatorFigure());
return true;
}
return false;
}

For x - x

protected boolean addFixedChild(EditPart childEditPart) {
if (childEditPart instanceof ABCOperatorEditPart) {
((ABCOperatorEditPart) childEditPart).setLabel(getPrimaryShape()
.getFigureABCOperatorFigure());
return true;
}
return false;
}


For connection between x - x it returns false saying not a instance



Regards
Govind R
Re: Link Mapping problem in eclipse 3.4 [message #218712 is a reply to message #218696] Fri, 13 February 2009 13:13 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex

I also found one difference in the respective Editpart .

the Editpart also implements ITreeBranchEditPart which is not in my
previous version ..

and the methods 1.)addFixedChild(EditPart childEditPart)
2.)addChildVisual(EditPart childEditPart, int index)

methods in new version.

Regards
Govind R
Re: Link Mapping problem in eclipse 3.4 [message #218775 is a reply to message #218704] Fri, 13 February 2009 14:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

> protected boolean addFixedChild(EditPart childEditPart) {
This method should be added only for an "inner" figures - figures nested
in another one (like - node name label where the label figure is a part of
node figure hierarchy).
Anyway, on case of links these methods should not be generated for link edit
parts. Can you please check which figures are referenced by corresponding
LinkMappings? This should be a standalone figures (like: Link connection
from plugin/org.eclipse.gmf.graphdef/models/basic.gmfgraph resource).

As an option you can try temporary switching to this connection in both existing
LinkMappings.

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #218783 is a reply to message #218712] Fri, 13 February 2009 14:54 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

> the Editpart also implements ITreeBranchEditPart which is not in my
It's ok. This change was introduced intentionally and should not break anything.

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #218808 is a reply to message #218783] Fri, 13 February 2009 15:21 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex..

I may be bugging u too much..sorry for that

But any clue or suggestions..

Regards
Govind R
Re: Link Mapping problem in eclipse 3.4 [message #220050 is a reply to message #218808] Thu, 26 February 2009 06:02 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex,

One more thing after creating one link i am not able to create any link
subsequent links.

For any other Editparts

I am using now eclipse 3.4 ,gmf 2.13 latest release and its dependencies.


Regards
Govind R.
Re: Link Mapping problem in eclipse 3.4 [message #220060 is a reply to message #220050] Thu, 26 February 2009 10:17 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

You can place a breakpoint into XXXCreateCommand.canExecute() generated for
this link to see the reason why "false" is returned from there.

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #220075 is a reply to message #220060] Thu, 26 February 2009 13:24 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex,

I added and checked

protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
if (!canExecute()) {
throw new ExecutionException(
"Invalid arguments in create link command"); //$NON-NLS-1$
}
return super.doExecuteWithResult(monitor, info);
}

canExecute returns me true .i think its is throwing exception in
super.doExecuteWithResult(monitor, info) method..

is there any problem in modelling.


Also i cames across this link
http://www.jevon.org/wiki/GMF_Troubleshooting_3

do i have add any ocl to me link mapping


Regards
Govind R
Re: Link Mapping problem in eclipse 3.4 [message #220079 is a reply to message #220075] Thu, 26 February 2009 13:47 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

Ok. If "true" is returned from XXXCreateCommand.canExecute() then you can
try placing a breakpont into XXXViewProvider.createEdge() operation - this
method will be called as a second part of link creation and can be another
reason preventing you from second link creation.

> do i have add any ocl to me link mapping
If you have several links with same underlying domain model meta-element
then you have to add some (OCL) constraints to make it possible for GMF to
destinguish between these links.

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #220083 is a reply to message #220079] Thu, 26 February 2009 14:23 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex

In my generated code i have XXXViewProvider which is my superclass, but
doesn't have any createEdge().

I Have to add link constraint or just constraint .




Hello govind,

Ok. If "true" is returned from XXXCreateCommand.canExecute() then you can
try placing a breakpont into XXXViewProvider.createEdge() operation - this
method will be called as a second part of link creation and can be another
reason preventing you from second link creation.

do i have add any ocl to me link mapping
If you have several links with same underlying domain model meta-element
then you have to add some (OCL) constraints to make it possible for GMF to
destinguish between these links.
Re: Link Mapping problem in eclipse 3.4 [message #220146 is a reply to message #220079] Fri, 27 February 2009 04:55 Go to previous messageGo to next message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
Hi Alex.

Can i send u the model files.
So that u have better picture and suggest me the changes.

Thanks in advance

Regards
Govind R
Re: Link Mapping problem in eclipse 3.4 [message #220204 is a reply to message #220146] Fri, 27 February 2009 14:43 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

> So that u have better picture and suggest me the changes.
Sorry, but the usual practice is to answer all questions in newsgroup and
not patching the code..

-----------------
Alex Shatalin
Re: Link Mapping problem in eclipse 3.4 [message #220212 is a reply to message #220083] Fri, 27 February 2009 14:45 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello govind,

> In my generated code i have XXXViewProvider which is my superclass,
What do you mean by "my superclass"? This class should be generated by GMF
and used by diagram while working with it.

> but doesn't have any createEdge().
This method should be implemented anywhere because IViewProvider (interface)
contains it..

-----------------
Alex Shatalin
Re: [Solved]Link Mapping problem in eclipse 3.4 [message #220982 is a reply to message #220204] Tue, 10 March 2009 14:38 Go to previous message
govind Ra is currently offline govind RaFriend
Messages: 95
Registered: July 2009
Member
I added extra checks
It's working
Thanks & Regards
Previous Topic:Connection happens only for first linking mapping
Next Topic:Figure Ref Child Attributes aren't overtaken to the referenced Figures
Goto Forum:
  


Current Time: Thu Apr 18 04:01:07 GMT 2024

Powered by FUDForum. Page generated in 0.02473 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top