Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to get layer to fill it's pane?
How to get layer to fill it's pane? [message #243964] Mon, 30 June 2008 03:24
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
I'm adding a FreeformLayer to a ScalableFreeformLayeredPane, and I
can't seem to get the layer to fill the pane. In order to see the
polygon drawn on the layer, I must call layer.setBounds(). What am I
missing?

Canvas canvas = new Canvas(parent, SWT.NONE);
canvas.setLayout(new FillLayout());
LightweightSystem lws = new LightweightSystem(canvas);

final ScalableFreeformLayeredPane pane = new ScalableFreeformLayeredPane();
pane.setLayoutManager(new FreeformLayout());
lws.setContents(pane);

FreeformLayer layer = new FreeformLayer();
layer.setLayoutManager(new FreeformLayout());
// layer.setBounds(new Rectangle(0, 0, 500, 500));
pane.add(layer);

Polygon polygon = new Polygon();
polygon.addPoint(new Point(20,10));
polygon.addPoint(new Point(30,10));
polygon.addPoint(new Point(40,20));
polygon.addPoint(new Point(40,30));
polygon.addPoint(new Point(30,40));
polygon.addPoint(new Point(20,40));
polygon.addPoint(new Point(10,30));
polygon.addPoint(new Point(10,20));

layer.add(polygon);
Previous Topic:Problem in creating ScrollPane.
Next Topic:Problem with rotating a Draw2D Label
Goto Forum:
  


Current Time: Tue Oct 23 20:50:50 GMT 2018

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

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

Back to the top