|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.Debug
public class Debug
This is a simple way to add runtime-settable debugging. Debug flags are just strings; the Debug class dynamically adds them to the debug menu. Example: putting a runtime flag in your code. A convention I use is to put the name of the debug flag in the message, so I know "where it comes from".
if (Debug.isSet("Map.draw")) {
System.out.println("Map.draw: makeShapes with "+displayProject);
}
Example: adding the debug menu to a "System" menu
private JMenu debugMenu;
JMenu sysMenu = new JMenu("System");
debugMenu = (JMenu) sysMenu.add(new JMenu("Debug"));
debugMenu.addMenuListener( new MenuListener() {
public void menuSelected(MenuEvent e) { ucar.unidata.util.Debug.constructMenu(debugMenu); }
public void menuDeselected(MenuEvent e) {}
public void menuCanceled(MenuEvent e) {}
});
| Constructor Summary | |
|---|---|
Debug()
|
|
| Method Summary | |
|---|---|
static void |
clear()
_more_ |
static void |
constructMenu(JMenu topMenu)
_more_ |
static void |
fetchPersistentData(PersistentStore store)
call this when you want to fetch the persistent data |
static boolean |
isSet(String flagName)
_more_ |
static void |
set(String flagName,
boolean value)
_more_ |
static void |
storePersistentData(PersistentStore store)
call this when you want to store the persistent data |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Debug()
| Method Detail |
|---|
public static void fetchPersistentData(PersistentStore store)
store - public static void storePersistentData(PersistentStore store)
store - public static boolean isSet(String flagName)
flagName -
public static void set(String flagName,
boolean value)
flagName - value - public static void clear()
public static void constructMenu(JMenu topMenu)
topMenu -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||