Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Scalable Polygon not drawing
Scalable Polygon not drawing [message #212249] Thu, 27 November 2008 04:34 Go to next message
RefuX Zanzeebarr is currently offline RefuX ZanzeebarrFriend
Messages: 51
Registered: July 2009
Member
First I apologize if my question is really stupid, I'm new to the GMF game.

So I have some Polygon made up of TemplatePoints drawing just
wonderfully. However it doesn't resize with the EditPart it's part of. I
figure what I need is to just replace the Polygon with a Scalable
Polygon, then (hopefully) it will get scaled in proportion of it's EditPart.

However this Scalable Polygon never gets drawn :(

Not being one to be scared off, I have a dig about in the code. Turns
out for the case of a Scalable Polygon, the Polygon class isn't used,
but a little custom subclass of Shape is generated. So in this inner
class I stick a breakpoint on the fillShape and outlineShape methods...
turns out these are never called! :( :(

More debugging later and it turns out it never gets drawn because
getBounds() doesn't return the correct bounds.
Looking a Polygon class, getBounds if overridden and returns the correct
bounds, but the class generated for my Scalable Polygon doesn't. It DOES
have a method called getTemplateBounds, which looks just like what i
need....

So anyways, I'm a bit confused as to why the Scalable Polygon doesn't
override getBounds and return the correct size...


I figure being the newbie I am, I'm way off the reservation by now, so
before I end up lost in the Jungle I figured I'd send a shout out for
help! :)
Re: Scalable Polygon not drawing [message #212370 is a reply to message #212249] Fri, 28 November 2008 10:31 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello RefuX,

I think you have to specify proper layout for Scalable polygon parent figure
+ layout constraints for ScalablePolygon. As a result this figure will get
proper bounds just like any other figures.

-----------------
Alex Shatalin
Previous Topic:Common Navigator in RCP
Next Topic:Ambiguous extensions error in generator model
Goto Forum:
  


Current Time: Sat Apr 20 01:13:58 GMT 2024

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

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

Back to the top