View Javadoc

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  package ui.panel;
21  
22  import java.awt.BorderLayout;
23  
24  import javax.swing.ImageIcon;
25  import javax.swing.JPanel;
26  import javax.swing.JTabbedPane;
27  
28  import ui.Messages;
29  
30  @SuppressWarnings("serial") //$NON-NLS-1$
31  public class ICNetworkPanel extends JPanel {
32  
33  	private JTabbedPane tabbedPanel;
34  
35  	private JPanel clientPanel;
36  
37  	private JPanel serverPanel;
38  
39  	public ICNetworkPanel() {
40  		initialize();
41  	}
42  
43  	protected void initialize() {
44  		this.setName(Messages.getString("common.network")); //$NON-NLS-1$
45  		this.setLayout(new BorderLayout());
46  		this.add(getTabbedPanel(), BorderLayout.CENTER);
47  	}
48  
49  	/***
50  	 * @return Returns the clientPanel.
51  	 */
52  	protected JPanel getClientPanel() {
53  		if (clientPanel == null) {
54  			clientPanel = new TabledClientWorkstationPanel();
55  		}
56  		return clientPanel;
57  	}
58  
59  	/***
60  	 * @return Returns the serverPanel.
61  	 */
62  	protected JPanel getServerPanel() {
63  		if (serverPanel == null) {
64  			serverPanel = new TabledServerWorkstationPanel();
65  		}
66  		return serverPanel;
67  	}
68  
69  	/***
70  	 * @return Returns the tabbedPanel.
71  	 */
72  	protected JTabbedPane getTabbedPanel() {
73  		if (tabbedPanel == null) {
74  			tabbedPanel = new JTabbedPane();
75  			tabbedPanel.addTab(Messages.getString("common.clientworkstations"), //$NON-NLS-1$
76  					new ImageIcon(this.getClass().getResource(
77  							"/icon/16x16/devices/computer.png")), //$NON-NLS-1$
78  					getClientPanel(), Messages.getString("panel.icnetworkpanel.manageclientworkstations")); //$NON-NLS-1$
79  			tabbedPanel.addTab(Messages.getString("common.serverworkstations"), new ImageIcon(this //$NON-NLS-1$
80  					.getClass().getResource(
81  							"/icon/16x16/places/network-server.png")), //$NON-NLS-1$
82  					getServerPanel(), Messages.getString("panel.icnetworkpanel.manageserverworkstations")); //$NON-NLS-1$
83  		}
84  		return tabbedPanel;
85  	}
86  }