|
From: <sa...@us...> - 2003-11-10 15:47:02
|
Update of /cvsroot/jrobin/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10507
Modified Files:
Demo.java
Log Message:
Removed 'flaming' colors - the first demo should not be a trick shot!
Index: Demo.java
===================================================================
RCS file: /cvsroot/jrobin/src/Demo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Demo.java 10 Nov 2003 08:52:27 -0000 1.3
--- Demo.java 10 Nov 2003 15:46:59 -0000 1.4
***************
*** 33,48 ****
import java.io.IOException;
import java.io.PrintWriter;
- import java.util.GregorianCalendar;
class Demo {
static final String HOME = Util.getJRobinDemoDirectory();
static final String FILE = "demo";
! static final GregorianCalendar START = new GregorianCalendar(2003, 4, 1);
! static final GregorianCalendar END = new GregorianCalendar(2003, 5, 1);
static final int MAX_STEP = 240;
- // increase this to get better flaming graph...
- static final int GRADIENT_COLOR_STEPS = 20;
-
public static void main(String[] args) throws RrdException, IOException {
// setup
--- 33,44 ----
import java.io.IOException;
import java.io.PrintWriter;
class Demo {
static final String HOME = Util.getJRobinDemoDirectory();
static final String FILE = "demo";
! static final long START = Util.getTimestamp(2003, 4, 1);
! static final long END = Util.getTimestamp(2003, 5, 1);
static final int MAX_STEP = 240;
public static void main(String[] args) throws RrdException, IOException {
// setup
***************
*** 51,56 ****
long startMillis = System.currentTimeMillis();
! long start = START.getTime().getTime() / 1000L;
! long end = END.getTime().getTime() / 1000L;
String rrdPath = getFullPath(FILE + ".rrd");
String xmlPath = getFullPath(FILE + ".xml");
--- 47,52 ----
long startMillis = System.currentTimeMillis();
! long start = START;
! long end = END;
String rrdPath = getFullPath(FILE + ".rrd");
String xmlPath = getFullPath(FILE + ".xml");
***************
*** 119,122 ****
--- 115,119 ----
println("==Creating RRD file " + rrdRestoredPath + " from XML file " + xmlPath);
RrdDb rrdRestoredDb = new RrdDb(rrdRestoredPath, xmlPath);
+
// close files
println("==Closing both RRD files");
***************
*** 124,128 ****
rrdRestoredDb.close();
! // creating graph
println("==Creating graph from the second file");
RrdGraphDef gDef = new RrdGraphDef();
--- 121,125 ----
rrdRestoredDb.close();
! // create graph
println("==Creating graph from the second file");
RrdGraphDef gDef = new RrdGraphDef();
***************
*** 134,142 ****
gDef.datasource("median", "sun,shade,+,2,/");
gDef.datasource("diff", "sun,shade,-,ABS,-1,*");
- // gradient color datasources
- for(int i = 1; i < GRADIENT_COLOR_STEPS; i++) {
- double factor = i / (double) GRADIENT_COLOR_STEPS;
- gDef.datasource("diff" + i, "diff," + factor + ",*");
- }
gDef.datasource("sine", "TIME," + start + ",-," + (end - start) +
",/,2,PI,*,*,SIN,1000,*");
--- 131,134 ----
***************
*** 144,154 ****
gDef.line("shade", Color.BLUE, "shade temp");
gDef.line("median", Color.MAGENTA, "median value@L");
! gDef.area("diff", Color.RED, "difference@r");
! // gradient color areas
! for(int i = GRADIENT_COLOR_STEPS - 1; i >= 1; i--) {
! gDef.area("diff" + i,
! new Color(255, 255 - 255 * i / GRADIENT_COLOR_STEPS, 0),
! null);
! }
gDef.line("sine", Color.CYAN, "sine function demo@L");
gDef.gprint("sun", "MAX", "maxSun = @3@s");
--- 136,141 ----
gDef.line("shade", Color.BLUE, "shade temp");
gDef.line("median", Color.MAGENTA, "median value@L");
! gDef.area("diff", Color.YELLOW, "difference@r");
! gDef.line("diff", Color.RED, null);
gDef.line("sine", Color.CYAN, "sine function demo@L");
gDef.gprint("sun", "MAX", "maxSun = @3@s");
|