How do new packages work ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
lonelyplanetfr@yahoo.fr

How do new packages work ?

Post by lonelyplanetfr@yahoo.fr » Sun Jan 27, 2002 9:38 am

I tried to intall the new release ant i 've got one question and one problem !

1- (question) What about the package 'junit'. To make a try, i imported all classes included in jcommom and jfreechart.
The program canot be compiled as he needs somme elements of 'junit'. Is 'junit' necessary to all projects ?
Is it possible to get JUnit source ?

2- (problem) After having imported all the classes, I ve got somme errors

"JFreeChart.java": Error #: 300 : method getLegendItemCount() not found in interface com.jrefinery.data.Dataset at line 278, column 26
"PiePlot.java": Error #: 300 : method getCategoryCount() not found in interface com.jrefinery.data.PieDataset at line 413, column 56
"PiePlot.java": Error #: 300 : method getCategoryCount() not found in interface com.jrefinery.data.PieDataset at line 433, column 63
"PiePlot.java": Error #: 300 : method getLegendItemLabels() not found in interface com.jrefinery.data.PieDataset at line 576, column 42
"StandardLegend.java": Error #: 300 : method getLegendItemLabels() not found in interface com.jrefinery.data.Dataset at line 228, column 47



For the first one, I looked in "Dataset", where you wrote:

* 18-Sep-2001 : Added standard header and fixed DOS encoding problem (DG);
* 15-Oct-2001 : Moved to a new package (com.jrefinery.data.*) (DG);
* 22-Oct-2001 : Changed name to Dataset.java (DG);
* 17-Nov-2001 : Added getLegendItemCount() and getLegendItemLabels() methods, created
* SeriesDataset interface and transferred series related methods out (DG);
* 22-Jan-2002 : Reconsidered (and removed) the getLegendItemCount() and getLegendItemLabels()
* methods...leave this to client code (DG);
*
*/

Is it a problem of version, or do I make some thingS wrong ?

/////////////////////////////////////

I think both questions are related , as I don't have understood the working of the new packages.


Thanks for your help !



NB: Here are the instructions I wrote

package essainouvchart ;



import com.jrefinery.data.*;
import com.jrefinery.data.junit.*;
import com.jrefinery.date.*;
import com.jrefinery.date.junit.*;
import com.jrefinery.chart.*;
import com.jrefinery.chart.data.*;
import com.jrefinery.chart.demo.*;
import com.jrefinery.chart.event.*;
import com.jrefinery.chart.ui.*;

import com.jrefinery.io.*;
import com.jrefinery.junit.*;
import com.jrefinery.layout.*;
import com.jrefinery.ui.*;

import com.keypoint.*;

import junit.*;
import junit.extensions.*;
import junit.framework.*;
import junit.runner.*;
import junit.swingui.*;
import junit.swingui.icons.*;
import junit.textui.*;
import junit.ui.*;




public class mainclass {

public mainclass() {
}
public static void main(String[] args) {
//mainclass mainclass1 = new mainclass();
//JFreeChartFrame = new JFreeChartFrame() ;
}
}

And here is directories' tree


essainouvchart
mainclass
com (includes JCommons & JFreeChart)
junit (includes the extracted classes from junit.jar)

David Gilbert

RE: How do new packages work ?

Post by David Gilbert » Sun Jan 27, 2002 9:28 pm

Hi,

JUnit is an excellent testing framework, open source which is even better. I've written some test cases for some of the classes in JCommon and JUnit makes it very easy to re-run them at any time. There's a note in the README file for JCommon about this. The JUnit website is:

http://www.junit.org

It's an excellent tool, you should take a look at it.

For your second question, it looks to me like you've used an old version of PiePlot (JFreeChart) with a new version of PieDataset (JCommon)...but I'll go and double check to make sure I haven't messed up the JFreeChart 0.7.1 packaging somehow...

Regards,

Dave Gilbert.

David Gilbert

RE: How do new packages work ?

Post by David Gilbert » Mon Jan 28, 2002 10:32 am

I've double checked and the source code in the download recompiles as described in the documentation. I think you must be mixing up some source files...

Regards,

DG.

Locked