From: Benjamin R. <ran...@us...> - 2007-08-28 15:59:46
|
Update of /cvsroot/jrobin/src/org/jrobin/cmd In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22653/src/org/jrobin/cmd Modified Files: RrdGraphCmd.java Log Message: make it more obvious that we are creating a new graphdef object Index: RrdGraphCmd.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/cmd/RrdGraphCmd.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RrdGraphCmd.java 28 Aug 2007 13:49:03 -0000 1.4 --- RrdGraphCmd.java 28 Aug 2007 14:39:44 -0000 1.5 *************** *** 70,74 **** */ public RrdGraphDef getGraphDef() throws RrdException { ! RrdGraphDef graphDef = new RrdGraphDef(); // OPTIONS --- 70,74 ---- */ public RrdGraphDef getGraphDef() throws RrdException { ! RrdGraphDef gdef = new RrdGraphDef(); // OPTIONS *************** *** 76,80 **** // START, END String t1 = getOptionValue("s", "start", DEFAULT_START), t2 = getOptionValue("e", "end", DEFAULT_END); ! graphDef.setTimeSpan(Util.getTimestamps(t1, t2)); // X-GRID parseXGrid(getOptionValue("x", "x-grid")); --- 76,80 ---- // START, END String t1 = getOptionValue("s", "start", DEFAULT_START), t2 = getOptionValue("e", "end", DEFAULT_END); ! gdef.setTimeSpan(Util.getTimestamps(t1, t2)); // X-GRID parseXGrid(getOptionValue("x", "x-grid")); *************** *** 82,184 **** parseYGrid(getOptionValue("y", "y-grid")); // ALT-Y-GRID ! graphDef.setAltYGrid(getBooleanOption("Y", "alt-y-grid")); // NO_MINOR ! graphDef.setNoMinorGrid(getBooleanOption(null, "no-minor")); // ALT-Y-MRTG ! graphDef.setAltYMrtg(getBooleanOption("R", "alt-y-mrtg")); // ALT-AUTOSCALE ! graphDef.setAltAutoscale(getBooleanOption("A", "alt-autoscale")); // ALT-AUTOSCALE-MAX ! graphDef.setAltAutoscaleMax(getBooleanOption("M", "alt-autoscale-max")); // UNITS-EXPONENT String opt = getOptionValue("X", "units-exponent"); if (opt != null) { ! graphDef.setUnitsExponent(parseInt(opt)); } // UNITS-LENGTH opt = getOptionValue("L", "units-length"); if (opt != null) { ! graphDef.setUnitsLength(parseInt(opt)); } // VERTICAL LABEL opt = getOptionValue("v", "vertical-label"); if (opt != null) { ! graphDef.setVerticalLabel(opt); } // WIDTH opt = getOptionValue("w", "width"); if (opt != null) { ! graphDef.setWidth(parseInt(opt)); } // HEIGHT opt = getOptionValue("h", "height"); if (opt != null) { ! graphDef.setHeight(parseInt(opt)); } // INTERLACED ! graphDef.setInterlaced(getBooleanOption("i", "interlaced")); // IMGINFO opt = getOptionValue("f", "imginfo"); if (opt != null) { ! graphDef.setImageInfo(opt); } // IMGFORMAT opt = getOptionValue("a", "imgformat"); if (opt != null) { ! graphDef.setImageFormat(opt); } // BACKGROUND opt = getOptionValue("B", "background"); if (opt != null) { ! graphDef.setBackgroundImage(opt); } // OVERLAY opt = getOptionValue("O", "overlay"); if (opt != null) { ! graphDef.setOverlayImage(opt); } // UNIT opt = getOptionValue("U", "unit"); if (opt != null) { ! graphDef.setUnit(opt); } // LAZY ! graphDef.setLazy(getBooleanOption("z", "lazy")); // UPPER-LIMIT opt = getOptionValue("u", "upper-limit"); if (opt != null) { ! graphDef.setMaxValue(parseDouble(opt)); } // LOWER-LIMIT opt = getOptionValue("l", "lower-limit"); if (opt != null) { ! graphDef.setMinValue(parseDouble(opt)); } // RIGID ! graphDef.setRigid(getBooleanOption("r", "rigid")); // BASE opt = getOptionValue("b", "base"); if (opt != null) { ! graphDef.setBase(parseDouble(opt)); } // LOGARITHMIC ! graphDef.setLogarithmic(getBooleanOption("o", "logarithmic")); // COLORS parseColors(getMultipleOptionValues("c", "color")); // NO-LEGEND ! graphDef.setNoLegend(getBooleanOption("g", "no-legend")); // ONLY_GRAPH ! graphDef.setOnlyGraph(getBooleanOption("j", "only-graph")); // FORCE-RULES-LEGEND ! graphDef.setForceRulesLegend(getBooleanOption("F", "force-rules-legend")); // TITLE opt = getOptionValue("t", "title"); if (opt != null) { ! graphDef.setTitle(opt); } // STEP opt = getOptionValue("S", "step"); if (opt != null) { ! graphDef.setStep(parseLong(opt)); } --- 82,184 ---- parseYGrid(getOptionValue("y", "y-grid")); // ALT-Y-GRID ! gdef.setAltYGrid(getBooleanOption("Y", "alt-y-grid")); // NO_MINOR ! gdef.setNoMinorGrid(getBooleanOption(null, "no-minor")); // ALT-Y-MRTG ! gdef.setAltYMrtg(getBooleanOption("R", "alt-y-mrtg")); // ALT-AUTOSCALE ! gdef.setAltAutoscale(getBooleanOption("A", "alt-autoscale")); // ALT-AUTOSCALE-MAX ! gdef.setAltAutoscaleMax(getBooleanOption("M", "alt-autoscale-max")); // UNITS-EXPONENT String opt = getOptionValue("X", "units-exponent"); if (opt != null) { ! gdef.setUnitsExponent(parseInt(opt)); } // UNITS-LENGTH opt = getOptionValue("L", "units-length"); if (opt != null) { ! gdef.setUnitsLength(parseInt(opt)); } // VERTICAL LABEL opt = getOptionValue("v", "vertical-label"); if (opt != null) { ! gdef.setVerticalLabel(opt); } // WIDTH opt = getOptionValue("w", "width"); if (opt != null) { ! gdef.setWidth(parseInt(opt)); } // HEIGHT opt = getOptionValue("h", "height"); if (opt != null) { ! gdef.setHeight(parseInt(opt)); } // INTERLACED ! gdef.setInterlaced(getBooleanOption("i", "interlaced")); // IMGINFO opt = getOptionValue("f", "imginfo"); if (opt != null) { ! gdef.setImageInfo(opt); } // IMGFORMAT opt = getOptionValue("a", "imgformat"); if (opt != null) { ! gdef.setImageFormat(opt); } // BACKGROUND opt = getOptionValue("B", "background"); if (opt != null) { ! gdef.setBackgroundImage(opt); } // OVERLAY opt = getOptionValue("O", "overlay"); if (opt != null) { ! gdef.setOverlayImage(opt); } // UNIT opt = getOptionValue("U", "unit"); if (opt != null) { ! gdef.setUnit(opt); } // LAZY ! gdef.setLazy(getBooleanOption("z", "lazy")); // UPPER-LIMIT opt = getOptionValue("u", "upper-limit"); if (opt != null) { ! gdef.setMaxValue(parseDouble(opt)); } // LOWER-LIMIT opt = getOptionValue("l", "lower-limit"); if (opt != null) { ! gdef.setMinValue(parseDouble(opt)); } // RIGID ! gdef.setRigid(getBooleanOption("r", "rigid")); // BASE opt = getOptionValue("b", "base"); if (opt != null) { ! gdef.setBase(parseDouble(opt)); } // LOGARITHMIC ! gdef.setLogarithmic(getBooleanOption("o", "logarithmic")); // COLORS parseColors(getMultipleOptionValues("c", "color")); // NO-LEGEND ! gdef.setNoLegend(getBooleanOption("g", "no-legend")); // ONLY_GRAPH ! gdef.setOnlyGraph(getBooleanOption("j", "only-graph")); // FORCE-RULES-LEGEND ! gdef.setForceRulesLegend(getBooleanOption("F", "force-rules-legend")); // TITLE opt = getOptionValue("t", "title"); if (opt != null) { ! gdef.setTitle(opt); } // STEP opt = getOptionValue("S", "step"); if (opt != null) { ! gdef.setStep(parseLong(opt)); } *************** *** 190,194 **** throw new RrdException("Image filename must be specified"); } ! graphDef.setFilename(words[1]); // parse remaining words, in no particular order for (int i = 2; i < words.length; i++) { --- 190,194 ---- throw new RrdException("Image filename must be specified"); } ! gdef.setFilename(words[1]); // parse remaining words, in no particular order for (int i = 2; i < words.length; i++) { *************** *** 228,232 **** } ! return graphDef; } --- 228,232 ---- } ! return gdef; } |