Embedding FlowPage inside FlowAdapter [message #214097] |
Wed, 12 April 2006 18:20 |
Eclipse User |
|
|
|
Originally posted by: andrew_NOSPAM_.eisenberg.as
I want to embed a FlowPage (or even just a textual label) inside of a
FlowAdapter. I am able to do this, but the contents of the embedded FlowPage is
shifted up a few pixels (3 or 4). Does this have something to do with the
baseline of the FigureBox? If so, how can I change it?
The code snippet below is the simplest example of this that I could think of.
The label (new Label("label---up above ")) will appear 3 or 4 pixels above the
TextFlows.
I am using Eclipse3.2M5 and Draw2D version 3.2.0.
Any help would be appreciated. Thanks.
public static void main(String[] args) {
Display d = new Display();
final Shell shell = new Shell(d);
shell.setSize(400, 400);
shell.setText("Embedded Flow Pages Test");
LightweightSystem lws = new LightweightSystem(shell);
Figure page = new FlowPage();
page.add(new TextFlow("textflow "));
FlowAdapter adapter = new FlowAdapter();
adapter.setLayoutManager(new ToolbarLayout(true));
adapter.add(new Label("label---up above "));
page.add(adapter);
page.add(new TextFlow("textflow "));
lws.setContents(page);
shell.open();
while (!shell.isDisposed())
while (!d.readAndDispatch())
d.sleep();
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03939 seconds