Skip to main content



      Home
Home » Eclipse Projects » GEF » PolyLine.setBounds fails
PolyLine.setBounds fails [message #229108] Tue, 16 January 2007 06:05 Go to next message
Eclipse UserFriend
Originally posted by: andras.balogh.cas.de

Hi,

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

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,
Andras





  • Attachment: Unbenannt.JPG
    (Size: 70.42KB, Downloaded 224 times)
Re: PolyLine.setBounds fails [message #229119 is a reply to message #229108] Tue, 16 January 2007 07:11 Go to previous message
Eclipse UserFriend
Hi,

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 ...

Manu
Previous Topic:Resize node figure as textflow content changes
Next Topic:Q: Greying out objects/connections in a diagram?
Goto Forum:
  


Current Time: Tue May 20 03:34:05 EDT 2025

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

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

Back to the top