001: /*
002: * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.doclets.formats.html;
027:
028: import com.sun.tools.doclets.internal.toolkit.util.*;
029:
030: import java.io.*;
031:
032: /**
033: * Writes the style sheet for the doclet output.
034: *
035: * @author Atul M Dambalkar
036: */
037: public class StylesheetWriter extends HtmlDocletWriter {
038:
039: /**
040: * Constructor.
041: */
042: public StylesheetWriter(ConfigurationImpl configuration,
043: String filename) throws IOException {
044: super (configuration, filename);
045: }
046:
047: /**
048: * Generate the style file contents.
049: * @throws DocletAbortException
050: */
051: public static void generate(ConfigurationImpl configuration) {
052: StylesheetWriter stylegen;
053: String filename = "";
054: try {
055: filename = "stylesheet.css";
056: stylegen = new StylesheetWriter(configuration, filename);
057: stylegen.generateStyleFile();
058: stylegen.close();
059: } catch (IOException exc) {
060: configuration.standardmessage.error(
061: "doclet.exception_encountered", exc.toString(),
062: filename);
063: throw new DocletAbortException();
064: }
065: }
066:
067: /**
068: * Generate the style file contents.
069: */
070: protected void generateStyleFile() {
071: print("/* ");
072: printText("doclet.Style_line_1");
073: println(" */");
074: println("");
075:
076: print("/* ");
077: printText("doclet.Style_line_2");
078: println(" */");
079: println("");
080:
081: print("/* ");
082: printText("doclet.Style_line_3");
083: println(" */");
084: println("body { background-color: #FFFFFF; color:#000000 }");
085: println("");
086:
087: print("/* ");
088: printText("doclet.Style_Headings");
089: println(" */");
090: println("h1 { font-size: 145% }");
091: println("");
092:
093: print("/* ");
094: printText("doclet.Style_line_4");
095: println(" */");
096: print(".TableHeadingColor { background: #CCCCFF; color:#000000 }");
097: print(" /* ");
098: printText("doclet.Style_line_5");
099: println(" */");
100: print(".TableSubHeadingColor { background: #EEEEFF; color:#000000 }");
101: print(" /* ");
102: printText("doclet.Style_line_6");
103: println(" */");
104: print(".TableRowColor { background: #FFFFFF; color:#000000 }");
105: print(" /* ");
106: printText("doclet.Style_line_7");
107: println(" */");
108: println("");
109:
110: print("/* ");
111: printText("doclet.Style_line_8");
112: println(" */");
113: println(".FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
114: println(".FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
115: println(".FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
116: println("");
117:
118: // Removed doclet.Style_line_9 as no longer needed
119:
120: print("/* ");
121: printText("doclet.Style_line_10");
122: println(" */");
123: print(".NavBarCell1 { background-color:#EEEEFF; color:#000000}");
124: print(" /* ");
125: printText("doclet.Style_line_6");
126: println(" */");
127: print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}");
128: print(" /* ");
129: printText("doclet.Style_line_11");
130: println(" */");
131:
132: print(".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;");
133: println("color:#000000;}");
134: print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;");
135: println("color:#FFFFFF;}");
136: println("");
137:
138: print(".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; ");
139: println("background-color:#FFFFFF; color:#000000}");
140: print(".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; ");
141: println("background-color:#FFFFFF; color:#000000}");
142: println("");
143:
144: }
145:
146: }
|