Skip to main content



      Home
Home » Eclipse Projects » GEF » BorderLayout - max size at center
BorderLayout - max size at center [message #166213] Sat, 29 January 2005 14:26 Go to next message
Eclipse UserFriend
Originally posted by: me.here.com

Hi.

One of my edit parts uses a figure with a borderlayout.
What i want is, that the figures left, right, top and bottom should stay
at their preferred size, while the figure in the center will occupy
the rest.

Do i have to subclass BorderLayout and override some methods?

Greets and thanks
Re: BorderLayout - max size at center [message #166233 is a reply to message #166213] Sat, 29 January 2005 20:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You are describing the way this class is supposed to work. Perhaps you can
post a snippet showing the problem.

Top figure is given it's preferred height, but width is stretched to match
the width of the container. Similar for the other sides. Did you want to
avoid stretching?

> One of my edit parts uses a figure with a borderlayout.
> What i want is, that the figures left, right, top and bottom should stay
> at their preferred size, while the figure in the center will occupy the
> rest.
Re: BorderLayout - max size at center [message #166273 is a reply to message #166233] Sun, 30 January 2005 04:39 Go to previous message
Eclipse UserFriend
Originally posted by: me.here.com

This is a multi-part message in MIME format.
--------------040303010007000609030307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


> You are describing the way this class is supposed to work. Perhaps you can
> post a snippet showing the problem.
Hmm. I thought that...

Ok. More specific:
Please look at the attached picture.
The figure uses the border layout. I added a panel ror each side and the
center. The line in the middle of the picture is the lineborder around
the center panel.
So what i want is that the center panel should be stretched (width and
height) so the title-label is at the top border and the status bar at
the bottom. The width of the left and right panel should not be modified.


--- Here's the code i use (btw. the small rectangles are figures of
other parts which are added later):

public NodeFigure() {
super();

setBorder(new SimpleRaisedBorder());
setLayoutManager(new BorderLayout());
setBackgroundColor(COLOR_BACKGROUND);
setOpaque(true);

IFigure contentPane = new Figure();
contentPane.setLayoutManager(new BorderLayout());
contentPane.setBorder(new MarginBorder(2));
contentPane.setOpaque(true);

IFigure panelTitle = new Figure();
panelTitle.setLayoutManager(new FlowLayout());
panelTitle.setBorder(new MarginBorder(2));
panelTitle.setOpaque(true);
panelTitle.setBackgroundColor(COLOR_BACKGROUND_TITLE);
titleText = new Label("Title");
titleText.setForegroundColor(COLOR_TEXT_TITLE);
panelTitle.add(titleText);
contentPane.add(panelTitle, BorderLayout.TOP);

IFigure panelLeft = new Figure();
panelLeft.setLayoutManager(new ToolbarLayout());
panelLeftTop = new Figure();
panelLeft.add(panelLeftTop);
panelLeftBottom = new Figure();
panelLeft.add(panelLeftBottom);
contentPane.add(panelLeft, BorderLayout.LEFT);

IFigure panelRight = new Figure();
panelRight.setLayoutManager(new ToolbarLayout());
panelRightTop = new Figure();
panelRight.add(panelRightTop);
panelRightBottom = new Figure();
panelRight.add(panelRightBottom);
contentPane.add(panelRight, BorderLayout.RIGHT);

IFigure panelCenter = new Figure();
panelCenter.setLayoutManager(new ToolbarLayout());
panelCenter.setBorder(new LineBorder(ColorConstants.black, 1));
contentPane.add(panelCenter, BorderLayout.CENTER);

IFigure panelStatusBar = new Figure();
panelStatusBar.setBorder(new SimpleLoweredBorder(1));
panelStatusBar.setLayoutManager(new ToolbarLayout(true));
statusText = new Label(Constant.STRING_EMPTY);
panelStatusBar.add(statusText);
contentPane.add(panelStatusBar, BorderLayout.BOTTOM);

add(contentPane, BorderLayout.CENTER);
}

> Top figure is given it's preferred height, but width is stretched to match
> the width of the container. Similar for the other sides. Did you want to
> avoid stretching?
>
>
>>One of my edit parts uses a figure with a borderlayout.
>>What i want is, that the figures left, right, top and bottom should stay
>>at their preferred size, while the figure in the center will occupy the
>>rest.
>
>
>


--------------040303010007000609030307
Content-Type: image/jpeg;
name="layout.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="layout.jpg"

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJ ChQODwwQFxQY
GBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoI ChMKChMoGhYa
KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo KCgoKCj/wAAR
CADHANUDASIAAhEBAxEB/8QAGgABAAMBAQEAAAAAAAAAAAAAAAMGBwUIBP/E AEYQAAEDAQME
DQkGBQUBAAAAAAABAgMEBQYRBxZVlRITFBUXITdTVpKU0dI0cnN1sbKz09Qi MTJXYaYIQVF0
kSM4QnG0wv/EABsBAQEBAAMBAQAAAAAAAAAAAAABBAMFBgIH/8QAKBEBAAED BAEFAAIDAQAA
AAAAAAECBBEDEiExQQUUUVORBjITNWFy/9oADAMBAAIRAxEAPwD1SCq5UrZt y79xLTtO6lm7
521BtW56TaHzbZspWNd9hio5cGq5eJeLDH7ivXOvZfm1Lo2TX2pduyKa0qiO R1TT1lXU0D4n
JNI1qJEsEqoisax2Ku49kvEiYYhpYKXv9e7QV29eVH0Q3+vdoK7evKj6IC6A pe/17tBXb15U
fRDf692grt68qPogLoCl7/Xu0FdvXlR9EN/r3aCu3ryo+iAugKXv9e7QV29e VH0Q3+vdoK7e
vKj6IC6Ape/17tBXb15UfRDf692grt68qPogLoCl7/Xu0FdvXlR9EVG7V+so dflBvTZVfdSm
gsWg2/e6rqYKmkjqdhUMYzGdUkauMbnO+yxcVRMMExUDYgUvf692grt68qPo hv8AXu0FdvXl
R9EBdAUvf692grt68qPohv8AXu0FdvXlR9EBdAUvf692grt68qPohv8AXu0F dvXlR9EBdAUv
f692grt68qPohv8AXu0FdvXlR9EBdAUvf692grt68qPohv8AXu0FdvXlR9EB dAUvf692grt6
8qPois5R765QbDuq2usC61m11pLWxQ7non1Npf6TmSq57mtihVuDmRoi/aT7 S44cWIa0DlXT
ra60bq2NXWvTbktKpooZqqn2t0e1SuYivZsXcbcHKqYLxphxgDlZWOSy+XqW t+A8mq/KpvPd
7SHKxyWXy9S1vwHk1X5VN57vaBEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGe5e uS62vRO91xoR
nuXrkutr0TvdcSehtYAKKrlY5LL5epa34Dyar8qm893tIcrHJZf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IHkqtL+3f/8AZoW6Z+ek6ymdZfnvkyX2yr3O cu0uTFVx/wCL
iT0NpABRVcrHJZfL1LW/AeTVflU3nu9pDlY5LL5epa34Dyar8qm893tAiAAA AAAAAAAAAAAA
AAAAAAAAAAAAAADPcvXJdbXone640Iz3L1yXW16J3uuJPQ2sAFFVyscll8vU tb8B5NV+VTee
72nJy52zBYOSW81ZWUktZTPpdySwxTJC9zJ3NhVWvVrkRUSRVTFq/cUuyMqU lt3dsm24Lp27
I20opJ1ZQ001YyJWzyxbFZGRYY/6eywwRURyf9qGigoXCDU9Db26nqvljhBq eht7dT1XyyZF
9BQuEGp6G3t1PVfLHCDU9Db26nqvljIvoKFwg1PQ29up6r5Y4Qanobe3U9V8 sZF9BQuEGp6G
3t1PVfLHCDU9Db26nqvljIvoKFwg1PQ29up6r5Y4Qanobe3U9V8sZF9BQuEG p6G3t1PVfLOX
ZWV1lpX1vbd2G7Nc+SwduwkpZnVMlTtdSyDihZFskx2ey4lXBEX/ALGRqIKF wg1PQ29up6r5
Y4Qanobe3U9V8sZF9BQuEGp6G3t1PVfLHCDU9Db26nqvljIvoKFwg1PQ29up 6r5Y4Qanobe3
U9V8sZF9BQuEGp6G3t1PVfLHCDU9Db26nqvljIvoKFwg1PQ29up6r5Y4Qano be3U9V8sZF9M
9y9cl1teid7riXhBqeht7dT1XyypZXr9Ur8m9a+2br3gipp6uKhWOdr7Pe5J I5nK5jpYXI7D
asFRG/8AJMf1TOR6TByrp2vnBdWxrZ2jc++NFDWbTs9nte2MR+x2WCY4Y4Y4 Jj/QFHVAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//Z
--------------040303010007000609030307--
Previous Topic:labelled connections
Next Topic:how to draw connection between two labels?
Goto Forum:
  


Current Time: Sat Jun 21 08:04:34 EDT 2025

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

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

Back to the top