|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
| Christophe Bouhier
Registered: July 2009
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
- 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...
Powered by FUDForum
. Page generated in 0.05274 seconds