public class ProgressMonitoredDataTransfer extends Observable implements Runnable, ActionListener
Objects of this class also act as Observables, updating their observers after each block of data is transfered, and again at the end of the transfer.
| Constructor and Description |
|---|
ProgressMonitoredDataTransfer(Component par,
InputStream from,
OutputStream to,
int maxtransfer,
Object message,
boolean close)
Create a progress monitored data transfer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
Handle timer actions.
|
int |
getCurrent()
Retrieve the value of current, which is the number of bytes transferred so far.
|
void |
handleProblem(String msg)
Override this to handle problems differently.
|
boolean |
isDone()
Check whether the task is done yet.
|
void |
run() |
void |
waitForDone()
Wait for the task to be done.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedpublic static final int DELAY
public static final int BUFSIZ
public ProgressMonitoredDataTransfer(Component par, InputStream from, OutputStream to, int maxtransfer, Object message, boolean close)
par - Parent Swing Window or Framefrom - Stream to read data fromto - Stream to write data out tomaxtransfer - Maximum number of bytes we expect to transfermessage - Progress monitor message object (usually String)close - If set, then close the streams at end of transferpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - DOCUMENT ME!public void handleProblem(String msg)
msg - Message about the problempublic int getCurrent()
public boolean isDone()
public void waitForDone()
Copyright © 2012–2025 cismet GmbH. All rights reserved.