1 7 8 package javax.swing; 9 10 import java.awt.*; 11 import java.util.*; 12 13 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 27 void setDebugOptions(JComponent component, int debug) { 28 if (debug == 0) { 29 return; 30 } 31 if (componentToDebug == null) { 32 componentToDebug = new Hashtable(); 33 } 34 if (debug > 0) { 35 componentToDebug.put(component, new Integer (debug)); 36 } else { 37 componentToDebug.remove(component); 38 } 39 } 40 41 int getDebugOptions(JComponent component) { 42 if (componentToDebug == null) { 43 return 0; 44 } else { 45 Integer integer = (Integer )componentToDebug.get(component); 46 47 return integer == null ? 0 : integer.intValue(); 48 } 49 } 50 51 void log(String string) { 52 stream.println(string); 53 } 54 } 55 56 57 | Popular Tags |