2 editparts that use FreeformLayer in the same viewer [message #156577] |
Tue, 02 November 2004 17:54 |
Eclipse User |
|
|
|
Originally posted by: rsudra.hotmail.com
Dear all,
I have a graphical editor which uses two top level edit parts to contain model components (there are no other visual levels of containment, just the diagram and its children). The reason for the two is that the editor is able to focus on completely different parts of the model. The two top level edit parts createFigure() methods just create a FreeformFigure which has setOpaque(true) and sets a FreeformLayout.
On editor refocusing, getViewer().setContents(newModelcontext) is called which relies on GEF to swaps in the appropriate top level edit part.
I am now providing an extension to the editor where is is able to show the complete model in one go although must maintain the legacy behaviour. I have opted for making the second top level edit parts figure setOpaque(false) and ensuring that the model component is included in the first edit parts getModelChildren() method. I then do some clever laying out to ensure that all of the components are visible.
The question is, what are the side effects of having multiple FreeformFigure's in the GraphicalViewer? Is there anything I should be careful of?
TIA,
Raj
|
|
|
|
Re: 2 editparts that use FreeformLayer in the same viewer [message #156954 is a reply to message #156889] |
Fri, 05 November 2004 10:31 |
Eclipse User |
|
|
|
Originally posted by: rsudra.hotmail.com
Originally, our editor only supported a single parent model object who editpart figure was a FreeformFigure. Is was possible to reset the graphical editors contents with another (different) model object which had is own editpart with a FreeformFigure. Therefore, the editor would only ever have a single parent object with its editpart containing the FreeformFigure.
Now I have the editor rendering both editparts (i.e. two FreeformFigures) each with their own children. Is this ok? I have to make the later editpart opaque attribute to false.
You answer leads me to believe that it is but you refer to a Freeform layer, is this the same thing as a FreeformFigure?
Thanks
Raj
Hello Pratik,
> It's not exactly clear to me what you're doing here. But as far as
> having multiple freeform layers is concerned, it's not an issue (to
> the best of my knowledge). The logic example does the same: every
> circuit has a FreeformLayer.
>
> "Rajeev Sudra" <rsudra@hotmail.com> wrote in message
> news:cm8hkb$j2$1@eclipse.org...
>
>> Dear all,
>>
>> I have a graphical editor which uses two top level edit parts to
>> contain
>>
> model components (there are no other visual levels of containment,
> just the diagram and its children). The reason for the two is that the
> editor is able to focus on completely different parts of the model.
> The two top level edit parts createFigure() methods just create a
> FreeformFigure which has setOpaque(true) and sets a FreeformLayout.
>
>> On editor refocusing, getViewer().setContents(newModelcontext) is
>> called
>>
> which relies on GEF to swaps in the appropriate top level edit part.
>
>> I am now providing an extension to the editor where is is able to
>> show the
>>
> complete model in one go although must maintain the legacy behaviour.
> I have opted for making the second top level edit parts figure
> setOpaque(false) and ensuring that the model component is included in
> the first edit parts getModelChildren() method. I then do some clever
> laying out to ensure that all of the components are visible.
>
>> The question is, what are the side effects of having multiple
>>
> FreeformFigure's in the GraphicalViewer? Is there anything I should be
> careful of?
>
>> TIA,
>> Raj
|
|
|
Powered by
FUDForum. Page generated in 0.02968 seconds