|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.gui.listeners.CanvasKeyListener
public class CanvasKeyListener
Responds to keyboard shortcuts when the canvas has the focus.
Currently, the keyboard shortcuts are only for zooming the camera in or out
5 angstroms at a time or for printing camera distances to the monitor (see
the comments for the keyTyped() method).
Constructor Summary | |
---|---|
CanvasKeyListener(Mediator mediator,
Renderer renderer,
GLCanvas canvas)
Constructs a CanvasKeyListener. |
Method Summary | |
---|---|
void |
keyPressed(KeyEvent e)
This KeyListener interface method is not needed. |
void |
keyReleased(KeyEvent e)
This KeyListener interface method is not needed. |
void |
keyTyped(KeyEvent e)
Moves the z coordinate for the camera and then redraws the canvas. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CanvasKeyListener(Mediator mediator, Renderer renderer, GLCanvas canvas)
mediator
- the central Mediator that allows communication with the
GUI classes.renderer
- the Renderer for the canvas of the main GUI.canvas
- the canvas of the main GUI.Method Detail |
---|
public void keyTyped(KeyEvent e)
Shortcut keys:
M - toggles motion (constant rotation) between on and off
D - toggles printing of object camera distance and auto tiling number
i or I - zoom camera In (camera moves 5 anstroms in -z direction)
o or O - zoom camera Out (camera moves 5 angstroms in +z direction)
keyTyped
in interface KeyListener
e
- the key event.public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |