diff src/alice/test/topology/aquarium/MakeFrame.java @ 140:b51d3bf971e7 working

add function (refresh)
author sugi
date Thu, 20 Sep 2012 01:32:46 +0900
parents 87f1a30a8c82
children 4c71bbfe557d
line wrap: on
line diff
--- a/src/alice/test/topology/aquarium/MakeFrame.java	Tue Sep 18 16:19:50 2012 +0900
+++ b/src/alice/test/topology/aquarium/MakeFrame.java	Thu Sep 20 01:32:46 2012 +0900
@@ -24,13 +24,15 @@
 
 public class MakeFrame {
 	
-	int fSizeX = 800;
-	int fSizeY = 800;
+	private int fSizeX = 800;
+	private int fSizeY = 800;
 	private Canvas3D canvas;
 	private SimpleUniverse universe;
+	private JFrame frame;
+	private ObjectList list = new ObjectList();
 	
 	public MakeFrame(String str){
-		JFrame frame = new JFrame(str);
+		frame = new JFrame(str);
 		frame.setSize(fSizeX,fSizeY);
 		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 		
@@ -47,7 +49,7 @@
 		universe.addBranchGraph(createLight());
 		universe.addBranchGraph(setBackground());
 		
-		canvas.addKeyListener(new KeyInputCodeSegment());
+		canvas.addKeyListener(new KeyInputCodeSegment(this));
 		frame.setVisible(true);
 		
 		ViewingPlatform camera = universe.getViewingPlatform();
@@ -85,8 +87,10 @@
 	}
 	
 	public void register(MakeObject obj){
+		list.table.add(obj);
 		BranchGroup group = obj.createBranch();
 		this.universe.addBranchGraph(group);
+		
 	}
 	
 	public SimpleUniverse getUniverse(){
@@ -96,4 +100,13 @@
 	public Canvas3D getCanvas(){
 		return this.canvas;
 	}
+	
+	public JFrame getJFrame(){
+		return this.frame;
+	}
+	
+	public ObjectList getList(){
+		return this.list;
+	}
+	
 }