|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TGMouseHandler
TGMouseHandler is an interface that a class implements when it would like to receive Java AWT mouse events from TGCanvas. The provided methods are an attempt to reduce the complexity of the, more general, MouseListener and MouseMotionListener interfaces.
In the case of TG, TGDriver registers with TGCanvas, passing the events on to the current jLogo program, invoking specific user-defined procedures if they exist.
In the case of TurtleGraphicsWindow, the methods in this interface are stubs that should be overridden by child classes if they want to handle mouse input events.
Method Summary | |
---|---|
void |
tgMouseClicked(int x,
int y)
tgMouseClicked() is invoked by TGCanvas for all objects implementing TGMouseHander which have registered to receive the mouse click event when the left mouse button is clicked in the graphics canvas when it is active. |
void |
tgMouseMoved(int x,
int y)
tgMouseMoved() is invoked by TGCanvas, for all objects implementing TGMouseHander that have registered to receive mouse moved events when the mouse is moved within the graphics canvas when it's active. |
Method Detail |
---|
void tgMouseClicked(int x, int y)
x
- X coordinate of mouse's location on the graphics canvasy
- Y coordinate of mouse's location on the graphics canvasvoid tgMouseMoved(int x, int y)
x
- X coordinate of mouse's location on the graphics canvasy
- Y coordinate of mouse's location on the graphics canvas
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |