Creating fixed nodes on main diagram [message #116796] |
Tue, 03 April 2007 11:30  |
Eclipse User |
|
|
|
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 #117275 is a reply to message #116796] |
Thu, 05 April 2007 04:54   |
Eclipse User |
|
|
|
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 #117343 is a reply to message #117275] |
Thu, 05 April 2007 06:11  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04730 seconds