home *** CD-ROM | disk | FTP | other *** search
/ Internet News 1999 October / INEWS_10_CD.ISO / pc / jdk / jdk1.2.2 / docs / tooldocs / javadoc / source / standard / StylesheetWriter.java < prev    next >
Encoding:
Java Source  |  1999-09-19  |  3.9 KB  |  107 lines

  1. /*
  2.  * @(#)StylesheetWriter.java    1.6 98/07/17
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package com.sun.tools.doclets.standard;
  16.  
  17. import com.sun.tools.doclets.*;
  18. import java.io.*;
  19. import java.lang.*;
  20. import java.util.*;
  21.  
  22. /**
  23.  *
  24.  * @author Atul M Dambalkar
  25.  */
  26. public class StylesheetWriter extends HtmlStandardWriter {
  27.  
  28.     /**
  29.      * Constructor.
  30.      */
  31.     public StylesheetWriter(String filename) throws IOException {
  32.         super(filename);
  33.     }
  34.  
  35.     /**
  36.      * Generate the style file contents.
  37.      */
  38.     public static void generate() throws DocletAbortException {
  39.         StylesheetWriter stylegen;
  40.         String filename = "";
  41.         try {
  42.             if (Standard.configuration().stylesheetfile.length() == 0) {
  43.                 filename = "stylesheet.css";
  44.                 stylegen = new StylesheetWriter(filename);
  45.                 stylegen.generateStyleFile();
  46.                 stylegen.close();
  47.             }
  48.         } catch (IOException exc) {
  49.             Standard.configuration().standardmessage.error(
  50.                 "doclet.exception_encountered",
  51.                 exc.toString(), filename);
  52.             throw new DocletAbortException();
  53.         }
  54.     }
  55.  
  56.     /**
  57.      * Generate the style file contents.
  58.      */
  59.     protected void generateStyleFile() {
  60.         print("/* "); printText("doclet.Style_line_1"); println(" */");
  61.         println("");
  62.         print("/* "); printText("doclet.Style_line_2"); println(" */");
  63.         println("");
  64.         print("/* "); printText("doclet.Style_line_3"); println(" */");
  65.         println("body { background-color: #FFFFFF }"); println("");
  66.         print("/* "); printText("doclet.Style_line_4"); println(" */");
  67.         print("#TableHeadingColor     { background: #CCCCFF }"); 
  68.         print(" /* "); printText("doclet.Style_line_5"); println(" */");
  69.         print("#TableSubHeadingColor  { background: #EEEEFF }"); 
  70.         print(" /* "); printText("doclet.Style_line_6"); println(" */");
  71.         print("#TableRowColor         { background: #FFFFFF }"); 
  72.         print(" /* "); printText("doclet.Style_line_7"); println(" */");
  73.         println("");
  74.         print("/* "); printText("doclet.Style_line_8"); println(" */");
  75.         println("#FrameTitleFont   { font-size: normal; font-family: normal }");
  76.         println("#FrameHeadingFont { font-size: normal; font-family: normal }");
  77.         println("#FrameItemFont    { font-size: normal; font-family: normal }");
  78.         println("");
  79.         print("/* "); printText("doclet.Style_line_9"); println(" */");
  80.         print("/* "); 
  81.         print("#FrameItemFont  { font-size: 10pt; font-family: ");
  82.         print("Helvetica, Arial, sans-serif }"); println(" */");
  83.         println("");
  84.         print("/* "); printText("doclet.Style_line_10"); println(" */");
  85.         print("#NavBarCell1    { background-color:#EEEEFF;}");
  86.         print("/* "); printText("doclet.Style_line_6"); println(" */");
  87.         print("#NavBarCell1Rev { background-color:#00008B;}");
  88.         print("/* "); printText("doclet.Style_line_11"); println(" */");
  89.  
  90.         print("#NavBarFont1    { font-family: Arial, Helvetica, sans-serif; ");
  91.         println("color:#000000;}");
  92.         print("#NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; ");
  93.         println("color:#FFFFFF;}");
  94.         println("");
  95.         print("#NavBarCell2    { font-family: Arial, Helvetica, sans-serif; ");
  96.         println("background-color:#FFFFFF;}");
  97.         print("#NavBarCell3    { font-family: Arial, Helvetica, sans-serif; ");
  98.         println("background-color:#FFFFFF;}");
  99.         println("");
  100.  
  101.     }
  102.  
  103. }
  104.  
  105.  
  106.  
  107.