Class ButtonMouseListener

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by ButtonMouseListener
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

 class ButtonMouseListener
extends java.awt.event.MouseAdapter

ButtonMouseListener is a class that manages operations that are performed when mouse actions are happened on buttons on the game window and dialogs.

Version:
1.0.0
Author:
Michiru Nishikawa

Field Summary
private  java.awt.Cursor myCursor
          Cursor object that is a shape of a cursor when it goes over the buttons.
private  MyDialog myDialog
          MyDialog object that creates and has this listener.
private  PlusNumber plusNumber
          PlusNumber object that is an owner of the MyDialog object.
 
Constructor Summary
ButtonMouseListener()
          Default constructor that initialises attributes by caling a non-default constructor.
ButtonMouseListener(MyDialog myDialog)
          Constructor initialising all attributes.
 
Method Summary
 void mouseEntered(java.awt.event.MouseEvent e)
          Change the mouse cursor to a hand shape when the cursor enters on the "PASS" button on the game window or "OK" buttons on the dialogs.
 void mouseExited(java.awt.event.MouseEvent e)
          Change the mouse cursor back to a normal arrow when the cursor leaves the "PASS" button on the game window or "OK" buttons on the dialogs.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myDialog

private MyDialog myDialog
MyDialog object that creates and has this listener.


plusNumber

private PlusNumber plusNumber
PlusNumber object that is an owner of the MyDialog object.


myCursor

private java.awt.Cursor myCursor
Cursor object that is a shape of a cursor when it goes over the buttons.

Constructor Detail

ButtonMouseListener

public ButtonMouseListener(MyDialog myDialog)
Constructor initialising all attributes.

Parameters:
myDialog - a MyDialog object, either AboutDialog or InstructionDialog.

ButtonMouseListener

public ButtonMouseListener()
Default constructor that initialises attributes by caling a non-default constructor.

Method Detail

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Change the mouse cursor to a hand shape when the cursor enters on the "PASS" button on the game window or "OK" buttons on the dialogs.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Overrides:
mouseEntered in class java.awt.event.MouseAdapter
Parameters:
e - a mouse event happened on buttons, which is mouseover.

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Change the mouse cursor back to a normal arrow when the cursor leaves the "PASS" button on the game window or "OK" buttons on the dialogs.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class java.awt.event.MouseAdapter
Parameters:
e - a mouse event happened on buttons, which is mouseout.