Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » PolyLine.setBounds fails
PolyLine.setBounds fails [message #229108] Tue, 16 January 2007 11:05 Go to next message
Eclipse UserFriend
Originally posted by:


I have the following figure structure:
-Figure (no layout Manager)
-RoundedRectangle (ToolbarLayoutManager)
-(some child shapes displayed correctly)

My Polyline (striking through the rectangle actually) should be displayed
according to a boolean value in the model. But after having added the points
I have to setBounds() in order to have the right bounds (Is it usual to do
so? without this bounds is 0,0,0,0).

That is not enough :) -> if I call e.g. setBounds (new Rectangle(10, 20, 30,
40)) on it, only the "width" and "height" params are set on my Polyline, x
and y values are left unchanged (0,0) (see attached screenshot of
debugging).Therefore I subclassed Polyline and overrode the method
setBounds() and it simply works now...

Is this a bug or have I overseen something?

thank you,

  • Attachment: Unbenannt.JPG
    (Size: 70.42KB, Downloaded 145 times)
Re: PolyLine.setBounds fails [message #229119 is a reply to message #229108] Tue, 16 January 2007 12:11 Go to previous message
Manuel Selva is currently offline Manuel SelvaFriend
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member

Here is the Java doc description for polyline:

A polyline's bounds will be calculated automatically based on its
PointList. The bounds will be the smallest Rectangle large enough to
render the line properly. Children should not be added to a Polyline and
will not affect the bounds calculation.

I am also dealing with polylines. To layout them i just add point to them
and all is fine .... The only differenc eis that my polylines are part of
a figure which layouts using XYLayout ...


Previous Topic:non-Selection policy
Next Topic:Draw2d layout, fixed positions
Goto Forum:

Current Time: Fri Dec 03 17:37:37 GMT 2021

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

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

Back to the top