Add and move/re-locate annotation

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Mike Watts
Posts: 13
Joined: Mon May 08, 2006 1:27 pm

Add and move/re-locate annotation

Post by Mike Watts » Mon May 08, 2006 1:50 pm

I want to add an annotation ( maybe with a pointer ) but I can imagine a user wanting to 'drag' the annotation to finely position it. Anyone tried doing this?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Mon May 08, 2006 2:01 pm

The problem is that, as delivered, Annotations are immutable. So you will need to cut and paste some code to achieve what you want.

But it does work :D

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue May 09, 2006 9:56 am

Initially, I made annotations immutable because I didn't want the overhead of event listeners to notify the chart whenever an annotation changes, in order to trigger the automatic chart repainting.

You'll notice that now the classes aren't really immutable (you can modify some attributes), but there is also still no event notification. This needs tidying up. Perhaps adding event notification, and allowing annotations to be completely modifiable makes sense. It would certainly make it easier to implement more complex annotations (for instance, an entire chart could be added in one corner of a larger chart, as an annotation).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Add and move/re-locate annotation

Post by paradoxoff » Fri Jun 19, 2009 4:57 pm

I have uploaded a patch to add the (still missing) event handling code for annotations (artifact id 2809117).

Locked