Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problem creating link from derived class
Problem creating link from derived class [message #217253] Wed, 04 February 2009 15:09 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi,

I want to create a link between nodes.
The ecore model is like this:
the nodes: Class A
a link: Class B
another link Class BA -> Class B

I can create a link with class B but not with class BA. When I draw the connection with class BA
than I get the following exception:

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:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)
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:169)
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

I debug a bit and found that for Class BA is no ViewProvider registered but it is for class B. I
have no idea where I could register this ViewProvider.

Does any one know how to solve the problem?

Thanks, Martin
Re: Problem creating link from derived class [message #217269 is a reply to message #217253] Wed, 04 February 2009 16:03 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi,

in addition to the information below I found that the EditPart for class B is used when generating a
diagram from a the model. But for my understanding it should be EditPart for class BA.

Any idea how to solve the problem?

Martin

Martin Jacob wrote, On 04.02.2009 16:09:
> Hi,
>
> I want to create a link between nodes.
> The ecore model is like this:
> the nodes: Class A
> a link: Class B
> another link Class BA -> Class B
>
> I can create a link with class B but not with class BA. When I draw the
> connection with class BA than I get the following exception:
>
> 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:386)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> 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)
>
> 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:169)
>
> 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
>
> I debug a bit and found that for Class BA is no ViewProvider registered
> but it is for class B. I have no idea where I could register this
> ViewProvider.
>
> Does any one know how to solve the problem?
>
> Thanks, Martin
Re: Problem creating link from derived class [message #217277 is a reply to message #217269] Wed, 04 February 2009 16:37 Go to previous messageGo to next message
Christian Muth is currently offline Christian MuthFriend
Messages: 24
Registered: July 2009
Junior Member
hi martin,


could you please post your .gmfgraph and .gmfmap files (just the relevant
portion) so we can reproduce your problem? its way easier than just
textual description...


cheers

christian
Re: Problem creating link from derived class [message #217294 is a reply to message #217277] Wed, 04 February 2009 16:51 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Christian,

please find below .gmfmap and gmfgraph

Please note the class names are different than described before. The class Isolator is derived from
class Conductor.

..gmfmap:
<links>
<domainMetaElement
href="psc.ecore#//Conductor"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
editorPattern=""
editPattern="">
<diagramLabel
href="psc.gmfgraph#ConductorNameLable"/>
<features
href="psc.ecore#//Conductor/name"/>
</labelMappings>
<containmentFeature
href="psc.ecore#//Network/conductors"/>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramLink
href="psc.gmfgraph#Conductor"/>
<sourceMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeFrom"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeTo"/>
</links>
<links>
<domainMetaElement
href="psc.ecore#//Isolator"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
editorPattern=""
editPattern="">
<diagramLabel
href="psc.gmfgraph#IsolatorNameLable"/>
<features
href="psc.ecore#//Conductor/name"/>
</labelMappings>
<containmentFeature
href="psc.ecore#//Network/conductors"/>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.4"/>
<diagramLink
href="psc.gmfgraph#Isolator"/>
<sourceMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeFrom"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeTo"/>
</links>



..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/2006/GraphicalDefinition" name="psc">
<figures
name="Default">
<descriptors
name="NodeFigure">
<actualFigure
xsi:type="gmfgraph:Rectangle"
name="NodeFigure"
lineWidth="2">
<layout
xsi:type="gmfgraph:FlowLayout"/>
<foregroundColor
xsi:type="gmfgraph:ConstantColor"
value="black"/>
<backgroundColor
xsi:type="gmfgraph:ConstantColor"
value="lightGreen"/>
<children
xsi:type="gmfgraph:Label"
name="NodeIDLable"/>
</actualFigure>
<accessors
figure="//@figures.0/@descriptors.0/@actualFigure/@children.0 "/>
</descriptors>
....
<descriptors
name="ConductorFigure">
<actualFigure
xsi:type="gmfgraph:PolylineConnection"
name="ConductorFigure"
lineWidth="4">
<foregroundColor
xsi:type="gmfgraph:ConstantColor"
value="black"/>
<children
xsi:type="gmfgraph:Label"
name="ConductorNameFigure"
text="&lt;...>"/>
</actualFigure>
<accessors
figure="//@figures.0/@descriptors.2/@actualFigure/@children.0 "/>
</descriptors>
<descriptors
name="IsolatorFigure">
<actualFigure
xsi:type="gmfgraph:PolylineConnection"
name="IsolatorFigure"
lineWidth="8">
<foregroundColor
xsi:type="gmfgraph:ConstantColor"
value="black"/>
<children
xsi:type="gmfgraph:Label"
name="IsolatorNameFigure"
text="&lt;...>"/>
</actualFigure>
<accessors
figure="//@figures.0/@descriptors.3/@actualFigure/@children.0 "/>
</descriptors>
</figures>
<nodes
name="Node"
figure="NodeFigure"/>
<connections
name="Conductor"
figure="ConductorFigure"/>
....
<connections
name="Isolator"
figure="IsolatorFigure"/>
<labels
name="NodeIDLable"
figure="NodeFigure"
elementIcon="false"
accessor="//@figures.0/@descriptors.0/@accessors.0"/>
....
<labels
name="ConductorNameLable"
figure="ConductorFigure"
elementIcon="false"
accessor="//@figures.0/@descriptors.2/@accessors.0"/>
<labels
name="IsolatorNameLable"
figure="IsolatorFigure"
elementIcon="false"
accessor="//@figures.0/@descriptors.3/@accessors.0"/>
</gmfgraph:Canvas>

If you need more details please let me know.

thanks, Martin


Christian Muth wrote, On 04.02.2009 17:37:
> hi martin,
>
>
> could you please post your .gmfgraph and .gmfmap files (just the
> relevant portion) so we can reproduce your problem? its way easier than
> just textual description...
>
>
> cheers
>
> christian
>
Re: Problem creating link from derived class [message #217341 is a reply to message #217294] Thu, 05 February 2009 10:51 Go to previous messageGo to next message
Christian Muth is currently offline Christian MuthFriend
Messages: 24
Registered: July 2009
Junior Member
hi martin,


please also post your .ecore file, i don't understand the domain model
structure regarding Isolator and Conductor....


thanks

christian
Re: Problem creating link from derived class [message #217350 is a reply to message #217341] Thu, 05 February 2009 11:16 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Christian,

here the .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="model"
nsURI="http://www.bahntechnik.de/opn/psc/prj" nsPrefix="de.bahntechnik.dd.opn.psc.prj">
<eAnnotations source="EAnnotation0"/>
<eClassifiers xsi:type="ecore:EClass" name="PSC">
<eStructuralFeatures xsi:type="ecore:EReference" name="networks" upperBound="-1"
eType="#//Network" containment="true" eOpposite="#//Network/psc"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Network">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="psc" eType="#//PSC"
eOpposite="#//PSC/networks"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="lines" upperBound="-1"
eType="#//Line" containment="true" eOpposite="#//Line/network"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="slices" upperBound="-1"
eType="#//Slice" containment="true" eOpposite="#//Slice/network"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="conductors" upperBound="-1"
eType="#//Conductor" containment="true" eOpposite="#//Conductor/network"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="tracks" upperBound="-1"
eType="#//Track" containment="true" eOpposite="#//Track/network"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
eType="#//Node" containment="true" eOpposite="#//Node/network"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="connectors" upperBound="-1"
eType="#//Connector" containment="true" eOpposite="#//Connector/network"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Line">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="network" eType="#//Network"
eOpposite="#//Network/lines"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="firstSlice" eType="#//Slice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="slices" ordered="false"
upperBound="-1" eType="#//Slice" eOpposite="#//Slice/line"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="tracks" upperBound="-1"
eType="#//Track" eOpposite="#//Track/lines"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Slice">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="pos_m" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="line" eType="#//Line"
eOpposite="#//Line/slices"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="network" eType="#//Network"
eOpposite="#//Network/slices"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
eType="#//Node" eOpposite="#//Node/slice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nextSlice" eType="#//Slice"
eOpposite="#//Slice/prevSlice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="prevSlice" eType="#//Slice"
eOpposite="#//Slice/nextSlice"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Track">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="network" eType="#//Network"
eOpposite="#//Network/tracks"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="conductors" upperBound="-1"
eType="#//Conductor" eOpposite="#//Conductor/track"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="lines" upperBound="-1"
eType="#//Line" eOpposite="#//Line/tracks"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Conductor">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="track" eType="#//Track"
eOpposite="#//Track/conductors"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodeTo" eType="#//Node"
eOpposite="#//Node/nextCond"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodeFrom" eType="#//Node"
eOpposite="#//Node/prevCond"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="line" eType="#//Line"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//ConductorType"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="x_m" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="y_m" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="equivalentRadius_mm"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="r20_Ohm_km" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="temperatureCoefficient"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="temperature_GradCelsius"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="network" eType="#//Network"
eOpposite="#//Network/conductors"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ConductorType">
<eLiterals name="ContactWire"/>
<eLiterals name="Earth" value="1"/>
<eLiterals name="MessangerWire" value="2"/>
<eLiterals name="NegativeFeeder" value="3"/>
<eLiterals name="Rail" value="4"/>
<eLiterals name="ReinforcementFeeder" value="5"/>
<eLiterals name="ReinforcementReturnFeeder" value="6"/>
<eLiterals name="unknown" value="7"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Node">
<eStructuralFeatures xsi:type="ecore:EReference" name="network" eType="#//Network"
eOpposite="#//Network/nodes"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nextCond" eType="#//Conductor"
eOpposite="#//Conductor/nodeTo"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="prevCond" eType="#//Conductor"
eOpposite="#//Conductor/nodeFrom"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="slice" eType="#//Slice"
eOpposite="#//Slice/nodes"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="prevConns" upperBound="-1"
eType="#//Connector" eOpposite="#//Connector/nodeFrom"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nextConns" upperBound="-1"
eType="#//Connector" eOpposite="#//Connector/nodeTo"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="nodeID" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Connector">
<eStructuralFeatures xsi:type="ecore:EReference" name="nodeFrom" eType="#//Node"
eOpposite="#//Node/prevConns"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodeTo" eType="#//Node"
eOpposite="#//Node/nextConns"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="r_Ohm" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="x_Ohm" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="network" eType="#//Network"
eOpposite="#//Network/connectors"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Isolator" eSuperTypes="#//Conductor"/>
<eClassifiers xsi:type="ecore:EClass" name="Switch" eSuperTypes="#//Conductor"/>
</ecore:EPackage>

thanks, Martin


Christian Muth wrote, On 05.02.2009 11:51:
> hi martin,
>
>
> please also post your .ecore file, i don't understand the domain model
> structure regarding Isolator and Conductor....
>
>
> thanks
> christian
>
Re: Problem creating link from derived class [message #217367 is a reply to message #217294] Thu, 05 February 2009 12:35 Go to previous messageGo to next message
Christian Muth is currently offline Christian MuthFriend
Messages: 24
Registered: July 2009
Junior Member
Hi Martin,


your problem might be that you do not have a node mapping (top node
reference) for Isolator, but only for Conductors.
Though Isolator is a specialized Conductor, you have to give it its own
node mapping (second top node reference for Network->conductors, node
mapping inside with domain meta element Isolator and diagram node Node)
for being able to use it with links.


Cheers

Christian
Re: Problem creating link from derived class [message #217374 is a reply to message #217367] Thu, 05 February 2009 13:25 Go to previous message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Christian,

actually Isolator shall be a connection and not a node. I try what u proposed but than I got a node
instead of a connection.
Please find below my complete .gmfmap file. Do you have any other suggestion?

<?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/2008/mappings"
xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
<nodes>
<containmentFeature
href="psc.ecore#//Network/nodes"/>
<ownedChild>
<domainMetaElement
href="psc.ecore#//Node"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
readOnly="true"
viewPattern="{0}"
editorPattern=""
editPattern="">
<diagramLabel
href="psc.gmfgraph#NodeIDLable"/>
<features
href="psc.ecore#//Node/nodeID"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramNode
href="psc.gmfgraph#Node"/>
</ownedChild>
</nodes>
<links>
<domainMetaElement
href="psc.ecore#//Conductor"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
editorPattern=""
editPattern="">
<diagramLabel
href="psc.gmfgraph#ConductorNameLable"/>
<features
href="psc.ecore#//Conductor/name"/>
</labelMappings>
<containmentFeature
href="psc.ecore#//Network/conductors"/>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramLink
href="psc.gmfgraph#Conductor"/>
<sourceMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeFrom"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeTo"/>
</links>
<links>
<domainMetaElement
href="psc.ecore#//Connector"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
viewPattern="{0}+{1}j"
editorPattern="{0}+{1}"
editPattern="{0}+{1}">
<diagramLabel
href="psc.gmfgraph#Connector_X_OhmLable"/>
<features
href="psc.ecore#//Connector/r_Ohm"/>
<features
href="psc.ecore#//Connector/x_Ohm"/>
</labelMappings>
<containmentFeature
href="psc.ecore#//Network/connectors"/>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.3"/>
<diagramLink
href="psc.gmfgraph#Connection"/>
<sourceMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Connector/nodeFrom"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Connector/nodeTo"/>
</links>
<links>
<domainMetaElement
href="psc.ecore#//Isolator"/>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
editorPattern=""
editPattern="">
<diagramLabel
href="psc.gmfgraph#IsolatorNameLable"/>
<features
href="psc.ecore#//Conductor/name"/>
</labelMappings>
<containmentFeature
href="psc.ecore#//Network/conductors"/>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.4"/>
<diagramLink
href="psc.gmfgraph#Isolator"/>
<sourceMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeFrom"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="psc.ecore#//Conductor/nodeTo"/>
</links>
<diagram>
<diagramCanvas
href="psc.gmfgraph#psc"/>
<domainModel
href="psc.ecore#/"/>
<domainMetaElement
href="psc.ecore#//Network"/>
<palette
href="psc.gmftool#//@palette"/>
</diagram>
</gmfmap:Mapping>


Christian Muth wrote, On 05.02.2009 13:35:
> Hi Martin,
>
>
> your problem might be that you do not have a node mapping (top node
> reference) for Isolator, but only for Conductors.
> Though Isolator is a specialized Conductor, you have to give it its own
> node mapping (second top node reference for Network->conductors, node
> mapping inside with domain meta element Isolator and diagram node Node)
> for being able to use it with links.
>
>
> Cheers
>
> Christian
>
Previous Topic:Set attributes when a link is deleted
Next Topic:Changing a label to a dropdown menu
Goto Forum:
  


Current Time: Fri Apr 19 19:56:02 GMT 2024

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

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

Back to the top