Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9689/src/net/sourceforge/bprocessor/gl/view
Modified Files:
PopupMenu.java
Log Message:
Instance work
Index: PopupMenu.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** PopupMenu.java 25 Jun 2009 23:28:49 -0000 1.32
--- PopupMenu.java 26 Jun 2009 12:39:54 -0000 1.33
***************
*** 22,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;
--- 22,25 ----
***************
*** 994,1023 ****
menu.add(new CollectionMenuAction(components, "Make Instance") {
public void actionPerformed(ActionEvent e) {
! Project proj = Project.getInstance();
! Space world = proj.getActiveSpace();
! for (Object o : col) {
! Component lo = (Component)o;
! Space space = lo.getSpace();
! Instance instance = new Instance(space.getName() + " instance ");
! proj.addCalalogObject(lo);
! 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);
! proj.checkpoint();
};
});
--- 993,1009 ----
menu.add(new CollectionMenuAction(components, "Make Instance") {
public void actionPerformed(ActionEvent e) {
! Project project = Project.getInstance();
! Space world = project.getActiveSpace();
! List<Component> components = new LinkedList(col);
! for (Component component : components) {
! project.addCalalogObject(component);
! Instance instance = component.makeInstance();
world.add(instance);
Selection.primary().set(instance);
FinalMoveTool tool = (FinalMoveTool)editor.changeTool(Tool.FINAL_MOVE_TOOL);
! tool.activate(instance);
}
! project.changed(world);
! project.checkpoint();
};
});
|