Coverage Report - wjhk.jupload2.gui.JUploadPanel
 
Classes in this File Line Coverage Branch Coverage Complexity
JUploadPanel
N/A
N/A
1
 
 1  
 //
 2  
 // $Id: JUploadPanelImpl.java 303 2007-07-21 07:42:51 +0000 (sam., 21 juil.
 3  
 // 2007)
 4  
 // etienne_sf $
 5  
 //
 6  
 // jupload - A file upload applet.
 7  
 // Copyright 2007 The JUpload Team
 8  
 //
 9  
 // Created: ?
 10  
 // Creator: William JinHua Kwong
 11  
 // Last modified: $Date: 2010-02-09 11:32:18 +0100 (mar., 09 févr. 2010) $
 12  
 //
 13  
 // This program is free software; you can redistribute it and/or modify it under
 14  
 // the terms of the GNU General Public License as published by the Free Software
 15  
 // Foundation; either version 2 of the License, or (at your option) any later
 16  
 // version. This program is distributed in the hope that it will be useful, but
 17  
 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 18  
 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 19  
 // details. You should have received a copy of the GNU General Public License
 20  
 // along with this program; if not, write to the Free Software Foundation, Inc.,
 21  
 // 675 Mass Ave, Cambridge, MA 02139, USA.
 22  
 
 23  
 package wjhk.jupload2.gui;
 24  
 
 25  
 import java.awt.event.ActionListener;
 26  
 import java.awt.event.MouseEvent;
 27  
 import java.awt.event.MouseListener;
 28  
 
 29  
 import javax.swing.JButton;
 30  
 import javax.swing.JComponent;
 31  
 import javax.swing.JLabel;
 32  
 import javax.swing.JPanel;
 33  
 import javax.swing.JProgressBar;
 34  
 import javax.swing.JScrollPane;
 35  
 import javax.swing.TransferHandler;
 36  
 
 37  
 import wjhk.jupload2.gui.filepanel.FilePanel;
 38  
 import wjhk.jupload2.upload.FileUploadManagerThread;
 39  
 
 40  
 /**
 41  
  * Interface for the central object of the JUpload GUI. It creates and contains
 42  
  * all GUI items: creation of necessary elements, and calls to
 43  
  * {@link wjhk.jupload2.policies.UploadPolicy} methods to allow easy
 44  
  * personalization.
 45  
  * 
 46  
  * @author etienne_sf
 47  
  * 
 48  
  */
 49  
 public interface JUploadPanel {
 50  
 
 51  
     /**
 52  
      * This methods show or hides the logWindow, depending on the following
 53  
      * applet parameters. The following conditions must be met, to hide the log
 54  
      * window: <DIR> <LI>showLogWindow (must be False) <LI>debugLevel (must be 0
 55  
      * or less) </DIR>
 56  
      */
 57  
     public void showOrHideLogWindow();
 58  
 
 59  
     /**
 60  
      * Reaction to a click on the browse button.
 61  
      */
 62  
     public void doBrowse();
 63  
 
 64  
     /**
 65  
      * Reaction to a click on the remove button. This method actually removes
 66  
      * the selected files in the file list.
 67  
      */
 68  
     public void doRemove();
 69  
 
 70  
     /**
 71  
      * Reaction to a click on the removeAll button. This method actually removes
 72  
      * all the files in the file list.
 73  
      */
 74  
     public void doRemoveAll();
 75  
 
 76  
     /**
 77  
      * Reaction to a click on the upload button. This method can be called from
 78  
      * outside to start the upload.
 79  
      */
 80  
     public void doStartUpload();
 81  
 
 82  
     /**
 83  
      * Reaction to a click on the stop button. This stops the running on upload.
 84  
      * This method can be called from outside to start the upload.
 85  
      */
 86  
     public void doStopUpload();
 87  
 
 88  
     /**
 89  
      * Select or unselect the applet buttons
 90  
      */
 91  
     public void updateButtonState();
 92  
 
 93  
     /** Clear the current log window content. */
 94  
     public void clearLogWindow();
 95  
 
 96  
     /**
 97  
      * Copy the log window content into the clipboard. Allows easy access to the
 98  
      * debug output.
 99  
      * 
 100  
      */
 101  
     public void copyLogWindow();
 102  
 
 103  
     /**
 104  
      * @return the actionListener, that'll manage the button interaction.
 105  
      */
 106  
     public ActionListener getActionListener();
 107  
 
 108  
     /**
 109  
      * @return the browseButton
 110  
      */
 111  
     public JButton getBrowseButton();
 112  
 
 113  
     /**
 114  
      * Returns the awt container, that contains all the objects of the GUI.
 115  
      * 
 116  
      * @return The Container.
 117  
      */
 118  
     public JComponent getJComponent();
 119  
 
 120  
     /**
 121  
      * @return the dndListener
 122  
      */
 123  
     public DnDListener getDndListener();
 124  
 
 125  
     /**
 126  
      * @return the filePanel
 127  
      */
 128  
     public FilePanel getFilePanel();
 129  
 
 130  
     /**
 131  
      * The component that contains the log window. It is used to display the
 132  
      * content of the log window, with the relevant scroll bars.
 133  
      * 
 134  
      * @return the jLogWindowPane
 135  
      */
 136  
     public JScrollPane getJLogWindowPane();
 137  
 
 138  
     /**
 139  
      * The component that manages the mouse.
 140  
      * 
 141  
      * @return the MouseListener
 142  
      */
 143  
     public MouseListener getMouseListener();
 144  
 
 145  
     /**
 146  
      * @return the preparationProgressBar
 147  
      */
 148  
     public JProgressBar getPreparationProgressBar();
 149  
 
 150  
     /**
 151  
      * @return the uploadProgressBar
 152  
      */
 153  
     public JProgressBar getUploadProgressBar();
 154  
 
 155  
     /**
 156  
      * @return the removeAllButton
 157  
      */
 158  
     public JButton getRemoveAllButton();
 159  
 
 160  
     /**
 161  
      * @return the removeButton
 162  
      */
 163  
     public JButton getRemoveButton();
 164  
 
 165  
     /**
 166  
      * @return the statusLabel
 167  
      */
 168  
     public JLabel getStatusLabel();
 169  
 
 170  
     /**
 171  
      * @return the stopButton
 172  
      */
 173  
     public JButton getStopButton();
 174  
 
 175  
     /**
 176  
      * @see JPanel#getTransferHandler()
 177  
      * 
 178  
      * @return The TransfertHandler
 179  
      */
 180  
     public TransferHandler getTransferHandler();
 181  
 
 182  
     /**
 183  
      * @return the uploadButton
 184  
      */
 185  
     public JButton getUploadButton();
 186  
 
 187  
     /**
 188  
      * This method opens the popup menu, if the mouseEvent is relevant. In this
 189  
      * case it returns true. Otherwise, it does nothing and returns false.
 190  
      * 
 191  
      * @param mouseEvent The triggered mouse event.
 192  
      * @return true if the popup menu was opened, false otherwise.
 193  
      */
 194  
     public boolean maybeOpenPopupMenu(MouseEvent mouseEvent);
 195  
 
 196  
     /**
 197  
      * Standard setter for filePanel.
 198  
      * 
 199  
      * @param filePanel
 200  
      */
 201  
     public void setFilePanel(FilePanel filePanel);
 202  
 
 203  
     /**
 204  
      * @return the fileUploadManagerThread
 205  
      */
 206  
     public FileUploadManagerThread getFileUploadManagerThread();
 207  
 
 208  
 }