| 26 |
|
* The current CVS revision of this class |
| 27 |
|
*/ |
| 28 |
|
public final String REVISION = "$Revision$"; |
| 29 |
+ |
|
| 30 |
|
|
| 30 |
– |
private final int _fg = 0; // black |
| 31 |
– |
private final int _bg = 16777215; // white |
| 32 |
– |
private final int _gradeColour = 13421823; // i-scream blue ;) |
| 33 |
– |
|
| 31 |
|
//---STATIC METHODS--- |
| 32 |
|
|
| 33 |
|
//---CONSTRUCTORS--- |
| 39 |
|
|
| 40 |
|
//---PUBLIC METHODS--- |
| 41 |
|
|
| 42 |
< |
public void writeGraph(String filename, int width, int height, int grade){ |
| 46 |
< |
|
| 47 |
< |
//Uncomment this to find out the integer values for certain colours. |
| 48 |
< |
//int rgb = 0*256*256 + 0*256 + 0; |
| 49 |
< |
//System.out.println ((rgb & 0xff00ff00) | ((rgb & 0xff0000) >> 16) | ((rgb & 0xff) << 16)); |
| 42 |
> |
public void writeGraph(String filename, int width, int height, int gradeX, int gradeY){ |
| 43 |
|
|
| 44 |
|
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| 45 |
|
|
| 46 |
< |
_pd.drawGraph(img, width, height, grade, _fg, _bg, _gradeColour); |
| 46 |
> |
_pd.drawGraph(img, width, height, gradeX, gradeY); |
| 47 |
|
|
| 48 |
|
try { |
| 49 |
|
FileOutputStream fos = new FileOutputStream(new File(filename)); |
| 54 |
|
fos.flush(); |
| 55 |
|
fos.close(); |
| 56 |
|
|
| 57 |
< |
System.out.println(" - Written "+width+"x"+height+" graph file"); |
| 57 |
> |
System.out.println(" - Written "+width+"x"+height+" graph file"); |
| 58 |
|
} |
| 59 |
|
catch(Exception e){ |
| 60 |
|
System.out.println("Could not write the .gif file."); |