duke@1: /* duke@1: * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as duke@1: * published by the Free Software Foundation. Sun designates this duke@1: * particular file as subject to the "Classpath" exception as provided duke@1: * by Sun in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * duke@1: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@1: * CA 95054 USA or visit www.sun.com if you need additional information or duke@1: * have any questions. duke@1: */ duke@1: duke@1: package com.sun.tools.doclets.formats.html; duke@1: duke@1: import com.sun.tools.doclets.internal.toolkit.util.*; duke@1: duke@1: import java.io.*; duke@1: duke@1: /** duke@1: * Writes the style sheet for the doclet output. duke@1: * duke@1: * @author Atul M Dambalkar duke@1: */ duke@1: public class StylesheetWriter extends HtmlDocletWriter { duke@1: duke@1: /** duke@1: * Constructor. duke@1: */ duke@1: public StylesheetWriter(ConfigurationImpl configuration, duke@1: String filename) throws IOException { duke@1: super(configuration, filename); duke@1: } duke@1: duke@1: /** duke@1: * Generate the style file contents. duke@1: * @throws DocletAbortException duke@1: */ duke@1: public static void generate(ConfigurationImpl configuration) { duke@1: StylesheetWriter stylegen; duke@1: String filename = ""; duke@1: try { duke@1: filename = "stylesheet.css"; duke@1: stylegen = new StylesheetWriter(configuration, filename); duke@1: stylegen.generateStyleFile(); duke@1: stylegen.close(); duke@1: } catch (IOException exc) { duke@1: configuration.standardmessage.error( duke@1: "doclet.exception_encountered", duke@1: exc.toString(), filename); duke@1: throw new DocletAbortException(); duke@1: } duke@1: } duke@1: duke@1: /** duke@1: * Generate the style file contents. duke@1: */ duke@1: protected void generateStyleFile() { duke@1: print("/* "); printText("doclet.Style_line_1"); println(" */"); duke@1: println(""); duke@1: duke@1: print("/* "); printText("doclet.Style_line_2"); println(" */"); duke@1: println(""); duke@1: duke@1: print("/* "); printText("doclet.Style_line_3"); println(" */"); duke@1: println("body { background-color: #FFFFFF; color:#000000 }"); duke@1: println(""); duke@1: duke@1: print("/* "); printText("doclet.Style_Headings"); println(" */"); duke@1: println("h1 { font-size: 145% }"); duke@1: println(""); duke@1: duke@1: print("/* "); printText("doclet.Style_line_4"); println(" */"); duke@1: print(".TableHeadingColor { background: #CCCCFF; color:#000000 }"); duke@1: print(" /* "); printText("doclet.Style_line_5"); println(" */"); duke@1: print(".TableSubHeadingColor { background: #EEEEFF; color:#000000 }"); duke@1: print(" /* "); printText("doclet.Style_line_6"); println(" */"); duke@1: print(".TableRowColor { background: #FFFFFF; color:#000000 }"); duke@1: print(" /* "); printText("doclet.Style_line_7"); println(" */"); duke@1: println(""); duke@1: duke@1: print("/* "); printText("doclet.Style_line_8"); println(" */"); duke@1: println(".FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); duke@1: println(".FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); duke@1: println(".FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); duke@1: println(""); duke@1: duke@1: // Removed doclet.Style_line_9 as no longer needed duke@1: duke@1: print("/* "); printText("doclet.Style_line_10"); println(" */"); duke@1: print(".NavBarCell1 { background-color:#EEEEFF; color:#000000}"); duke@1: print(" /* "); printText("doclet.Style_line_6"); println(" */"); duke@1: print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}"); duke@1: print(" /* "); printText("doclet.Style_line_11"); println(" */"); duke@1: duke@1: print(".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;"); duke@1: println("color:#000000;}"); duke@1: print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;"); duke@1: println("color:#FFFFFF;}"); duke@1: println(""); duke@1: duke@1: print(".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; "); duke@1: println("background-color:#FFFFFF; color:#000000}"); duke@1: print(".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; "); duke@1: println("background-color:#FFFFFF; color:#000000}"); duke@1: println(""); duke@1: duke@1: } duke@1: duke@1: }