Home » Eclipse Projects » GEF » Problems with costumized ToolBarLayoutManager
Problems with costumized ToolBarLayoutManager [message #179725] |
Fri, 29 April 2005 15:51 |
Andreas Holtz Messages: 53 Registered: July 2009 |
Member |
|
|
This is a multi-part message in MIME format.
--------------010903050104010601000105
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Hi,
I have some problems with the ToolbarLayoutManager.
I need a layoutmanager, who handles three figures, alinged in a row or
column (configurable).
I explain the problem now with horizontal alignment:
The left and the right figure have to have the height of the center
figure, which serves as a
container for the childFigures.
The left and right figures just paint some lines, which depends from the
size of the figure (i.e. drawLine from top to bottom)
The problem is, that when i use a normal ToolbarLayout (or
BorderLayout), the outer figures have the standard size of (64,36) and
are smaller than the center figure. But they should have the same height
as the centerFigure (width of 64 is ok).
So i overwrote the layout()-method of the toolbarLayout like this:
Rectangle badBoundsLeft =((IFigure) children.get(0)).getBounds();
Rectangle badBoundsRight =((IFigure) children.get(2)).getBounds();
Rectangle centerBounds ==((IFigure) children.get(1)).getBounds();
((Figure) children.get(0)).setBounds(new Rectangle(badBoundsLeft.x,
badBoundsLeft.y, badBoundsLeft.width, centerBounds.height));
((Figure) children.get(2)).setBounds(new Rectangle(badBoundsRight.x,
badBoundsRight.y, badBoundsRight.width, centerBounds.height));
and (another try) like this
badBoundsLeft.height = centerBounds.height;
badBoundsRight.height = centerBounds.height;
Now everything is drawn fine. But the child figures can be collapsed and
expanded (works fine). The problem is, that with collapsing the height
and the width changes. With the above changed layoutManger, the height
isn
|
|
|
Re: Problems with costumized ToolBarLayoutManager [message #179847 is a reply to message #179725] |
Sun, 01 May 2005 22:24 |
Pratik Shah Messages: 1077 Registered: July 2009 |
Senior Member |
|
|
Without looking at what your post is really about, it seems you missed the
method ToolbarLayout#setStretchMinorAxis
"Andreas Holtz" <A.Holtz@gmx.net> wrote in message
news:d4tld7$n3t$1@news.eclipse.org...
> Hi,
>
> I have some problems with the ToolbarLayoutManager.
> I need a layoutmanager, who handles three figures, alinged in a row or
> column (configurable).
> I explain the problem now with horizontal alignment:
>
> The left and the right figure have to have the height of the center
> figure, which serves as a
> container for the childFigures.
> The left and right figures just paint some lines, which depends from the
> size of the figure (i.e. drawLine from top to bottom)
> The problem is, that when i use a normal ToolbarLayout (or
> BorderLayout), the outer figures have the standard size of (64,36) and
> are smaller than the center figure. But they should have the same height
> as the centerFigure (width of 64 is ok).
> So i overwrote the layout()-method of the toolbarLayout like this:
>
> Rectangle badBoundsLeft =((IFigure) children.get(0)).getBounds();
> Rectangle badBoundsRight =((IFigure) children.get(2)).getBounds();
> Rectangle centerBounds ==((IFigure) children.get(1)).getBounds();
> ((Figure) children.get(0)).setBounds(new Rectangle(badBoundsLeft.x,
> badBoundsLeft.y, badBoundsLeft.width, centerBounds.height));
> ((Figure) children.get(2)).setBounds(new Rectangle(badBoundsRight.x,
> badBoundsRight.y, badBoundsRight.width, centerBounds.height));
>
> and (another try) like this
>
> badBoundsLeft.height = centerBounds.height;
> badBoundsRight.height = centerBounds.height;
>
> Now everything is drawn fine. But the child figures can be collapsed and
> expanded (works fine). The problem is, that with collapsing the height
> and the width changes. With the above changed layoutManger, the height
> isn
|
|
| | | |
Re: Problems with costumized ToolBarLayoutManager [message #180020 is a reply to message #179725] |
Mon, 02 May 2005 17:37 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
You should be using a Border perhaps.
> I have some problems with the ToolbarLayoutManager.
> I need a layoutmanager, who handles three figures, alinged in a row or
> column (configurable).
> I explain the problem now with horizontal alignment:
>
> The left and the right figure have to have the height of the center
> figure, which serves as a
> container for the childFigures.
> The left and right figures just paint some lines, which depends from the
> size of the figure (i.e. drawLine from top to bottom)
> The problem is, that when i use a normal ToolbarLayout (or
> BorderLayout), the outer figures have the standard size of (64,36) and
> are smaller than the center figure. But they should have the same height
> as the centerFigure (width of 64 is ok).
> So i overwrote the layout()-method of the toolbarLayout like this:
>
> Rectangle badBoundsLeft =((IFigure) children.get(0)).getBounds();
> Rectangle badBoundsRight =((IFigure) children.get(2)).getBounds();
> Rectangle centerBounds ==((IFigure) children.get(1)).getBounds();
> ((Figure) children.get(0)).setBounds(new Rectangle(badBoundsLeft.x,
> badBoundsLeft.y, badBoundsLeft.width, centerBounds.height));
> ((Figure) children.get(2)).setBounds(new Rectangle(badBoundsRight.x,
> badBoundsRight.y, badBoundsRight.width, centerBounds.height));
>
> and (another try) like this
>
> badBoundsLeft.height = centerBounds.height;
> badBoundsRight.height = centerBounds.height;
>
> Now everything is drawn fine. But the child figures can be collapsed and
> expanded (works fine). The problem is, that with collapsing the height
> and the width changes. With the above changed layoutManger, the height
> isn
|
|
|
Goto Forum:
Current Time: Fri Mar 29 15:11:39 GMT 2024
Powered by FUDForum. Page generated in 0.02935 seconds
|