Unnecessary repaints

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Kees Kuip

Unnecessary repaints

Post by Kees Kuip » Thu Jun 13, 2002 7:14 pm

Hello,

I noticed that the DynamicChart Demo in JFreeChartDemo.java does some
unnecesarry repaints (at least that is my opinion).

I tracked it down at XYPlot.java (method render) which calls
domainAxis.setCrosshairValue(...) and
rangeAxis.setCrosshairValue(...).
The method setCrosshairValue() in ValueAxis.java always
notifies it Listeners (even when the crosshair is not visible).

I change the setCrosshairValue-method in ValueAxis to :

public void setCrosshairValue(double value) {

this.crosshairValue = value;

if(!isCrosshairVisible()) {
return;
}

notifyListeners(new AxisChangeEvent(this));
}

Now I don't get any unnessesary repaints.

Kees.

David Gilbert

Re: Unnecessary repaints

Post by David Gilbert » Thu Jun 13, 2002 11:04 pm

Hi Kees,

Thanks for reporting this. I've added your change...it makes sense to me.

Regards,

DG.

Locked