annotate src/alice/test/topology/aquarium/KeyInputCodeSegment.java @ 134:53aff28cde6b working

change package
author sugi
date Wed, 15 Aug 2012 17:11:57 +0900
parents src/alice/test/topology/fishmodel/alpha/KeyInputCodeSegment.java@a8f77957a477
children 87f1a30a8c82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
134
53aff28cde6b change package
sugi
parents: 107
diff changeset
1 package alice.test.topology.aquarium;
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
2
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
3 import java.awt.event.KeyEvent;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
4 import java.awt.event.KeyListener;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
5
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
6 public class KeyInputCodeSegment implements KeyListener{
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
7 int KeyCode = 0;
98
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
8 SendLocation cs;
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
9 String key;
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
10
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
11 public void setKey(){
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
12
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
13 }
21e68300e205 add jar file"vecmath" "j3dcore" "j3dutils"
sugi
parents: 97
diff changeset
14
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
15 @Override
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
16 public void keyPressed(KeyEvent event) {
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
17 KeyCode = event.getKeyCode();
105
993a9f194615 success share TEST
sugi
parents: 98
diff changeset
18 //System.out.println("getKey" +KeyCode);
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
19 switch(KeyCode)
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
20 {
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
21 case 37:
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
22 cs = new SendLocation(-0.1f,0.0f);
105
993a9f194615 success share TEST
sugi
parents: 98
diff changeset
23 cs.position.setKey("local", "fish");
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
24 break;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
25 case 39:
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
26 cs = new SendLocation(0.1f,0.0f);
105
993a9f194615 success share TEST
sugi
parents: 98
diff changeset
27 cs.position.setKey("local", "fish");
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
28 break;
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
29 case 40:
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
30 cs = new SendLocation(0.0f,-0.1f);
105
993a9f194615 success share TEST
sugi
parents: 98
diff changeset
31 cs.position.setKey("local", "fish");
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
32 break;
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
33 case 38:
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
34 cs = new SendLocation(0.0f,0.1f);
105
993a9f194615 success share TEST
sugi
parents: 98
diff changeset
35 cs.position.setKey("local", "fish");
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
36 break;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
37 }
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
38 }
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
39
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
40 @Override
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
41 public void keyReleased(KeyEvent arg0) {
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
42
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
43 }
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
44
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
45 @Override
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
46 public void keyTyped(KeyEvent arg0) {
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
47
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
48 }
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
49
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
50 }