|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.Mouse
public class Mouse
| Field Summary | |
|---|---|
private java.awt.Point |
leftClick
position of left mouse click |
private java.awt.Point |
middleClick
position of middle mouse click |
private java.awt.Point |
mouseClick
position of mouse click |
private boolean |
mouseDown
whether mouse is down or not |
private java.awt.Point |
mousePosition
position of the mouse |
private java.util.Observer |
observer
observer |
private java.awt.Point |
rightClick
position of right mouse click |
| Constructor Summary | |
|---|---|
Mouse()
Creates a new instance of Mouse |
|
| Method Summary | |
|---|---|
void |
clear()
clear all pending mouse events |
void |
clearClicks()
clears all mouse clicks |
java.awt.Point |
getClickPosition()
determines the last position of a click and once called, clears that click |
java.awt.Point |
getLeftClickPosition()
determines the last position of a left click and once called, clears that click |
java.awt.Point |
getMiddleClickPosition()
determines the last position of a middle click and once called, clears that click |
java.awt.Point |
getMousePosition()
gets the last position of the mouse. |
java.awt.Point |
getRightClickPosition()
determines the last position of a right click and once called, clears that click |
void |
mouseClicked(java.awt.event.MouseEvent mouseEvent)
stores the MouseEvent for later polling. |
void |
mouseDragged(java.awt.event.MouseEvent mouseEvent)
|
void |
mouseEntered(java.awt.event.MouseEvent mouseEvent)
stores the MouseEvent for later polling. |
void |
mouseExited(java.awt.event.MouseEvent mouseEvent)
stores the MouseEvent for later polling. |
void |
mouseMoved(java.awt.event.MouseEvent mouseEvent)
stores the MouseEvent for later polling. |
boolean |
mousePressed()
|
void |
mousePressed(java.awt.event.MouseEvent mouseEvent)
stores the MouseEvent for later polling. |
void |
mouseReleased(java.awt.event.MouseEvent mouseEvent)
stores the MouseEvent for later polling. |
void |
readExternal(java.io.ObjectInput in)
|
private java.awt.Point |
readPoint(java.io.ObjectInput in,
java.awt.Point point)
|
void |
setObserver(java.util.Observer observer)
sets observer |
java.lang.String |
toString()
returns a string representation of the mouse position |
void |
writeExternal(java.io.ObjectOutput out)
|
private void |
writePoint(java.io.ObjectOutput out,
java.awt.Point point)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.awt.Point mousePosition
private java.awt.Point mouseClick
private java.awt.Point leftClick
private java.awt.Point middleClick
private java.awt.Point rightClick
private boolean mouseDown
private java.util.Observer observer
| Constructor Detail |
|---|
public Mouse()
| Method Detail |
|---|
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
private void writePoint(java.io.ObjectOutput out,
java.awt.Point point)
throws java.io.IOException
java.io.IOException
private java.awt.Point readPoint(java.io.ObjectInput in,
java.awt.Point point)
throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void clear()
public void clearClicks()
public java.awt.Point getMousePosition()
public java.awt.Point getClickPosition()
public java.awt.Point getLeftClickPosition()
public java.awt.Point getMiddleClickPosition()
public java.awt.Point getRightClickPosition()
public boolean mousePressed()
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
mouseClicked in interface java.awt.event.MouseListenerMouseListener.mouseClicked(java.awt.event.MouseEvent)public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent mouseEvent)
mouseEntered in interface java.awt.event.MouseListenerMouseListener.mouseEntered(java.awt.event.MouseEvent)public void mouseExited(java.awt.event.MouseEvent mouseEvent)
mouseExited in interface java.awt.event.MouseListenerMouseListener.mouseExited(java.awt.event.MouseEvent)public void mouseMoved(java.awt.event.MouseEvent mouseEvent)
mouseMoved in interface java.awt.event.MouseMotionListenerMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)public void mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed in interface java.awt.event.MouseListenerMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased in interface java.awt.event.MouseListenerMouseListener.mouseReleased(java.awt.event.MouseEvent)public void setObserver(java.util.Observer observer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||