Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jpl2.link.gui
Class FileDownload  view FileDownload download FileDownload.java

java.lang.Object
  extended byjpl2.link.gui.FileDownload

public class FileDownload
extends java.lang.Object

Dialog to show when downloading/uploading a file(s).


Nested Class Summary
(package private)  class FileDownload.Icon
           
 
Field Summary
private  int approxSpeed
           
private  byte[] buffer
           
private  boolean cancelled
           
private  java.awt.Component currentFile
           
private  java.awt.Dialog dialog
           
private  java.lang.Thread downloadThread
           
private  java.awt.Frame frame
           
private  FileDownload.Icon icon
           
private  java.awt.Image image
           
private  java.awt.Component numFiles
           
private  java.awt.Dialog overWriteDialog
           
private  java.awt.Component progress
           
private  java.awt.Component size
           
private  java.awt.Component speed
           
private  jpl2.common.gui.JPLToolkit tk
           
private  boolean yesToAll
           
 
Constructor Summary
FileDownload(java.awt.Frame frame, boolean downloading)
           
FileDownload(java.awt.Frame frame, java.lang.String title)
           
 
Method Summary
 void cancel()
           
 void checkOverwrite(java.io.File file)
           
 void checkOverwrite(jpl2.link.PsionFile file)
          Check whether the file already exists and will be written over.
 boolean isCancelled()
           
 void reset()
           
 void setCurrentFile(java.io.File file)
           
 void setCurrentFile(jpl2.link.PsionFile file)
           
 void setCurrentFile(java.lang.String fileName, long fileSize)
           
 void setNumFiles(int num)
           
 void setProgressMax(int max)
           
 void setProgressValue(int value)
           
 void setSpeed(double ks)
           
 void setTitle(java.lang.String title)
           
 void show()
           
 void showOverwriteDialog(java.lang.String path, java.lang.String fileName)
           
 void transfer(int length, java.io.InputStream in, java.io.OutputStream out)
          Trannsfer length bytes from in to out, updating progress bar and speed * on dialog as we go.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dialog

private java.awt.Dialog dialog

currentFile

private java.awt.Component currentFile

size

private java.awt.Component size

speed

private java.awt.Component speed

numFiles

private java.awt.Component numFiles

progress

private java.awt.Component progress

downloadThread

private java.lang.Thread downloadThread

image

private java.awt.Image image

icon

private FileDownload.Icon icon

frame

private java.awt.Frame frame

yesToAll

private boolean yesToAll

cancelled

private boolean cancelled

tk

private jpl2.common.gui.JPLToolkit tk

approxSpeed

private int approxSpeed

overWriteDialog

private java.awt.Dialog overWriteDialog

buffer

private final byte[] buffer
Constructor Detail

FileDownload

public FileDownload(java.awt.Frame frame,
                    java.lang.String title)

FileDownload

public FileDownload(java.awt.Frame frame,
                    boolean downloading)
Method Detail

setTitle

public void setTitle(java.lang.String title)

reset

public void reset()

setProgressMax

public void setProgressMax(int max)

setProgressValue

public void setProgressValue(int value)

setSpeed

public void setSpeed(double ks)

setNumFiles

public void setNumFiles(int num)

setCurrentFile

public void setCurrentFile(jpl2.link.PsionFile file)

checkOverwrite

public void checkOverwrite(jpl2.link.PsionFile file)
Check whether the file already exists and will be written over. * Ask the user whether they want to overwrite the file.


checkOverwrite

public void checkOverwrite(java.io.File file)

showOverwriteDialog

public void showOverwriteDialog(java.lang.String path,
                                java.lang.String fileName)

setCurrentFile

public void setCurrentFile(java.io.File file)

setCurrentFile

public void setCurrentFile(java.lang.String fileName,
                           long fileSize)

show

public void show()

transfer

public void transfer(int length,
                     java.io.InputStream in,
                     java.io.OutputStream out)
              throws java.io.IOException
Trannsfer length bytes from in to out, updating progress bar and speed * on dialog as we go.


cancel

public void cancel()

isCancelled

public boolean isCancelled()