|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.gui.CanvasMapEditorMouseListener
public final class CanvasMapEditorMouseListener
Listens to the mouse being moved at the level of the Canvas.
| Nested Class Summary | |
|---|---|
private class |
CanvasMapEditorMouseListener.ScrollThread
Scrolls the view of the Map by moving its focus. |
| Field Summary | |
|---|---|
private static int |
AUTO_SCROLLSPACE
|
private Canvas |
canvas
|
private static int |
DRAG_SCROLLSPACE
|
private GUI |
gui
|
private static java.util.logging.Logger |
logger
|
private java.awt.Point |
oldPoint
|
private CanvasMapEditorMouseListener.ScrollThread |
scrollThread
|
private java.awt.Point |
startPoint
|
| Constructor Summary | |
|---|---|
CanvasMapEditorMouseListener(Canvas canvas,
GUI g)
The constructor to use. |
|
| Method Summary | |
|---|---|
private void |
auto_scroll(int x,
int y)
|
private void |
drag_scroll(int x,
int y)
|
private void |
drawBox(javax.swing.JComponent component,
java.awt.Point startPoint,
java.awt.Point endPoint)
|
private Map |
getMap()
This method can be called to make sure the map is loaded There is no point executing mouse events if the map is not loaded |
void |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when a mouse button was clicked. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when the mouse has been dragged. |
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 |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse has been moved. |
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. |
private void |
scroll(int x,
int y,
int scrollspace)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private final Canvas canvas
private final GUI gui
private CanvasMapEditorMouseListener.ScrollThread scrollThread
private static final int DRAG_SCROLLSPACE
private static final int AUTO_SCROLLSPACE
private java.awt.Point oldPoint
private java.awt.Point startPoint
| Constructor Detail |
|---|
public CanvasMapEditorMouseListener(Canvas canvas,
GUI g)
canvas - The component this object gets created for.g - The GUI that holds information such as screen resolution.| Method Detail |
|---|
private Map getMap()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - The MouseEvent that holds all the information.public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - The MouseEvent that holds all the information.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - The MouseEvent that holds all the information.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - The MouseEvent that holds all the information.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - The MouseEvent that holds all the information.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - The MouseEvent that holds all the information.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - The MouseEvent that holds all the information.
private void drawBox(javax.swing.JComponent component,
java.awt.Point startPoint,
java.awt.Point endPoint)
private void auto_scroll(int x,
int y)
private void drag_scroll(int x,
int y)
private void scroll(int x,
int y,
int scrollspace)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||