|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jv.object.PsDebug
Allows to issue messages and debug information on the console of JavaView, which is different from Java console. These calls are intended to replace System.out calls. Textual debug information may be issued with either of the following calls
if (PsDebug.NOTIFY) PsDebug.notify(String) // Default: disabled in release version if (PsDebug.WARNING) PsDebug.warning(String) // Default: enabled PsDebug.error(String, PsObject) // Default: enabledand textual messages may be directly issued with
PsDebug.message(String) // Default: enabledAll information is collected in a text area and shown in the dialog
PsConsole.
The checkboxes located in the header of the console allow to enable different warning levels.
Remark: All messages are cached and flushed to console after some short intervals.
Debug methods parse the current stack trace and print additional information about the calling method and class.
message(String) added.PsConsole| Field Summary | |
static boolean |
NOTIFY
Global flag used during compile time to include or exclude all PsDebug.notify() calls. |
static boolean |
WARNING
Global flag used during compile time to include or exclude all PsDebug.notify() calls. |
| Constructor Summary | |
PsDebug()
|
|
| Method Summary | |
static void |
beep(java.lang.String message)
Issue a beep and print message to System.out. |
static void |
disposeConsole()
Dispose console window, e.g. when applet stops, remove textArea and reset variables. |
static void |
error(java.lang.String aString)
Error messages indicate fatal errors which cannot be handled. |
static void |
error(java.lang.String aString,
java.lang.Object what)
Error messages indicate fatal errors which cannot be handled. |
static void |
flushMessages()
Flush cached messages into console window. |
static PsConsole |
getConsole()
Get console window. |
static java.awt.Rectangle |
getConsoleSize()
Get rectangle with size of JavaView console window. |
static long |
getFlushInterval()
Get length of least time interval between two successive flushs. |
static int |
getMaxNumBeeps()
Get maximal number of warning beeps. |
static boolean |
hasConsole()
Get state of console. |
static boolean |
hasMessages()
Check whether message buffer contains non-flushed messages. |
static boolean |
isError()
Check switch to record heavy errors in JavaView console. |
static boolean |
isMessage()
Check switch to record info message in JavaView console. |
static boolean |
isNotify()
Check switch to record notify message, i.e. debug messages, in JavaView console. |
static boolean |
isWarning()
Check switch to record warning messages in JavaView console. |
static void |
message(java.lang.String aString)
Print messages immediately to console, make rare use since no button to turn it off. |
static void |
message(java.lang.String aString,
boolean bShowConsole)
Print messages immediately to console, make rare use since no button to turn it off. |
static void |
notify(java.lang.String aString)
Heavily used during development process for all different messages. |
static void |
setConsole(PsConsole console)
Set console. |
static void |
setError(boolean aFlag)
Enable recording of heavy errors in JavaView console. |
static void |
setMaxNumBeeps(int num)
Set maximal number of warning beeps. |
static void |
setMessage(boolean aFlag)
Enable recording of info message in JavaView console. |
static void |
setNotify(boolean aFlag)
Enable recording of notify message, i.e. debug messages, in JavaView console. |
static void |
setWarning(boolean aFlag)
Enable recording of warning messages in JavaView console. |
static void |
showStatus(java.lang.String aString)
Display message in status bar of applet, and in console window. |
static void |
warning(java.lang.Exception ex,
java.lang.String aString)
Warning messages indicate real errors which are handled. |
static void |
warning(java.lang.String aString)
Warning messages indicate real errors which are handled. |
static void |
warning(java.lang.String aString,
java.lang.Object what)
Warning messages indicate real errors which are handled. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final boolean NOTIFY
NOTIFY==false then all notification methods are removed by a Java
compiler during optimization since the methods would never be executed.
The Microsoft conditional directive is used to simplify the conditional switch, and the conditional statements can be removed without any influence if the developer sets the variable NOTIFY by hand.
public static final boolean WARNING
NOTIFY==false then all notification methods are removed by a Java
compiler during optimization since the methods would never be executed.
The Microsoft conditional directive is used to simplify the conditional switch, and the conditional statements can be removed without any influence if the developer sets the variable NOTIFY by hand.
| Constructor Detail |
public PsDebug()
| Method Detail |
public static PsConsole getConsole()
public static void disposeConsole()
public static void setConsole(PsConsole console)
public static boolean hasConsole()
public static java.awt.Rectangle getConsoleSize()
public static boolean isMessage()
public static boolean isNotify()
public static boolean isWarning()
public static boolean isError()
public static void setMessage(boolean aFlag)
public static void setNotify(boolean aFlag)
public static void setWarning(boolean aFlag)
public static void setError(boolean aFlag)
public static long getFlushInterval()
public static boolean hasMessages()
public static final void flushMessages()
public static final void showStatus(java.lang.String aString)
aString - status messagepublic static final void message(java.lang.String aString)
public static final void message(java.lang.String aString,
boolean bShowConsole)
public static final void notify(java.lang.String aString)
public static final void warning(java.lang.String aString)
aString - warning message
public static final void warning(java.lang.Exception ex,
java.lang.String aString)
Print stack trace either of the method which invoked this warning method, or, if ex!=null print the stack trace of the exception.
ex - Stack trace of exception is printed rather than of invocation of warning.aString - warning message
public static final void warning(java.lang.String aString,
java.lang.Object what)
aString - warning messagewhat - object containing more information, what.toString() is appended to messagepublic static final void error(java.lang.String aString)
PsDebug.error(String, Object)
with object==null.
Console window pops up automaticallyif method is called.aString - error message
public static final void error(java.lang.String aString,
java.lang.Object what)
aString - error message.what - object containing more information, what.toString() is appended to message.public static int getMaxNumBeeps()
public static void setMaxNumBeeps(int num)
num - maximal number of warning beeps.public static void beep(java.lang.String message)
The beep() method attempts to play an audio beep. You have no control over pitch, duration, or volume; it is like putting echo ^G in a UNIX shell script.
If run as application this method calls the beep method of the default toolkit. If run as applet then a beep from an audio file is played (pending).
Method is called if an error occurs, or, when in debug mode, also if a warning occurs. Information about the beep is given in the console window of JavaView.
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||