Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:43 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 13
Registered: October 2010
Junior Member
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 12:36 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
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: Sun Dec 21 09:20:02 GMT 2014

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

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