Skip to main content



      Home
Home » Eclipse Projects » GEF » enforcing order of child figures in a editpart
enforcing order of child figures in a editpart [message #47046] Wed, 04 December 2002 08:42 Go to next message
Eclipse UserFriend
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 #47076 is a reply to message #47046] Wed, 04 December 2002 08:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

Introduce another container.

+ ClassFigure
| - Label to display name
| + contents pane
| - property 1
| - property 2

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?

"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
>
>
Re: enforcing order of child figures in a editpart [message #47140 is a reply to message #47076] Wed, 04 December 2002 08:54 Go to previous message
Eclipse UserFriend
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
> >
> >
Previous Topic:Breaking changes in draw2d
Next Topic:Multiple Views in one Editor?
Goto Forum:
  


Current Time: Sat May 10 13:36:44 EDT 2025

Powered by FUDForum. Page generated in 0.05702 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top