From: Benjamin R. <ran...@us...> - 2007-08-27 19:52:34
|
Update of /cvsroot/jrobin/src/org/jrobin/cmd In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14424/src/org/jrobin/cmd Modified Files: RrdGraphCmd.java Log Message: allow getting the graph definition out of the RrdGraphCmd object Index: RrdGraphCmd.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/cmd/RrdGraphCmd.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RrdGraphCmd.java 21 Dec 2006 18:02:40 -0000 1.2 --- RrdGraphCmd.java 27 Aug 2007 19:52:29 -0000 1.3 *************** *** 45,49 **** Object execute() throws RrdException, IOException { ! gdef = new RrdGraphDef(); // OPTIONS --- 45,74 ---- Object execute() throws RrdException, IOException { ! gdef = getGraphDef(); ! ! // create diagram finally ! RrdGraphInfo info = new RrdGraph(gdef).getRrdGraphInfo(); ! if (info.getFilename().equals(RrdGraphConstants.IN_MEMORY_IMAGE)) { ! println(new String(info.getBytes())); ! } ! else { ! println(info.getWidth() + "x" + info.getHeight()); ! String[] plines = info.getPrintLines(); ! for (String pline : plines) { ! println(pline); ! } ! if (info.getImgInfo() != null && info.getImgInfo().length() > 0) { ! println(info.getImgInfo()); ! } ! } ! return info; ! } ! ! /** ! * @throws RrdException ! * @returns an RRD graph definition ! */ ! public RrdGraphDef getGraphDef() throws RrdException { ! RrdGraphDef gdef = new RrdGraphDef(); // OPTIONS *************** *** 202,222 **** } } ! // create diagram finally ! RrdGraphInfo info = new RrdGraph(gdef).getRrdGraphInfo(); ! if (info.getFilename().equals(RrdGraphConstants.IN_MEMORY_IMAGE)) { ! println(new String(info.getBytes())); ! } ! else { ! println(info.getWidth() + "x" + info.getHeight()); ! String[] plines = info.getPrintLines(); ! for (String pline : plines) { ! println(pline); ! } ! if (info.getImgInfo() != null && info.getImgInfo().length() > 0) { ! println(info.getImgInfo()); ! } ! } ! return info; ! } private void parseLine(String word) throws RrdException { --- 227,233 ---- } } ! ! return gdef; ! } private void parseLine(String word) throws RrdException { |