public class DialogMessageLogger extends java.lang.Object implements MessageLogger
A class to write log and status messages to a scrolling text area in a dialog box.
Modifier and Type | Class and Description |
---|---|
protected class |
DialogMessageLogger.ClearActionListener |
protected class |
DialogMessageLogger.CreateGUIRunnable |
protected class |
DialogMessageLogger.SendRunnable |
protected class |
DialogMessageLogger.SetVisibleRunnable |
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JDialog |
outputDialog |
protected javax.swing.JScrollPane |
outputScrollPane |
protected javax.swing.JTextArea |
outputTextArea |
Constructor and Description |
---|
DialogMessageLogger(java.lang.String titleMessage,
int width,
int height,
boolean exitApplicationOnClose)
Construct a logger and make it immediately visible.
|
DialogMessageLogger(java.lang.String titleMessage,
int width,
int height,
boolean exitApplicationOnClose,
boolean visible)
Construct a logger.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createGUI(java.lang.String titleMessage,
int width,
int height,
boolean exitApplicationOnClose,
boolean visible)
Construct the GUI for a logger.
|
void |
send(java.lang.String message)
Append the supplied text to the log.
|
void |
sendLn(java.lang.String message)
Append the supplied text to the log, followed by a new line.
|
void |
setVisible(boolean visible) |
protected javax.swing.JDialog outputDialog
protected javax.swing.JScrollPane outputScrollPane
protected javax.swing.JTextArea outputTextArea
public DialogMessageLogger(java.lang.String titleMessage, int width, int height, boolean exitApplicationOnClose)
Construct a logger and make it immediately visible.
titleMessage
- for the title bar of the dialog boxwidth
- initial width of the resizeable dialog boxheight
- initial height of the resizeable dialog boxexitApplicationOnClose
- if true, when the dialog box is closed (X-d out), will exit the application with success statuspublic DialogMessageLogger(java.lang.String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible)
Construct a logger.
titleMessage
- for the title bar of the dialog boxwidth
- initial width of the resizeable dialog boxheight
- initial height of the resizeable dialog boxexitApplicationOnClose
- if true, when the dialog box is closed (X-d out), will exit the application with success statusvisible
- if true, will be made visible after constructionprotected void createGUI(java.lang.String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible)
Construct the GUI for a logger.
titleMessage
- for the title bar of the dialog boxwidth
- initial width of the resizeable dialog boxheight
- initial height of the resizeable dialog boxexitApplicationOnClose
- if true, when the dialog box is closed (X-d out), will exit the application with success statusvisible
- if true, will be made visible after constructionpublic void setVisible(boolean visible)
public void send(java.lang.String message)
MessageLogger
Append the supplied text to the log.
send
in interface MessageLogger
message
- the (possibly multi-line) text to append to the logpublic void sendLn(java.lang.String message)
MessageLogger
Append the supplied text to the log, followed by a new line.
sendLn
in interface MessageLogger
message
- the (possibly multi-line) text to append to the log