net.sf.freecol.client.gui
Class CanvasMouseListener

java.lang.Object
  extended by net.sf.freecol.client.gui.CanvasMouseListener
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.util.EventListener

public final class CanvasMouseListener
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.MouseListener

Listens to mouse buttons being pressed at the level of the Canvas.


Field Summary
private  Canvas canvas
           
private  int centerX
           
private  int centerY
           
private  int doubleClickDelay
           
private  javax.swing.Timer doubleClickTimer
           
private  GUI gui
           
private static java.util.logging.Logger logger
           
 
Constructor Summary
CanvasMouseListener(Canvas canvas, GUI g)
          The constructor to use.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent timerEvent)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when a mouse button was clicked.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters the component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits the component.
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button was pressed.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button was released.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger

canvas

private final Canvas canvas

gui

private final GUI gui

doubleClickDelay

private final int doubleClickDelay
See Also:
Constant Field Values

doubleClickTimer

private javax.swing.Timer doubleClickTimer

centerX

private int centerX

centerY

private int centerY
Constructor Detail

CanvasMouseListener

public CanvasMouseListener(Canvas canvas,
                           GUI g)
The constructor to use.

Parameters:
canvas - The component this object gets created for.
g - The GUI that holds information such as screen resolution.
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when a mouse button was clicked.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - The MouseEvent that holds all the information.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters the component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - The MouseEvent that holds all the information.

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits the component.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - The MouseEvent that holds all the information.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button was pressed.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - The MouseEvent that holds all the information.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button was released.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - The MouseEvent that holds all the information.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent timerEvent)
Specified by:
actionPerformed in interface java.awt.event.ActionListener