Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » What's wrong with this gmf
What's wrong with this gmf [message #43699] Sun, 10 September 2006 07:47 Go to next message
Junyan is currently offline JunyanFriend
Messages: 10
Registered: July 2009
Junior Member
Hi,

I write a very simple gmf project to test the compartment use. I am
confusing about it for days. Whith the following files I generate the
'test diagram editor'. In the diagram editor I could add the 'Inner
rectangle' into the 'Outer rectangle', but after adding I could not
arrange the position of the added 'Inner rectangle' with eithro mouse or
its layout constrain property in the property view. Any comments would be
appreciated.

ecore file:
<?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="test"
nsURI="org.test" nsPrefix="org.test">
<eClassifiers xsi:type="ecore:EClass" name="Root">
<eStructuralFeatures xsi:type="ecore:EReference" name="outers"
upperBound="-1"
eType="#//Outer" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Outer">
<eStructuralFeatures xsi:type="ecore:EReference" name="inners"
upperBound="-1"
eType="#//Inner" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Inner"/>
</ecore:EPackage>

gmftool file:
<?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>
<tools
xsi:type="gmftool:ToolGroup"
title="test">
<tools
xsi:type="gmftool:CreationTool"
title="Outer"
description="Create new Outer">
<smallIcon
xsi:type="gmftool:DefaultImage"/>
<largeIcon
xsi:type="gmftool:DefaultImage"/>
</tools>
<tools
xsi:type="gmftool:CreationTool"
title="Inner"
description="Create new Inner">
<smallIcon
xsi:type="gmftool:DefaultImage"/>
<largeIcon
xsi:type="gmftool:DefaultImage"/>
</tools>
</tools>
</palette>
</gmftool:ToolRegistry>

gmfgraph file:
<?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="test">
<figures
name="Default">
<figures
xsi:type="gmfgraph:Rectangle"
referencingElements="Outer OuterCompartment"
name="OuterFigure"/>
<figures
xsi:type="gmfgraph:Rectangle"
referencingElements="Inner"
name="InnerFigure"/>
</figures>
<nodes
name="Outer"
figure="OuterFigure"/>
<nodes
name="Inner"
figure="InnerFigure"/>
<compartments
name="OuterCompartment"
figure="OuterFigure"
collapsible="true"/>
</gmfgraph:Canvas>

gmfmap file:
<?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:gmfmap="http://www.eclipse.org/gmf/2005/mappings"
xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
<nodes>
<containmentFeature
href="test.ecore#//Root/outers"/>
<ownedChild>
<domainMetaElement
href="test.ecore#//Outer"/>
<tool
xsi:type="gmftool:CreationTool"
href="test.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramNode
href="test.gmfgraph#Outer"/>
<children
compartment="//@nodes.0/@ownedChild/@compartments.0">
<containmentFeature
href="test.ecore#//Outer/inners"/>
<ownedChild>
<domainMetaElement
href="test.ecore#//Inner"/>
<tool
xsi:type="gmftool:CreationTool"
href="test.gmftool#//@palette/@tools.0/@tools.1"/>
<diagramNode
href="test.gmfgraph#Inner"/>
</ownedChild>
</children>
<compartments
children="//@nodes.0/@ownedChild/@children.0">
<compartment
href="test.gmfgraph#OuterCompartment"/>
</compartments>
</ownedChild>
</nodes>
<diagram>
<diagramCanvas
href="test.gmfgraph#test"/>
<domainModel
href="test.ecore#/"/>
<domainMetaElement
href="test.ecore#//Root"/>
<palette
href="test.gmftool#//@palette"/>
</diagram>
</gmfmap:Mapping>
Re: What's wrong with this gmf [message #44164 is a reply to message #43699] Mon, 11 September 2006 08:27 Go to previous message
Artem Tikhomirov is currently offline Artem TikhomirovFriend
Messages: 222
Registered: July 2009
Senior Member
Try to set List Layout of GenCompartment to false.
Look for List Layout in GMF Tutorial to find out more
(http://wiki.eclipse.org/index.php/GMF_Tutorial_Part_2)

Artem

"Junyan" <alexmajy@gmail.com> wrote in message
news:8dd410daa5bc3114ac9e0c0b7b3547b0$1@www.eclipse.org...
> Hi,
>
> I write a very simple gmf project to test the compartment use. I am
> confusing about it for days. Whith the following files I generate the
> 'test diagram editor'. In the diagram editor I could add the 'Inner
> rectangle' into the 'Outer rectangle', but after adding I could not
> arrange the position of the added 'Inner rectangle' with eithro mouse or
> its layout constrain property in the property view. Any comments would be
> appreciated.
>
> ecore file:
> <?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="test"
> nsURI="org.test" nsPrefix="org.test">
> <eClassifiers xsi:type="ecore:EClass" name="Root">
> <eStructuralFeatures xsi:type="ecore:EReference" name="outers"
> upperBound="-1"
> eType="#//Outer" containment="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Outer">
> <eStructuralFeatures xsi:type="ecore:EReference" name="inners"
> upperBound="-1"
> eType="#//Inner" containment="true"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Inner"/>
> </ecore:EPackage>
>
> gmftool file:
> <?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>
> <tools
> xsi:type="gmftool:ToolGroup"
> title="test">
> <tools
> xsi:type="gmftool:CreationTool"
> title="Outer"
> description="Create new Outer">
> <smallIcon
> xsi:type="gmftool:DefaultImage"/>
> <largeIcon
> xsi:type="gmftool:DefaultImage"/>
> </tools>
> <tools
> xsi:type="gmftool:CreationTool"
> title="Inner"
> description="Create new Inner">
> <smallIcon
> xsi:type="gmftool:DefaultImage"/>
> <largeIcon
> xsi:type="gmftool:DefaultImage"/>
> </tools>
> </tools>
> </palette>
> </gmftool:ToolRegistry>
>
> gmfgraph file:
> <?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="test">
> <figures
> name="Default">
> <figures
> xsi:type="gmfgraph:Rectangle"
> referencingElements="Outer OuterCompartment"
> name="OuterFigure"/>
> <figures
> xsi:type="gmfgraph:Rectangle"
> referencingElements="Inner"
> name="InnerFigure"/>
> </figures>
> <nodes
> name="Outer"
> figure="OuterFigure"/>
> <nodes
> name="Inner"
> figure="InnerFigure"/>
> <compartments
> name="OuterCompartment"
> figure="OuterFigure"
> collapsible="true"/>
> </gmfgraph:Canvas>
>
> gmfmap file:
> <?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:gmfmap="http://www.eclipse.org/gmf/2005/mappings"
> xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
> <nodes>
> <containmentFeature
> href="test.ecore#//Root/outers"/>
> <ownedChild>
> <domainMetaElement
> href="test.ecore#//Outer"/>
> <tool
> xsi:type="gmftool:CreationTool"
> href="test.gmftool#//@palette/@tools.0/@tools.0"/>
> <diagramNode
> href="test.gmfgraph#Outer"/>
> <children
> compartment="//@nodes.0/@ownedChild/@compartments.0">
> <containmentFeature
> href="test.ecore#//Outer/inners"/>
> <ownedChild>
> <domainMetaElement
> href="test.ecore#//Inner"/>
> <tool
> xsi:type="gmftool:CreationTool"
> href="test.gmftool#//@palette/@tools.0/@tools.1"/>
> <diagramNode
> href="test.gmfgraph#Inner"/>
> </ownedChild>
> </children>
> <compartments
> children="//@nodes.0/@ownedChild/@children.0">
> <compartment
> href="test.gmfgraph#OuterCompartment"/>
> </compartments>
> </ownedChild>
> </nodes>
> <diagram>
> <diagramCanvas
> href="test.gmfgraph#test"/>
> <domainModel
> href="test.ecore#/"/>
> <domainMetaElement
> href="test.ecore#//Root"/>
> <palette
> href="test.gmftool#//@palette"/>
> </diagram>
> </gmfmap:Mapping>
>
Previous Topic:Where can i find the GMF metamodels?
Next Topic:Gmf in rich client platform
Goto Forum:
  


Current Time: Thu Jan 02 23:56:23 GMT 2025

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

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

Back to the top