public class Message
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Message.ShowStream
Text written to a ShowStream is passed to the show method
when a newline is encountered or a flush occurs.
|
Modifier and Type | Field and Description |
---|---|
static javax.swing.text.Highlighter.HighlightPainter |
bluePainter |
static boolean |
DEBUG
If on, programmer errors are printed.
|
static javax.swing.text.Highlighter.HighlightPainter |
greenPainter |
static javax.swing.text.Highlighter.HighlightPainter |
pinkPainter |
Modifier and Type | Method and Description |
---|---|
static void |
beep()
Ring the bell at the terminal.
|
static void |
beep(java.lang.String msg)
Ring the bell and display an error message.
|
static javax.swing.JSplitPane |
createSplitPane(javax.swing.JComponent top)
Create a JSplitPane with the messages in the bottom.
|
static void |
deferExit(java.lang.String title,
java.lang.Object[] message,
int status)
Raise a dialog box With a button to close the application.
|
static void |
exception(java.lang.String msg,
java.lang.Throwable ex)
Ring the bell and display an exception message
prefixed with "EXCEPTION".
|
static void |
exitWhenClosed(int finalStatus)
Exit the application when the Message window is closed.
|
static void |
fileException(java.lang.String msg,
IOException ex)
Identical to the exception method
|
static int |
getLineHeight() |
static javax.swing.JScrollPane |
getMsgScroll() |
static javax.swing.JFrame |
getMsgWindow()
Report the message window.
|
static int |
getStdoutState() |
static java.lang.String |
getText() |
static void |
ignoreException(java.lang.Exception ex)
An exception has occurred and is being ignored.
|
static void |
ignoreFileException(java.lang.String msg,
java.lang.String fileName)
Tell the user there was a file error, but execution is continuing.
|
static void |
impossible(java.lang.String msg)
Print a message on System.out.
|
static void |
programmerError(java.lang.String msg)
Ring the bell and display an error message
prefixed with "Programmer error".
|
static void |
prompt(java.lang.String msg)
Show a message for a short time or until another message replaces it.
|
static void |
setBounds(int x,
int y,
int w,
int h) |
static void |
setBounds(java.awt.Rectangle b) |
static void |
setFont(java.awt.Font f)
Set the font for displaying messages.
|
static void |
setStdoutState(int newState)
Set the System.out and System.err destinations.
|
static void |
show(java.lang.String msg) |
static void |
show(java.lang.String msg,
javax.swing.text.Highlighter.HighlightPainter color)
Display a message to output, a window, or a message line.
|
static void |
show(java.lang.String msg,
int option) |
public static final boolean DEBUG
public static final javax.swing.text.Highlighter.HighlightPainter pinkPainter
public static final javax.swing.text.Highlighter.HighlightPainter greenPainter
public static final javax.swing.text.Highlighter.HighlightPainter bluePainter
public static int getLineHeight()
public static void setBounds(java.awt.Rectangle b)
public static void setBounds(int x, int y, int w, int h)
public static javax.swing.JScrollPane getMsgScroll()
public static javax.swing.JFrame getMsgWindow()
public static void setFont(java.awt.Font f)
f
- The new Fontpublic static java.lang.String getText()
public static void exitWhenClosed(int finalStatus)
finalStatus
- Status value to nbe passed to System.exitpublic static javax.swing.JSplitPane createSplitPane(javax.swing.JComponent top)
top
- What component to display above the message areapublic static int getStdoutState()
public static void setStdoutState(int newState)
newState
- the stdoutState to setpublic static void show(java.lang.String msg)
public static void show(java.lang.String msg, int option)
public static void show(java.lang.String msg, javax.swing.text.Highlighter.HighlightPainter color)
msg
- The text of the message.color
- Color of message as a Highlighter.HighlightPainter.
Should usually be greenPainter or pinkPainter.public static void prompt(java.lang.String msg)
msg
- The message to display.public static void beep()
public static void beep(java.lang.String msg)
msg
- The message to display in the log.public static void programmerError(java.lang.String msg)
msg
- The message to display in the log.public static void exception(java.lang.String msg, java.lang.Throwable ex)
msg
- The message to display in the log.ex
- The exception.public static void fileException(java.lang.String msg, IOException ex)
msg
- message to identify source of errorex
- should be an IOExceptionpublic static void ignoreFileException(java.lang.String msg, java.lang.String fileName)
msg
- printed in parentheses after the file name.fileName
- name of the file in errorpublic static void ignoreException(java.lang.Exception ex)
ex
- the exception being ignored.public static void impossible(java.lang.String msg)
msg
- text describing the point of failure. Should at least identify
package, class, and method where the failure occurred.public static void deferExit(java.lang.String title, java.lang.Object[] message, int status)
title
- title for the dialog boxmessage
- an array of (usually) Strings
to be displayed in the body of the dialog box.status
- The status code to be provided to Sysem.exit.