From: Benjamin R. <ran...@us...> - 2007-08-02 21:02:20
|
Update of /cvsroot/jrobin/src/org/jrobin/graph In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15896/src/org/jrobin/graph Modified Files: RrdGraph.java RrdGraphConstants.java RrdGraphDef.java Log Message: disable this stuff for now, it still acts funny Index: RrdGraphConstants.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraphConstants.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RrdGraphConstants.java 31 Jul 2007 21:04:02 -0000 1.5 --- RrdGraphConstants.java 2 Aug 2007 21:02:14 -0000 1.6 *************** *** 263,272 **** * Default graph small font */ ! String DEFAULT_SMALL_FONT_FILE = "DejaVuSansMono.ttf"; /** * Default graph large font */ ! String DEFAULT_LARGE_FONT_FILE = "DejaVuSans-Bold.ttf"; /** --- 263,272 ---- * Default graph small font */ ! String DEFAULT_MONOSPACE_FONT_FILE = "DejaVuSansMono.ttf"; /** * Default graph large font */ ! String DEFAULT_PROPORTIONAL_FONT_FILE = "DejaVuSans-Bold.ttf"; /** Index: RrdGraphDef.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraphDef.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** RrdGraphDef.java 2 Aug 2007 18:05:41 -0000 1.30 --- RrdGraphDef.java 2 Aug 2007 21:02:14 -0000 1.31 *************** *** 114,119 **** String title = null; // ok long step = 0; // ok ! Font smallFont; ! Font largeFont; boolean drawXGrid = true; // ok boolean drawYGrid = true; // ok --- 114,119 ---- String title = null; // ok long step = 0; // ok ! protected Font smallFont; ! protected Font largeFont; boolean drawXGrid = true; // ok boolean drawYGrid = true; // ok *************** *** 142,147 **** } ! smallFont = this.getFontFromResourceName(RrdGraphConstants.DEFAULT_SMALL_FONT_FILE).deriveFont(Font.PLAIN, 10); ! largeFont = this.getFontFromResourceName(RrdGraphConstants.DEFAULT_LARGE_FONT_FILE).deriveFont(Font.BOLD, 12); } --- 142,149 ---- } ! // smallFont = this.getFontFromResourceName(RrdGraphConstants.DEFAULT_MONOSPACE_FONT_FILE).deriveFont(10); ! // largeFont = this.getFontFromResourceName(RrdGraphConstants.DEFAULT_MONOSPACE_FONT_FILE).deriveFont(12); ! smallFont = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 10); ! largeFont = new Font(DEFAULT_FONT_NAME, Font.BOLD, 12); } *************** *** 187,198 **** } - protected Font getSmallFont() { - return this.smallFont; - } - - protected Font getLargeFont() { - return this.largeFont; - } - /** * Sets the signature string that runs along the right-side of the graph. --- 189,192 ---- *************** *** 706,709 **** --- 700,720 ---- /** + * Get the default small font for graphing. + * @return the font + */ + public Font getSmallFont() { + return this.smallFont; + } + + /** + * Get the default large font for graphing. + * @return the font + */ + public Font getLargeFont() { + return this.largeFont; + } + + + /** * Sets default font for graphing. Note that JRobin will behave unpredictably if proportional * font is selected. Index: RrdGraph.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/RrdGraph.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RrdGraph.java 29 Jul 2007 16:46:36 -0000 1.13 --- RrdGraph.java 2 Aug 2007 21:02:14 -0000 1.14 *************** *** 139,151 **** private void gator() { if (!gdef.onlyGraph && gdef.showSignature) { ! Font font; ! try { ! InputStream fontStream = ClassLoader.getSystemClassLoader().getResourceAsStream("DejaVuSansMono.ttf"); ! font = Font.createFont(Font.TRUETYPE_FONT, fontStream).deriveFont(9).deriveFont(Font.PLAIN); ! fontStream.close(); ! } catch (Exception e) { ! // fall back to the default font ! font = new Font(DEFAULT_FONT_NAME, Font.PLAIN, 9); ! } int x = (int) (im.xgif - 2 - worker.getFontAscent(font)); int y = 4; --- 139,143 ---- private void gator() { if (!gdef.onlyGraph && gdef.showSignature) { ! Font font = gdef.getSmallFont().deriveFont(Font.PLAIN, 9); int x = (int) (im.xgif - 2 - worker.getFontAscent(font)); int y = 4; *************** *** 186,190 **** if (gdef.verticalLabel != null) { int x = PADDING_LEFT; ! int y = im.yorigin - im.ysize / 2 + (int) worker.getStringWidth(gdef.verticalLabel, gdef.smallFont) / 2; int ascent = (int) worker.getFontAscent(gdef.smallFont); worker.transform(x, y, -Math.PI / 2); --- 178,182 ---- if (gdef.verticalLabel != null) { int x = PADDING_LEFT; ! int y = im.yorigin - im.ysize / 2 + (int) worker.getStringWidth(gdef.verticalLabel, gdef.getSmallFont()) / 2; int ascent = (int) worker.getFontAscent(gdef.smallFont); worker.transform(x, y, -Math.PI / 2); |