View Javadoc

1   /*
2    * This file is part of NetPisteur.
3    * 
4    * Copyright 2005-2007 : Damien RAUDE-MORVAN
5    * 
6    * NetPisteur is free software; you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation; either version 2 of the License, or
9    * (at your option) any later version.
10   *
11   * NetPisteur 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 NetPisteur; if not, write to the Free Software
18   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19   *
20   */
21  package com.drazzib.netpisteur.ui.listener;
22  
23  import java.awt.event.MouseEvent;
24  import java.awt.event.MouseListener;
25  import java.util.GregorianCalendar;
26  
27  import org.apache.commons.logging.Log;
28  import org.apache.commons.logging.LogFactory;
29  
30  import com.drazzib.netpisteur.configuration.Configuration;
31  import com.drazzib.netpisteur.monitor.Click;
32  import com.drazzib.netpisteur.ui.MainFrame;
33  import com.drazzib.netpisteur.util.Messages;
34  
35  public class ClickListener implements MouseListener {
36  	
37  	private static Log log = LogFactory.getLog(ClickListener.class);
38  
39  	private MainFrame window;
40  
41  	public ClickListener(MainFrame mfWindow) {
42  		this.window = mfWindow;
43  	}
44  
45  	/**
46  	 * save the mouse co-ordinate when the user click.
47  	 */
48  	public void mouseClicked(MouseEvent e) {
49  		if (Configuration.getHandle().isMesureClick()) {
50  			Click clic = new Click(e.getX(), e.getY(), new GregorianCalendar());
51  			log.debug(Messages.getString("mainWindow.CLICK") + e.getX() + " " + e.getY()); //$NON-NLS-1$ //$NON-NLS-2$
52  			this.window.maListeClick.ajouter(clic);
53  		}
54  	}
55  
56  	public void mouseEntered(MouseEvent e) {
57  	}
58  
59  	public void mouseExited(MouseEvent e) {
60  	}
61  
62  	public void mousePressed(MouseEvent e) {
63  	}
64  
65  	public void mouseReleased(MouseEvent e) {
66  	}
67  }