jsky.util
Interface StatusLogger

All Known Implementing Classes:
ProgressPanel, StatusPanel

public interface StatusLogger

This defines an interface for logging status messages. In a user interface, this can be implemented as a progress bar and test message.

Version:
$Revision: 1.1 $
Author:
Allan Brighton
See Also:
StatusPanel

Method Summary
 ProgressBarFilterInputStream getLoggedInputStream(java.io.InputStream in, int size)
          Return a input stream that will generate log messages showing the progress of the read from the given stream.
 ProgressBarFilterInputStream getLoggedInputStream(java.net.URL url)
          Return an input stream to use for reading from the given URL that will generate log messages showing the progress of the read.
 void logMessage(java.lang.String msg)
          Log or display the given message
 java.net.URLConnection openConnection(java.net.URL url)
          Return a connection to the given URL and log messages before and after opening the connection.
 void setProgress(int percent)
          Set the percent done.
 void stopLoggingInputStream(ProgressBarFilterInputStream in)
          Stop logging reads from the input stream returned from an earlier call to getLoggedInputStream().
 

Method Detail

logMessage

void logMessage(java.lang.String msg)
Log or display the given message


setProgress

void setProgress(int percent)
Set the percent done.


openConnection

java.net.URLConnection openConnection(java.net.URL url)
                                      throws java.io.IOException
Return a connection to the given URL and log messages before and after opening the connection.

Throws:
java.io.IOException

getLoggedInputStream

ProgressBarFilterInputStream getLoggedInputStream(java.io.InputStream in,
                                                  int size)
                                                  throws java.io.IOException
Return a input stream that will generate log messages showing the progress of the read from the given stream.

Parameters:
in - the input stream to be monitored
size - the size in bytes of the date to be read, or 0 if not known
Throws:
java.io.IOException

getLoggedInputStream

ProgressBarFilterInputStream getLoggedInputStream(java.net.URL url)
                                                  throws java.io.IOException
Return an input stream to use for reading from the given URL that will generate log messages showing the progress of the read.

Parameters:
url - the URL to read
Throws:
java.io.IOException

stopLoggingInputStream

void stopLoggingInputStream(ProgressBarFilterInputStream in)
                            throws java.io.IOException
Stop logging reads from the input stream returned from an earlier call to getLoggedInputStream().

Parameters:
in - an input stream returned from getLoggedInputStream()
Throws:
java.io.IOException