Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Connections graphical behavior
Connections graphical behavior [message #126621] Tue, 15 May 2007 11:08 Go to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------030204000807030806040705
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi there,
I've been modeling a small graphical editor for a very small language
and until I tried to customize graphical appearance and behavior
everything was quite ok. Now that I try to add some new "features" I've
been adding some problems. The first one is that, after changing the
Figure of one of my classes from rectangle to Ellipse, two of the other
classes in the metamodel also got the Ellipse mapping.

My .gmgraph is as follows:
<?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="StandardPetriNets">
<figures
name="Default">
<figures
xsi:type="gmfgraph:Rectangle"
name="PlaceFigure">
<children
xsi:type="gmfgraph:Label"
referencingElements="PlaceName"
name="PlaceNameFigure"
text="&lt;...>"/>
<children
xsi:type="gmfgraph:Label"
referencingElements="PlaceCapacity"
name="PlaceCapacityFigure"
text="&lt;...>"/>
<children
xsi:type="gmfgraph:Label"
referencingElements="PlaceNumOfTokens"
name="PlaceNumOfTokensFigure"
text="&lt;...>"/>
</figures>
<figures
xsi:type="gmfgraph:PolylineConnection"
referencingElements="InputArc"
name="InputArcFigure">
<children
xsi:type="gmfgraph:Label"
referencingElements="InputArcWeight"
name="InputArcWeightFigure"
text="&lt;...>"/>
</figures>
<figures
xsi:type="gmfgraph:Rectangle"
referencingElements="Transition"
name="TransitionFigure">
<children
xsi:type="gmfgraph:Label"
referencingElements="TransitionName"
name="TransitionNameFigure"
text="&lt;...>"/>
</figures>
<figures
xsi:type="gmfgraph:PolylineConnection"
referencingElements="OutputArc"
name="OutputArcFigure">
<children
xsi:type="gmfgraph:Label"
referencingElements="OutputArcWeight"
name="OutputArcWeightFigure"
text="&lt;...>"/>
</figures>
</figures>
<figures
name="Custom Images">
<figures
xsi:type="gmfgraph:Ellipse"
referencingElements="Place"
name="PlaceCustomFigure"
lineWidth="3">
<size
x="10"
y="10"/>
</figures>
</figures>
<nodes
name="Place"
figure="PlaceCustomFigure"/>
<nodes
name="Transition"
figure="TransitionFigure"/>
<connections
name="InputArc"
figure="InputArcFigure"/>
<connections
name="OutputArc"
figure="OutputArcFigure"/>
<labels
name="PlaceName"
figure="PlaceNameFigure"/>
<labels
name="PlaceCapacity"
figure="PlaceCapacityFigure"/>
<labels
name="PlaceNumOfTokens"
figure="PlaceNumOfTokensFigure"/>
<labels
name="InputArcWeight"
figure="InputArcWeightFigure"/>
<labels
name="TransitionName"
figure="TransitionNameFigure"/>
<labels
name="OutputArcWeight"
figure="OutputArcWeightFigure"/>
</gmfgraph:Canvas>

As you can see, I've modified the Node Place to be an Ellipse instead of
a rectangle. Instead I also got InputArc and OutputArc as Ellipse. Any
idea why? (I'm also sending in attachment the .gmfmap file if it might
be useful).

My second question is related with grouping elements. In my metamodel
the following Associations:
InputArc -> Place
InputArc -> Transition

everything with 1-1 multiplicity. In my graphical editor I need to have
an arrow that goes directly from Place to Transition taking into account
that this arrow will be an instance of InputArc. For the moment, using
the default generated .gmfgraph and .gmfmap I MUST create the polyline
from InputArc to Place and from InputAr to Place (which correponds
exactly to the metamodel but it is not suitable for the graphical
editor). Any hint how to do this?

Thank you very, very much for your time and help.

All the best,

Luis Pedro


--------------030204000807030806040705
Content-Type: text/xml; x-mac-type="0"; x-mac-creator="0";
name="PetriNets.gmfmap"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="PetriNets.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"
xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
<nodes>
<containmentFeature
href="PetriNets.ecore#//PetriNet/containsPlaces"/>
<ownedChild>
<domainMetaElement
href="PetriNets.ecore#//Place"/>
<labelMappings>
<diagramLabel
href="PetriNets.gmfgraph#PlaceName"/>
<features
href="PetriNets.ecore#//Place/name"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramNode
href="PetriNets.gmfgraph#Place"/>
</ownedChild>
</nodes>
<nodes>
<containmentFeature
href="PetriNets.ecore#//PetriNet/containsInputArcs"/>
<ownedChild>
<domainMetaElement
href="PetriNets.ecore#//InputArc"/>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.1"/>
<diagramNode
href="PetriNets.gmfgraph#Place"/>
</ownedChild>
</nodes>
<nodes>
<containmentFeature
href="PetriNets.ecore#//PetriNet/containsOutputArcs"/>
<ownedChild>
<domainMetaElement
href="PetriNets.ecore#//OutputArc"/>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.3"/>
<diagramNode
href="PetriNets.gmfgraph#Place"/>
</ownedChild>
</nodes>
<nodes>
<containmentFeature
href="PetriNets.ecore#//PetriNet/containsTransitions"/>
<ownedChild>
<domainMetaElement
href="PetriNets.ecore#//Transition"/>
<labelMappings>
<diagramLabel
href="PetriNets.gmfgraph#TransitionName"/>
<features
href="PetriNets.ecore#//Transition/name"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramNode
href="PetriNets.gmfgraph#Transition"/>
</ownedChild>
</nodes>
<links>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.0"/>
<diagramLink
href="PetriNets.gmfgraph#OutputArc"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="PetriNets.ecore#//OutputArc/outputArcToPlace"/>
</links>
<links>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.1"/>
<diagramLink
href="PetriNets.gmfgraph#InputArc"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="PetriNets.ecore#//InputArc/inputArcToTransition"/>
</links>
<links>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramLink
href="PetriNets.gmfgraph#OutputArc"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="PetriNets.ecore#//OutputArc/outputArcFromTransition"/ >
</links>
<links>
<tool
xsi:type="gmftool:CreationTool"
href="PetriNets.gmftool#//@palette/@tools.0/@tools.3"/>
<diagramLink
href="PetriNets.gmfgraph#InputArc"/>
<linkMetaFeature
xsi:type="ecore:EReference"
href="PetriNets.ecore#//InputArc/inputArcFromPlace"/>
</links>
<diagram>
<diagramCanvas
href="PetriNets.gmfgraph#StandardPetriNets"/>
<domainModel
href="PetriNets.ecore#/"/>
<domainMetaElement
href="PetriNets.ecore#//PetriNet"/>
<palette
href="PetriNets.gmftool#//@palette"/>
</diagram>
</gmfmap:Mapping>

--------------030204000807030806040705--
Re: Connections graphical behavior [message #127106 is a reply to message #126621] Thu, 17 May 2007 07:47 Go to previous message
Eclipse UserFriend
Hello Luis,

> the graphical editor). Any hint how to do this?
You can create LinkMapping for InputArc:

domainMetaElement = InputArc
sourceMetaFeature = reference InputArc -> Place
linkMetaFeature = reference InputArc -> Transition
containmentFeature = containment for InputArc

Then InputArc will be represented as a link on your diagram.

-----------------
Alex Shatalin
Previous Topic:Moving Index locations of Connections in a diagram
Next Topic:performance issue for diagram partitioning
Goto Forum:
  


Current Time: Thu May 08 15:30:22 EDT 2025

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

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

Back to the top