Mercurial > hg > Database > Alice
view src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java @ 543:f3f7e256ee03 dispose
add AliceDaemon on paramater
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 03 Aug 2015 20:00:53 +0900 |
parents | 6e304a7a60e7 |
children | 074c6716f906 |
line wrap: on
line source
package alice.test.topology.aquarium; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; public class KeyInputCodeSegment implements KeyListener{ MakeFrame frame; public KeyInputCodeSegment(MakeFrame frame) { this.frame = frame; } @Override public void keyPressed(KeyEvent event) { //System.out.println(event.getKeyCode()); switch(event.getKeyCode()) { case 37: // left new SendLocation(-0.1f,0.0f,0.0f); break; case 38: // up new SendLocation(0.0f,0.1f,0.0f); break; case 39: // right new SendLocation(0.1f,0.0f,0.0f); break; case 40: // down new SendLocation(0.0f,-0.1f,0.0f); break; case 76: // l new SendLocation(0.0f,0.0f,0.1f); break; case 78: // "n" new RefreshWindow(frame); break; case 79: // "o" new SendLocation(0.0f,0.0f,-0.1f); break; case 82: // "r" new ResetFish().execute(aliceDaemon); break; } } @Override public void keyReleased(KeyEvent event) { } @Override public void keyTyped(KeyEvent event) { } }