Package ucar.unidata.util
Class Debug
java.lang.Object
ucar.unidata.util.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
_more_static void
constructMenu
(JMenu topMenu) _more_static void
call this when you want to fetch the persistent datastatic boolean
_more_static void
_more_static void
call this when you want to store the persistent data
-
Constructor Details
-
Debug
public Debug()
-
-
Method Details
-
fetchPersistentData
call this when you want to fetch the persistent data- Parameters:
store
-
-
storePersistentData
call this when you want to store the persistent data- Parameters:
store
-
-
isSet
_more_- Parameters:
flagName
-- Returns:
- _more_
-
set
_more_- Parameters:
flagName
-value
-
-
clear
public static void clear()_more_ -
constructMenu
_more_- Parameters:
topMenu
-
-