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.MouseMotionListener;
25  
26  import com.drazzib.netpisteur.configuration.Configuration;
27  import com.drazzib.netpisteur.ui.MainFrame;
28  
29  public class MoveListener implements MouseMotionListener {
30  
31  	private MainFrame window;
32  
33  	public MoveListener(MainFrame mfWindow) {
34  		this.window = mfWindow;
35  	}
36  
37  	/**
38  	 * save the mouse co-ordinate when the user stay more 2 seconde whitout
39  	 * move.
40  	 */
41  	public void mouseMoved(MouseEvent e) {
42  		if (Configuration.getHandle().isMesurePlacement()) {
43  			this.window.setX(e.getX());
44  			this.window.setY(e.getY());
45  			this.window.t.restart();
46  		}
47  	}
48  
49  	public void mouseDragged(MouseEvent e) {
50  	}
51  
52  }