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: 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 174 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
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: Sat Apr 27 04:20:39 GMT 2024

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

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

Back to the top