Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12790/src/net/sourceforge/bprocessor/gl/view
Modified Files:
PopupMenu.java
Log Message:
changeTool on Editor now return the resulting tool from the change... FinalMovetool start a move of a instance by grabbing the handle by which it is moved and make Instance popup choice start moving the created instance.
Index: PopupMenu.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PopupMenu.java 19 Dec 2007 11:40:54 -0000 1.2
--- PopupMenu.java 20 Dec 2007 09:37:43 -0000 1.3
***************
*** 21,24 ****
--- 21,26 ----
import net.sourceforge.bprocessor.gl.Editor;
+ import net.sourceforge.bprocessor.gl.model.Intersection;
+ import net.sourceforge.bprocessor.gl.tool.FinalMoveTool;
import net.sourceforge.bprocessor.gl.tool.Tool;
import net.sourceforge.bprocessor.gui.GUI;
***************
*** 784,788 ****
instance.setProto(space);
world.add(instance);
! editor.changeTool(Tool.FINAL_MOVE_TOOL);
}
proj.changed(world);
--- 786,803 ----
instance.setProto(space);
world.add(instance);
! Selection.primary().set(instance);
! FinalMoveTool tool = (FinalMoveTool)editor.changeTool(Tool.FINAL_MOVE_TOOL);
! CoordinateSystem cs = null;
! if (!instance.getProto().getCoordinateSystems().isEmpty()) {
! cs = instance.getProto().getCoordinateSystems().iterator().next();
! }
! if (cs == null) {
! cs = instance.getInstanceAnchor();
! }
! Vertex center = instance.getInstanceAnchor().unTranslate(cs.center());
! Intersection i = new Intersection(center, Intersection.VERTEX, instance);
! Collection<Instance> insts = new LinkedList<Instance>();
! insts.add(instance);
! tool.activate(insts, i);
}
proj.changed(world);
|