Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Place nodes into specific regions of the canvas based on their types
Place nodes into specific regions of the canvas based on their types [message #658427] Tue, 08 March 2011 08:43 Go to next message
Eclipse UserFriend
Hello all,

I am building an editor which canvas has a flow layout. User can add different nodes and the nodes appear in a list one after another. So far, so good.

Now, I want to divide the canvas into different regions so that nodes of a certain type can only appear in a respective canvas region. Think of a UML class where the class is the canvas, the first region contains the class name, the second region contains the class members, and the third region contains the class operations.

How can I achieve such a functionality? Any help would be very much appreciated.

Cheers,
Stanislav
Re: Place nodes into specific regions of the canvas based on their types [message #658669 is a reply to message #658427] Wed, 09 March 2011 07:36 Go to previous message
Eclipse UserFriend
On 08-03-11 14:43, Stanislav wrote:
> Hello all,
>
> I am building an editor which canvas has a flow layout. User can add
> different nodes and the nodes appear in a list one after another. So
> far, so good.
>
> Now, I want to divide the canvas into different regions so that nodes of
> a certain type can only appear in a respective canvas region. Think of a
> UML class where the class is the canvas, the first region contains the
> class name, the second region contains the class members, and the third
> region contains the class operations.
> How can I achieve such a functionality? Any help would be very much
> appreciated.

- Perhaps, you could have a root figure, which is blown up, covering the
whole canvas, than you would add compartments with fixed height/width
which will be your regions? As a compartment can have a xylayout, it
would give the "impression" that it's a region on the canvas.

- Alternatively, you could perhaps partition your editor to have
multiple diagramEditPart's inside one root edit part. (See the
DiagramEditor class, configureGraphicalViewer(), the rootEP is actually
created from the EditPartService, so your EditPartProvider could
intercept CreateRootEditPartOperation, and act on it, by
returning an extended root edit part. (Which is :
RenderedDiagramRootEditPart). This extension, could add multiple children...

Cheers Christophe



>
> Cheers,
> Stanislav
>
Previous Topic:GMF Editors Integration
Next Topic:How to create a "log-file"?
Goto Forum:
  


Current Time: Tue Jul 08 17:58:52 EDT 2025

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

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

Back to the top