Mercurial > hg > Members > tatsuki > Alice
diff src/alice/test/topology/aquarium/MakeFrame.java @ 141:4c71bbfe557d working
add mouse event
author | sugi |
---|---|
date | Thu, 20 Sep 2012 21:35:23 +0900 |
parents | b51d3bf971e7 |
children | 287aae21e7d8 |
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/MakeFrame.java Thu Sep 20 01:32:46 2012 +0900 +++ b/src/alice/test/topology/aquarium/MakeFrame.java Thu Sep 20 21:35:23 2012 +0900 @@ -26,7 +26,8 @@ private int fSizeX = 800; private int fSizeY = 800; - private Canvas3D canvas; + //private Canvas3D canvas; + private ViewChange canvas; private SimpleUniverse universe; private JFrame frame; private ObjectList list = new ObjectList(); @@ -41,19 +42,20 @@ frame.add(cp); GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); - canvas = new Canvas3D(config); + //canvas = new Canvas3D(config); + canvas = new ViewChange(3.0f,0.01f,config); canvas.setBounds(0,0,fSizeX,fSizeY); cp.add(canvas); - universe = new SimpleUniverse(canvas); - universe.addBranchGraph(createLight()); - universe.addBranchGraph(setBackground()); + + canvas.universe.addBranchGraph(createLight()); + canvas.universe.addBranchGraph(setBackground()); canvas.addKeyListener(new KeyInputCodeSegment(this)); frame.setVisible(true); - ViewingPlatform camera = universe.getViewingPlatform(); - camera.setNominalViewingTransform(); + //ViewingPlatform camera = universe.getViewingPlatform(); + //camera.setNominalViewingTransform(); } private BranchGroup setBackground(){ @@ -89,7 +91,7 @@ public void register(MakeObject obj){ list.table.add(obj); BranchGroup group = obj.createBranch(); - this.universe.addBranchGraph(group); + this.canvas.universe.addBranchGraph(group); } @@ -97,7 +99,7 @@ return this.universe; } - public Canvas3D getCanvas(){ + public ViewChange getCanvas(){ return this.canvas; }