Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » BlockFlow width
BlockFlow width [message #215665] Mon, 08 May 2006 14:30 Go to next message
Eclipse UserFriend
Originally posted by: dana.schoonover.wpafb.af.mil

How can I determine the width of blockFlow?

TextFlow textFlow = new TextFlow ("Send Order");
BlockFlow blockFlow = new BlockFlow();
blockFlow.setOrientation(SWT.LEFT_TO_RIGHT);
blockFlow.setHorizontalAligment(PositionConstants.LEFT);
blockFlow.setBorder(SimpleEtchedBorder.singleton);
blockFlow.add(textFlow);

The following methods all seem to yield zero values:

dimension = blockFlow.getSize();
System.out.println("dimension.width = " + Integer.toString
(dimension.width));
dimension = blockFlow.getPreferredSize();
System.out.println("getPreferredSize = " +
Integer.toString(dimension.width));
Re: BlockFlow width [message #215673 is a reply to message #215665] Mon, 08 May 2006 17:03 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is because layout does not occur immediately. If it did, we would have
layed out 4 times. You need to force the update manager to run.

Normally this is not necessary. You should be querying the size/position
withing the context of a layout, in which case the block would already have
been positioned. Or, you add a listener to the figure to follow it, etc.

"Dana Schoonover" <dana.schoonover@wpafb.af.mil> wrote in message
news:91292d29d02f115beccf6a03b9daf1c0$1@www.eclipse.org...
>
> How can I determine the width of blockFlow?
>
> TextFlow textFlow = new TextFlow ("Send Order");
> BlockFlow blockFlow = new BlockFlow();
> blockFlow.setOrientation(SWT.LEFT_TO_RIGHT);
> blockFlow.setHorizontalAligment(PositionConstants.LEFT);
> blockFlow.setBorder(SimpleEtchedBorder.singleton);
> blockFlow.add(textFlow);
>
> The following methods all seem to yield zero values:
>
> dimension = blockFlow.getSize();
> System.out.println("dimension.width = " + Integer.toString
> (dimension.width));
> dimension = blockFlow.getPreferredSize();
> System.out.println("getPreferredSize = " +
> Integer.toString(dimension.width));
>
>
Previous Topic:can we add jface list & combobox in gef editor
Next Topic:Custom line style plays havoc with GuideLineFigure painting
Goto Forum:
  


Current Time: Thu Jan 16 16:53:27 GMT 2025

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

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

Back to the top