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

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.GridLayout;
25  
26 import javax.swing.JPanel;
27 import javax.swing.JScrollPane;
28 import javax.swing.JTextArea;
29 import javax.swing.JTextField;
30 import javax.swing.border.TitledBorder;
31  
32 import org.apache.log4j.Logger;
33  
34 import base.jdbs.network.NetworkManager;
35  
36 /**
37  * @author skunk
380 *
39  */
400@SuppressWarnings("serial")
41 public class InfoPanel extends JPanel {
420 
430    private static final transient Logger logger = Logger
44             .getLogger(InfoPanel.class.getName());
45  
46     private JPanel peerGroupIdPanel;
47  
48     private JPanel peerGroupNamePanel;
49  
50     private JPanel peerGroupAdvertisementPanel;
51  
52     private JPanel peerGroupAdvertisementTypePanel;
53  
54     private JPanel peerGroupAdvertisementDescriptionPanel;
55  
56     private JPanel peerIdPanel;
57  
58     private JPanel peerNamePanel;
59  
60     private JTextField peerGroupIdTextField;
61  
620    private JTextField peerGroupNameTextField;
630 
640    private JScrollPane peerGroupAdvertisementScrollPane;
650 
660    private JTextArea peerGroupAdvertisementTextArea;
670 
680    private JTextField peerGroupAdvertisementTypeTextField;
690 
700    private JTextField peerGroupAdvertisementDescriptionTextField;
710 
720    private JTextField peerIdTextField;
730 
740    private JTextField peerNameTextField;
750 
760    public InfoPanel() {
770        initialize();
780    }
79  
80     protected void initialize() {
810        this.setLayout(new GridLayout(7, 1));
820        this.add(this.getPeerGroupIdPanel());
830        this.add(this.getPeerGroupNamePanel());
840        this.add(this.getPeerGroupAdvertisementPanel());
850        this.add(this.getPeerGroupAdvertisementTypePanel());
860        this.add(this.getPeerGroupAdvertisementDescriptionPanel());
870 
880        this.add(this.getPeerIdPanel());
890        this.add(this.getPeerNamePanel());
900    }
91  
92     /**
93      * @return Returns the peerGroupIdTextField.
940     */
950    protected JTextField getPeerGroupIdTextField() {
960        if (this.peerGroupIdTextField == null) {
970            this.peerGroupIdTextField = new JTextField();
980            this.peerGroupIdTextField.setEditable(false);
990            this.peerGroupIdTextField.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerGroupID().toString());
100         }
1010        return peerGroupIdTextField;
102     }
103  
104     /**
105      * @return Returns the peerGroupNameTextField.
106      */
1070    protected JTextField getPeerGroupNameTextField() {
1080        if (this.peerGroupNameTextField == null) {
1090            this.peerGroupNameTextField = new JTextField();
1100            this.peerGroupNameTextField.setEditable(false);
1110            this.peerGroupNameTextField.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerGroupName());
1120        }
1130        return peerGroupNameTextField;
1140    }
115  
116     /**
117      * @return Returns the peerGroupAdvertisementTextArea.
118      */
1190    protected JTextArea getPeerGroupAdvertisementTextArea() {
1200        if (this.peerGroupAdvertisementTextArea == null) {
1210            this.peerGroupAdvertisementTextArea = new JTextArea();
1220            this.peerGroupAdvertisementTextArea.setEditable(false);
1230            this.peerGroupAdvertisementTextArea.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerAdvertisement().toString());
1240        }
1250        return peerGroupAdvertisementTextArea;
1260    }
127  
128     /**
129      * @return Returns the peerGroupAdvertisementTypeTextField.
130      */
1310    protected JTextField getPeerGroupAdvertisementTypeTextField() {
1320        if (this.peerGroupAdvertisementTypeTextField == null) {
1330            this.peerGroupAdvertisementTypeTextField = new JTextField();
1340            this.peerGroupAdvertisementTypeTextField.setEditable(false);
1350            this.peerGroupAdvertisementTypeTextField.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerAdvertisement().getAdvType());
1360        }
1370        return peerGroupAdvertisementTypeTextField;
1380    }
139  
140     /**
141      * @return Returns the peerGroupAdvertisementDescriptionTextField.
142      */
1430    protected JTextField getPeerGroupAdvertisementDescriptionTextField() {
1440        if (this.peerGroupAdvertisementDescriptionTextField == null) {
1450            this.peerGroupAdvertisementDescriptionTextField = new JTextField();
1460            this.peerGroupAdvertisementDescriptionTextField.setEditable(false);
1470            this.peerGroupAdvertisementDescriptionTextField.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerAdvertisement().getDescription());
1480        }
1490        return peerGroupAdvertisementDescriptionTextField;
1500    }
151  
152     /**
153      * @return Returns the peerIdTextField.
154      */
1550    protected JTextField getPeerIdTextField() {
1560        if (this.peerIdTextField == null) {
1570            this.peerIdTextField = new JTextField();
1580            this.peerIdTextField.setEditable(false);
1590            this.peerIdTextField.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerID().toString());
1600        }
1610        return peerIdTextField;
1620    }
163  
164     /**
165      * @return Returns the peerNameTextField.
166      */
1670    protected JTextField getPeerNameTextField() {
1680        if (this.peerNameTextField == null) {
1690            this.peerNameTextField = new JTextField();
1700            this.peerNameTextField.setEditable(false);
1710            this.peerNameTextField.setText(NetworkManager.getInstance().getJdbsPeerGroup().getPeerName());
1720        }
1730        return peerNameTextField;
174     }
1750 
176     /**
177      * @return Returns the peerGroupIdPanel.
178      */
179     protected JPanel getPeerGroupIdPanel() {
1800        if (this.peerGroupIdPanel == null) {
1810            this.peerGroupIdPanel = new JPanel();
1820            this.peerGroupIdPanel.setBorder(new TitledBorder("Peer Group ID"));
1830            this.peerGroupIdPanel.setLayout(new BorderLayout());
1840            this.peerGroupIdPanel.add(this.getPeerGroupIdTextField(),
1850                    BorderLayout.CENTER);
1860        }
1870        return peerGroupIdPanel;
1880    }
189  
190     /**
191      * @return Returns the peerGroupNamePanel.
192      */
193     protected JPanel getPeerGroupNamePanel() {
1940        if (this.peerGroupNamePanel == null) {
1950            this.peerGroupNamePanel = new JPanel();
1960            this.peerGroupNamePanel.setBorder(new TitledBorder(
1970                    "Peer Group Name"));
1980            this.peerGroupNamePanel.setLayout(new BorderLayout());
1990            this.peerGroupNamePanel.add(this.getPeerGroupNameTextField(),
2000                    BorderLayout.CENTER);
201         }
2020        return peerGroupNamePanel;
203     }
204  
2050    /**
2060     * @return Returns the peerGroupAdvertisementScrollPane.
2070     */
2080    protected JScrollPane getPeerGroupAdvertisementScrollPane() {
2090        if (this.peerGroupAdvertisementScrollPane == null) {
2100            this.peerGroupAdvertisementScrollPane = new JScrollPane(this
2110                    .getPeerGroupAdvertisementTextArea());
212  
2130        }
2140        return peerGroupAdvertisementScrollPane;
215     }
216  
217     /**
2180     * @return Returns the peerGroupAdvertisementPanel.
2190     */
2200    protected JPanel getPeerGroupAdvertisementPanel() {
2210        if (this.peerGroupAdvertisementPanel == null) {
2220            this.peerGroupAdvertisementPanel = new JPanel();
2230            this.peerGroupAdvertisementPanel.setBorder(new TitledBorder(
2240                    "Peer Group Advertisement"));
2250            this.peerGroupAdvertisementPanel.setLayout(new BorderLayout());
2260            this.peerGroupAdvertisementPanel
227                     .add(this.getPeerGroupAdvertisementScrollPane(),
228                             BorderLayout.CENTER);
229         }
2300        return peerGroupAdvertisementPanel;
2310    }
2320 
2330    /**
2340     * @return Returns the peerGroupAdvertisementTypePanel.
2350     */
2360    protected JPanel getPeerGroupAdvertisementTypePanel() {
2370        if (this.peerGroupAdvertisementTypePanel == null) {
2380            this.peerGroupAdvertisementTypePanel = new JPanel();
2390            this.peerGroupAdvertisementTypePanel.setBorder(new TitledBorder(
240                     "Peer Group Advertisement Type"));
2410            this.peerGroupAdvertisementTypePanel.setLayout(new BorderLayout());
2420            this.peerGroupAdvertisementTypePanel.add(this
243                     .getPeerGroupAdvertisementTypeTextField(),
2440                    BorderLayout.CENTER);
2450        }
2460        return peerGroupAdvertisementTypePanel;
2470    }
2480 
2490    /**
2500     * @return Returns the peerGroupAdvertisementDescriptionPanel.
251      */
2520    protected JPanel getPeerGroupAdvertisementDescriptionPanel() {
2530        if (this.peerGroupAdvertisementDescriptionPanel == null) {
2540            this.peerGroupAdvertisementDescriptionPanel = new JPanel();
2550            this.peerGroupAdvertisementDescriptionPanel
256                     .setBorder(new TitledBorder(
2570                            "Peer Group Advertisement Description"));
2580            this.peerGroupAdvertisementDescriptionPanel
2590                    .setLayout(new BorderLayout());
2600            this.peerGroupAdvertisementDescriptionPanel.add(this
2610                    .getPeerGroupAdvertisementDescriptionTextField(),
2620                    BorderLayout.CENTER);
2630        }
2640        return peerGroupAdvertisementDescriptionPanel;
2650    }
266  
267     /**
268      * @return Returns the peerIdPanel.
269      */
270     protected JPanel getPeerIdPanel() {
2710        if (this.peerIdPanel == null) {
2720            this.peerIdPanel = new JPanel();
2730            this.peerIdPanel.setBorder(new TitledBorder("Peer ID"));
2740            this.peerIdPanel.setLayout(new BorderLayout());
2750            this.peerIdPanel
276                     .add(this.getPeerIdTextField(), BorderLayout.CENTER);
277         }
2780        return peerIdPanel;
279     }
280  
281     /**
282      * @return Returns the peerNamePanel.
283      */
284     protected JPanel getPeerNamePanel() {
2850        if (this.peerNamePanel == null) {
2860            this.peerNamePanel = new JPanel();
2870            this.peerNamePanel.setBorder(new TitledBorder("Peer Name"));
2880            this.peerNamePanel.setLayout(new BorderLayout());
2890            this.peerNamePanel.add(this.getPeerNameTextField(),
290                     BorderLayout.CENTER);
291         }
2920        return peerNamePanel;
293     }
294  
295 }

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.