home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / swing / DebugGraphicsInfo.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.9 KB  |  63 lines

  1. /*
  2.  * @(#)DebugGraphicsInfo.java    1.4 98/01/30
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package java.awt.swing;
  22.  
  23. import java.awt.*;
  24. import java.util.*;
  25.  
  26. /** Class used by DebugGraphics for maintaining information about how
  27.   * to render graphics calls.
  28.   *
  29.   * @version 1.4 01/30/98
  30.   * @author Dave Karlton
  31.   */
  32. class DebugGraphicsInfo {
  33.     Color                flashColor = Color.red;
  34.     int                  flashTime = 100;
  35.     int                  flashCount = 2;
  36.     Hashtable            componentToDebug;
  37.     JFrame               debugFrame = null;
  38.     java.io.PrintStream  stream = System.out;
  39.  
  40.     void setDebugOptions(JComponent component, int debug) {
  41.         if (componentToDebug == null) {
  42.             componentToDebug = new Hashtable();
  43.         }
  44.         componentToDebug.put(component, new Integer(debug));
  45.     }
  46.  
  47.     int getDebugOptions(JComponent component) {
  48.         if (componentToDebug == null) {
  49.             return 0;
  50.         } else {
  51.             Integer integer = (Integer)componentToDebug.get(component);
  52.  
  53.             return integer == null ? 0 : integer.intValue();
  54.         }
  55.     }
  56.  
  57.     void log(String string) {
  58.         stream.println(string);
  59.     }
  60. }
  61.  
  62.  
  63.