|PolyLine.setBounds fails [message #229108]
||Tue, 16 January 2007 11:05
Originally posted by: andras.balogh.cas.de|
I have the following figure structure:
-Figure (no layout Manager)
-(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?
|Re: PolyLine.setBounds fails [message #229119 is a reply to message #229108]
||Tue, 16 January 2007 12:11
| Manuel Selva
Registered: July 2009
Location: Grenoble, France
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 ...
Powered by FUDForum
. Page generated in 0.01854 seconds