From: Benjamin R. <ran...@us...> - 2007-07-29 04:19:35
|
Update of /cvsroot/jrobin/src/org/jrobin/graph In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13824/src/org/jrobin/graph Modified Files: RrdGraphConstants.java RrdGraphDef.java ImageWorker.java Log Message: Incorporate Will Fraley's jrobin graph cleanups Index: RrdGraphConstants.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraphConstants.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RrdGraphConstants.java 21 Dec 2006 18:02:44 -0000 1.2 --- RrdGraphConstants.java 29 Jul 2007 04:19:29 -0000 1.3 *************** *** 168,176 **** * Default minor grid color */ ! Color DEFAULT_GRID_COLOR = new Color(140, 140, 140); /** * Default major grid color */ ! Color DEFAULT_MGRID_COLOR = new Color(130, 30, 30); /** * Default font color --- 168,178 ---- * Default minor grid color */ ! Color DEFAULT_GRID_COLOR = new Color(171, 171, 171, 95); ! // Color DEFAULT_GRID_COLOR = new Color(140, 140, 140); /** * Default major grid color */ ! Color DEFAULT_MGRID_COLOR = new Color(255, 91, 91, 95); ! // Color DEFAULT_MGRID_COLOR = new Color(130, 30, 30); /** * Default font color *************** *** 322,327 **** * Stroke used to draw grid */ ! Stroke GRID_STROKE = ! new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[] {1, 1}, 0); /** * Stroke used to draw ticks --- 324,332 ---- * Stroke used to draw grid */ ! // solid line ! Stroke GRID_STROKE = new BasicStroke(1); ! ! // dotted line ! // Stroke GRID_STROKE = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[] {1, 1}, 0); /** * Stroke used to draw ticks Index: RrdGraphDef.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraphDef.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** RrdGraphDef.java 21 Dec 2006 18:02:44 -0000 1.22 --- RrdGraphDef.java 29 Jul 2007 04:19:29 -0000 1.23 *************** *** 30,33 **** --- 30,35 ---- import java.awt.*; + import java.io.IOException; + import java.io.InputStream; import java.util.ArrayList; import java.util.List; *************** *** 125,132 **** try { setTimeSpan(Util.getTimestamps(DEFAULT_START, DEFAULT_END)); ! } ! catch (RrdException e) { throw new RuntimeException(e); } } --- 127,145 ---- try { setTimeSpan(Util.getTimestamps(DEFAULT_START, DEFAULT_END)); ! } catch (RrdException e) { throw new RuntimeException(e); } + try { + InputStream fontStream = ClassLoader.getSystemClassLoader() + .getResourceAsStream("DejaVuSansMono.ttf"); + smallFont = Font.createFont(Font.TRUETYPE_FONT, fontStream); + fontStream.close(); + fontStream = ClassLoader.getSystemClassLoader() + .getResourceAsStream("DejaVuSans-Bold.ttf"); + largeFont = Font.createFont(Font.TRUETYPE_FONT, fontStream); + fontStream.close(); + } catch (Exception ioe) { + // if we can't load custom fonts, fall back to the normal defaults + } } Index: ImageWorker.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/ImageWorker.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImageWorker.java 21 Dec 2006 18:02:43 -0000 1.2 --- ImageWorker.java 29 Jul 2007 04:19:29 -0000 1.3 *************** *** 170,173 **** --- 170,175 ---- gd.setRenderingHint(RenderingHints.KEY_ANTIALIASING, enable ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF); + gd.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + gd.setRenderingHint(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY); } |