|
|
|
|
|
|
|
|
|
|
|
|
|
Re: how do I setup link target mapping? [message #221447 is a reply to message #221314] |
Sat, 14 March 2009 09:06 |
Martin Mising name Messages: 32 Registered: July 2009 |
Member |
|
|
>then you can override public Command getCommand(Request request)
>method in MSubNodeDItemSemanticEditPolicy, just calling super
>implementation from there and place a breakpoint into this method
>- this method should be called then you enter MSubNodeD EditPart
>with the link creation tool...
Alex,
In addition to my previous reply to this, I have tried a different method
of investigating the problem, I don't know if this helps? but I have found
some stange things.
Since I have two versions of the program, one that works and one that does
not work, I thought I would compare the files generated by these different
versions and see where they diverge. The source of the difference is one
letter:
In the version which does not work, in MSubNodeS interface I have defined:
MSubNode getLink();
The version which works has:
MSubNodeD getLink();
As expected the only difference in the .ecore file is the link:
from es3 mathModel.ecore (not working):
<eClassifiers xsi:type="ecore:EClass" name="MSubNodeS"
eSuperTypes="#//MSubNode">
<eStructuralFeatures xsi:type="ecore:EReference" name="link"
eType="#//MSubNode"/>
</eClassifiers>
from es5 mathModel.ecore (working):
<eClassifiers xsi:type="ecore:EClass" name="MSubNodeS"
eSuperTypes="#//MSubNode">
<eStructuralFeatures xsi:type="ecore:EReference" name="link"
eType="#//MSubNodeD"/>
</eClassifiers>
There were no differences with gmfgraph or gmftool.
For some reason gmfmap seems to have created the <nodes> entries are in
reverse order, es3 has href="mathModel.ecore#//MNode/subNodeD first but
es5 has href="mathModel.ecore#//MNode/subNodeS first, given that the
inputs are so similar this seems stange? Otherwise I can't see any
differences, even the link entry seems identical (MSubNodeSLink stays the
same):
<links>
<tool
xsi:type="gmftool:CreationTool"
href="mathModel.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramLink
href="mathModel.gmfgraph#MSubNodeSLink"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="mathModel.ecore#//MSubNodeS/link"/>
</links>
There are a lot of differences in gmfgen and so it is hard to track them
all, these seem to be:
* different package names (es3 and es5) which is just a side effect I
can't avoid.
* various types are swapped between MSubNodeSxxx and MSubNodeDxxx
As far as I know I have answered in the wizards which created these files
in the same way (although its hard to be absolutely sure) in most cases I
have just used the defaults (in both cases I disabled the link entry in
gmftool).
So the versions seem to diverge with gmfmap. What controls the order that
<nodes> entries are created? Does this have any significance for the
program created?
Hopfully others could reproduce the program, I have made the program as
simple as possible to demonstrate the problem and I have put a zip file
with the annotated java interfaces on this web page:
http://www.euclideanspace.com/software/development/eclipse/g mf/linkTargetMapping/
Martin
|
|
|
|
|
Re: how do I setup link target mapping? [message #221571 is a reply to message #221509] |
Mon, 16 March 2009 16:15 |
Martin Mising name Messages: 32 Registered: July 2009 |
Member |
|
|
>Well, can you add same method to MSubNodeSItemSemanticEditPolicy,
>drag a link from MSubNodeS to MSubNodeS (with this link everything
>was ok, right?)
Alex,
No, In the version of the program that does not work, it does not work
when I drag to MSubNodeD or to itself.
In both cases it receives an CreateUnspecifiedTypeConnectionRequest which
does not match anything and returns null.
In an attempt to compare this with what it should do I then tried creating
a new program, using the same data model, but when creating .gmfgraph and
gmftool I selected MSubNode instead of MSubNodeD in the hope that it would
recognise this as the destination of the link. However this did not seem
to make much difference to the code generated, and dragging the link did
not work ether.
At least I have the working version of the program that I can compare
against (which has MSubNodeD getLink(); in the data model).
The difference between the working and non-working versions of the program
are not the execution of the getCommand method but what gets passed to it.
The program that does not work gets a
CreateUnspecifiedTypeConnectionRequest which does not match anything and
returns null.
The program that does work gets a CreateConnectionViewAndElementRequest
which returns a null followed by another call to getCommand containing
aEditCommandRequestWrapper which does return a value.
So I need to start debugging at an earlier stage where the program decides
what messages to send to the getCommand method. I don't know enough about
the structure to know where this might be, can you help?
Martin
PS. In case its any help here are the sequences of calls to the getCommand
method for both the non-working and working programs.
------------------------------------------------------------ ------------------------
The program which does not work gives the following sequence:
when I first select MSubNodeS (i.e. before dragging) I get the following
sequence:
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @3c32fb80)
return=org.eclipse.gef.commands.Command$1$ChainedCompoundCommand@734bcb5c
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.requests.GroupRequest@37debcf3)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.requests.GroupRequest@39fa487f)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @5eada795)
return=org.eclipse.gef.commands.Command$1$ChainedCompoundCommand@5ad557c2
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.requests.GroupRequest@161e14f0)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @10f0a3e8)
return=org.eclipse.gef.commands.Command$1$ChainedCompoundCommand@2698dd08
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @26e7127)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @34baf4ae)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @1f18317f)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.Request@360b0c5a)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @78d5c653)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @397577f9)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @16793542)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @464cdac8)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @45a8a7e)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @4283874e)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @6e6dcfde)
return=null
when I first click on MSubNodeS handle I get the following sequence:
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifie dTypeConnectionRequest @1b7adb4a)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @1ed2e55e)
return=org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy@27d08e21
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifie dTypeConnectionRequest @1b7adb4a)
return=null
when I drag inside MSubNodeD I get:
MSubNodeDItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifie dTypeConnectionRequest @9d8643e)
return=null
when I drag inside MSubNodeS I get:
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifie dTypeConnectionRequest @9d8643e)
return=null
------------------------------------------------------------ -------------------
The program which does work gives the following sequence:
when I first select MSubNodeS (i.e. before dragging) I get the following
sequence:
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @ba679e)
return=org.eclipse.gef.commands.Command$1$ChainedCompoundCommand@33d626a4
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.requests.GroupRequest@381172c5)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.requests.GroupRequest@47bb2cb)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @55172fb9)
return=org.eclipse.gef.commands.Command$1$ChainedCompoundCommand@653e4653
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.requests.GroupRequest@5ade5cd9)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @3ca1d92a)
return=org.eclipse.gef.commands.Command$1$ChainedCompoundCommand@25b8737f
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @5b224686)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @1005354a)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @7838c8c5)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand(org.eclipse.gef.Request@3f6ff2d9)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @2f26f304)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @224577f9)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @5f3c6654)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @2dca4eb4)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @1c6cc9c)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @125c99f)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @1f517997)
return=null
when I first click on MSubNodeS handle I get the following sequence:
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @19e142a5)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @6f7e982f)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyVa lueRequest @5a9c5842)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifie dTypeConnectionRequest @3be67280)
return=null
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @314955ec)
return=org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy@45a8123b
MSubNodeSItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifie dTypeConnectionRequest @3be67280)
return=null
when I drag inside MSubNodeD I get:
MSubNodeDItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnection ViewAndElementRequest @5c538b31)
return=null
MSubNodeDItemSemanticEditPolicy.getCommand( org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandReque stWrapper @654481bb)
return=org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy@74a14fed
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04432 seconds