Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating fixed nodes on main diagram
Creating fixed nodes on main diagram [message #116796] Tue, 03 April 2007 11:30 Go to next message
Eclipse UserFriend
Originally posted by: sylvain.maillard.univ-nantes.fr

Hi All,

I have a diagram that contains top nodes. I want these top nodes to be
fixed on one side of the main diagram (say, on top).
How can I achieve that ? I've looked at the CanonicalEditPolicy of my
diagram editpart, but I don't see how to force the top nodes to move to
the side of the diagram.
In addition, I want these nodes to move with the viewport when
scrolling ...

Help please !

Thanks in advance,
Sylvain

--
Sylvain
Re: Creating fixed nodes on main diagram [message #117015 is a reply to message #116796] Wed, 04 April 2007 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sylvain.maillard.univ-nantes.fr

> Hi All,
>
> I have a diagram that contains top nodes. I want these top nodes to be fixed
> on one side of the main diagram (say, on top).
> How can I achieve that ? I've looked at the CanonicalEditPolicy of my diagram
> editpart, but I don't see how to force the top nodes to move to the side of
> the diagram.
> In addition, I want these nodes to move with the viewport when scrolling ...
>
> Help please !
>
> Thanks in advance,
> Sylvain

Nobody ever had the same problem ?? In fact I wanted to show on the
main diagram some features of the root node...

--
Sylvain
Re: Creating fixed nodes on main diagram [message #117275 is a reply to message #116796] Thu, 05 April 2007 04:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sylvain,

You could try to override the createFigure() method for the diagram edit
part to e.g., set constrained toolbar layout and create several
container figures (likely with XYLayout), one for the top nodes that
should appear on top of the diagram and the other for other nodes.
Then, you would have to override methods addChildVisual(EditPart, int)
and removeChildVisual(EditPart) (and probably also
reorderChild(EditPart, int) and any other method that calls
getContentPane() in its implementation). Instead of using the same
content pane for each of the child types, it would substitute different
content panes based on the edit part type. An example of a very similar
approach is in the generated node edit parts (see template
xpt::diagram::editparts::NodeEditPart for reference)

Best regards,
Boris


Sylvain wrote:
> Hi All,
>
> I have a diagram that contains top nodes. I want these top nodes to be
> fixed on one side of the main diagram (say, on top).
> How can I achieve that ? I've looked at the CanonicalEditPolicy of my
> diagram editpart, but I don't see how to force the top nodes to move to
> the side of the diagram.
> In addition, I want these nodes to move with the viewport when scrolling
> ...
>
> Help please !
>
> Thanks in advance,
> Sylvain
>
Re: Creating fixed nodes on main diagram [message #117301 is a reply to message #117015] Thu, 05 April 2007 05:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

I recommend you to work in the following directions:

1. Disable commands that move 'fixed' nodes on diagram (remove layout
editpolicy from the nodes or install your own).

2. Set custom layout for diagram surface; it may be Draw2D layout for
DiagramEditPart figure or contribution to LayoutService or both.

Sylvain wrote:
>> Hi All,
>>
>> I have a diagram that contains top nodes. I want these top nodes to be
>> fixed on one side of the main diagram (say, on top).
>> How can I achieve that ? I've looked at the CanonicalEditPolicy of my
>> diagram editpart, but I don't see how to force the top nodes to move
>> to the side of the diagram.
>> In addition, I want these nodes to move with the viewport when
>> scrolling ...
>>
>> Help please !
>>
>> Thanks in advance,
>> Sylvain
>
> Nobody ever had the same problem ?? In fact I wanted to show on the main
> diagram some features of the root node...
>
Re: Creating fixed nodes on main diagram [message #117343 is a reply to message #117275] Thu, 05 April 2007 06:11 Go to previous message
Eclipse UserFriend
Originally posted by: sylvain.maillard.univ-nantes.fr

Hi Boris and Dmitry,

Thanks for your responses, I will try to understand it ;-)


> Hi Sylvain,
>
> You could try to override the createFigure() method for the diagram edit part
> to e.g., set constrained toolbar layout and create several container figures
> (likely with XYLayout), one for the top nodes that should appear on top of
> the diagram and the other for other nodes.
> Then, you would have to override methods addChildVisual(EditPart, int) and
> removeChildVisual(EditPart) (and probably also reorderChild(EditPart, int)
> and any other method that calls getContentPane() in its implementation).
> Instead of using the same content pane for each of the child types, it would
> substitute different content panes based on the edit part type. An example of
> a very similar approach is in the generated node edit parts (see template
> xpt::diagram::editparts::NodeEditPart for reference)
>
> Best regards,
> Boris
>
>
> Sylvain wrote:
>> Hi All,
>>
>> I have a diagram that contains top nodes. I want these top nodes to be
>> fixed on one side of the main diagram (say, on top).
>> How can I achieve that ? I've looked at the CanonicalEditPolicy of my
>> diagram editpart, but I don't see how to force the top nodes to move to the
>> side of the diagram.
>> In addition, I want these nodes to move with the viewport when scrolling
>> ...
>>
>> Help please !
>>
>> Thanks in advance,
>> Sylvain
>>

--
Sylvain
Previous Topic:Wrapped Labels
Next Topic:Coustmize generated properties view
Goto Forum:
  


Current Time: Fri Jun 06 05:51:48 EDT 2025

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

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

Back to the top