Package com.pixelmed.display
Class DialogMessageLogger
java.lang.Object
com.pixelmed.display.DialogMessageLogger
- All Implemented Interfaces:
MessageLogger
A class to write log and status messages to a scrolling text area in a dialog box.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimpleDateFormatprotected JDialogprotected JScrollPaneprotected JTextAreaprotected booleanprotected static long -
Constructor Summary
ConstructorsConstructorDescriptionDialogMessageLogger(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 slf4jlogger.DialogMessageLogger(String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible, boolean showDateTime, String dateTimeFormat) Construct a slf4jlogger. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateGUI(String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible, boolean showDateTime, String dateTimeFormat) Construct the GUI for a slf4jlogger.voidAppend the supplied text to the log.voidAppend the supplied text to the log, followed by a new line.voidsetDateTimeFormat(String pattern) Set the date format to usevoidsetVisible(boolean visible) voidshowDateTime(boolean showDateTime) Whether or not to show a timestamp.protected void
-
Field Details
-
outputDialog
-
outputScrollPane
-
outputTextArea
-
startTimeForLogging
protected static long startTimeForLogging -
showDateTime
protected boolean showDateTime -
dateFormatter
-
-
Constructor Details
-
DialogMessageLogger
public DialogMessageLogger(String titleMessage, int width, int height, boolean exitApplicationOnClose) Construct a logger and make it immediately visible.
- Parameters:
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 status
-
DialogMessageLogger
public DialogMessageLogger(String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible) Construct a slf4jlogger.
- Parameters:
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 construction
-
DialogMessageLogger
public DialogMessageLogger(String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible, boolean showDateTime, String dateTimeFormat) Construct a slf4jlogger.
- Parameters:
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 constructionshowDateTime- if true, show a timestampdateTimeFormat- a java.text.SimpleDateFormat pattern
-
-
Method Details
-
showDateTime
public void showDateTime(boolean showDateTime) Whether or not to show a timestamp.
- Parameters:
showDateTime- if true, show a timestamp
-
setDateTimeFormat
Set the date format to use
If not set will use relative time in ms from start of application
- Parameters:
pattern- a java.text.SimpleDateFormat pattern
-
createGUI
protected void createGUI(String titleMessage, int width, int height, boolean exitApplicationOnClose, boolean visible, boolean showDateTime, String dateTimeFormat) Construct the GUI for a slf4jlogger.
- Parameters:
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 constructionshowDateTime- if true, show a timestampdateTimeFormat- a java.text.SimpleDateFormat pattern
-
setVisible
public void setVisible(boolean visible) -
timestamp
protected void timestamp() -
send
Description copied from interface:MessageLoggerAppend the supplied text to the log.
- Specified by:
sendin interfaceMessageLogger- Parameters:
message- the (possibly multi-line) text to append to the log
-
sendLn
Description copied from interface:MessageLoggerAppend the supplied text to the log, followed by a new line.
- Specified by:
sendLnin interfaceMessageLogger- Parameters:
message- the (possibly multi-line) text to append to the log
-