public class DialogMessageLogger extends 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 JDialog |
outputDialog |
protected JScrollPane |
outputScrollPane |
protected JTextArea |
outputTextArea |
Constructor and Description |
---|
DialogMessageLogger(String titleMessage,
int width,
int height,
boolean exitApplicationOnClose)
Construct a logger and make it immediately visible.
|
DialogMessageLogger(String titleMessage,
int width,
int height,
boolean exitApplicationOnClose,
boolean visible)
Construct a logger.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createGUI(String titleMessage,
int width,
int height,
boolean exitApplicationOnClose,
boolean visible)
Construct the GUI for a logger.
|
void |
send(String message)
Append the supplied text to the log.
|
void |
sendLn(String message)
Append the supplied text to the log, followed by a new line.
|
void |
setVisible(boolean visible) |
protected JDialog outputDialog
protected JScrollPane outputScrollPane
protected JTextArea outputTextArea
public DialogMessageLogger(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(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(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(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(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