[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractTool.java,1.9,1.10
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-08-25 09:49:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30700 Modified Files: AbstractTool.java Log Message: added 8,9,0 keypress as change of drawing method, wireframe, solid and lighting Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AbstractTool.java 23 Aug 2005 11:55:38 -0000 1.9 --- AbstractTool.java 25 Aug 2005 09:49:17 -0000 1.10 *************** *** 33,43 **** /** The mouse position last time the mouse was pressed initializes to (0,0) */ ! protected int[] pressPos = new int[2]; /** The mouse movement in x axis since press */ ! protected int dx = 0; /** The mouse movement in y axis since press */ ! protected int dy = 0; /** An vertex counter */ --- 33,43 ---- /** The mouse position last time the mouse was pressed initializes to (0,0) */ ! protected static int[] pressPos = new int[2]; /** The mouse movement in x axis since press */ ! protected static int dx = 0; /** The mouse movement in y axis since press */ ! protected static int dy = 0; /** An vertex counter */ *************** *** 54,68 **** /** The zoom action listener */ ! private ActionListener zoomAction; /** The move action listener */ ! private ActionListener moveAction; /** The carmera move timer */ ! private Timer timer; /** The 3DView */ protected GLView glv = null; /** * KeyListener for the GL Canvas --- 54,72 ---- /** The zoom action listener */ ! private static ActionListener zoomAction; /** The move action listener */ ! private static ActionListener moveAction; /** The carmera move timer */ ! private static Timer timer; /** The 3DView */ protected GLView glv = null; + static { + timer = new Timer(40, null); + } + /** * KeyListener for the GL Canvas *************** *** 71,76 **** public AbstractTool(GLView glv) { this.glv = glv; - - timer = new Timer(40, null); timer.start(); moveAction = new CameraMoveTimer(this, glv); --- 75,78 ---- *************** *** 112,116 **** } else if (e.getKeyChar() == KeyEvent.VK_4) { glv.changeView(View.VIEW_YZ); ! } glv.repaint(); } --- 114,124 ---- } else if (e.getKeyChar() == KeyEvent.VK_4) { glv.changeView(View.VIEW_YZ); ! } else if (e.getKeyChar() == KeyEvent.VK_8) { ! glv.getView().changeDrawMode(View.WIREFRAME_MODE); ! } else if (e.getKeyChar() == KeyEvent.VK_9) { ! glv.getView().changeDrawMode(View.SOLID_MODE); ! } else if (e.getKeyChar() == KeyEvent.VK_0) { ! glv.getView().changeDrawMode(View.LIGHTING_MODE); ! } glv.repaint(); } |