Coverage details for base.jdbs.ui.panel.TabledTransfersPanel

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.panel;
22  
23 import java.awt.BorderLayout;
24 import java.awt.Dimension;
25  
26 import javax.swing.JPanel;
27 import javax.swing.JScrollPane;
28 import javax.swing.JTable;
29 import javax.swing.border.TitledBorder;
30 import javax.swing.table.TableModel;
31  
32 import org.apache.log4j.Logger;
33  
34 import ui.table.TableSorter;
35 import base.jdbs.ui.TransfersTableModel;
36  
370@SuppressWarnings("serial")
38 public class TabledTransfersPanel extends JPanel {
390 
400    private static final transient Logger logger = Logger
41             .getLogger(TabledTransfersPanel.class.getName());
42  
43     private JTable transfersTable;
44  
45     private JScrollPane transfersTableScrollPane;
460 
470    private TableSorter transfersTableSorter;
480 
49     private TableModel transfersTableModel;
50  
510    public TabledTransfersPanel() {
520        initialize();
530    }
54  
550    protected void initialize() {
560        this.setBorder(new TitledBorder("Transfers Panel"));
570        this.setLayout(new BorderLayout());
580        this.add(getTransfersTableScrollPane(), BorderLayout.CENTER);
59         // this.add(getButtonPanel(), BorderLayout.EAST);
600    }
610 
620    /**
63      * @return Returns the transfersTable.
640     */
65     protected JTable getTransfersTable() {
660        if (this.transfersTable == null) {
670            this.transfersTable = new JTable(getTransfersTableSorter());
680            this.transfersTable
69                     .setPreferredScrollableViewportSize(new Dimension(500, 70));
70             // We need to place it here to avoid a ciclyc call...
710            this.transfersTableSorter.setTableHeader(transfersTable
72                     .getTableHeader());
73             // Set up tool tips for column headers.
740            this.transfersTable
750                    .getTableHeader()
760                    .setToolTipText(
77                             "Click to specify sorting; Control-Click to specify secondary sorting.");
780        }
790        return transfersTable;
80     }
81  
82     /**
83      * @return Returns the transfersTableScrollPane.
84      */
850    protected JScrollPane getTransfersTableScrollPane() {
860        if (this.transfersTableScrollPane == null) {
870            this.transfersTableScrollPane = new JScrollPane(getTransfersTable());
880        }
890        return transfersTableScrollPane;
90     }
91  
92     /**
93      * @return Returns the transfersTableSorter.
94      */
950    protected TableSorter getTransfersTableSorter() {
960        if (this.transfersTableSorter == null) {
970            this.transfersTableSorter = new TableSorter(
980                    getTransfersTableModel());
99         }
1000        return transfersTableSorter;
101     }
102  
103     /**
104      * @return Returns the transfersTableModel.
105      */
106     protected TableModel getTransfersTableModel() {
1070        if (this.transfersTableModel == null) {
1080            this.transfersTableModel = new TransfersTableModel();
109         }
1100        return transfersTableModel;
111     }
112  
113 }

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.