Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Positionning a label above a figure
Positionning a label above a figure [message #1004584] Wed, 23 January 2013 13:58 Go to next message
nicolas h is currently offline nicolas hFriend
Messages: 60
Registered: February 2011
Location: Grenoble, France
Member
Hi there,

I'm looking for positionning a label above a Rectangle Figure, i.e. outside the RectangleFigure. To do this, I created a rectangle with no border containing the label and a rectangle with a border (dashed border). The dashed-border rectangle is used as a Compartment.

Below is my GMFGraph Model :
<descriptors
        name="RectangleWithoutLabelFigure">
      <actualFigure
          xsi:type="gmfgraph:Rectangle"
          name="RectangleWithoutLabelFigure"
          lineWidth="2">
        <layout
            xsi:type="gmfgraph:FlowLayout"/>
      </actualFigure>
    </descriptors>

<descriptors
        name="RectangleFigure">
      <actualFigure
          xsi:type="gmfgraph:Rectangle"
          name="RectangleFigure"
          lineWidth="0">
        <layout
            xsi:type="gmfgraph:FlowLayout"
            majorAlignment="CENTER"
            minorAlignment="CENTER"/>
        <children
            xsi:type="gmfgraph:Label"
            name="RectangleNameFigure"
            text="&lt;...>"/>
        <children
            xsi:type="gmfgraph:FigureRef"
            figure="//@figures.0/@descriptors.0/@actualFigure"/>
      </actualFigure>
      <accessors
          figure="//@figures.0/@descriptors.1/@actualFigure/@children.0"/>
    </descriptors>

<compartments
      name="RectangleCompartment"
      figure="RectangledWithoutLabelFigure"/>

<labels
      name="RectangledName"
      figure="RectangleFigure"
      accessor="//@figures.0/@descriptors.1/@accessors.0"/>


The visual representation does not fit with the expected result...
index.php/fa/13062/0/

In the figure, the top node is my rectangle "Test". Another object is put inside the RectangleComportament.

A thin border appears all around the expected borderless rectangle named "Rectangle" an no dashed border delimitate the "RectangleWithoutLabel" Rectangle. Besides, a solid line separate the label and the compartment.

Any idea about how to fix this ?

Many thanks,


regards,


Nicolas
Re: Positionning a label above a figure [message #1004625 is a reply to message #1004584] Wed, 23 January 2013 15:10 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 697
Registered: November 2009
Senior Member
Hi,

try this to get external labels. http://dirksmetric.wordpress.com/2008/06/21/gmf-knowledge-positioning-of-external-labels/ These labels can be postioned by mouse around the rectangle you have.

Ralph
Re: Positionning a label above a figure [message #1004696 is a reply to message #1004625] Wed, 23 January 2013 17:27 Go to previous message
nicolas h is currently offline nicolas hFriend
Messages: 60
Registered: February 2011
Location: Grenoble, France
Member
Hi,

Thanks for your reply. This is exactly what I looked for.

I found another thread where it is explained how to make the external label unmovable and dynamically position it.

Hope it can help someone who find this thread.

Thanks again,


Nicolas
Previous Topic:Change domain model when diagram was opened
Next Topic:How can i make a shortcut that can't be contained in the root element?
Goto Forum:
  


Current Time: Sat Dec 20 03:48:46 GMT 2014

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

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