[3951] | 1 | // |
---|
| 2 | // $Id: FilePanel.java 1386 2010-08-17 11:32:33Z postb99 $ |
---|
| 3 | // |
---|
| 4 | // jupload - A file upload applet. |
---|
| 5 | // Copyright 2007 The JUpload Team |
---|
| 6 | // |
---|
| 7 | // Created: ? |
---|
| 8 | // Creator: William JinHua Kwong |
---|
| 9 | // Last modified: $Date: 2010-08-17 08:32:33 -0300 (Ter, 17 Ago 2010) $ |
---|
| 10 | // |
---|
| 11 | // This program is free software; you can redistribute it and/or modify it under |
---|
| 12 | // the terms of the GNU General Public License as published by the Free Software |
---|
| 13 | // Foundation; either version 2 of the License, or (at your option) any later |
---|
| 14 | // version. This program is distributed in the hope that it will be useful, but |
---|
| 15 | // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
| 16 | // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
| 17 | // details. You should have received a copy of the GNU General Public License |
---|
| 18 | // along with this program; if not, write to the Free Software Foundation, Inc., |
---|
| 19 | // 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 20 | package wjhk.jupload2.gui.filepanel; |
---|
| 21 | |
---|
| 22 | import java.awt.Color; |
---|
| 23 | import java.awt.Component; |
---|
| 24 | import java.awt.Font; |
---|
| 25 | import java.awt.Point; |
---|
| 26 | import java.io.File; |
---|
| 27 | |
---|
| 28 | import javax.swing.ActionMap; |
---|
| 29 | import javax.swing.JComponent; |
---|
| 30 | import javax.swing.TransferHandler; |
---|
| 31 | |
---|
| 32 | import wjhk.jupload2.filedata.FileData; |
---|
| 33 | import wjhk.jupload2.gui.JUploadPanel; |
---|
| 34 | |
---|
| 35 | /** |
---|
| 36 | * Defines the interface used in the applet, when dealing with the file panel. |
---|
| 37 | */ |
---|
| 38 | public interface FilePanel { |
---|
| 39 | |
---|
| 40 | /** |
---|
| 41 | * Add multiple files to this panel. |
---|
| 42 | * |
---|
| 43 | * @param f An array of files to add. |
---|
| 44 | * @param root The top level of a directory hierarchy to add |
---|
| 45 | */ |
---|
| 46 | public void addFiles(File[] f, File root); |
---|
| 47 | |
---|
| 48 | /** |
---|
| 49 | * Retrieve all currently stored files. |
---|
| 50 | * |
---|
| 51 | * @return an array of files, currently managed by this instance. |
---|
| 52 | */ |
---|
| 53 | public FileData[] getFiles(); |
---|
| 54 | |
---|
| 55 | /** |
---|
| 56 | * Retrieve the number of file entries in the JTable. |
---|
| 57 | * |
---|
| 58 | * @return the current number of files, held by this instance. |
---|
| 59 | */ |
---|
| 60 | public int getFilesLength(); |
---|
| 61 | |
---|
| 62 | /** |
---|
| 63 | * Removes all currently selected file entries. |
---|
| 64 | */ |
---|
| 65 | public void removeSelected(); |
---|
| 66 | |
---|
| 67 | /** |
---|
| 68 | * Removes all file entries. |
---|
| 69 | */ |
---|
| 70 | public void removeAll(); |
---|
| 71 | |
---|
| 72 | /** |
---|
| 73 | * Remove a specified file entry. |
---|
| 74 | * |
---|
| 75 | * @param fileData The file to be removed. |
---|
| 76 | */ |
---|
| 77 | public void remove(FileData fileData); |
---|
| 78 | |
---|
| 79 | /** |
---|
| 80 | * Clears the current selection of the JTable. |
---|
| 81 | */ |
---|
| 82 | public void clearSelection(); |
---|
| 83 | |
---|
| 84 | /** |
---|
| 85 | * Requests focus for the JTable. |
---|
| 86 | */ |
---|
| 87 | public void focusTable(); |
---|
| 88 | |
---|
| 89 | /** |
---|
| 90 | * Ask for the file contained below the specific point on the screen. |
---|
| 91 | * |
---|
| 92 | * @param point The point |
---|
| 93 | * @return The return instance of File. |
---|
| 94 | */ |
---|
| 95 | public FileData getFileDataAt(Point point); |
---|
| 96 | |
---|
| 97 | /** |
---|
| 98 | * Return the component on which drop event can occur. Used by |
---|
| 99 | * {@link JUploadPanel}, when initializing the DropTarget. |
---|
| 100 | * |
---|
| 101 | * @return The drop component target |
---|
| 102 | */ |
---|
| 103 | public Component getDropComponent(); |
---|
| 104 | |
---|
| 105 | /** |
---|
| 106 | * Transfer handler, to manage copy/paste operations. |
---|
| 107 | * |
---|
| 108 | * @param newHandler |
---|
| 109 | * @see JComponent#setTransferHandler(TransferHandler) |
---|
| 110 | */ |
---|
| 111 | public void setTransferHandler(TransferHandler newHandler); |
---|
| 112 | |
---|
| 113 | /** |
---|
| 114 | * Allows to get standard action map, like paste action. |
---|
| 115 | * |
---|
| 116 | * @return Get the current actionMap |
---|
| 117 | * @see JComponent#getActionMap() |
---|
| 118 | */ |
---|
| 119 | public ActionMap getActionMap(); |
---|
| 120 | |
---|
| 121 | /** |
---|
| 122 | * Set color of files list grid border. |
---|
| 123 | * @param color awt Color |
---|
| 124 | */ |
---|
| 125 | public void setGridBorderColor(Color color); |
---|
| 126 | |
---|
| 127 | /** |
---|
| 128 | * Set back color of table header |
---|
| 129 | * @param color awt Color |
---|
| 130 | */ |
---|
| 131 | public void setTableHeaderBackColor(Color color); |
---|
| 132 | |
---|
| 133 | /** |
---|
| 134 | * Set text color of table header |
---|
| 135 | * @param color awt Color |
---|
| 136 | */ |
---|
| 137 | public void setTableHeaderTextColor(Color color); |
---|
| 138 | |
---|
| 139 | /** |
---|
| 140 | * Set table header text font |
---|
| 141 | * @param color awt Color |
---|
| 142 | */ |
---|
| 143 | public void setTableHeaderFont(Font font); |
---|
| 144 | } |
---|