I plot a curve with JFreechart. Then the user can draw ranges by dragging the mouse. These I plot using AbstractChartAnnotation to draw a filled Path2D. So far so nice - all ali
You might look at the Layer to which the annotation is being added. There's an example here. Naturally, an sscce that exhibits the problem you describe would help clarify the source of the problem.
Addendum: One potential problem is that your implementation of Comparable is not consistent with equals()
, as the latter relies (implicitly) on the super-class implementation. A consistent implementation is required for use with a sorted Set
such as TreeSet
. You'll need to override hashCode()
, too. Class Value is an example.