ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/SHTMLMaker.java
Revision: 1.8
Committed: Sun Jan 7 13:49:54 2001 UTC (24 years, 11 months ago) by pjm2
Branch: MAIN
Changes since 1.7: +0 -0 lines
Log Message:
The x axis of each graph now includes a scale.

File Contents

# User Rev Content
1 pjm2 1.1 //---PACKAGE DECLARATION---
2    
3     //---IMPORTS---
4     import java.io.*;
5    
6    
7     /**
8 pjm2 1.2 * Produces an SHTML document.
9 pjm2 1.1 *
10     * @author $Author: pjm2 $
11 pjm2 1.5 * @version $Id: SHTMLMaker.java,v 1.4 2000/12/14 17:17:29 pjm2 Exp $
12 pjm2 1.1 */
13     public class SHTMLMaker {
14    
15     //---FINAL ATTRIBUTES---
16    
17     /**
18     * The current CVS revision of this class
19     */
20 pjm2 1.5 public final String REVISION = "$Revision: 1.4 $";
21 pjm2 1.1
22     //---STATIC METHODS---
23    
24     //---CONSTRUCTORS---
25    
26 pjm2 1.5 public SHTMLMaker(String metaDescription, String metaKeywords, String title, String graphFile, int width, int height, PlotData pd, int type, long startDate, long endDate){
27 pjm2 1.1
28     _metaDescription = metaDescription;
29     _metaKeywords = metaKeywords;
30     _title = title;
31     _graphFile = graphFile;
32     _width = width;
33     _height = height;
34     _pd = pd;
35 pjm2 1.5 _type = type;
36     _startDate = startDate;
37     _endDate = endDate;
38 pjm2 1.1
39 pjm2 1.3 }
40 pjm2 1.1
41     public void writePage(String filename) throws IOException{
42    
43     BufferedWriter bw = null;
44     try {
45     bw = new BufferedWriter(new FileWriter(filename));
46     }
47     catch (IOException e){
48     System.out.println("Could not write to the SHTML page: "+e);
49     }
50    
51     // Use the layout functions in SHTMLLayout...
52    
53     IscreamLayout.printDocType(bw);
54    
55     IscreamLayout.printHeader(bw, _title, _metaDescription, _metaKeywords);
56    
57     IscreamLayout.printLeftMenu(bw);
58    
59     IscreamLayout.printTitle(bw, _title);
60    
61 pjm2 1.5 IscreamLayout.printGraph(bw, _graphFile, _width, _height, _type, _startDate, _endDate);
62 pjm2 1.1
63 pjm2 1.6 // Let's leave this bit out for now...
64     //IscreamLayout.printTable(bw, _pd);
65 pjm2 1.1
66     IscreamLayout.printBottom(bw);
67    
68     bw.flush();
69     bw.close();
70    
71 pjm2 1.4 System.out.println(" - Written SHTML page");
72 pjm2 1.1
73     }
74    
75     //---PUBLIC METHODS---
76    
77    
78     /**
79     * Overrides the {@link java.lang.Object#toString() Object.toString()}
80     * method to provide clean logging (every class should have this).
81     *
82     * @return the name of this class and its CVS revision
83     */
84     public String toString() {
85     return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
86     }
87    
88     //---PRIVATE METHODS---
89    
90     //---ACCESSOR/MUTATOR METHODS---
91    
92     //---ATTRIBUTES---
93    
94     private String _metaDescription;
95     private String _metaKeywords;
96     private String _title;
97     private String _graphFile;
98     private int _width;
99     private int _height;
100     private PlotData _pd;
101 pjm2 1.5 private int _type;
102     private long _startDate;
103     private long _endDate;
104 pjm2 1.1
105     //---STATIC ATTRIBUTES---
106    
107     }