|How to control the adding of child figures [message #215339]
||Sun, 30 April 2006 11:19
| Johannes Herr
Registered: July 2009
I am new to GEF and currently working on a editor similar to an uml class
diagram editor. That is I have 'class'-figures, which contain lists of
'method'-figures. What I would like to do, is set the background color of
the 'method'-figure-children to alternating values (similar to the lines
in a propertysheet).
- classname -
# method1 (blue)
# method2 (red)
# method3 (blue)
# method4 (red)
My problem is, that since the 'methods' are model children of 'class', gef
adds them automatically to the 'class' figure, without me being able to
As a way to get it working I overrode the add method in 'class'-figure and
set the color of the 'method'-figures before adding them. But this
certainly is a terrible hack. So my question is, what would be a clean way
to achieve this.
I have a similar problem when I want to add an additional picture to the
'class'-figure. I would like to have the picture aligned centered and the
methods left aligned, but once again I would need a hook to influence the
adding of child-figures.
'addChildVisual' looks like like a place to do that, but the javadoc seems
to discourage using it.
Thank you for your help.
Powered by FUDForum
. Page generated in 0.01759 seconds