ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/IscreamLayout.java
(Generate patch)

Comparing projects/cms/source/reports/DBReporter/IscreamLayout.java (file contents):
Revision 1.1 by pjm2, Mon Dec 11 16:34:16 2000 UTC vs.
Revision 1.3 by pjm2, Sun Jan 7 12:49:28 2001 UTC

# Line 48 | Line 48 | public class IscreamLayout {
48      
49      public static void printLeftMenu(BufferedWriter bw) throws IOException{
50          bw.newLine();
51 <        bw.write("<!--#include virtual=\"left.inc\" -->");
51 >        bw.write("<!--#include virtual=\"../left.inc\" -->");
52          bw.newLine();
53          bw.write("</td><td valign=\"top\">");
54          bw.newLine();
# Line 57 | Line 57 | public class IscreamLayout {
57      
58      public static void printTitle(BufferedWriter bw, String title) throws IOException{
59          bw.newLine();
60 <        bw.write("<!--#include virtual=\"title.inc\" -->");
60 >        bw.write("<!--#include virtual=\"../title.inc\" -->");
61          bw.newLine();
62          bw.newLine();
63          bw.write("<h3>"+title+"</h3>");
# Line 65 | Line 65 | public class IscreamLayout {
65          bw.flush();
66      }
67      
68 <    public static void printGraph(BufferedWriter bw, String filename, int width, int height) throws IOException{
68 >    public static void printGraph(BufferedWriter bw, String filename, int width, int height, int type, long startDate, long endDate) throws IOException{
69 >        
70 >        String graphTitle = "Unknown time period";
71 >        String xAxisTitle = "Time";
72 >        String yAxisTitle = "Value";
73 >        String scaleRow = " <tr><td>&nbsp;</td><td align=\"left\">"+startDate+"</td><td align=\"right\">"+endDate+"</td></tr>";
74 >        
75 >        switch (type) {
76 >            case ReportPage.HOUR:
77 >                graphTitle = "Hourly report from "+startDate+" to "+endDate;
78 >                break;
79 >            case ReportPage.DAY:
80 >                graphTitle = "24 hour report from "+startDate+" to "+endDate;
81 >                break;
82 >            case ReportPage.WEEK:
83 >                graphTitle = "7 day report from "+startDate+" to "+endDate;
84 >                break;
85 >            case ReportPage.MONTH:
86 >                graphTitle = "30 day report from "+startDate+" to "+endDate;
87 >                break;
88 >            default:
89 >                // Do nothing.
90 >        }
91 >        
92          bw.write("<table border=\"0\">");
93 <        bw.write(" <tr><td>&nbsp;</td><td colspan=\"2\"><b>Visual representation of the last 7 days</b></td></tr>");
94 <        bw.write(" <tr><td>y axis</td><td colspan=\"2\"><img src=\""+filename+"\" width=\""+width+"\" height=\""+height+"\"></td></tr>");
95 <        bw.write(" <tr><td>&nbsp;</td><td align=\"left\">7 days ago</td><td align=\"right\">now</td>");
93 >        bw.write(" <tr><td>&nbsp;</td><td colspan=\"2\"><b>"+graphTitle+"</b></td></tr>");
94 >        bw.write(" <tr><td>"+yAxisTitle+"</td><td colspan=\"2\"><img src=\""+filename+"\" width=\""+width+"\" height=\""+height+"\"></td></tr>");
95 >        bw.write(scaleRow);
96          bw.write("</table>");
97          bw.newLine();
98          bw.flush();
# Line 107 | Line 130 | public class IscreamLayout {
130      
131      public static void printBottom(BufferedWriter bw) throws IOException{
132          bw.newLine();
133 <        bw.write("<!--#include virtual=\"bottom.inc\" -->");
133 >        bw.write("<!--#include virtual=\"../bottom.inc\" -->");
134          bw.newLine();
135          bw.newLine();
136          bw.flush();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines