Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem with drawing polygon using draw2d ScalablePolygonShape.(Problem with drawing polygon using draw2d ScalablePolygonShape.)
Problem with drawing polygon using draw2d ScalablePolygonShape. [message #761401] Tue, 06 December 2011 12:33
Meghna Missing name is currently offline Meghna Missing nameFriend
Messages: 9
Registered: March 2011
Junior Member

I have to display a polygon(basically a trapezium shape) on a
FigureCanvas. I have a class that extends org.eclipse.draw2d
ScalablePolygonShape. While creating the object of this class,
the polygon points are added using the addPoint() method:-
addPoint(new Point(x1,y1));
addPoint(new Point(x2,y2));
addPoint(new Point(x2,y3));
addPoint(new Point(x1,y4));

After creating the polygon object, I set a contraint on it with a
rectangle having bounds that encloses the polygon:-
  new Rectangle(x1, y1, x2 - x1, y4 - y1);

The polygon is plotted correctly if the y position values are less,
i.e y1=300, y2=400, y3=500, y4=600, but if the y position values
are increased to say y1=10300, y2=10400, y3=10500, y4=10600,
then the polygon is plotted smaller in size & appear clipped.

Any reasons as to why this is happening?
Any pointers to resolve this problem will be greatly helpful.
Previous Topic:How to rotate draw2d label?
Next Topic:Problem with drawing connections using draw2d PolylineConnection
Goto Forum:

Current Time: Wed Dec 08 19:05:46 GMT 2021

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

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

Back to the top