Home » Eclipse Projects » GEF » Layout of figures in an editpart
Layout of figures in an editpart [message #78242] |
Wed, 07 May 2003 05:16  |
Eclipse User |
|
|
|
Originally posted by: j.verschoor.nefli.nl
Hello
I've create an editpart that has a number of child editparts.
The parent editpart creates a figure that extends from a rectanglefigure and
adds a label in top of the rectangle.
The child figures should be inside the parent, and aligned right, right
under the parentlabel:
+-------------+
| Label |
| |
| child |
| child |
| child |
+-------------+
My problem is that I can't get the positioning / alignment done properly. I
get something that looks like:
+-------------+
| child |
| child |
| child |
| Label |
+-------------+
If somone could tell me where I should specify the layout, I'd appreciate
it.
Thanks.
|
|
| | | | |
Re: Layout of figures in an editpart [message #78652 is a reply to message #78520] |
Thu, 08 May 2003 10:57   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Actually, that is what I understood. The label is getting pushed down to
the bottom in refreshChildren because it is a sibling of the children
editparts' figures. Your container edipart must consist of 3 separate
figures, one for the editpart, one for the label, and one to contain the
children editparts.
+Figure in ToolbarLayout
|-Label
|-+ Figure in ToolbarLayout
| - figure from first child editpart
| - figure from second child editpart
"Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
news:b9dd63$m3f$1@rogue.oti.com...
> Hi, I think you misunderstand me.
> I have two EditParts (the container and the children)
> They both have figures. (they are editparts because I want to be able to
> select a child and remove / rename it etc)
> So I don't really have a LayoutManager for the editparts..
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b9b9ic$agq$1@rogue.oti.com...
> > The children cannot have other sibling figures like the label you
> describe.
> > You need to create a "contents pane" figure for containing the children:
> >
> > +------------+
> > | Label |
> > | +---------+|
> > | | child| |
> > | | child| |
> > | +---------+|
> > +-----------+
> >
> > For the outer-most figure, use a ToolbarLayout
> > For the contents pane, use a ToolbarLayout, with
> > setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRIGHT)
> >
> > "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> > news:b9aiod$na9$1@rogue.oti.com...
> > > Hello
> > >
> > > I've create an editpart that has a number of child editparts.
> > > The parent editpart creates a figure that extends from a
rectanglefigure
> > and
> > > adds a label in top of the rectangle.
> > > The child figures should be inside the parent, and aligned right,
right
> > > under the parentlabel:
> > >
> > > +-------------+
> > > | Label |
> > > | |
> > > | child |
> > > | child |
> > > | child |
> > > +-------------+
> > >
> > > My problem is that I can't get the positioning / alignment done
> properly.
> > I
> > > get something that looks like:
> > > +-------------+
> > > | child |
> > > | child |
> > > | child |
> > > | Label |
> > > +-------------+
> > >
> > > If somone could tell me where I should specify the layout, I'd
> appreciate
> > > it.
> > >
> > > Thanks.
> > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Layout of figures in an editpart [message #78695 is a reply to message #78652] |
Thu, 08 May 2003 11:12   |
Eclipse User |
|
|
|
Originally posted by: j.verschoor.nefli.nl
Ok I understand that, but what I don't understand is where and how I can
add() a child to the figure with toolbar layout
I create a figure in createFigure(), and gef does some magic, so there's no
way of adding the figure to another figure instead of the figure I return in
createFigure()
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b9dr8d$2mt$1@rogue.oti.com...
> Actually, that is what I understood. The label is getting pushed down to
> the bottom in refreshChildren because it is a sibling of the children
> editparts' figures. Your container edipart must consist of 3 separate
> figures, one for the editpart, one for the label, and one to contain the
> children editparts.
>
> +Figure in ToolbarLayout
> |-Label
> |-+ Figure in ToolbarLayout
> | - figure from first child editpart
> | - figure from second child editpart
>
>
> "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> news:b9dd63$m3f$1@rogue.oti.com...
> > Hi, I think you misunderstand me.
> > I have two EditParts (the container and the children)
> > They both have figures. (they are editparts because I want to be able to
> > select a child and remove / rename it etc)
> > So I don't really have a LayoutManager for the editparts..
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b9b9ic$agq$1@rogue.oti.com...
> > > The children cannot have other sibling figures like the label you
> > describe.
> > > You need to create a "contents pane" figure for containing the
children:
> > >
> > > +------------+
> > > | Label |
> > > | +---------+|
> > > | | child| |
> > > | | child| |
> > > | +---------+|
> > > +-----------+
> > >
> > > For the outer-most figure, use a ToolbarLayout
> > > For the contents pane, use a ToolbarLayout, with
> > > setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRIGHT)
> > >
> > > "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> > > news:b9aiod$na9$1@rogue.oti.com...
> > > > Hello
> > > >
> > > > I've create an editpart that has a number of child editparts.
> > > > The parent editpart creates a figure that extends from a
> rectanglefigure
> > > and
> > > > adds a label in top of the rectangle.
> > > > The child figures should be inside the parent, and aligned right,
> right
> > > > under the parentlabel:
> > > >
> > > > +-------------+
> > > > | Label |
> > > > | |
> > > > | child |
> > > > | child |
> > > > | child |
> > > > +-------------+
> > > >
> > > > My problem is that I can't get the positioning / alignment done
> > properly.
> > > I
> > > > get something that looks like:
> > > > +-------------+
> > > > | child |
> > > > | child |
> > > > | child |
> > > > | Label |
> > > > +-------------+
> > > >
> > > > If somone could tell me where I should specify the layout, I'd
> > appreciate
> > > > it.
> > > >
> > > > Thanks.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Layout of figures in an editpart [message #78769 is a reply to message #78695] |
Thu, 08 May 2003 12:12   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
create a field in your graphicaleditpart subclass called contentsPane. in
createFigure, hold onto the contentsPane. override getContentsPane to return
the contentsPane field.
"Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
news:b9ds1c$3je$1@rogue.oti.com...
> Ok I understand that, but what I don't understand is where and how I can
> add() a child to the figure with toolbar layout
> I create a figure in createFigure(), and gef does some magic, so there's
no
> way of adding the figure to another figure instead of the figure I return
in
> createFigure()
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b9dr8d$2mt$1@rogue.oti.com...
> > Actually, that is what I understood. The label is getting pushed down
to
> > the bottom in refreshChildren because it is a sibling of the children
> > editparts' figures. Your container edipart must consist of 3 separate
> > figures, one for the editpart, one for the label, and one to contain the
> > children editparts.
> >
> > +Figure in ToolbarLayout
> > |-Label
> > |-+ Figure in ToolbarLayout
> > | - figure from first child editpart
> > | - figure from second child editpart
> >
> >
> > "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> > news:b9dd63$m3f$1@rogue.oti.com...
> > > Hi, I think you misunderstand me.
> > > I have two EditParts (the container and the children)
> > > They both have figures. (they are editparts because I want to be able
to
> > > select a child and remove / rename it etc)
> > > So I don't really have a LayoutManager for the editparts..
> > >
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:b9b9ic$agq$1@rogue.oti.com...
> > > > The children cannot have other sibling figures like the label you
> > > describe.
> > > > You need to create a "contents pane" figure for containing the
> children:
> > > >
> > > > +------------+
> > > > | Label |
> > > > | +---------+|
> > > > | | child| |
> > > > | | child| |
> > > > | +---------+|
> > > > +-----------+
> > > >
> > > > For the outer-most figure, use a ToolbarLayout
> > > > For the contents pane, use a ToolbarLayout, with
> > > > setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRIGHT)
> > > >
> > > > "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> > > > news:b9aiod$na9$1@rogue.oti.com...
> > > > > Hello
> > > > >
> > > > > I've create an editpart that has a number of child editparts.
> > > > > The parent editpart creates a figure that extends from a
> > rectanglefigure
> > > > and
> > > > > adds a label in top of the rectangle.
> > > > > The child figures should be inside the parent, and aligned right,
> > right
> > > > > under the parentlabel:
> > > > >
> > > > > +-------------+
> > > > > | Label |
> > > > > | |
> > > > > | child |
> > > > > | child |
> > > > > | child |
> > > > > +-------------+
> > > > >
> > > > > My problem is that I can't get the positioning / alignment done
> > > properly.
> > > > I
> > > > > get something that looks like:
> > > > > +-------------+
> > > > > | child |
> > > > > | child |
> > > > > | child |
> > > > > | Label |
> > > > > +-------------+
> > > > >
> > > > > If somone could tell me where I should specify the layout, I'd
> > > appreciate
> > > > > it.
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Layout of figures in an editpart [message #79000 is a reply to message #78769] |
Mon, 12 May 2003 05:11  |
Eclipse User |
|
|
|
Originally posted by: j.verschoor.nefli.nl
Ah thanks for explaining. I also found the same code in the logic example.
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b9dvkt$6rc$1@rogue.oti.com...
> create a field in your graphicaleditpart subclass called contentsPane. in
> createFigure, hold onto the contentsPane. override getContentsPane to
return
> the contentsPane field.
>
>
> "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> news:b9ds1c$3je$1@rogue.oti.com...
> > Ok I understand that, but what I don't understand is where and how I can
> > add() a child to the figure with toolbar layout
> > I create a figure in createFigure(), and gef does some magic, so there's
> no
> > way of adding the figure to another figure instead of the figure I
return
> in
> > createFigure()
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b9dr8d$2mt$1@rogue.oti.com...
> > > Actually, that is what I understood. The label is getting pushed down
> to
> > > the bottom in refreshChildren because it is a sibling of the children
> > > editparts' figures. Your container edipart must consist of 3 separate
> > > figures, one for the editpart, one for the label, and one to contain
the
> > > children editparts.
> > >
> > > +Figure in ToolbarLayout
> > > |-Label
> > > |-+ Figure in ToolbarLayout
> > > | - figure from first child editpart
> > > | - figure from second child editpart
> > >
> > >
> > > "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> > > news:b9dd63$m3f$1@rogue.oti.com...
> > > > Hi, I think you misunderstand me.
> > > > I have two EditParts (the container and the children)
> > > > They both have figures. (they are editparts because I want to be
able
> to
> > > > select a child and remove / rename it etc)
> > > > So I don't really have a LayoutManager for the editparts..
> > > >
> > > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > > news:b9b9ic$agq$1@rogue.oti.com...
> > > > > The children cannot have other sibling figures like the label you
> > > > describe.
> > > > > You need to create a "contents pane" figure for containing the
> > children:
> > > > >
> > > > > +------------+
> > > > > | Label |
> > > > > | +---------+|
> > > > > | | child| |
> > > > > | | child| |
> > > > > | +---------+|
> > > > > +-----------+
> > > > >
> > > > > For the outer-most figure, use a ToolbarLayout
> > > > > For the contents pane, use a ToolbarLayout, with
> > > > > setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRIGHT)
> > > > >
> > > > > "Joris Verschoor" <j.verschoor@nefli.nl> wrote in message
> > > > > news:b9aiod$na9$1@rogue.oti.com...
> > > > > > Hello
> > > > > >
> > > > > > I've create an editpart that has a number of child editparts.
> > > > > > The parent editpart creates a figure that extends from a
> > > rectanglefigure
> > > > > and
> > > > > > adds a label in top of the rectangle.
> > > > > > The child figures should be inside the parent, and aligned
right,
> > > right
> > > > > > under the parentlabel:
> > > > > >
> > > > > > +-------------+
> > > > > > | Label |
> > > > > > | |
> > > > > > | child |
> > > > > > | child |
> > > > > > | child |
> > > > > > +-------------+
> > > > > >
> > > > > > My problem is that I can't get the positioning / alignment done
> > > > properly.
> > > > > I
> > > > > > get something that looks like:
> > > > > > +-------------+
> > > > > > | child |
> > > > > > | child |
> > > > > > | child |
> > > > > > | Label |
> > > > > > +-------------+
> > > > > >
> > > > > > If somone could tell me where I should specify the layout, I'd
> > > > appreciate
> > > > > > it.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Tue May 06 19:38:56 EDT 2025
Powered by FUDForum. Page generated in 0.03762 seconds
|