Coverage details for ui.frame.ICMainFrame

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 package ui.frame;
21  
22 import java.awt.BorderLayout;
23 import java.awt.event.MouseEvent;
24 import java.awt.event.MouseListener;
25 import java.awt.event.WindowEvent;
26 import java.awt.event.WindowListener;
27 import java.util.Date;
28  
29 import javax.swing.ImageIcon;
30 import javax.swing.JFrame;
31 import javax.swing.JPanel;
32 import javax.swing.JTabbedPane;
33  
34 import org.apache.log4j.Logger;
35  
36 import ui.ICMenuBar;
37 import ui.Messages;
38 import ui.command.CommandExecutor;
39 import ui.command.IO.ExitCommand;
40 import ui.panel.ICConfigurationPanel;
41 import ui.panel.ICInfoPanel;
42 import ui.panel.ICInventoryPanel;
43 import ui.panel.ICNetworkPanel;
44 import ui.panel.ICServicePanel;
45 import ui.panel.ICSessionPanel;
46 import ui.panel.ICStatisticPanel;
47 import ui.panel.ICUserPanel;
48 import base.ConfigurationManager;
49 import base.InternetCafe;
50  
510@SuppressWarnings("serial") //$NON-NLS-1$
520public class ICMainFrame extends JFrame {
530 
540    private static final transient Logger logger = Logger
550            .getLogger(ICMainFrame.class.getName());
56  
57     private JTabbedPane tabbedPane;
580 
590    public ICMainFrame() {
600        initialize();
610    }
62  
630    protected void initialize() {
640        this.setTitle(ConfigurationManager.getInstance().getInternetCafeName());
650        this.setJMenuBar(new ICMenuBar());
660        setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
670        setSize(1024, 768);
680        setResizable(true);
690        JPanel panel = new JPanel();
700        panel.setLayout(new BorderLayout());
710        panel.add(InternetCafe.getToolBar(), BorderLayout.NORTH);
720        panel.add(getTabbedPane(), BorderLayout.CENTER);
730        panel.add(InternetCafe.getStatusBar(), BorderLayout.SOUTH);
740 
750        this.setContentPane(panel);
760 
770        this.addWindowListener(new WindowListener() {
78  
79             public void windowOpened(WindowEvent arg0) {
80                 // TODO Auto-generated method stub
81  
82             }
83  
84             public void windowClosing(WindowEvent arg0) {
85                 CommandExecutor.getInstance().executeCommand(new ExitCommand(),
86                         false);
87             }
88  
89             public void windowClosed(WindowEvent arg0) {
90                 // CommandExecutor.getInstance().executeCommand(new
91                 // ExitCommand());
92  
93             }
94  
95             public void windowIconified(WindowEvent arg0) {
96                 // TODO Auto-generated method stub
97  
98             }
99  
100             public void windowDeiconified(WindowEvent arg0) {
101                 // TODO Auto-generated method stub
102  
103             }
104  
105             public void windowActivated(WindowEvent arg0) {
106                 // TODO Auto-generated method stub
107  
108             }
109  
110             public void windowDeactivated(WindowEvent arg0) {
111                 // TODO Auto-generated method stub
112  
113             }
114  
1150        });
1160    }
117  
118     /**
119      * @return Returns the tabbedPane.
120      */
1210    protected JTabbedPane getTabbedPane() {
1220        if (tabbedPane == null) {
1230            tabbedPane = new JTabbedPane();
1240            tabbedPane.addTab(Messages.getString("mainframe.info"), new ImageIcon(this.getClass() //$NON-NLS-1$
1250                    .getResource("/icon/16x16/places/start-here.png")), //$NON-NLS-1$
1260                    new ICInfoPanel(), ConfigurationManager.getInstance()
1270                            .getInternetCafeName()
1280                            + Messages.getString("mainframe.tooltip.infoof")); //$NON-NLS-1$
1290            tabbedPane.addTab(Messages.getString("mainframe.users"), new ImageIcon(this.getClass() //$NON-NLS-1$
1300                    .getResource("/icon/16x16/apps/system-users.png")), //$NON-NLS-1$
1310                    new ICUserPanel(), Messages.getString("mainframe.tooltip.manageusers")); //$NON-NLS-1$
1320            tabbedPane
1330                    .addTab(
1340                            Messages.getString("mainframe.sessions"), //$NON-NLS-1$
1350                            new ImageIcon(
1360                                    this
1370                                            .getClass()
1380                                            .getResource(
1390                                                    "/icon/16x16/apps/preferences-system-windows.png")), //$NON-NLS-1$
1400                            new ICSessionPanel(), Messages.getString("mainframe.tooltip.managesessions")); //$NON-NLS-1$
1410            tabbedPane.addTab(Messages.getString("mainframe.services"), new ImageIcon(this.getClass() //$NON-NLS-1$
1420                    .getResource("/icon/16x16/apps/internet-web-browser.png")), //$NON-NLS-1$
1430                    new ICServicePanel(), Messages.getString("mainframe.tooltip.manageservices")); //$NON-NLS-1$
1440            tabbedPane.addTab(Messages.getString("mainframe.network"), new ImageIcon(this.getClass() //$NON-NLS-1$
1450                    .getResource("/icon/16x16/places/network-workgroup.png")), //$NON-NLS-1$
1460                    new ICNetworkPanel(), Messages.getString("mainframe.tooltip.managenetwork")); //$NON-NLS-1$
1470            tabbedPane.addTab(Messages.getString("mainframe.inventory"), //$NON-NLS-1$
1480                    new ImageIcon(this.getClass().getResource(
1490                            "/icon/16x16/actions/format-justify-fill.png")), //$NON-NLS-1$
1500                    new ICInventoryPanel(), Messages.getString("mainframe.tooltip.manageinventory")); //$NON-NLS-1$
1510            tabbedPane.addTab(Messages.getString("mainframe.statistics"), new ImageIcon(this.getClass() //$NON-NLS-1$
1520                    .getResource(
1530                            "/icon/16x16/mimetypes/x-office-spreadsheet.png")), //$NON-NLS-1$
1540                    new ICStatisticPanel(), Messages.getString("mainframe.tooltip.manageinventory")); //$NON-NLS-1$
1550            tabbedPane.addTab(Messages.getString("mainframe.configuration"), new ImageIcon(this.getClass() //$NON-NLS-1$
1560                    .getResource(
1570                            "/icon/16x16/categories/preferences-desktop.png")), //$NON-NLS-1$
1580                    new ICConfigurationPanel(),
1590                    Messages.getString("mainframe.tooltip.manageconfiguration")); //$NON-NLS-1$
1600            tabbedPane.addMouseListener(new MouseListener() {
161  
162                 public void mouseClicked(MouseEvent arg0) {
163                     Date currentDate = new Date();
164                     logger.debug("Last Seen User Working: " + currentDate); //$NON-NLS-1$
165                     ConfigurationManager.getInstance().setLastSeenUserWorking(
166                             currentDate);
167                 }
168  
169                 public void mousePressed(MouseEvent arg0) {
170                     // TODO Auto-generated method stub
171  
172                 }
173  
174                 public void mouseReleased(MouseEvent arg0) {
175                     // TODO Auto-generated method stub
176  
177                 }
178  
179                 public void mouseEntered(MouseEvent arg0) {
180                     // TODO Auto-generated method stub
181  
182                 }
183  
184                 public void mouseExited(MouseEvent arg0) {
185                     // TODO Auto-generated method stub
186  
187                 }
188  
189             });
1900        }
1910        return tabbedPane;
192     }
193 }

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.