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",
062                            exc.toString(), filename);
063                throw new DocletAbortException();
064            }
065        }
066    
067        /**
068         * Generate the style file contents.
069         */
070        protected void generateStyleFile() {
071            print("/* "); printText("doclet.Style_line_1"); println(" */");
072            println("");
073    
074            print("/* "); printText("doclet.Style_line_2"); println(" */");
075            println("");
076    
077            print("/* "); printText("doclet.Style_line_3"); println(" */");
078            println("body { background-color: #FFFFFF; color:#000000 }");
079            println("");
080    
081            print("/* "); printText("doclet.Style_Headings"); println(" */");
082            println("h1 { font-size: 145% }");
083            println("");
084    
085            print("/* "); printText("doclet.Style_line_4"); println(" */");
086            print(".TableHeadingColor     { background: #CCCCFF; color:#000000 }");
087            print(" /* "); printText("doclet.Style_line_5"); println(" */");
088            print(".TableSubHeadingColor  { background: #EEEEFF; color:#000000 }");
089            print(" /* "); printText("doclet.Style_line_6"); println(" */");
090            print(".TableRowColor         { background: #FFFFFF; color:#000000 }");
091            print(" /* "); printText("doclet.Style_line_7"); println(" */");
092            println("");
093    
094            print("/* "); printText("doclet.Style_line_8"); println(" */");
095            println(".FrameTitleFont   { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
096            println(".FrameHeadingFont { font-size:  90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
097            println(".FrameItemFont    { font-size:  90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
098            println("");
099    
100           // Removed doclet.Style_line_9 as no longer needed
101    
102            print("/* "); printText("doclet.Style_line_10"); println(" */");
103            print(".NavBarCell1    { background-color:#EEEEFF; color:#000000}");
104            print(" /* "); printText("doclet.Style_line_6"); println(" */");
105            print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}");
106            print(" /* "); printText("doclet.Style_line_11"); println(" */");
107    
108            print(".NavBarFont1    { font-family: Arial, Helvetica, sans-serif; color:#000000;");
109            println("color:#000000;}");
110            print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;");
111            println("color:#FFFFFF;}");
112            println("");
113    
114            print(".NavBarCell2    { font-family: Arial, Helvetica, sans-serif; ");
115            println("background-color:#FFFFFF; color:#000000}");
116            print(".NavBarCell3    { font-family: Arial, Helvetica, sans-serif; ");
117            println("background-color:#FFFFFF; color:#000000}");
118            println("");
119    
120        }
121    
122    }