Skip to main content



      Home
Home » Eclipse Projects » GEF » Questoins of Layouts in GEF?
Questoins of Layouts in GEF? [message #5836] Thu, 30 May 2002 12:07 Go to next message
Eclipse UserFriend
Originally posted by: eric_to_jeff.hotmail.com

Hi,

I want to write a report design plug-in use gef framework,
and I confused with Layouts in gef. For each band in report,
which layout should I use (FlowLayout)?

And if I have a BandEditPart class, what Figure should I return for
its createFigure method? This is my code:

public BandFigure() {
this.setLayoutManager(new ToolbarLayout(false));
elementPanel = new Panel();
elementPanel.setLayoutManager(new XYLayout());
elementPanel.setOpaque(true);
elementPanel.setBackgroundColor(ColorConstants.white);
bandLabel = new Label("band");
bandLabel.setOpaque(true);
bandLabel.setBackgroundColor(ColorConstants.button);
this.add(elementPanel);
this.add(bandLabel);
this.setOpaque(true);
}

But I can not set the width of lable and panel!

And how can I resize band? It seems ResizableEditPolicy not

Sorry for my pool English.

Thanks & Regards,

Eric


  • Attachment: report.gif
    (Size: 4.91KB, Downloaded 203 times)
Re: Questoins of Layouts in GEF? [message #5859 is a reply to message #5836] Thu, 30 May 2002 12:59 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

elementPanel should be FlowLayout(HORIZONTAL) or ToolbarLayout(HORIZONTAL).
If your figure is inside another Figure that will allow it to be its
preferred size, both layouts will contine to expand in horizontal direction.
The 2 layouts are similar, but ToolbarLayout will compress the elements if
there is not enough total width.

You can use subclass of FlowLayoutEditPolicy with ToolbarLayout easily.

Both layout will give children their preferred size. If you want to be able
to "resize" the children, CHANGE the NonResizableEditPolicy to some subclass
that allows horizontal resizing. You could even make the handle invisible
so that you only see resize cursor, and no handles. See
LayoutEditPolicy.createChildEditPolicy

Don't use XYLayout for this.

"Eric Sun" <eric_to_jeff@hotmail.com> wrote in message
news:ad5gro$9l1$1@rogue.oti.com...
> Hi,
>
> I want to write a report design plug-in use gef framework,
> and I confused with Layouts in gef. For each band in report,
> which layout should I use (FlowLayout)?
>
> And if I have a BandEditPart class, what Figure should I return for
> its createFigure method? This is my code:
>
> public BandFigure() {
> this.setLayoutManager(new ToolbarLayout(false));
> elementPanel = new Panel();
> elementPanel.setLayoutManager(new XYLayout());
> elementPanel.setOpaque(true);
> elementPanel.setBackgroundColor(ColorConstants.white);
> bandLabel = new Label("band");
> bandLabel.setOpaque(true);
> bandLabel.setBackgroundColor(ColorConstants.button);
> this.add(elementPanel);
> this.add(bandLabel);
> this.setOpaque(true);
> }
>
> But I can not set the width of lable and panel!
>
> And how can I resize band? It seems ResizableEditPolicy not
>
> Sorry for my pool English.
>
> Thanks & Regards,
>
> Eric
>
>
>
Previous Topic:GEF Homepage now available
Next Topic:AnimatableFigure Question
Goto Forum:
  


Current Time: Sun Jun 22 13:37:15 EDT 2025

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

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

Back to the top