3
* Created : 24 nov. 2003
6
* Copyright (C) 2004, 2005, 2006 Aelitis SAS, All rights Reserved
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details ( see the LICENSE file ).
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
* AELITIS, SAS au capital de 46,603.30 euros,
22
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
25
package org.gudy.azureus2.ui.swt.views.tableitems.mytorrents;
27
import org.gudy.azureus2.core3.util.DisplayFormatters;
28
import org.gudy.azureus2.core3.download.DownloadManager;
29
import org.gudy.azureus2.plugins.ui.tables.*;
30
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
33
/** bytes uploaded column
36
* @author TuxPaper (2004/Apr/17: modified to TableCellAdapter)
39
extends CoreTableColumn
40
implements TableCellRefreshListener
42
/** Default Constructor */
43
public UpItem(String sTableID) {
44
super("up", ALIGN_TRAIL, POSITION_INVISIBLE, 70, sTableID);
45
setRefreshInterval(INTERVAL_LIVE);
47
if (sTableID.equals(TableManager.TABLE_MYTORRENTS_COMPLETE))
48
setPosition(POSITION_LAST);
50
setPosition(POSITION_INVISIBLE);
53
public void refresh(TableCell cell) {
54
DownloadManager dm = (DownloadManager)cell.getDataSource();
55
long value = (dm == null) ? 0 : dm.getStats().getTotalDataBytesSent();
57
if (!cell.setSortValue(value) && cell.isValid())
60
cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value));
3
* Created : 24 nov. 2003
6
* Copyright (C) 2004, 2005, 2006 Aelitis SAS, All rights Reserved
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details ( see the LICENSE file ).
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
* AELITIS, SAS au capital de 46,603.30 euros,
22
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
25
package org.gudy.azureus2.ui.swt.views.tableitems.mytorrents;
27
import org.gudy.azureus2.core3.util.DisplayFormatters;
28
import org.gudy.azureus2.core3.download.DownloadManager;
29
import org.gudy.azureus2.plugins.ui.tables.*;
30
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
33
/** bytes uploaded column
36
* @author TuxPaper (2004/Apr/17: modified to TableCellAdapter)
39
extends CoreTableColumn
40
implements TableCellRefreshListener
42
/** Default Constructor */
43
public UpItem(String sTableID) {
44
super("up", ALIGN_TRAIL, POSITION_INVISIBLE, 70, sTableID);
45
setRefreshInterval(INTERVAL_LIVE);
46
setMinWidthAuto(true);
48
if (sTableID.equals(TableManager.TABLE_MYTORRENTS_COMPLETE))
49
setPosition(POSITION_LAST);
51
setPosition(POSITION_INVISIBLE);
54
public void refresh(TableCell cell) {
55
DownloadManager dm = (DownloadManager)cell.getDataSource();
56
long value = (dm == null) ? 0 : dm.getStats().getTotalDataBytesSent();
58
if (!cell.setSortValue(value) && cell.isValid())
61
cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value));