public final class Mouse
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Modifier and Type | Field and Description |
---|---|
private MouseHandler |
activeHandler |
private int |
button |
private WorldCanvas |
canvas |
private int |
canvasHeight |
private int |
canvasWidth |
private ClickListener |
clickListener |
private boolean |
down |
private MouseHandler[] |
handlers |
static int |
LEFT |
static int |
MIDDLE |
private MouseHandler |
motionHandler |
private int |
nHandler |
static int |
RIGHT |
private int |
xCurrent |
private int |
xDown |
private int |
yCurrent |
private int |
yDown |
Constructor and Description |
---|
Mouse(WorldCanvas c,
boolean interactive) |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(MouseHandler h) |
(package private) void |
boxSelected(int x0,
int y0,
int x1,
int y1) |
void |
detach() |
void |
dragRollRotate(int pdx,
int pdy) |
(package private) void |
dragZoom(double fx,
double fy,
int xc,
int yc) |
void |
dragZRotate(int pdx,
int pdy) |
(package private) void |
echoPaint(java.awt.Graphics2D g) |
int |
getButton() |
(package private) int |
getCanvasHeight() |
(package private) int |
getCanvasWidth() |
(package private) int |
getX() |
(package private) int |
getXDown() |
(package private) int |
getY() |
(package private) int |
getYDown() |
void |
initializeRotation(double x,
double y,
double z) |
void |
initializeRotation(int ix,
int iy) |
(package private) void |
initializeZoom(int xc,
int yc) |
boolean |
isDown() |
(package private) boolean |
leftButton() |
(package private) boolean |
middleButton() |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
(package private) void |
permanentPan(int xfrom,
int yfrom,
int xto,
int yto) |
void |
prependHandler(MouseHandler h) |
private void |
readButton(java.awt.event.MouseEvent e) |
private void |
readPosition(java.awt.event.MouseEvent e) |
private void |
readPressPosition(java.awt.event.MouseEvent e) |
private void |
requestRepaint() |
void |
restoreAA() |
(package private) boolean |
rightButton() |
void |
setClickListener(ClickListener cl) |
(package private) void |
trialPan(int xfrom,
int yfrom,
int xto,
int yto) |
void |
updateCanvasDimensions() |
(package private) void |
zoom(double xfac,
double yfac,
int xc,
int yc) |
(package private) void |
zoom(double fac,
int xc,
int yc) |
public static final int LEFT
public static final int MIDDLE
public static final int RIGHT
private int button
private int canvasWidth
private int canvasHeight
private int xDown
private int yDown
private int xCurrent
private int yCurrent
private boolean down
private int nHandler
private MouseHandler[] handlers
private MouseHandler activeHandler
private MouseHandler motionHandler
private WorldCanvas canvas
private ClickListener clickListener
public Mouse(WorldCanvas c, boolean interactive)
public void setClickListener(ClickListener cl)
public void detach()
public void addHandler(MouseHandler h)
public void prependHandler(MouseHandler h)
private void requestRepaint()
boolean leftButton()
boolean middleButton()
boolean rightButton()
public void updateCanvasDimensions()
int getCanvasWidth()
int getCanvasHeight()
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
private void readPosition(java.awt.event.MouseEvent e)
private void readPressPosition(java.awt.event.MouseEvent e)
private void readButton(java.awt.event.MouseEvent e)
public int getButton()
public boolean isDown()
int getX()
int getY()
int getXDown()
int getYDown()
void echoPaint(java.awt.Graphics2D g)
void boxSelected(int x0, int y0, int x1, int y1)
void initializeZoom(int xc, int yc)
void dragZoom(double fx, double fy, int xc, int yc)
void zoom(double fac, int xc, int yc)
void zoom(double xfac, double yfac, int xc, int yc)
void trialPan(int xfrom, int yfrom, int xto, int yto)
void permanentPan(int xfrom, int yfrom, int xto, int yto)
public void dragRollRotate(int pdx, int pdy)
public void dragZRotate(int pdx, int pdy)
public void initializeRotation(int ix, int iy)
public void initializeRotation(double x, double y, double z)
public void restoreAA()
Copyright © 2013. All Rights Reserved.