| 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.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 | ||
| 37 | 0 | @SuppressWarnings("serial") |
| 38 | public class TabledTransfersPanel extends JPanel { | |
| 39 | 0 | |
| 40 | 0 | private static final transient Logger logger = Logger |
| 41 | .getLogger(TabledTransfersPanel.class.getName()); | |
| 42 | ||
| 43 | private JTable transfersTable; | |
| 44 | ||
| 45 | private JScrollPane transfersTableScrollPane; | |
| 46 | 0 | |
| 47 | 0 | private TableSorter transfersTableSorter; |
| 48 | 0 | |
| 49 | private TableModel transfersTableModel; | |
| 50 | ||
| 51 | 0 | public TabledTransfersPanel() { |
| 52 | 0 | initialize(); |
| 53 | 0 | } |
| 54 | ||
| 55 | 0 | protected void initialize() { |
| 56 | 0 | this.setBorder(new TitledBorder("Transfers Panel")); |
| 57 | 0 | this.setLayout(new BorderLayout()); |
| 58 | 0 | this.add(getTransfersTableScrollPane(), BorderLayout.CENTER); |
| 59 | // this.add(getButtonPanel(), BorderLayout.EAST); | |
| 60 | 0 | } |
| 61 | 0 | |
| 62 | 0 | /** |
| 63 | * @return Returns the transfersTable. | |
| 64 | 0 | */ |
| 65 | protected JTable getTransfersTable() { | |
| 66 | 0 | if (this.transfersTable == null) { |
| 67 | 0 | this.transfersTable = new JTable(getTransfersTableSorter()); |
| 68 | 0 | this.transfersTable |
| 69 | .setPreferredScrollableViewportSize(new Dimension(500, 70)); | |
| 70 | // We need to place it here to avoid a ciclyc call... | |
| 71 | 0 | this.transfersTableSorter.setTableHeader(transfersTable |
| 72 | .getTableHeader()); | |
| 73 | // Set up tool tips for column headers. | |
| 74 | 0 | this.transfersTable |
| 75 | 0 | .getTableHeader() |
| 76 | 0 | .setToolTipText( |
| 77 | "Click to specify sorting; Control-Click to specify secondary sorting."); | |
| 78 | 0 | } |
| 79 | 0 | return transfersTable; |
| 80 | } | |
| 81 | ||
| 82 | /** | |
| 83 | * @return Returns the transfersTableScrollPane. | |
| 84 | */ | |
| 85 | 0 | protected JScrollPane getTransfersTableScrollPane() { |
| 86 | 0 | if (this.transfersTableScrollPane == null) { |
| 87 | 0 | this.transfersTableScrollPane = new JScrollPane(getTransfersTable()); |
| 88 | 0 | } |
| 89 | 0 | return transfersTableScrollPane; |
| 90 | } | |
| 91 | ||
| 92 | /** | |
| 93 | * @return Returns the transfersTableSorter. | |
| 94 | */ | |
| 95 | 0 | protected TableSorter getTransfersTableSorter() { |
| 96 | 0 | if (this.transfersTableSorter == null) { |
| 97 | 0 | this.transfersTableSorter = new TableSorter( |
| 98 | 0 | getTransfersTableModel()); |
| 99 | } | |
| 100 | 0 | return transfersTableSorter; |
| 101 | } | |
| 102 | ||
| 103 | /** | |
| 104 | * @return Returns the transfersTableModel. | |
| 105 | */ | |
| 106 | protected TableModel getTransfersTableModel() { | |
| 107 | 0 | if (this.transfersTableModel == null) { |
| 108 | 0 | this.transfersTableModel = new TransfersTableModel(); |
| 109 | } | |
| 110 | 0 | return transfersTableModel; |
| 111 | } | |
| 112 | ||
| 113 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |