[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view ViewFactory.java,1.3,1.4
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-08-25 16:08:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19563 Modified Files: ViewFactory.java Log Message: Added buttons for draw mode Index: ViewFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ViewFactory.java 17 Aug 2005 08:58:49 -0000 1.3 --- ViewFactory.java 25 Aug 2005 16:08:12 -0000 1.4 *************** *** 66,69 **** --- 66,75 ---- 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)); + but.setToolTipText("Solid"); + but = tb.registerAction(new ViewLighting(glv)); + but.setToolTipText("Shading"); } *************** *** 218,220 **** --- 224,313 ---- } } + + /** + * The viewwireframe inner class + */ + class ViewWireframe extends AbstractAction { + /** The GLView */ + private GLView glv = null; + + /** + * Constructor + * @param glv TheGLView + */ + ViewWireframe(GLView glv) { + this.glv = glv; + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource("wireframeicon.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.getView().changeDrawMode(View.WIREFRAME_MODE); + glv.repaint(); + } + } + + /** + * The viewSolid inner class + */ + class ViewSolid extends AbstractAction { + /** The GLView */ + private GLView glv = null; + + /** + * Constructor + * @param glv TheGLView + */ + ViewSolid(GLView glv) { + this.glv = glv; + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource("solidicon.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.getView().changeDrawMode(View.SOLID_MODE); + glv.repaint(); + } + } + + /** + * The viewlighting inner class + */ + class ViewLighting extends AbstractAction { + /** The GLView */ + private GLView glv = null; + + /** + * Constructor + * @param glv TheGLView + */ + ViewLighting(GLView glv) { + this.glv = glv; + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource("lightingicon.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.getView().changeDrawMode(View.LIGHTING_MODE); + glv.repaint(); + } + } } |