Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how to create a figure without a corresponding model element(I need to create a figure and edit part which do not correspond to a model element)
how to create a figure without a corresponding model element [message #551497] Fri, 06 August 2010 16:25 Go to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
I know this is a very tricky question and I do not expect someone in this forum to do this work for me, I'm just interested in any pointers on any information related on the subject.

I need to create graphic elements depending on semantic information in elements in the model. Furthermore, this new created elements should be able to host (be parents) for model elements.

Let's say I have objects of type T that have an attribute "block", like:

      <t name="t_B1" block="B">
        ....
     </t>
      <t name="t_B2" block="B">
        ....
     </t>

      <t name="t_A1" block="A">
        ....
     </t>


I don't have elements of type "block", just "block" attributes.
What I would like to do, is to create a graphical representation of a block, like a rectangle which hosts (is parent) for t_B1 and t_B2 elements.
This would be straight forward if my model was like:

    <block name="B">
         <t name="t_B1">
          ....
        </t>
       <t name="t_B2">
        ....
     </t>
   </block>

   <block name="A">
      <t name="t_A1" block="A">
        ....
     </t>
  </block>


But I have to create an editor for an already existing model, so I don't have the "block" element, I need to "simulate" it, and don't have the right to add it in the xml file.

Any advice of any kind, would be appreciated (even one that says "forget that, it's not possible with gmf" would spare me a lot of time of research and debugging).

Cheers,
Emil.

Re: how to create a figure without a corresponding model element [message #551790 is a reply to message #551497] Mon, 09 August 2010 14:50 Go to previous message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
One solution I found for the problem:

Introduce, in the EMF model, a TRANSIENT element (in my case, corresponding to "block"). Actually, the element is not transient itself, but only attached to the model tree through a transient relationship.
In this way we can have a model element (therfore an edit part) which is not serialized in the xml file.



Previous Topic:Link Mapping - complex case
Next Topic:Selection problem of elements within compartments
Goto Forum:
  


Current Time: Fri Apr 26 09:35:41 GMT 2024

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

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

Back to the top