0

I understand that Draw2D doesn't provide support for more complex figures like cylinders and that we have to "construct them ourselves". I couldn't find much support for that route online. Is there any way I can construct a custom Figure representing a cylinder. I hope this isn't too broad but could someone please point me in the right direction?

Asher
  • 811
  • 3
  • 10
  • 19
  • Can you add an image of how that figure should look like? – Baz Jul 22 '14 at 14:19
  • [Here](http://doublexia.wordpress.com/2011/06/23/use-eclipse-draw2d-to-create-custom-figure/) someone creates a Hexagon. Maybe that's something to look at. – Baz Jul 22 '14 at 14:24
  • @Baz How do you arrive at vertices when only given the enclosing Rectangle's dimensions? – Asher Jul 22 '14 at 14:37
  • Sorry, but I've no idea what you're talking about :/ – Baz Jul 22 '14 at 14:39
  • @Baz The example you pointed out follows the method of first identifying the vertices of the figure to be created, based on the enclosing Rectangle rect. My question is how can we follow the same methodology i.e, identify all the vertices of the cylinder within rect? – Asher Jul 22 '14 at 14:44
  • No idea, sorry. I just found it, but I'm not entirely sure you can use it. That's why I didn't post an answer. – Baz Jul 22 '14 at 14:46

1 Answers1

1

As an alternative to constructing your own cylinder figure geometrically, you can use the GeoShapeCylinderFigure class from the org.eclipse.gmf.runtime.diagram.ui.geoshapes.internal.draw2d.figures package.

Baz
  • 36,440
  • 11
  • 68
  • 94
Asher
  • 811
  • 3
  • 10
  • 19