java uses or overrides a deprecated API.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Bilisten
Posts: 10
Joined: Mon Mar 22, 2004 8:45 am

java uses or overrides a deprecated API.

Post by Bilisten » Tue Jun 22, 2004 7:46 am

Why does my code override a deprecated API?

My code:

NumberAxis axis1 = (NumberAxis) plot.getRangeAxis();
axis1.setInverted(true);
axis1.setMinimumAxisValue(minDyp);
axis1.setMaximumAxisValue(maksDyp);
axis1.setTickUnit(new NumberTickUnit(100));
NumberAxis axis2 = (NumberAxis) plot.getDomainAxis();
axis2.setMinimumAxisValue(minTrykk);
axis2.setMaximumAxisValue(maksTrykk);
axis2.setTickUnit(new NumberTickUnit(50));

ty for a great project

DopeForADay
Posts: 32
Joined: Thu Apr 22, 2004 9:15 am

Post by DopeForADay » Tue Jun 22, 2004 8:37 am

The thrown error/warning would be useful to answer that question :)

Bilisten
Posts: 10
Joined: Mon Mar 22, 2004 8:45 am

Post by Bilisten » Tue Jun 22, 2004 12:12 pm

It does not throw any error or warning.

It just says that jfree.chart.ValueAxis has been deprecated
Why?!?!?!

DopeForADay
Posts: 32
Joined: Thu Apr 22, 2004 9:15 am

Post by DopeForADay » Tue Jun 22, 2004 1:06 pm

Referring to the jfreechart api (0.9.20), it isn't actually the whole ValueAxis class that has been deprecated, but 7 of it's methods. But for each of those methods there are new or alternative methods to use. If you don't use any of these methods, I don't know the reason neither.

BigWillyStyle42
Posts: 58
Joined: Wed Jun 02, 2004 1:37 pm

Post by BigWillyStyle42 » Tue Jun 22, 2004 1:34 pm

Recompile and add -deprecation to the command line. It will tell you exactly what you're calling that is deprecated.

Guest

Post by Guest » Tue Jun 22, 2004 2:28 pm

i think it's the
setMinimumAxisValue
replaced by setLowerBound (or something like that)

Bilisten
Posts: 10
Joined: Mon Mar 22, 2004 8:45 am

Post by Bilisten » Wed Jun 23, 2004 7:38 am

Ty all, its working now. :D
But i dont understand;
Why make a method that deprecates a class?!?

BigWillyStyle42
Posts: 58
Joined: Wed Jun 02, 2004 1:37 pm

Post by BigWillyStyle42 » Wed Jun 23, 2004 1:28 pm

The method was deprecated, not the class. The method was deprecated because there was another method that you should use now.

Locked