[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmf] Scalable Polygon not drawing
|
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! :)