[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ExtrusionTool.java,1.4,1.5
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-09-02 13:35:41
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16245 Modified Files: ExtrusionTool.java Log Message: Works with the new move tool and selecttool Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExtrusionTool.java 30 Aug 2005 12:49:34 -0000 1.4 --- ExtrusionTool.java 2 Sep 2005 13:35:32 -0000 1.5 *************** *** 16,19 **** --- 16,23 ---- import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.model.ConstructionSpace; + import net.sourceforge.bprocessor.model.ConstructionSpaceFacade; + import net.sourceforge.bprocessor.model.FunctionalSpace; + import net.sourceforge.bprocessor.model.Space; import java.awt.event.MouseEvent; *************** *** 28,32 **** * The extrusion tool */ ! public class ExtrusionTool extends SelectTool { /** The logger */ private static Logger log = Logger.getLogger(ExtrusionTool.class); --- 32,36 ---- * The extrusion tool */ ! public class ExtrusionTool extends MoveTool { /** The logger */ private static Logger log = Logger.getLogger(ExtrusionTool.class); *************** *** 35,38 **** --- 39,45 ---- private static Surface dragSurface = null; + /** the selected surface */ + private static Surface selectedSurface = null; + /** * The Constructor *************** *** 151,154 **** --- 158,166 ---- protected void pressed(MouseEvent e) { super.pressed(e); + if (target instanceof Surface) { + selectedSurface = (Surface)target; + } else { + selectedSurface = null; + } } *************** *** 167,170 **** --- 179,184 ---- */ private Surface extendSurface(Surface extendSurf) { + ConstructionSpace newCSpace = new ConstructionSpace("innerSpace"); + Space outer = selectedSurface.getFrontSpace(); Edge previousEdge = null; Vertex previousVertex = null; *************** *** 173,176 **** --- 187,191 ---- List edges = extendSurf.getEdges(); List top = new ArrayList(edges.size()); + newCSpace.addSurface(selectedSurface); Iterator i = edges.iterator(); Edge current = null; *************** *** 223,227 **** } } ! createSurface(newEdges); newEdges = new ArrayList(); --- 238,246 ---- } } ! Surface sur = createSurface(newEdges); ! newCSpace.addSurface(sur); ! if (outer != null) { ! outer.addSurface(sur); ! } newEdges = new ArrayList(); *************** *** 239,243 **** } } ! return createSurface(top); } --- 258,279 ---- } } ! ConstructionSpaceFacade.getInstance().create(newCSpace); ! dragSurface = createSurface(top); ! if (outer != null) { ! outer.addSurface(dragSurface); ! } ! newCSpace.addSurface(dragSurface); ! Notification n = new Notification(Notification.SURFACE_SELECTED, dragSurface.getId()); ! Notifier.getInstance().sendNotification(n); ! if (outer instanceof FunctionalSpace) { ! n = new Notification(Notification.FUNCTIONAL_SPACE_MODIFIED, outer.getId()); ! } else if (outer instanceof ConstructionSpace) { ! n = new Notification(Notification.CONSTRUCTION_SPACE_MODIFIED, outer.getId()); ! } ! Notifier.getInstance().sendNotification(n); ! n = new Notification(Notification.CONSTRUCTION_SPACE_MODIFIED, newCSpace.getId()); ! Notifier.getInstance().sendNotification(n); ! ! return dragSurface; } *************** *** 258,263 **** } dragSurface = top; - Notification n = new Notification(Notification.SURFACE_SELECTED, dragSurface.getId()); - Notifier.getInstance().sendNotification(n); } } --- 294,297 ---- |