Line | Hits | Source |
---|---|---|
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") | |
28 | 0 | public class TransfersTableModel extends AbstractTableModel { |
29 | ||
30 | 0 | private static final transient Logger logger = Logger |
31 | .getLogger(TransfersTableModel.class.getName()); | |
32 | 0 | |
33 | 0 | 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 | ||
46 | 0 | public TransfersTableModel() { |
47 | 0 | super(); |
48 | 0 | } |
49 | ||
50 | 0 | public int getColumnCount() { |
51 | 0 | return columnNames.length; |
52 | } | |
53 | ||
54 | 0 | public int getRowCount() { |
55 | 0 | return 0; |
56 | } | |
57 | ||
58 | 0 | public String getColumnName(int column) { |
59 | 0 | return columnNames[column]; |
60 | } | |
61 | ||
62 | 0 | public Object getValueAt(int row, int column) { |
63 | 0 | if (row < 0 || column < 0) |
64 | 0 | return null; |
65 | 0 | Object result = null; |
66 | 0 | switch (column) { |
67 | 0 | case TRANSFER_SOURCE_PEER_COLUMN: |
68 | 0 | break; |
69 | 0 | case TRANSFER_DESTINATION_PEER_COLUMN: |
70 | 0 | break; |
71 | 0 | case TRANSFER_BACKUP_SIZE_COLUMN: |
72 | 0 | break; |
73 | 0 | case TRANSFER_COMPLETION_PERCENTAGE_COLUMN: |
74 | 0 | break; |
75 | case TRANSFER_BACKUP_NAME_COLUMN: | |
76 | break; | |
77 | 0 | } |
78 | 0 | return result; |
79 | } | |
80 | ||
81 | @SuppressWarnings("unchecked") | |
82 | 0 | public Class getColumnClass(int column) { |
83 | 0 | Class result = null; |
84 | 0 | switch (column) { |
85 | 0 | case TRANSFER_SOURCE_PEER_COLUMN: |
86 | 0 | break; |
87 | 0 | case TRANSFER_DESTINATION_PEER_COLUMN: |
88 | 0 | break; |
89 | 0 | case TRANSFER_BACKUP_SIZE_COLUMN: |
90 | 0 | break; |
91 | 0 | case TRANSFER_COMPLETION_PERCENTAGE_COLUMN: |
92 | 0 | break; |
93 | case TRANSFER_BACKUP_NAME_COLUMN: | |
94 | break; | |
95 | 0 | } |
96 | 0 | return result; |
97 | } | |
98 | ||
99 | /* | |
100 | * Don't need to implement this method unless your table's editable. | |
101 | */ | |
102 | 0 | public boolean isCellEditable(int row, int column) { |
103 | 0 | if (row < 0 || column < 0) |
104 | 0 | return false; |
105 | // Note that the data/cell address is constant, | |
106 | 0 | // no matter where the cell appears onscreen. |
107 | 0 | boolean result = false; |
108 | 0 | switch (column) { |
109 | 0 | case TRANSFER_SOURCE_PEER_COLUMN: |
110 | 0 | result = false; |
111 | 0 | break; |
112 | 0 | case TRANSFER_DESTINATION_PEER_COLUMN: |
113 | 0 | result = false; |
114 | 0 | break; |
115 | 0 | case TRANSFER_BACKUP_SIZE_COLUMN: |
116 | 0 | result = false; |
117 | 0 | break; |
118 | 0 | case TRANSFER_COMPLETION_PERCENTAGE_COLUMN: |
119 | 0 | result = false; |
120 | 0 | break; |
121 | 0 | case TRANSFER_BACKUP_NAME_COLUMN: |
122 | 0 | result = false; |
123 | break; | |
124 | 0 | } |
125 | 0 | return result; |
126 | } | |
127 | ||
128 | /* | |
129 | * Don't need to implement this method unless your table's data can change. | |
130 | */ | |
131 | 0 | public void setValueAt(Object value, int row, int column) { |
132 | 0 | if (row < 0 || column < 0) |
133 | 0 | return; |
134 | 0 | switch (column) { |
135 | 0 | case TRANSFER_SOURCE_PEER_COLUMN: |
136 | 0 | break; |
137 | 0 | case TRANSFER_DESTINATION_PEER_COLUMN: |
138 | 0 | break; |
139 | 0 | case TRANSFER_BACKUP_SIZE_COLUMN: |
140 | 0 | break; |
141 | 0 | case TRANSFER_COMPLETION_PERCENTAGE_COLUMN: |
142 | 0 | break; |
143 | case TRANSFER_BACKUP_NAME_COLUMN: | |
144 | break; | |
145 | 0 | } |
146 | 0 | fireTableCellUpdated(row, column); |
147 | 0 | } |
148 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |