moving child elements [message #238925] |
Mon, 08 October 2007 06:48  |
Eclipse User |
|
|
|
Hello,
I'm fairly new to GEF and have a query about coordinate systems etc.
We have a model object ('MyShape')which can be represented as a shape
which can contain nested Shapes. In addition to this, the MyShape object
needs to have some invisible padding around it.
Our MyShape Figure therefore is a complex figure of 2 layers; the first
holds the
RectangleFigure or Ellipse object from draw2d, the top layer is the
content pane into which to add new MyShape figures as children. Both are
FreeForm layers with FreeFormLayout, and the whole figure uses a stack
layout. This works OK except if I move
the parent container, the children don't move.
If I want to continue to use absolute coordinates, do I need to write my
own code
to update the child elements locations? Where is the best place to do
this? In the move command or in refreshVisuals or refreshChildren()?
Or would it be better to change to relative coordinates?
When I first started doing this I didn't have the invisible padding
requirement
and so the MyShapeFigure WAS a draw2d Rectange or ELlipse figure - in this
case
child elements kept their location relatve location when their parent was
moved, even though draw2D Shapes don't set useRelativeLocation ==true.
Only
now that I have a complex figure do I have problems moving the children.
Thanks for any advice,
Richard
|
|
|
|
|
Re: moving child elements [message #238962 is a reply to message #238942] |
Tue, 09 October 2007 02:53  |
Eclipse User |
|
|
|
Just to add, basically I am trying to get the behaviour of the 'Circuit'
in the
logic example, but as well as merely being a container, to also have a
shape
as its content.
Any help greatly appreciated
Richard
|
|
|
Powered by
FUDForum. Page generated in 0.04862 seconds