|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectus.zuercher.gpx2map.util.MessageSink
us.zuercher.gpx2map.gui.GuiProgressMeter
public class GuiProgressMeter
GuiProgressMeter is a combination ProgressMeter and
MessageSink. It displays a dialog that contains a
JProgressBar representing the ProgessMeter as well as a
JTextArea representing the MessageSink.
| Field Summary | |
|---|---|
JButton |
closeButton
The close button. |
Action |
closeButtonAction
The close button action is executed when the close button is clicked. |
private int |
count
Task completion point. |
private JDialog |
dialog
Dialog object that is created and displayed by this class. |
private static String |
NL
System new-line character. |
JProgressBar |
progressBar
The progress bar. |
JLabel |
progressBarLabel
Label for progressBar. |
private String |
taskName
The current task name. |
JTextArea |
textArea
The MessageSink output. |
private WindowListener |
windowListener
Listens for window closing events and handles graceful exits. |
| Constructor Summary | |
|---|---|
GuiProgressMeter(JFrame root,
String dialogName)
Constructs a new GuiProgressMeter. |
|
| Method Summary | |
|---|---|
(package private) void |
close()
Closing the GuiProgressMeter simply enables the closeButton. |
private void |
closeDialog()
Actually closes and disposes of the dialog. |
void |
newLine()
Write a new line to the text area. |
void |
reset()
Reset the progress bar. |
void |
setCount(int count)
Set the count for the current progress bar task. |
(package private) void |
setDialogName(String dialogName)
Update the dialog's name. |
void |
setTaskName(String taskName)
Set the current task name. |
void |
updateProgress(int count)
Update the progress bar to the given completion count. |
void |
write(String message)
Write a message to the text area. |
| Methods inherited from class us.zuercher.gpx2map.util.MessageSink |
|---|
write, write, write, write, write, writeLine, writeLine, writeLine, writeLine, writeLine, writeLine, writeLine |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String NL
private final JDialog dialog
private String taskName
private int count
public JLabel progressBarLabel
progressBar. Updated to reflect the current progress
meter name.
public JProgressBar progressBar
taskName or
items completed out of total items information.
public JTextArea textArea
MessageSink output.
public JButton closeButton
public Action closeButtonAction
private WindowListener windowListener
| Constructor Detail |
|---|
GuiProgressMeter(JFrame root,
String dialogName)
root - application root framedialogName - dialog's initial name| Method Detail |
|---|
void close()
closeButton.
The closeDialog() method actually closes the dialog, and is
called by closeButtonAction and windowListener.
private void closeDialog()
void setDialogName(String dialogName)
dialogName - new dialog name.public void setTaskName(String taskName)
setTaskName in interface ProgressMetertaskName - the new task namepublic void reset()
reset in interface ProgressMeterpublic void setCount(int count)
setCount in interface ProgressMetercount - the number of items in the current task.
IllegalStateException - if the count was already setpublic void updateProgress(int count)
taskName is null, updates the progress bar string to
reflect the number of items completed.
updateProgress in interface ProgressMetercount - the number of items completedpublic void write(String message)
write in class MessageSinkmessage - message to writepublic void newLine()
newLine in class MessageSink
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||