Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Create Pie chart Figure(can i custom a figure like a pie (devided circle ))
Create Pie chart Figure [message #1010895] Mon, 18 February 2013 12:41 Go to next message
Mokhtar Abdu is currently offline Mokhtar AbduFriend
Messages: 104
Registered: November 2011
Senior Member

Is it possible to customize a figure in draw2d to have this shape depicted (see image)

I need the divisions to be re-sized dynamically based on a given data. Also, I need to add an image or label to each part. Finally, it should be possible to mouse click on any color as well as symbol. Is this possible???


[Updated on: Mon, 18 February 2013 13:24]

Report message to a moderator

Re: Create Pie chart Figure [message #1011793 is a reply to message #1010895] Wed, 20 February 2013 09:12 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi, of course it is possible.

You have to extend the Figure class and override its paintFigure() where you have to paint all that graphics based on the model state.
You have also to override its containsPoint() method to get mouse events properly work, see Ellipse figure for example.

Then just add a mouseListener to that figure and call whatever you want based on the position of the mouse pointer in the figure.
Previous Topic:Best practice for "invisible" figures with an EditPart?
Next Topic:customize gridlayout
Goto Forum:

Current Time: Mon Nov 19 07:43:40 GMT 2018

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

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

Back to the top