enforcing order of child figures in a editpart [message #47046] |
Wed, 04 December 2002 08:42  |
Eclipse User |
|
|
|
Originally posted by: bramez.users.sourceforge.net
I have this question: (Eclipse 2.0, GEF 2.0.0)
Suppose I want to display a Class in a class diagram. I have
a ClassEditpart:
- getFigure() returns a Rectangle with a Label child (to display the
class name). On the Rectangle is a FlowLayout.
- getModelChildren() returns a list of Property
with Property correponds a PropertyEditpart:
- getFigure() returns a Label with the Property name
now the problem: the label with the class name gets shown at the bottom of
the rectangle, after the labels of the properties. I found out that this
is because AbstractEditPart.refreshVisuals() does addChild(EditPart, i),
where i = 0 .. getModelChildren().size(), so the class Label gets "pushed
backwards" in the list of children of the Rectangle.
I see several approaches to this:
- add a TableHeaderEditPart
- override refreshVisuals or addChildVisual
- put this in bugzilla
- make a custom ClassFigure
what should I do?
Bram
|
|
|
|
Re: enforcing order of child figures in a editpart [message #47140 is a reply to message #47076] |
Wed, 04 December 2002 08:54  |
Eclipse User |
|
|
|
Originally posted by: bramez.users.sourceforge.net
Randy Hudson wrote:
> Introduce another container.
> + ClassFigure
> | - Label to display name
> | + contents pane
> | - property 1
> | - property 2
thx, I\'ll try that
> see GraphicalEditPart.getContentsPane(), it is well documented in the latest
> builds.
> What do you mean by GEF 2.0.0? Do you mean com.ibm version, or the version
> found here?
that\'s what is showing in help about->plugin details->GEF
my gef.jar dates from 21 Aug 2002, org.eclipse version
> \"Bram Stieperaere\" <bramez@users.sourceforge.net> wrote in message
> news:asl0oo$6s2$1@rogue.oti.com...
> >
> > I have this question: (Eclipse 2.0, GEF 2.0.0)
> >
> > Suppose I want to display a Class in a class diagram. I have
> >
> > a ClassEditpart:
> >
> > - getFigure() returns a Rectangle with a Label child (to display the
> > class name). On the Rectangle is a FlowLayout.
> > - getModelChildren() returns a list of Property
> >
> > with Property correponds a PropertyEditpart:
> >
> > - getFigure() returns a Label with the Property name
> >
> >
> > now the problem: the label with the class name gets shown at the bottom of
> > the rectangle, after the labels of the properties. I found out that this
> > is because AbstractEditPart.refreshVisuals() does addChild(EditPart, i),
> > where i = 0 .. getModelChildren().size(), so the class Label gets \"pushed
> > backwards\" in the list of children of the Rectangle.
> >
> > I see several approaches to this:
> > - add a TableHeaderEditPart
> > - override refreshVisuals or addChildVisual
> > - put this in bugzilla
> > - make a custom ClassFigure
> >
> > what should I do?
> >
> > Bram
> >
> >
|
|
|
Powered by
FUDForum. Page generated in 0.05702 seconds