[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SpaceTool.java,1.19,1.20
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nordholt <nor...@us...> - 2006-05-15 12:27:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20145 Modified Files: SpaceTool.java Log Message: added 90degree counter clockwise rotation to options Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SpaceTool.java 3 May 2006 10:01:20 -0000 1.19 --- SpaceTool.java 15 May 2006 12:08:03 -0000 1.20 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.constraints.OffsetConstraint; *************** *** 98,102 **** this.space = space; } - } --- 99,102 ---- *************** *** 452,459 **** public void actionPerformed(ActionEvent arg0) { if (space != null) { - selection.clear(); Space spaceCopy = space.copy(); selection.clear(); selection.add(spaceCopy); } } --- 452,476 ---- public void actionPerformed(ActionEvent arg0) { if (space != null) { Space spaceCopy = space.copy(); selection.clear(); selection.add(spaceCopy); + glv.changeTool(Tool.MOVE_TOOL); + } + } + }); + + JMenuItem flipSpaceItem = new JMenuItem("Rotate space 90degrees CCW"); + flipSpaceItem.addActionListener(new SpaceAction(space) { + public void actionPerformed(ActionEvent arg0) { + if (space != null) { + Iterator it = space.collect().iterator(); + Vertex center = space.center(); + while (it.hasNext()) { + Geometry.rotate(Math.PI / 2, + 0, 0, 1, + (Vertex)it.next(), + center); + } + space.changed(); } } *************** *** 490,493 **** --- 507,511 ---- menu.add(copySpaceItem); menu.add(editSpaceItem); + menu.add(flipSpaceItem); menu.addPopupMenuListener(spl); menu.pack(); |