[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java,1.50,1.51
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-01-25 14:47:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24546/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added listening for cameras in update Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** View.java 23 Jan 2006 10:16:22 -0000 1.50 --- View.java 25 Jan 2006 14:46:40 -0000 1.51 *************** *** 367,379 **** Toolbar tb = Toolbar.getInstance(); ! JButton but = tb.registerAction(new View3DAction(glv)); ! but.setToolTipText("3D view"); ! but = tb.registerAction(new ViewxzAction(glv)); ! but.setToolTipText("xz-plane"); ! but = tb.registerAction(new ViewxyAction(glv)); ! but.setToolTipText("xy-plane"); ! but = tb.registerAction(new ViewyzAction(glv)); ! but.setToolTipText("yz-plane"); ! but = tb.registerAction(new ViewWireframe(glv)); but.setToolTipText("Wireframe"); but = tb.registerAction(new ViewSolid(glv)); --- 367,371 ---- Toolbar tb = Toolbar.getInstance(); ! JButton but = tb.registerAction(new ViewWireframe(glv)); but.setToolTipText("Wireframe"); but = tb.registerAction(new ViewSolid(glv)); *************** *** 2171,2182 **** } } - - /** - * Change active camera - * @param c The camera - */ - public void changeCamera(Camera c) { - this.camera = c; - } /** --- 2163,2166 ---- *************** *** 2272,2394 **** return new Transformation(glu, modelMatrix, projMatrix, screenport); } - - /** - * Return the camera - * @return The current camera - */ - public Camera getCamera() { - return camera; - } - - /** - * The viewxy inner class - */ - class ViewxyAction extends AbstractAction { - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - ViewxyAction(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("xyicon.png"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.changeCamera(Camera.create(Camera.VIEW_XY)); - } - } - - /** - * The viewxz inner class - */ - class ViewxzAction extends AbstractAction { - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - ViewxzAction(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("xzicon.png"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.changeCamera(Camera.create(Camera.VIEW_XZ)); - } - } - /** - * The viewyz inner class - */ - class ViewyzAction extends AbstractAction { - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - ViewyzAction(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("yzicon.png"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.changeCamera(Camera.create(Camera.VIEW_YZ)); - } - } - - /** - * The view3D inner class - */ - class View3DAction extends AbstractAction { - /** The GLView */ - private GLView glv = null; - - /** - * Constructor - * @param glv TheGLView - */ - View3DAction(GLView glv) { - this.glv = glv; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL url = cl.getResource("3dicon.png"); - ImageIcon im = new ImageIcon(url); - putValue(Action.SMALL_ICON, im); - } - - /** - * Called when the button is pressed - * @param e The ActionEvent - */ - public void actionPerformed(ActionEvent e) { - glv.changeCamera(Camera.create(Camera.VIEW_3D)); - } - } /** --- 2256,2259 ---- *************** *** 2478,2480 **** --- 2343,2361 ---- } } + + /** + * Getter for camera + * @return the Camera + */ + public Camera getCamera() { + return camera; + } + + /** + * Setter for camera + * @param camera the Camera + */ + public void setCamera(Camera camera) { + this.camera = camera; + } } |