Coverage details for base.jdbs.ui.TransfersTableModel

LineHitsSource
1 /*******************************************************************************
2  *InternetCafe is a software solution that helps the management of Cybercafes
3  * according with the ITALIAN DECREE LAW ON ANTI-TERROR MEASURES, 27 JULY 2005.
4  * Copyright (C) 2006 Guido Angelo Ingenito
5  
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *******************************************************************************/
20  
21 package base.jdbs.ui;
22  
23 import javax.swing.table.AbstractTableModel;
24  
25 import org.apache.log4j.Logger;
26  
27 @SuppressWarnings("serial")
280public class TransfersTableModel extends AbstractTableModel {
29  
300    private static final transient Logger logger = Logger
31             .getLogger(TransfersTableModel.class.getName());
320 
330    private String[] columnNames = { "Source Peer", "Destination Peer",
34             "Backup Size", "Completion Percentage", "Backup Name" };
35  
36     public static final int TRANSFER_SOURCE_PEER_COLUMN = 0;
37  
38     public static final int TRANSFER_DESTINATION_PEER_COLUMN = 1;
39  
40     public static final int TRANSFER_BACKUP_SIZE_COLUMN = 2;
41  
42     public static final int TRANSFER_COMPLETION_PERCENTAGE_COLUMN = 3;
43  
44     public static final int TRANSFER_BACKUP_NAME_COLUMN = 4;
45  
460    public TransfersTableModel() {
470        super();
480    }
49  
500    public int getColumnCount() {
510        return columnNames.length;
52     }
53  
540    public int getRowCount() {
550        return 0;
56     }
57  
580    public String getColumnName(int column) {
590        return columnNames[column];
60     }
61  
620    public Object getValueAt(int row, int column) {
630        if (row < 0 || column < 0)
640            return null;
650        Object result = null;
660        switch (column) {
670        case TRANSFER_SOURCE_PEER_COLUMN:
680            break;
690        case TRANSFER_DESTINATION_PEER_COLUMN:
700            break;
710        case TRANSFER_BACKUP_SIZE_COLUMN:
720            break;
730        case TRANSFER_COMPLETION_PERCENTAGE_COLUMN:
740            break;
75         case TRANSFER_BACKUP_NAME_COLUMN:
76             break;
770        }
780        return result;
79     }
80  
81     @SuppressWarnings("unchecked")
820    public Class getColumnClass(int column) {
830        Class result = null;
840        switch (column) {
850        case TRANSFER_SOURCE_PEER_COLUMN:
860            break;
870        case TRANSFER_DESTINATION_PEER_COLUMN:
880            break;
890        case TRANSFER_BACKUP_SIZE_COLUMN:
900            break;
910        case TRANSFER_COMPLETION_PERCENTAGE_COLUMN:
920            break;
93         case TRANSFER_BACKUP_NAME_COLUMN:
94             break;
950        }
960        return result;
97     }
98  
99     /*
100      * Don't need to implement this method unless your table's editable.
101      */
1020    public boolean isCellEditable(int row, int column) {
1030        if (row < 0 || column < 0)
1040            return false;
105         // Note that the data/cell address is constant,
1060        // no matter where the cell appears onscreen.
1070        boolean result = false;
1080        switch (column) {
1090        case TRANSFER_SOURCE_PEER_COLUMN:
1100            result = false;
1110            break;
1120        case TRANSFER_DESTINATION_PEER_COLUMN:
1130            result = false;
1140            break;
1150        case TRANSFER_BACKUP_SIZE_COLUMN:
1160            result = false;
1170            break;
1180        case TRANSFER_COMPLETION_PERCENTAGE_COLUMN:
1190            result = false;
1200            break;
1210        case TRANSFER_BACKUP_NAME_COLUMN:
1220            result = false;
123             break;
1240        }
1250        return result;
126     }
127  
128     /*
129      * Don't need to implement this method unless your table's data can change.
130      */
1310    public void setValueAt(Object value, int row, int column) {
1320        if (row < 0 || column < 0)
1330            return;
1340        switch (column) {
1350        case TRANSFER_SOURCE_PEER_COLUMN:
1360            break;
1370        case TRANSFER_DESTINATION_PEER_COLUMN:
1380            break;
1390        case TRANSFER_BACKUP_SIZE_COLUMN:
1400            break;
1410        case TRANSFER_COMPLETION_PERCENTAGE_COLUMN:
1420            break;
143         case TRANSFER_BACKUP_NAME_COLUMN:
144             break;
1450        }
1460        fireTableCellUpdated(row, column);
1470    }
148 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.