comparison src/alice/test/topology/movement/MakeFrame.java @ 93:6601f8854126 working

can KeyInputCodeSegment
author sugi
date Tue, 05 Jun 2012 16:33:28 +0900
parents 8e3c1217aad4
children
comparison
equal deleted inserted replaced
92:8e3c1217aad4 93:6601f8854126
20 int fSizeX = 800; 20 int fSizeX = 800;
21 int fSizeY = 800; 21 int fSizeY = 800;
22 private Canvas3D canvas; 22 private Canvas3D canvas;
23 private SimpleUniverse universe; 23 private SimpleUniverse universe;
24 private KeyInput key; 24 private KeyInput key;
25 private KeyInputCodeSegment KIC;
25 26
26 public MakeFrame(){ 27 public MakeFrame(){
27 JFrame frame = new JFrame(); 28 JFrame frame = new JFrame();
28 frame.setSize(fSizeX,fSizeY); 29 frame.setSize(fSizeX,fSizeY);
29 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 30 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
37 canvas.setBounds(0,0,fSizeX,fSizeY); 38 canvas.setBounds(0,0,fSizeX,fSizeY);
38 cp.add(canvas); 39 cp.add(canvas);
39 40
40 universe = new SimpleUniverse(canvas); 41 universe = new SimpleUniverse(canvas);
41 universe.addBranchGraph(createLight()); 42 universe.addBranchGraph(createLight());
42 43 /*
43 key = new KeyInput(); 44 key = new KeyInput();
44 canvas.addKeyListener(key); 45 canvas.addKeyListener(key);
45 46 */
47 KIC = new KeyInputCodeSegment();
48 canvas.addKeyListener(KIC);
46 frame.setVisible(true); 49 frame.setVisible(true);
47 50
48 ViewingPlatform camera = universe.getViewingPlatform(); 51 ViewingPlatform camera = universe.getViewingPlatform();
49 camera.setNominalViewingTransform(); 52 camera.setNominalViewingTransform();
50 } 53 }
76 79
77 public KeyInput getKey(){ 80 public KeyInput getKey(){
78 return this.key; 81 return this.key;
79 } 82 }
80 83
81 public SimpleUniverse getUniverse(){ 84 public KeyInputCodeSegment getKeySegment(){
82 return this.universe; 85 return this.KIC;
83 } 86 }
84 87
85 } 88 }