Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Strange behaviours of diagram partitionning
Strange behaviours of diagram partitionning [message #113687] Thu, 22 March 2007 09:52 Go to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------020905000508000109070504
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


Hi all,


I'm using the diagram partitioning on GMF 3.3M5 and I notice three
strange behaviours.

Here is an example of my recursive model (see example.duplicate and
duplicate.xsd in attachment) :


<duplicate:root xmlns:duplicate="http://www.example.org/duplicate"
name="Level0">
<a link="#//@root/@b.0" name="Level1">
<a link="#//@root/@a.0/@b.0" name="Level2">
<b name="B3"/>
</a>
<b name="B2"/>
</a>
<b name="B1"/>
</duplicate:root>



"root" is an extend of "a", I put a related diagram on "a" with the
same CanvasMappings as the root (see duplicate.gmfmap).

It works fine, except for three strange behaviours :

1. duplication :

When I duplicate an "a" element with children, and when I open the
duplicated element by double clicking, it opens the original element
and not the new one. But if I close the diagram and regenerate another
one with initialisation, everything is ok !

You can try the example in attachment :
- generate the code and launch it
- open example.duplicate_diagram
- duplicate "Level1" element
- rename duplicated "Level1" to "Level11"
- save
- open "Level11"
- fill a description to "B2"
- save and close Level11
- open "Level1"
- description of B2 is filled !
...

2. save1 :

In order not to loose modifications I have to save a diagram before
pening a child, otherwise when I save the child diagram the program asks
if I want to relaod the superior level and so loose modifications...
You can test it by modifying the level0, opening and modifying Level1,
closing and saving it...

3. save2 :

If we open three levels at the same time (for example level0, level1
and level2) with modifications on each. And try to save the three
iagrams, it will be ok for the first but there is an error for the
second and the third ("the file has been changed on the file system"),
the order is not important.


Anybody knows how to fix these behaviours?

Thanks,

Bertrand






--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.gmfgen"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="duplicate.gmfgen"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<gmfgen:GenEditorGenerator xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI"
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xmlns:gmfgen=3D"http://www.eclipse.org/gmf/2005/GenModel/2.0">
<diagram
visualID=3D"79"
editPartClassName=3D"AEditPart"
itemSemanticEditPolicyClassName=3D"AItemSemanticEditPolicy"
notationViewFactoryClassName=3D"AViewFactory"
canonicalEditPolicyClassName=3D"ACanonicalEditPolicy"
iconProviderPriority=3D"Low"
validationProviderPriority=3D"Low">
<diagramRunTimeClass
href=3D"../../../plugin/org.eclipse.gmf.runtime.notation/model/no=
tation.genmodel#//notation/Diagram"/>
<elementType
xsi:type=3D"gmfgen:MetamodelType"
editHelperClassName=3D"AEditHelper"/>
<viewmap
xsi:type=3D"gmfgen:FigureViewmap"
figureQualifiedClassName=3D"org.eclipse.draw2d.FreeformLayer "/>
<domainDiagramElement
href=3D"duplicate.genmodel#//duplicate/A"/>
<topLevelNodes
visualID=3D"1001"
editPartClassName=3D"BEditPart"
itemSemanticEditPolicyClassName=3D"BItemSemanticEditPolicy"
notationViewFactoryClassName=3D"BViewFactory"
canonicalEditPolicyClassName=3D"BCanonicalEditPolicy"
graphicalNodeEditPolicyClassName=3D"BGraphicalNodeEditPolicy "
createCommandClassName=3D"BCreateCommand">
<diagramRunTimeClass
href=3D"../../../plugin/org.eclipse.gmf.runtime.notation/model/=
notation.genmodel#//notation/Node"/>
<elementType
xsi:type=3D"gmfgen:MetamodelType"
editHelperClassName=3D"BEditHelper"/>
<viewmap
xsi:type=3D"gmfgen:InnerClassViewmap"
className=3D"BFigure"
classBody=3D"&#xA;/**&#xA; * @generated&#xA; */&#xA;public clas=
s BFigure extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#x9;/**&#xA;=
&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public BFigure() {&#xA;&#x9;&#x9=
;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimen=
sion(getMapMode().DPtoLP(20)&#xA;, getMapMode().DPtoLP(20)&#xA;));&#xA;th=
is.setFill(true);&#xA;this.setFillXOR(false);&#xA;th is.setOutline(true);&=
#xA;this.setOutlineXOR(false);&#xA;this.setLineWidth(1); &#xA;this.setLine=
Style(org.eclipse.draw2d.Graphics.LINE_SOLID);&#xA;& #x9;&#x9;createConten=
ts();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&# x9; * @generated&#xA;&#x9; */&#xA;&#x=
9;private void createContents(){&#xA;&#xA;&#xA;&#xA;org.ecl ipse.gmf.runti=
me.draw2d.ui.figures.WrapLabel superName2Figure0 =3D new org.eclipse.gmf.=
runtime.draw2d.ui.figures.WrapLabel();&#xA;superName2Fig ure0.setText(&quo=
t;&lt;...> &quot;);&#xA;&#xA;this.add(superName2Figure0);&a mp;#xA;setFigureSup=
erName2Figure(superName2Figure0);&#xA;&#xA;&#x9; }&#xA;&#x9;/**&#xA;&#x9; =
* @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d=
=2Eui.figures.WrapLabel fSuperName2Figure; &#xA;&#xA;&#x9;/**&#xA;&#x9; *=
@generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.u=
i.figures.WrapLabel getFigureSuperName2Figure() {&#xA;&#x9;&#x9;return fS=
uperName2Figure;&#xA;&#x9;}&#xA;&#x9;&#x A;&#x9;/**&#xA;&#x9; * @generated=
&#xA;&#x9; */&#xA;&#x9;private void setFigureSuperName2Figure(org.eclipse=
=2Egmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xA;&#x9;&#x9;fSuperName=
2Figure =3D fig;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;& amp;#xA;&#xA;&#x9;/**&#xA;&#x=
9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinat=
es =3D false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&=
#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseL=
ocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x 9;/**&#xA;&#x9; * @generated&#xA;=
&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalC=
oordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates =3D useLocalCoordinates=
;&#xA;&#x9;}&#xA;&#xA;}&#xA;&#xA;">
<requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
<requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPlu=
ginIDs>
</viewmap>
<modelFacet>
<metaClass
href=3D"duplicate.genmodel#//duplicate/B"/>
<containmentMetaFeature
href=3D"duplicate.genmodel#//duplicate/A/b"/>
<childMetaFeature
href=3D"duplicate.genmodel#//duplicate/A/b"/>
</modelFacet>
<labels
visualID=3D"4001"
editPartClassName=3D"BNameEditPart"
itemSemanticEditPolicyClassName=3D"BNameItemSemanticEditPolicy "=

notationViewFactoryClassName=3D"BNameViewFactory"
elementIcon=3D"true">
<diagramRunTimeClass
href=3D"../../../plugin/org.eclipse.gmf.runtime.notation/mode=
l/notation.genmodel#//notation/Node"/>
<viewmap
xsi:type=3D"gmfgen:ParentAssignedViewmap"
getterName=3D"getFigureSuperName2Figure"
figureQualifiedClassName=3D"org.eclipse.gmf.runtime.draw2d.ui=
=2Efigures.WrapLabel"/>
<modelFacet
xsi:type=3D"gmfgen:FeatureLabelModelFacet">
<metaFeatures
href=3D"duplicate.genmodel#//duplicate/Super/name"/>
</modelFacet>
</labels>
</topLevelNodes>
<topLevelNodes
visualID=3D"1002"
editPartClassName=3D"A2EditPart"
itemSemanticEditPolicyClassName=3D"A2ItemSemanticEditPolicy "
notationViewFactoryClassName=3D"A2ViewFactory"
canonicalEditPolicyClassName=3D"A2CanonicalEditPolicy"
graphicalNodeEditPolicyClassName=3D"AGraphicalNodeEditPolicy "
createCommandClassName=3D"ACreateCommand">
<diagramRunTimeClass
href=3D"../../../plugin/org.eclipse.gmf.runtime.notation/model/=
notation.genmodel#//notation/Node"/>
<elementType
xsi:type=3D"gmfgen:SpecializationType"
metamodelType=3D"//@diagram/@elementType"
editHelperAdviceClassName=3D"AEditHelperAdvice"/>
<viewmap
xsi:type=3D"gmfgen:InnerClassViewmap"
className=3D"AFigure"
classBody=3D"&#xA;/**&#xA; * @generated&#xA; */&#xA;public clas=
s AFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#x9;/**&#xA;&=
#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public AFigure() {&#xA;&#x9;&#x9;=
&#x9;&#x9;this.setFill(true);&#xA;this.setFillXO R(false);&#xA;this.setOut=
line(true);&#xA;this.setOutlineXOR(false);&#xA;this. setLineWidth(1);&#xA;=
this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID);&a mp;#xA;&#x9;&#x9;=
createContents();&#xA;&#x9;}&#xA;&#x9;/**&am p;#xA;&#x9; * @generated&#xA;&#x9=
; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;&#xA;org.ecl ip=
se.gmf.runtime.draw2d.ui.figures.WrapLabel superNameFigure0 =3D new org.e=
clipse.gmf.runtime.draw2d.ui.figures.WrapLabel();&#xA;su perNameFigure0.se=
tText(&quot;&lt;...> &quot;);&#xA;&#xA;this.add(superNameFigure0);&am p;#xA;set=
FigureSuperNameFigure(superNameFigure0);&#xA;&#xA;&a mp;#x9;}&#xA;&#x9;/**&#xA=
;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime=
=2Edraw2d.ui.figures.WrapLabel fSuperNameFigure; &#xA;&#xA;&#x9;/**&#xA;&=
#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.dr=
aw2d.ui.figures.WrapLabel getFigureSuperNameFigure() {&#xA;&#x9;&#x9;retu=
rn fSuperNameFigure;&#xA;&#x9;}&#xA;&#x9;&# xA;&#x9;/**&#xA;&#x9; * @gener=
ated&#xA;&#x9; */&#xA;&#x9;private void setFigureSuperNameFigure(org.ecli=
pse.gmf.runtime.draw2d.ui.figures.WrapLabel fig){&#xA;&#x9;&#x9;fSuperNam=
eFigure =3D fig;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;& amp;#xA;&#xA;&#x9;/**&#xA;&#x=
9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinat=
es =3D false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&=
#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseL=
ocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x 9;/**&#xA;&#x9; * @generated&#xA;=
&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalC=
oordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates =3D useLocalCoordinates=
;&#xA;&#x9;}&#xA;&#xA;}&#xA;&#xA;">
<requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
<requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPlu=
ginIDs>
</viewmap>
<behaviour
xsi:type=3D"gmfgen:OpenDiagramBehaviour"/>
<modelFacet>
<metaClass
href=3D"duplicate.genmodel#//duplicate/A"/>
<containmentMetaFeature
href=3D"duplicate.genmodel#//duplicate/A/a"/>
<childMetaFeature
href=3D"duplicate.genmodel#//duplicate/A/a"/>
</modelFacet>
<labels
visualID=3D"4002"
editPartClassName=3D"ANameEditPart"
itemSemanticEditPolicyClassName=3D"ANameItemSemanticEditPolicy "=

notationViewFactoryClassName=3D"ANameViewFactory"
elementIcon=3D"true">
<diagramRunTimeClass
href=3D"../../../plugin/org.eclipse.gmf.runtime.notation/mode=
l/notation.genmodel#//notation/Node"/>
<viewmap
xsi:type=3D"gmfgen:ParentAssignedViewmap"
getterName=3D"getFigureSuperNameFigure"
figureQualifiedClassName=3D"org.eclipse.gmf.runtime.draw2d.ui=
=2Efigures.WrapLabel"/>
<modelFacet
xsi:type=3D"gmfgen:FeatureLabelModelFacet">
<metaFeatures
href=3D"duplicate.genmodel#//duplicate/Super/name"/>
</modelFacet>
</labels>
</topLevelNodes>
<links
visualID=3D"3001"
editPartClassName=3D"SuperLinkEditPart"
itemSemanticEditPolicyClassName=3D"SuperLinkItemSemanticEditPolic=
y"
notationViewFactoryClassName=3D"SuperLinkViewFactory">
<diagramRunTimeClass
href=3D"../../../plugin/org.eclipse.gmf.runtime.notation/model/=
notation.genmodel#//notation/Edge"/>
<elementType
xsi:type=3D"gmfgen:SpecializationType"
editHelperAdviceClassName=3D"SuperLinkEditHelperAdvice"/>
<viewmap
xsi:type=3D"gmfgen:FigureViewmap"
figureQualifiedClassName=3D"org.eclipse.gmf.runtime.draw2d.ui.f=
igures.PolylineConnectionEx">
<requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs>
<requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPlu=
ginIDs>
</viewmap>
<modelFacet
xsi:type=3D"gmfgen:FeatureLinkModelFacet">
<metaFeature
href=3D"duplicate.genmodel#//duplicate/Super/link"/>
</modelFacet>
</links>
<palette>
<groups
title=3D"duplicate">
<entries
xsi:type=3D"gmfgen:ToolEntry"
title=3D"A"
description=3D"Create new A"
genNodes=3D"//@diagram/@topLevelNodes.1"/>
<entries
xsi:type=3D"gmfgen:ToolEntry"
title=3D"B"
description=3D"Create new B"
genNodes=3D"//@diagram/@topLevelNodes.0"/>
<entries
xsi:type=3D"gmfgen:ToolEntry"
title=3D"Link"
description=3D"Link"
genLinks=3D"//@diagram/@links.0"/>
</groups>
</palette>
<preferencePages
xsi:type=3D"gmfgen:GenStandardPreferencePage"
iD=3D"org.eclipse.gmf.duplicate.example.diagram.general"
name=3D"Duplicate Diagram">
<children
xsi:type=3D"gmfgen:GenStandardPreferencePage"
iD=3D"org.eclipse.gmf.duplicate.example.diagram.appearance"
name=3D"Appearance"
kind=3D"Appearance"/>
<children
xsi:type=3D"gmfgen:GenStandardPreferencePage"
iD=3D"org.eclipse.gmf.duplicate.example.diagram.connections "
name=3D"Connections"
kind=3D"Connections"/>
<children
xsi:type=3D"gmfgen:GenStandardPreferencePage"
iD=3D"org.eclipse.gmf.duplicate.example.diagram.printing"
name=3D"Printing"
kind=3D"Printing"/>
<children
xsi:type=3D"gmfgen:GenStandardPreferencePage"
iD=3D"org.eclipse.gmf.duplicate.example.diagram.rulersAndGrid "
name=3D"Rulers And Grid"
kind=3D"RulersAndGrid"/>
<children
xsi:type=3D"gmfgen:GenStandardPreferencePage"
iD=3D"org.eclipse.gmf.duplicate.example.diagram.pathmaps"
name=3D"Pathmaps"
kind=3D"Pathmaps"/>
</preferencePages>
</diagram>
<plugin/>
<editor/>
<navigator>
<childReferences
child=3D"//@diagram"/>
<childReferences
parent=3D"//@diagram"
child=3D"//@diagram/@topLevelNodes.0"/>
<childReferences
parent=3D"//@diagram"
child=3D"//@diagram/@topLevelNodes.1"/>
<childReferences
parent=3D"//@diagram"
child=3D"//@diagram/@links.0"
groupName=3D"links"
groupIcon=3D"icons/linksNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@links.0"
child=3D"//@diagram/@topLevelNodes.0"
referenceType=3D"out_taget"
groupName=3D"target"
groupIcon=3D"icons/linkTargetNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@topLevelNodes.0"
child=3D"//@diagram/@links.0"
referenceType=3D"in_source"
groupName=3D"incoming links"
groupIcon=3D"icons/incomingLinksNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@links.0"
child=3D"//@diagram/@topLevelNodes.1"
referenceType=3D"out_taget"
groupName=3D"target"
groupIcon=3D"icons/linkTargetNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@topLevelNodes.1"
child=3D"//@diagram/@links.0"
referenceType=3D"in_source"
groupName=3D"incoming links"
groupIcon=3D"icons/incomingLinksNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@links.0"
child=3D"//@diagram/@topLevelNodes.0"
referenceType=3D"in_source"
groupName=3D"source"
groupIcon=3D"icons/linkSourceNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@topLevelNodes.0"
child=3D"//@diagram/@links.0"
referenceType=3D"out_taget"
groupName=3D"outgoing links"
groupIcon=3D"icons/outgoingLinksNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@links.0"
child=3D"//@diagram/@topLevelNodes.1"
referenceType=3D"in_source"
groupName=3D"source"
groupIcon=3D"icons/linkSourceNavigatorGroup.gif"/>
<childReferences
parent=3D"//@diagram/@topLevelNodes.1"
child=3D"//@diagram/@links.0"
referenceType=3D"out_taget"
groupName=3D"outgoing links"
groupIcon=3D"icons/outgoingLinksNavigatorGroup.gif"/>
</navigator>
<propertySheet>
<tabs
xsi:type=3D"gmfgen:GenStandardPropertyTab"
iD=3D"appearance"/>
<tabs
xsi:type=3D"gmfgen:GenStandardPropertyTab"
iD=3D"diagram"
label=3D"Rulers &amp; Grid"/>
<tabs
xsi:type=3D"gmfgen:GenCustomPropertyTab"
iD=3D"domain"
label=3D"Core">
<filter
xsi:type=3D"gmfgen:TypeTabFilter">
<types>org.eclipse.gmf.runtime.notation.View</types>
<types>org.eclipse.gef.EditPart</types>
<generatedTypes>abstractNavigatorItem</generatedTypes>
</filter>
</tabs>
</propertySheet>
<domainGenModel
href=3D"duplicate.genmodel#/"/>
</gmfgen:GenEditorGenerator>

--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.gmfgraph"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duplicate.gmfgraph"

<?xml version="1.0" encoding="UTF-8"?>
<gmfgraph:Canvas xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gmfgraph="http://www.eclipse.org/gmf/2005/GraphicalDefinition" name="duplicate">
<figures
name="Default">
<figures
xsi:type="gmfgraph:Rectangle"
referencingElements="A"
name="AFigure">
<children
xsi:type="gmfgraph:Label"
referencingElements="SuperName"
name="SuperNameFigure"
text="&lt;...>"/>
</figures>
<figures
xsi:type="gmfgraph:PolylineConnection"
referencingElements="ConnectionLink"
name="Link"/>
<figures
xsi:type="gmfgraph:RoundedRectangle"
referencingElements="B"
name="BFigure"
cornerWidth="20"
cornerHeight="20">
<children
xsi:type="gmfgraph:Label"
referencingElements="SuperName2"
name="SuperName2Figure"
text="&lt;...>"/>
</figures>
</figures>
<nodes
name="A"
figure="AFigure"/>
<nodes
name="B"
figure="BFigure"/>
<connections
name="ConnectionLink"
figure="Link"/>
<labels
name="SuperName"
figure="SuperNameFigure"/>
<labels
name="SuperName2"
figure="SuperName2Figure"/>
</gmfgraph:Canvas>

--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.gmfmap"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duplicate.gmfmap"

<?xml version="1.0" encoding="UTF-8"?>
<gmfmap:Mapping xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:gmfmap="http://www.eclipse.org/gmf/2005/mappings/2.0"
xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
<nodes>
<containmentFeature
href="duplicate.ecore#//A/b"/>
<ownedChild>
<domainMetaElement
href="duplicate.ecore#//B"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping">
<diagramLabel
href="duplicate.gmfgraph#SuperName2"/>
<features
href="duplicate.ecore#//Super/name"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="duplicate.gmftool#//@palette/@tools.0/@tools.1"/>
<diagramNode
href="duplicate.gmfgraph#B"/>
</ownedChild>
</nodes>
<nodes>
<containmentFeature
href="duplicate.ecore#//A/a"/>
<ownedChild
relatedDiagrams="//@diagram">
<domainMetaElement
href="duplicate.ecore#//A"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping">
<diagramLabel
href="duplicate.gmfgraph#SuperName"/>
<features
href="duplicate.ecore#//Super/name"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="duplicate.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramNode
href="duplicate.gmfgraph#A"/>
</ownedChild>
</nodes>
<links>
<tool
xsi:type="gmftool:CreationTool"
href="duplicate.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramLink
href="duplicate.gmfgraph#ConnectionLink"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="duplicate.ecore#//Super/link"/>
</links>
<diagram>
<diagramCanvas
href="duplicate.gmfgraph#duplicate"/>
<domainModel
href="duplicate.ecore#/"/>
<domainMetaElement
href="duplicate.ecore#//A"/>
<palette
href="duplicate.gmftool#//@palette"/>
</diagram>
</gmfmap:Mapping>

--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.gmftool"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duplicate.gmftool"

<?xml version="1.0" encoding="UTF-8"?>
<gmftool:ToolRegistry xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
<palette
title="duplicatePalette">
<tools
xsi:type="gmftool:ToolGroup"
title="duplicate">
<tools
xsi:type="gmftool:CreationTool"
title="A"
description="Create new A">
<smallIcon
xsi:type="gmftool:DefaultImage"/>
<largeIcon
xsi:type="gmftool:DefaultImage"/>
</tools>
<tools
xsi:type="gmftool:CreationTool"
title="B"
description="Create new B">
<smallIcon
xsi:type="gmftool:DefaultImage"/>
<largeIcon
xsi:type="gmftool:DefaultImage"/>
</tools>
<tools
xsi:type="gmftool:CreationTool"
title="Link"
description="Link"/>
</tools>
</palette>
</gmftool:ToolRegistry>

--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.xsd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duplicate.xsd"

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by hrerolle (EMBRACE) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:duplicate="http://www.example.org/duplicate" targetNamespace="http://www.example.org/duplicate" attributeFormDefault="unqualified">
<xs:element name="root" type="duplicate:A">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="Super">
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="link" type="xs:anyURI" ecore:reference="duplicate:Super"/>
</xs:complexType>
<xs:complexType name="A">
<xs:complexContent>
<xs:extension base="duplicate:Super">
<xs:sequence>
<xs:element name="a" type="duplicate:A" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="b" type="duplicate:B" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="B">
<xs:complexContent>
<xs:extension base="duplicate:Super"/>
</xs:complexContent>
</xs:complexType>
</xs:schema>

--------------020905000508000109070504
Content-Type: text/xml;
name="example.duplicate"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="example.duplicate"

<?xml version="1.0" encoding="UTF-8"?>
<duplicate:root xmlns:duplicate="http://www.example.org/duplicate" name="Level0">
<a link="#//@root/@b.0" name="Level1">
<a link="#//@root/@a.0/@b.0" name="Level2">
<b name="B3"/>
</a>
<b name="B2"/>
</a>
<b name="B1"/>
</duplicate:root>
--------------020905000508000109070504
Content-Type: text/xml;
name="example.duplicate_diagram"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="example.duplicate_diagram"

<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:duplicate="http://www.example.org/duplicate" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.0/notation" xmi:id="_h455gNh7Edu5HYGP5sA8ow" type="Duplicate" measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_ibSN0Nh7Edu5HYGP5sA8ow" type="1001">
<children xmi:type="notation:Node" xmi:id="_ibebENh7Edu5HYGP5sA8ow" type="4001"/>
<styles xmi:type="notation:FontStyle" xmi:id="_ibYUcNh7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:DescriptionStyle" xmi:id="_ibYUcdh7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:FillStyle" xmi:id="_ibYUcth7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:LineStyle" xmi:id="_ibYUc9h7Edu5HYGP5sA8ow"/>
<element xmi:type="duplicate:B" href="example.duplicate#//@root/@b.0"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_ibYUdNh7Edu5HYGP5sA8ow" x="72" y="108"/>
</children>
<children xmi:type="notation:Node" xmi:id="_ibebEdh7Edu5HYGP5sA8ow" type="1002">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ibebF9h7Edu5HYGP5sA8ow" source="uri://eclipse.org/gmf/openDiagramPolicy"/>
<children xmi:type="notation:Node" xmi:id="_ibkhsNh7Edu5HYGP5sA8ow" type="4002"/>
<styles xmi:type="notation:FontStyle" xmi:id="_ibebEth7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:DescriptionStyle" xmi:id="_ibebE9h7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:FillStyle" xmi:id="_ibebFNh7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:LineStyle" xmi:id="_ibebFdh7Edu5HYGP5sA8ow"/>
<element xmi:type="duplicate:A" href="example.duplicate#//@root/@a.0"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_ibebFth7Edu5HYGP5sA8ow" x="72" y="36"/>
</children>
<styles xmi:type="notation:PageStyle" xmi:id="_h5AAINh7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:GuideStyle" xmi:id="_h5AAIdh7Edu5HYGP5sA8ow"/>
<styles xmi:type="notation:DescriptionStyle" xmi:id="_h5AAIth7Edu5HYGP5sA8ow"/>
<element xmi:type="duplicate:A" href="example.duplicate#//@root"/>
</notation:Diagram>

--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duplicate.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="duplicate"
nsURI="http://www.example.org/duplicate" nsPrefix="duplicate">
<eClassifiers xsi:type="ecore:EClass" name="A" eSuperTypes="#//Super">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="A"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="a" upperBound="-1" eType="#//A"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="a"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="b" upperBound="-1" eType="#//B"
containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="b"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="B" eSuperTypes="#//Super">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="B"/>
<details key="kind" value="empty"/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=""/>
<details key="kind" value="mixed"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="elementWildcard"/>
<details key="name" value=":mixed"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"
transient="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="xmlns:prefix"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"
transient="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="xsi:schemaLocation"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="root" upperBound="-2" eType="#//A"
volatile="true" transient="true" derived="true" containment="true" resolveProxies="false">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Comment describing your root element"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="root"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Super">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="Super"/>
<details key="kind" value="empty"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="description"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="link" eType="#//Super">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="link"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="name"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

--------------020905000508000109070504
Content-Type: text/xml;
name="duplicate.genmodel"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="duplicate.genmodel"

<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gmf.duplicate.example/src"
modelPluginID="org.eclipse.gmf.duplicate.example" modelName="Duplicate" importerID="org.eclipse.xsd.ecore.importer"
complianceLevel="5.0">
<foreignModel>duplicate.xsd</foreignModel>
<genPackages prefix="Duplicate" basePackage="org.example" resource="XML" disposableProviderFactory="true"
ecorePackage="duplicate.ecore#/">
<genClasses ecoreClass="duplicate.ecore#//A">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference duplicate.ecore#//A/a"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference duplicate.ecore#//A/b"/>
</genClasses>
<genClasses ecoreClass="duplicate.ecore#//B"/>
<genClasses ecoreClass="duplicate.ecore#//DocumentRoot">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute duplicate.ecore#//DocumentRoot/mixed"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference duplicate.ecore#//DocumentRoot/xMLNSPrefixMap"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference duplicate.ecore#//DocumentRoot/xSISchemaLocation"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference duplicate.ecore#//DocumentRoot/root"/>
</genClasses>
<genClasses ecoreClass="duplicate.ecore#//Super">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute duplicate.ecore#//Super/description"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference duplicate.ecore#//Super/link"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute duplicate.ecore#//Super/name"/>
</genClasses>
</genPackages>
</genmodel:GenModel>

--------------020905000508000109070504--
Re: Strange behaviours of diagram partitionning [message #114105 is a reply to message #113687] Sat, 24 March 2007 07:10 Go to previous messageGo to next message
Eclipse UserFriend
Hello Bertrand,

> 1. duplication :
Please, submitt a request for GMF generation - this situation should be handled
correctly by the generated code.

> 2. save1 :
Current logic is:
if diagram editor you are activating is not dirty and underlying model resource
was changed (for example - from the second diagram editor + save) the diagram
content should be automatically refreshed.

if diagram editor is dirty then you'll receive this dialog. The hint is:
always save editor before switching to enother one. ;-)

If you find any differences in synchronize logic in your situation - submitt
a request.

> 3. save2 :
This is not an error - the logic described above should be applied to this
situation as well. So, modify only one diagram ..

As an option you can try using shared editing domain for all your diagrams,
but this solution has other side-effects.

-----------------
Alex Shatalin
Re: Strange behaviours of diagram partitionning [message #114965 is a reply to message #114105] Wed, 28 March 2007 06:29 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex and thank you,


Alex Shatalin a écrit :
> Hello Bertrand,
>
>> 1. duplication :
> Please, submitt a request for GMF generation - this situation should be
> handled correctly by the generated code.
>
I had opened a request at:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=179683

>> 2. save1 :
> Current logic is:
> if diagram editor you are activating is not dirty and underlying model
> resource was changed (for example - from the second diagram editor +
> save) the diagram content should be automatically refreshed.
> if diagram editor is dirty then you'll receive this dialog. The hint is:
> always save editor before switching to enother one. ;-)
>
> If you find any differences in synchronize logic in your situation -
> submitt a request.

I had the same idea, but I think this solution is not perfect: when two
parts are opened and saved at the same time and when you modify the
both, the situation is the same.


>> 3. save2 :
> This is not an error - the logic described above should be applied to
> this situation as well. So, modify only one diagram ..
>
> As an option you can try using shared editing domain for all your
> diagrams, but this solution has other side-effects.
>
> -----------------
> Alex Shatalin
>
>


Bertrand Roulier
Re: Strange behaviours of diagram partitionning [message #115025 is a reply to message #114965] Wed, 28 March 2007 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Hello Bertrand,

> I had the same idea, but I think this solution is not perfect: when
> two parts are opened and saved at the same time and when you modify
> the both, the situation is the same.
Then you can modify generated code to use shared editing domain actoss these
two editors, but this modification has other side-effects.

-----------------
Alex Shatalin
Re: Strange behaviours of diagram partitionning [message #115068 is a reply to message #115025] Wed, 28 March 2007 11:07 Go to previous messageGo to next message
Eclipse UserFriend
Alex,

Alex Shatalin a écrit :
> Hello Bertrand,
>
>> I had the same idea, but I think this solution is not perfect: when
>> two parts are opened and saved at the same time and when you modify
>> the both, the situation is the same.
> Then you can modify generated code to use shared editing domain actoss
> these two editors, but this modification has other side-effects.
>
Do you think that it's worth a request?

Bertrand
Re: Strange behaviours of diagram partitionning [message #115081 is a reply to message #115068] Wed, 28 March 2007 11:11 Go to previous message
Eclipse UserFriend
Hello Bertrand,

> Do you think that it's worth a request?
I think provided possibility to modify generated code already cover this
request.

-----------------
Alex Shatalin
Previous Topic:Re: Override the palette generated by GMF
Next Topic:Default look and feel of the diagram...
Goto Forum:
  


Current Time: Wed Jul 23 17:06:30 EDT 2025

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

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

Back to the top