1. /*
  2. * @(#)DebugGraphicsInfo.java 1.9 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing;
  11. import java.awt.*;
  12. import java.util.*;
  13. /** Class used by DebugGraphics for maintaining information about how
  14. * to render graphics calls.
  15. *
  16. * @version 1.9 02/02/00
  17. * @author Dave Karlton
  18. */
  19. class DebugGraphicsInfo {
  20. Color flashColor = Color.red;
  21. int flashTime = 100;
  22. int flashCount = 2;
  23. Hashtable componentToDebug;
  24. JFrame debugFrame = null;
  25. java.io.PrintStream stream = System.out;
  26. void setDebugOptions(JComponent component, int debug) {
  27. if (componentToDebug == null) {
  28. componentToDebug = new Hashtable();
  29. }
  30. if (debug > 0) {
  31. componentToDebug.put(component, new Integer(debug));
  32. } else {
  33. componentToDebug.remove(component);
  34. }
  35. }
  36. int getDebugOptions(JComponent component) {
  37. if (componentToDebug == null) {
  38. return 0;
  39. } else {
  40. Integer integer = (Integer)componentToDebug.get(component);
  41. return integer == null ? 0 : integer.intValue();
  42. }
  43. }
  44. void log(String string) {
  45. stream.println(string);
  46. }
  47. }