From: <sa...@us...> - 2004-03-11 14:21:10
|
Update of /cvsroot/jrobin/src/org/jrobin/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27547/org/jrobin/graph Modified Files: RrdGraph.java Log Message: RrdDbPool final tweaks Index: RrdGraph.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraph.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RrdGraph.java 1 Mar 2004 12:02:46 -0000 1.4 --- RrdGraph.java 11 Mar 2004 13:54:25 -0000 1.5 *************** *** 26,30 **** import javax.swing.JPanel; - import java.util.ArrayList; import java.util.Iterator; import java.io.File; --- 26,29 ---- *************** *** 56,68 **** // -- Members // ================================================================ ! private static int DEFAULT_POOLSIZE = 15; ! private Grapher grapher; private BufferedImage img; ! private ArrayList rrdDbPool; ! private RrdDbPool pool; - private int maxPoolSize = DEFAULT_POOLSIZE; private boolean useImageSize = false; --- 55,64 ---- // -- Members // ================================================================ ! private Grapher grapher; private BufferedImage img; ! private RrdDbPool pool; private boolean useImageSize = false; *************** *** 91,98 **** * Constructs a new JRobin graph object from the supplied definition. * @param graphDef Graph definition. - * @throws IOException Thrown in case of I/O error. - * @throws RrdException Thrown in case of JRobin specific error. */ ! public RrdGraph( RrdGraphDef graphDef ) throws IOException, RrdException { this( graphDef, false ); --- 87,92 ---- * Constructs a new JRobin graph object from the supplied definition. * @param graphDef Graph definition. */ ! public RrdGraph( RrdGraphDef graphDef ) { this( graphDef, false ); *************** *** 103,110 **** * @param graphDef Graph definition. * @param usePool True if this should object should use RrdDbPool - * @throws IOException Thrown in case of I/O error. - * @throws RrdException Thrown in case of JRobin specific error. */ ! public RrdGraph( RrdGraphDef graphDef, boolean usePool ) throws IOException, RrdException { if ( usePool ) --- 97,102 ---- * @param graphDef Graph definition. * @param usePool True if this should object should use RrdDbPool */ ! public RrdGraph( RrdGraphDef graphDef, boolean usePool ) { if ( usePool ) *************** *** 162,166 **** public void saveAsPNG( String path, int width, int height ) throws RrdException, IOException { ! ImageIO.write( (RenderedImage) getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB), "png", new File(path) ); } --- 154,159 ---- public void saveAsPNG( String path, int width, int height ) throws RrdException, IOException { ! ImageIO.write(getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB), ! "png", new File(path) ); } *************** *** 224,229 **** // Based on http://javaalmanac.com/egs/javax.imageio/JpegWrite.html?l=rel // Retrieve jpg image to be compressed ! BufferedImage gImage = getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB); ! RenderedImage rndImage = (RenderedImage) gImage; // Find a jpeg writer --- 217,221 ---- // Based on http://javaalmanac.com/egs/javax.imageio/JpegWrite.html?l=rel // Retrieve jpg image to be compressed ! RenderedImage rndImage = getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // Find a jpeg writer *************** *** 273,277 **** ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ! ImageIO.write( (RenderedImage) getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB), "png", outputStream ); return outputStream.toByteArray(); --- 265,270 ---- ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ! ImageIO.write(getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB), ! "png", outputStream ); return outputStream.toByteArray(); *************** *** 302,307 **** // Retrieve jpg image to be compressed ! BufferedImage gImage = getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB); ! RenderedImage rndImage = (RenderedImage) gImage; // Find a jpeg writer --- 295,299 ---- // Retrieve jpg image to be compressed ! RenderedImage rndImage = getBufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // Find a jpeg writer |