|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--netwar.gui.MouseParser
This is the MouseListener and MouseMotionListener for HexViewer.
This enables the point and click interface for the game.
The game currently recognizes the following click inputs:
Alt + click = Center the HexViewer on the location of the click.
Ctrl + left click = Zoom in, preserving the center of the view.
Ctrl + right click = Zoom out, preserving the center of the view.
Shift + click = Add or remove a selectable GameObject to/from the set of selected objects.
Right click = Unselect all GameObjects.
Left Click (no objects selected) = Select a selectable GameObject.
Left Click (on a GameObject, with at least one selected) = Set this GameObject as the goal of the selected GameObjects.
Left Click (on an unoccupied Hex, with at least one object selected) = Set this Hex as the gola of the selected GameObjects.
A selectable object is one which is owned by the local player, and is not dead. Each GameObject may define its own behaviors when a goal is set. Typically, a Unit (mobile GameObject) will move to a goal hex, or pursue/attack a goal GameObject.
| Field Summary | |
static int |
maxZoom
The maximum zoom level. |
static int |
minZoom
The minimum zoom level. |
static float |
zoomFactor
The factor for zooming. |
| Constructor Summary | |
MouseParser()
|
|
| Method Summary | |
void |
drawHigh()
Causes the upper portion of the selection box to be drawn on each selected GameObject. |
void |
drawLow()
Causes the lower portion of the selection box to be drawn on each selected GameObject. |
static int |
getZoomLevel()
Accessor for Zoom Level. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Required by MouseListener, but not currently used. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Required by MouseMotionListener, but not currently used. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Required by MouseListener, but not currently used. |
void |
mouseExited(java.awt.event.MouseEvent e)
Required by MouseListener, but not currently used. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Required by MouseMotionListener, but not currently used. |
void |
mousePressed(java.awt.event.MouseEvent e)
Required by MouseListener, but not currently used. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Catches and interprets a mouse click. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int minZoom
public static final int maxZoom
public static final float zoomFactor
| Constructor Detail |
public MouseParser()
| Method Detail |
public static int getZoomLevel()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - The MouseEvent containing all the relevant click data.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void drawLow()
public void drawHigh()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||