Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF Ecore Model Problem
GMF Ecore Model Problem [message #507401] Wed, 13 January 2010 11:37 Go to next message
Thomas is currently offline ThomasFriend
Messages: 79
Registered: October 2009
Member
hi, i have a problem with generating a gmf Editor.

My Core Problem:

-LineHandles are be able to "paint" on my ShapesDiagram (works^^)

-LineHandles are able to "paint" in Line (rectangle) (don´t work)

My Ecore Model:

<?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="shapesModel"
nsURI="http://shapesModel" nsPrefix="shapesModel">
<eClassifiers xsi:type="ecore:EClass" name="Shape"/>
<eClassifiers xsi:type="ecore:EClass" name="RectangularShape" eSuperTypes="#//Shape"/>
<eClassifiers xsi:type="ecore:EClass" name="EllipticalShape" eSuperTypes="#//Shape"/>
<eClassifiers xsi:type="ecore:EClass" name="Line" eSuperTypes="#//Shape">
<eStructuralFeatures xsi:type="ecore:EReference" name="linehandles" upperBound="-1"
eType="#//LineHandle" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LineHandle" eSuperTypes="#//Shape"/>
<eClassifiers xsi:type="ecore:EClass" name="ShapeDiagram">
<eStructuralFeatures xsi:type="ecore:EReference" name="shapes" upperBound="-1"
eType="#//Shape" containment="true"/>
</eClassifiers>
</ecore:EPackage>

Thanks

Thomas
Re: GMF Ecore Model Problem [message #507661 is a reply to message #507401] Thu, 14 January 2010 09:55 Go to previous message
Thomas is currently offline ThomasFriend
Messages: 79
Registered: October 2009
Member
ok, i am able to add LineHandles to my RootDiagram but i cannot add it to my Line figure.

Are there some Sites, which explain Compartments?

Maybe there is a hint creating 2 diffenent Elements with 1 paletteCreationTool? or somehow?

my gmfgraph:
<descriptors
name="LineShapeFigure">
<actualFigure
xsi:type="gmfgraph:Rectangle"
name="LineShapeFigure">
<layout
xsi:type="gmfgraph:BorderLayout"/>
<children
xsi:type="gmfgraph:Rectangle"
name="LineHandleCompartmentFigure">
<layout
xsi:type="gmfgraph:FlowLayout"/>
</children>
</actualFigure>
<accessors
accessor="getFigureLineHandleCompartment"
figure="//@figures.0/@descriptors.0/@actualFigure/@children.0 "/>
</descriptors>
<descriptors
name="RectangleFigure">
<actualFigure
xsi:type="gmfgraph:Rectangle"
name="RectangleFigure"/>
</descriptors>
</figures>
<nodes
name="LineShape"
figure="LineShapeFigure"/>

<compartments
name="LineLineHandleCompartment"
figure="LineShapeFigure"
accessor="//@figures.0/@descriptors.0/@accessors.0"/>


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:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
<nodes>
<containmentFeature
href="lineModel.ecore#//Diagram/shapes"/>
<ownedChild>
<domainMetaElement
href="lineModel.ecore#//LineShape"/>
<tool
xsi:type="gmftool:CreationTool"
href="lineModel.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramNode
href="lineModel.gmfgraph#LineShape"/>
<children
compartment="//@nodes.0/@ownedChild/@compartments.0">
<containmentFeature
href="lineModel.ecore#//LineShape/linehandles"/>
<ownedChild>
<domainMetaElement
href="lineModel.ecore#//LineShape"/>
<tool
xsi:type="gmftool:CreationTool"
href="lineModel.gmftool#//@palette/@tools.0/@tools.1"/>
<diagramNode
href="lineModel.gmfgraph#LineShape"/>
</ownedChild>
</children>
<compartments
children="//@nodes.0/@ownedChild/@children.0">
<compartment
href="lineModel.gmfgraph#LineLineHandleCompartment"/>
</compartments>
</ownedChild>
</nodes>

Maybe this helps
Thanks

[Updated on: Thu, 14 January 2010 12:13]

Report message to a moderator

Previous Topic:Fix connection anchor when resizing source/target figure
Next Topic:problem with nested elements and wrappers
Goto Forum:
  


Current Time: Thu Sep 19 17:55:37 GMT 2024

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

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

Back to the top