[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ToolFactory.java,1.27,1.28 RotationToo
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-02-01 10:04:37
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28414/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java RotationTool.java Log Message: added selection of buttons so that the start tool are selected at start and so that selection by key shortcuts reflects to the buttons Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ToolFactory.java 30 Jan 2006 14:11:55 -0000 1.27 --- ToolFactory.java 1 Feb 2006 10:04:28 -0000 1.28 *************** *** 69,72 **** --- 69,102 ---- /** The curretn tool */ private Tool currentTool; + + /** The selection button */ + private JToggleButton selBut; + + /** The pencil button */ + private JToggleButton pencilBut; + + /** The move button */ + private JToggleButton moveBut; + + /** The rotation button */ + private JToggleButton rotBut; + + /** The extrude button */ + private JToggleButton extrudBut; + + /** The clipplane button */ + private JToggleButton clipBut; + + /** The tapemeasure button */ + private JToggleButton tmBut; + + /** The camera rotation button */ + private JToggleButton cRotBut; + + /** The camera flymode button */ + private JToggleButton flyBut; + + /** The camera walkmode button */ + private JToggleButton walkBut; /** *************** *** 97,131 **** Toolbar tb = Toolbar.getInstance(); tb.addSeparator(); ! JToggleButton but = tb.registerAction(new SelectAction(glv)); ! bg.add(but); ! but.setToolTipText("Select"); ! but = tb.registerAction(new PencilAction(glv)); ! bg.add(but); ! but.setToolTipText("Pencil"); ! but = tb.registerAction(new MoveAction(glv)); ! bg.add(but); ! but.setToolTipText("Move"); ! but = tb.registerAction(new RotationAction(glv)); ! bg.add(but); ! but.setToolTipText("Rotate"); ! but = tb.registerAction(new ExtrudeAction(glv)); ! bg.add(but); ! but.setToolTipText("Extrude"); ! but = tb.registerAction(new ClipAction(glv)); ! bg.add(but); ! but.setToolTipText("Clipping"); ! but = tb.registerAction(new TapeMeasureAction(glv)); ! bg.add(but); ! but.setToolTipText("Tape Measure"); tb.addSeparator(); ! but = tb.registerAction(new CameraAction(glv)); ! bg.add(but); ! but.setToolTipText("Camera rotation"); ! but = tb.registerAction(new CameraFlyAction(glv)); ! bg.add(but); ! but.setToolTipText("Fly mode"); ! but = tb.registerAction(new CameraWalkAction(glv)); ! bg.add(but); ! but.setToolTipText("Walk mode"); --- 127,161 ---- Toolbar tb = Toolbar.getInstance(); tb.addSeparator(); ! selBut = tb.registerAction(new SelectAction(glv)); ! bg.add(selBut); ! selBut.setToolTipText("Select"); ! pencilBut = tb.registerAction(new PencilAction(glv)); ! bg.add(pencilBut); ! pencilBut.setToolTipText("Pencil"); ! moveBut = tb.registerAction(new MoveAction(glv)); ! bg.add(moveBut); ! moveBut.setToolTipText("Move"); ! rotBut = tb.registerAction(new RotationAction(glv)); ! bg.add(rotBut); ! rotBut.setToolTipText("Rotate"); ! extrudBut = tb.registerAction(new ExtrudeAction(glv)); ! bg.add(extrudBut); ! extrudBut.setToolTipText("Extrude"); ! clipBut = tb.registerAction(new ClipAction(glv)); ! bg.add(clipBut); ! clipBut.setToolTipText("Clipping"); ! tmBut = tb.registerAction(new TapeMeasureAction(glv)); ! bg.add(tmBut); ! tmBut.setToolTipText("Tape Measure"); tb.addSeparator(); ! cRotBut = tb.registerAction(new CameraAction(glv)); ! bg.add(cRotBut); ! cRotBut.setToolTipText("Camera rotation"); ! flyBut = tb.registerAction(new CameraFlyAction(glv)); ! bg.add(flyBut); ! flyBut.setToolTipText("Fly mode"); ! walkBut = tb.registerAction(new CameraWalkAction(glv)); ! bg.add(walkBut); ! walkBut.setToolTipText("Walk mode"); *************** *** 181,204 **** Tool temp = currentTool; if (i == Tool.SELECT_TOOL) { currentTool = select; } else if (i == Tool.MOVE_TOOL) { currentTool = move; } else if (i == Tool.ROTATION_TOOL) { currentTool = rotation; } else if (i == Tool.EXTRUSION_TOOL) { currentTool = extrusion; } else if (i == Tool.PENCIL_TOOL) { currentTool = pencil; } else if (i == Tool.CLIP_TOOL) { currentTool = clipplane; } else if (i == Tool.CAMERA_TOOL) { currentTool = camera; } else if (i == Tool.FLY_TOOL) { currentTool = fly; } else if (i == Tool.WALK_TOOL) { currentTool = walk; } else if (i == Tool.TAPE_MEASURE_TOOL) { currentTool = tapeMeasure; - return tapeMeasure; } else { log.error("[get] No such tool " + i); --- 211,243 ---- Tool temp = currentTool; if (i == Tool.SELECT_TOOL) { + selBut.setSelected(true); currentTool = select; } else if (i == Tool.MOVE_TOOL) { + moveBut.setSelected(true); currentTool = move; } else if (i == Tool.ROTATION_TOOL) { + rotBut.setSelected(true); currentTool = rotation; } else if (i == Tool.EXTRUSION_TOOL) { + extrudBut.setSelected(true); currentTool = extrusion; } else if (i == Tool.PENCIL_TOOL) { + pencilBut.setSelected(true); currentTool = pencil; } else if (i == Tool.CLIP_TOOL) { + clipBut.setSelected(true); currentTool = clipplane; } else if (i == Tool.CAMERA_TOOL) { + cRotBut.setSelected(true); currentTool = camera; } else if (i == Tool.FLY_TOOL) { + flyBut.setSelected(true); currentTool = fly; } else if (i == Tool.WALK_TOOL) { + walkBut.setSelected(true); currentTool = walk; } else if (i == Tool.TAPE_MEASURE_TOOL) { + tmBut.setSelected(true); currentTool = tapeMeasure; } else { log.error("[get] No such tool " + i); *************** *** 415,423 **** /** The GLView */ private GLView glv = null; - - /** The Cursor */ - - private Cursor cursor = null; /** * Constructor --- 454,461 ---- /** The GLView */ private GLView glv = null; + /** The mouse cursor */ + private Cursor cursor; + /** * Constructor Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RotationTool.java 30 Jan 2006 14:48:44 -0000 1.7 --- RotationTool.java 1 Feb 2006 10:04:28 -0000 1.8 *************** *** 217,220 **** --- 217,221 ---- */ private void rotate(Vertex v1, Vertex v2, Vertex center) { + //TODO need to take constratints into account Vertex first = from.minus(center); Vertex second = initial.minus(center); |