moving child elements [message #238925] |
Mon, 08 October 2007 10:48 |
Richard Adams Messages: 77 Registered: July 2009 Location: Edinburgh |
Member |
|
|
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
Dr Richard Adams, University of Edinburgh
http://richardadams606blog.blogspot.com/
http://csbe.bio.ed.ac.uk/adams.php
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04090 seconds