[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ZoomTool.java, 1.2, 1.3 FocusTool.jav
Status: Pre-Alpha
Brought to you by:
henryml
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16012/src/net/sourceforge/bprocessor/gl/tool Modified Files: ZoomTool.java FocusTool.java RelationTool.java ExtrusionTool.java ConstructorTool.java AbstractPencil.java OrbitStrategy.java PanTool.java CameraFlyTool.java ToolFactory.java SelectStrategy.java RotationTool.java RectTool.java EraserTool.java Pencil.java SelectTool.java CameraWalkTool.java ControlledMoveTool.java PanStrategy.java MoveTool.java OffsetTool.java SpaceTool.java EdgeMoveTool.java ClipplaneTool.java FinalMoveTool.java TapeMeasure.java CameraTool.java ControlledExtrudeTool.java AbstractTool.java Protractor.java ArcTool.java AltMoveTool.java Log Message: Renamed GLView to Editor Index: PanTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PanTool.java 18 Nov 2007 20:32:47 -0000 1.2 --- PanTool.java 18 Nov 2007 21:30:17 -0000 1.3 *************** *** 22,30 **** /** * The constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public PanTool(Editor glv, Cursor cursor) { ! super(glv, cursor); dragDelay = 0; } --- 22,30 ---- /** * The constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public PanTool(Editor editor, Cursor cursor) { ! super(editor, cursor); dragDelay = 0; } Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** OffsetTool.java 18 Nov 2007 20:32:47 -0000 1.24 --- OffsetTool.java 18 Nov 2007 21:30:17 -0000 1.25 *************** *** 72,80 **** /** * Constructor fo OffsetTool ! * @param glv The GLView * @param cursor The Cursor */ ! public OffsetTool(Editor glv, Cursor cursor) { ! super(glv, cursor); guide = new Edge(new Vertex(0, 0, 0), new Vertex(0, 0, 0)); guide.setStrippled(true); --- 72,80 ---- /** * Constructor fo OffsetTool ! * @param editor The GLView * @param cursor The Cursor */ ! public OffsetTool(Editor editor, Cursor cursor) { ! super(editor, cursor); guide = new Edge(new Vertex(0, 0, 0), new Vertex(0, 0, 0)); guide.setStrippled(true); *************** *** 110,114 **** } if (edge != null) { ! glv.setCursor(this.getCursor()); edgePoint = edge.intersection(current.vertex()); Vertex dir = edge.getDirection(); --- 110,114 ---- } if (edge != null) { ! editor.setCursor(this.getCursor()); edgePoint = edge.intersection(current.vertex()); Vertex dir = edge.getDirection(); *************** *** 152,156 **** } else { setTip(errorString()); ! glv.setCursor(ToolFactory.errorCursor); current = null; } --- 152,156 ---- } else { setTip(errorString()); ! editor.setCursor(ToolFactory.errorCursor); current = null; } Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ClipplaneTool.java 18 Nov 2007 20:32:47 -0000 1.14 --- ClipplaneTool.java 18 Nov 2007 21:30:17 -0000 1.15 *************** *** 36,44 **** /** * The Constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public ClipplaneTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 36,44 ---- /** * The Constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public ClipplaneTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 57,61 **** Vertex j = system.getJ(); Vertex o = system.getOrigin().copy(); ! boolean front = glv.getView().facingFront(system); if (front) { n.scaleInPlace(-1); --- 57,61 ---- Vertex j = system.getJ(); Vertex o = system.getOrigin().copy(); ! boolean front = editor.getView().facingFront(system); if (front) { n.scaleInPlace(-1); *************** *** 65,74 **** cp = new ClippingPlane(system); if (Project.getInstance().getCurrentCamera().getClipplanes().size() < ! glv.getView().getMaxClipPlanes()) { Project.getInstance().getCurrentCamera().addClipplane(cp); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } ! View view = glv.getView(); previous = view.toPlaneCoords(e.getX(), e.getY(), cp.getPlane()); Transformation trans = view.transformation(); --- 65,74 ---- cp = new ClippingPlane(system); if (Project.getInstance().getCurrentCamera().getClipplanes().size() < ! editor.getView().getMaxClipPlanes()) { Project.getInstance().getCurrentCamera().addClipplane(cp); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } ! View view = editor.getView(); previous = view.toPlaneCoords(e.getX(), e.getY(), cp.getPlane()); Transformation trans = view.transformation(); *************** *** 90,96 **** findTarget(e); if (target instanceof Surface) { ! glv.getView().makeTarget(target); } else { ! glv.getView().makeTarget(null); } } --- 90,96 ---- findTarget(e); if (target instanceof Surface) { ! editor.getView().makeTarget(target); } else { ! editor.getView().makeTarget(null); } } *************** *** 101,105 **** protected void dragged(MouseEvent e) { if (cp != null) { ! Vertex to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex delta = to.minus(previous); cp.move(delta.getX(), delta.getY(), delta.getZ()); --- 101,105 ---- protected void dragged(MouseEvent e) { if (cp != null) { ! Vertex to = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex delta = to.minus(previous); cp.move(delta.getX(), delta.getY(), delta.getZ()); Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** ToolFactory.java 18 Nov 2007 20:32:47 -0000 1.91 --- ToolFactory.java 18 Nov 2007 21:30:17 -0000 1.92 *************** *** 42,46 **** /** glv */ ! private Editor glv; /** tools */ --- 42,46 ---- /** glv */ ! private Editor editor; /** tools */ *************** *** 136,146 **** /** * Constructor ! * @param glv the GLView */ ! private ToolFactory(Editor glv) { tools = new HashMap(); buttons = new HashMap(); group = new ButtonGroup(); ! this.glv = glv; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 136,146 ---- /** * Constructor ! * @param editor the GLView */ ! private ToolFactory(Editor editor) { tools = new HashMap(); buttons = new HashMap(); group = new ButtonGroup(); ! this.editor = editor; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 179,201 **** Cursor zoomCursor = Toolkit.getDefaultToolkit().createCustomCursor(zoomImage, new Point(7, 8), "Zoom"); ! select = new SpaceTool(glv, null); ! pencil = new Pencil(glv, pencilcursor); ! eraser = new EraserTool(glv, pencilcursor); ! arc = new ArcTool(glv, pencilcursor); ! rotation = new RotationTool(glv, null); ! extrude = new ExtrusionTool(glv, pencilcursor); ! multiExtrude = new ControlledExtrudeTool(glv, pencilcursor); ! clipplane = new ClipplaneTool(glv, pencilcursor); ! tapeMeasure = new TapeMeasure(glv, pencilcursor); ! protractor = new Protractor(glv, pencilcursor); ! relation = new RelationTool(glv, arrowAddCursor); ! camera = new CameraTool(glv, rotationCursor); ! constructor = new ConstructorTool(glv, pencilcursor); ! offset = new OffsetTool(glv, pencilcursor); ! altRect = new RectTool(glv, pencilcursor); ! focusTool = new FocusTool(glv, null); ! finalMoveTool = new FinalMoveTool(glv, pencilcursor); ! panTool = new PanTool(glv, panCursor); ! zoomTool = new ZoomTool(glv, zoomCursor); Toolbar tb = Toolbar.getInstance(); --- 179,201 ---- Cursor zoomCursor = Toolkit.getDefaultToolkit().createCustomCursor(zoomImage, new Point(7, 8), "Zoom"); ! select = new SpaceTool(editor, null); ! pencil = new Pencil(editor, pencilcursor); ! eraser = new EraserTool(editor, pencilcursor); ! arc = new ArcTool(editor, pencilcursor); ! rotation = new RotationTool(editor, null); ! extrude = new ExtrusionTool(editor, pencilcursor); ! multiExtrude = new ControlledExtrudeTool(editor, pencilcursor); ! clipplane = new ClipplaneTool(editor, pencilcursor); ! tapeMeasure = new TapeMeasure(editor, pencilcursor); ! protractor = new Protractor(editor, pencilcursor); ! relation = new RelationTool(editor, arrowAddCursor); ! camera = new CameraTool(editor, rotationCursor); ! constructor = new ConstructorTool(editor, pencilcursor); ! offset = new OffsetTool(editor, pencilcursor); ! altRect = new RectTool(editor, pencilcursor); ! focusTool = new FocusTool(editor, null); ! finalMoveTool = new FinalMoveTool(editor, pencilcursor); ! panTool = new PanTool(editor, panCursor); ! zoomTool = new ZoomTool(editor, zoomCursor); Toolbar tb = Toolbar.getInstance(); *************** *** 251,255 **** tb.addSeparator(10); ! Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); --- 251,255 ---- tb.addSeparator(10); ! Action orthoAction = new ToolAction(editor, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); *************** *** 258,290 **** int fac = (int)cam.calcFactor(); Project.getInstance().getCurrentCamera().setFactor(fac); ! glv.setFactor(fac); ! glv.enableFactor(); ! glv.repaint(); } } }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); if (cam.getType() != Camera.PERSPECTIVE) { cam.setType(Camera.PERSPECTIVE); ! glv.disableFactor(); cam.invertFactor(); ! glv.repaint(); } } }; ! Action topAction = new ToolAction(glv, 0, "xyicon.png") { public void actionPerformed(ActionEvent arg0) { Camera.makeTop(Project.getInstance().getCurrentCamera()); ! glv.repaint(); } }; Toolbar.getInstance().registerPushButtonAction(topAction, "See from above"); ! Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { ! double aspect = glv.getView().getAspect(); if (Selection.primary().isEmpty()) { List list = new LinkedList(); --- 258,290 ---- int fac = (int)cam.calcFactor(); Project.getInstance().getCurrentCamera().setFactor(fac); ! editor.setFactor(fac); ! editor.enableFactor(); ! editor.repaint(); } } }; ! Action perspAction = new ToolAction(editor, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { Camera cam = Project.getInstance().getCurrentCamera(); if (cam.getType() != Camera.PERSPECTIVE) { cam.setType(Camera.PERSPECTIVE); ! editor.disableFactor(); cam.invertFactor(); ! editor.repaint(); } } }; ! Action topAction = new ToolAction(editor, 0, "xyicon.png") { public void actionPerformed(ActionEvent arg0) { Camera.makeTop(Project.getInstance().getCurrentCamera()); ! editor.repaint(); } }; Toolbar.getInstance().registerPushButtonAction(topAction, "See from above"); ! Action zoomAction = new ToolAction(editor, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { ! double aspect = editor.getView().getAspect(); if (Selection.primary().isEmpty()) { List list = new LinkedList(); *************** *** 294,298 **** Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect); } ! this.glv.repaint(); } }; --- 294,298 ---- Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect); } ! this.editor.repaint(); } }; *************** *** 315,324 **** /** * Get the factory ! * @param glv The GLView * @return The factory */ ! public static synchronized ToolFactory getFactory(Editor glv) { if (factory == null) { ! factory = new ToolFactory(glv); } return factory; --- 315,324 ---- /** * Get the factory ! * @param editor The GLView * @return The factory */ ! public static synchronized ToolFactory getFactory(Editor editor) { if (factory == null) { ! factory = new ToolFactory(editor); } return factory; *************** *** 358,362 **** public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { tools.put(new Integer(key), tool); ! ToolAction action = new ToolAction(glv, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); --- 358,362 ---- public JToggleButton registerTool(int key, Tool tool, String iconname, String tooltip) { tools.put(new Integer(key), tool); ! ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); button.setToolTipText(tooltip); *************** *** 401,405 **** /** glv */ ! protected Editor glv; /** key */ --- 401,405 ---- /** glv */ ! protected Editor editor; /** key */ *************** *** 408,417 **** /** * Constructor ! * @param glv GLView * @param key Key * @param iconname Iconname */ ! public ToolAction(Editor glv, int key, String iconname) { ! this.glv = glv; this.key = key; ClassLoader cl = Thread.currentThread().getContextClassLoader(); --- 408,417 ---- /** * Constructor ! * @param editor GLView * @param key Key * @param iconname Iconname */ ! public ToolAction(Editor editor, int key, String iconname) { ! this.editor = editor; this.key = key; ClassLoader cl = Thread.currentThread().getContextClassLoader(); *************** *** 425,429 **** */ public void actionPerformed(ActionEvent event) { ! glv.changeTool(key); } } --- 425,429 ---- */ public void actionPerformed(ActionEvent event) { ! editor.changeTool(key); } } Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** SelectTool.java 18 Nov 2007 20:32:47 -0000 1.67 --- SelectTool.java 18 Nov 2007 21:30:17 -0000 1.68 *************** *** 11,15 **** import java.awt.Cursor; import java.awt.event.MouseEvent; - import org.apache.log4j.Logger; /** --- 11,14 ---- *************** *** 17,30 **** */ public class SelectTool extends AbstractTool { - /** The logger */ - private static Logger log = Logger.getLogger(SelectTool.class); - /** * The constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public SelectTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 16,26 ---- */ public class SelectTool extends AbstractTool { /** * The constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public SelectTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ExtrusionTool.java 18 Nov 2007 20:32:47 -0000 1.71 --- ExtrusionTool.java 18 Nov 2007 21:30:17 -0000 1.72 *************** *** 76,84 **** /** * Constructor ! * @param glv GLVIew * @param cursor Cursor */ ! public ExtrusionTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 76,84 ---- /** * Constructor ! * @param editor GLVIew * @param cursor Cursor */ ! public ExtrusionTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 167,172 **** protected void moved(MouseEvent e) { if (extrudesurface != null) { ! glv.getView().removeTempVertex(to); ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex normal = extrudesurface.normal(); ontoPlane = null; --- 167,172 ---- protected void moved(MouseEvent e) { if (extrudesurface != null) { ! editor.getView().removeTempVertex(to); ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Vertex normal = extrudesurface.normal(); ontoPlane = null; *************** *** 190,194 **** Vertex cross = normal.cross(n); if (cross.isZero()) { ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), surface.plane()); current = new Intersection(to, Intersection.SURFACE, surface); calcDistCallExtrude(to, from, normal); --- 190,194 ---- Vertex cross = normal.cross(n); if (cross.isZero()) { ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), surface.plane()); current = new Intersection(to, Intersection.SURFACE, surface); calcDistCallExtrude(to, from, normal); *************** *** 199,203 **** calcDistCallExtrude(to, from, normal); } else { ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), ontoPlane); current = new Intersection(to, Intersection.PLANE_INTERSECTION, ontoPlane); extrudeOnto(ontoPlane, all, false); --- 199,203 ---- calcDistCallExtrude(to, from, normal); } else { ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), ontoPlane); current = new Intersection(to, Intersection.PLANE_INTERSECTION, ontoPlane); extrudeOnto(ontoPlane, all, false); *************** *** 240,248 **** } float[] color = targetColor(current); ! glv.getView().addTempVertex(to); ! glv.getView().changeColor(to, color); } } else if (extrudeEdges != null) { ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Set<Geometric> elements = new HashSet<Geometric>(extrudeEdges); if (extrusion != null) { --- 240,248 ---- } float[] color = targetColor(current); ! editor.getView().addTempVertex(to); ! editor.getView().changeColor(to, color); } } else if (extrudeEdges != null) { ! to = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); Set<Geometric> elements = new HashSet<Geometric>(extrudeEdges); if (extrusion != null) { *************** *** 288,294 **** findTarget(e); if (target instanceof Surface) { ! glv.getView().makeTarget(target); } else if (target == null) { ! glv.getView().makeTarget(null); } active = true; --- 288,294 ---- findTarget(e); if (target instanceof Surface) { ! editor.getView().makeTarget(target); } else if (target == null) { ! editor.getView().makeTarget(null); } active = true; *************** *** 363,367 **** startx = e.getX(); starty = e.getY(); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = startx; --- 363,367 ---- startx = e.getX(); starty = e.getY(); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = startx; *************** *** 381,385 **** startx = e.getX(); starty = e.getY(); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = startx; --- 381,385 ---- startx = e.getX(); starty = e.getY(); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = startx; *************** *** 484,488 **** */ public void cleanUp() { ! glv.getView().removeTempVertex(to); all = false; dragplane = null; --- 484,488 ---- */ public void cleanUp() { ! editor.getView().removeTempVertex(to); all = false; dragplane = null; Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** AbstractPencil.java 18 Nov 2007 20:32:47 -0000 1.99 --- AbstractPencil.java 18 Nov 2007 21:30:17 -0000 1.100 *************** *** 134,142 **** /** * Constructor ! * @param glv GLView * @param cursor Cursor */ ! public AbstractPencil(Editor glv, Cursor cursor) { ! super(glv, cursor); timer = new Timer(500, new TargetAction()); timer.setRepeats(false); --- 134,142 ---- /** * Constructor ! * @param editor GLView * @param cursor Cursor */ ! public AbstractPencil(Editor editor, Cursor cursor) { ! super(editor, cursor); timer = new Timer(500, new TargetAction()); timer.setRepeats(false); *************** *** 173,177 **** Intersection intersection = null; ! Transformation transformation = glv.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); --- 173,177 ---- Intersection intersection = null; ! Transformation transformation = editor.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); *************** *** 233,237 **** intersection = ! (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, View.INTERSECTIONS, work); --- 233,237 ---- intersection = ! (Intersection) editor.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, View.INTERSECTIONS, work); *************** *** 284,290 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().addTempConstructor((Constructor) o); } } --- 284,290 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().addTempConstructor((Constructor) o); } } *************** *** 299,305 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().removeTempConstructor((Constructor) o); } } --- 299,305 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().removeTempConstructor((Constructor) o); } } *************** *** 325,331 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().addTempConstructor((Constructor) o); } } --- 325,331 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().addTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().addTempConstructor((Constructor) o); } } *************** *** 340,346 **** Object o = iter.next(); if (o instanceof Edge) { ! glv.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! glv.getView().removeTempConstructor((Constructor) o); } } --- 340,346 ---- Object o = iter.next(); if (o instanceof Edge) { ! editor.getView().removeTempEdge((Edge) o); } else if (o instanceof Constructor) { ! editor.getView().removeTempConstructor((Constructor) o); } } *************** *** 365,369 **** while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! glv.getView().addTempVertex(current); } } --- 365,369 ---- while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! editor.getView().addTempVertex(current); } } *************** *** 376,380 **** while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! glv.getView().removeTempVertex(current); } } --- 376,380 ---- while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); ! editor.getView().removeTempVertex(current); } } *************** *** 609,613 **** } updateConstructors(); ! glv.repaint(); } --- 609,613 ---- } updateConstructors(); ! editor.repaint(); } *************** *** 623,637 **** Vertex targetVertex = intersection.vertex(); float[] targetColor = targetColor(intersection); ! glv.getView().removeTempVertex(lockSnapVertex); ! glv.getView().clearColor(lockSnapVertex); ! glv.getView().removeTempEdge(lockEdgeExtention); ! glv.getView().removeTempEdge(lockHighlightEdge); ! glv.getView().clearStyle(lockHighlightEdge); if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); lockSnapVertex = actual.vertex().copy(); targetColor = targetColor(actual); ! glv.getView().addTempVertex(lockSnapVertex); ! glv.getView().changeColor(lockSnapVertex, targetColor); if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); --- 623,637 ---- Vertex targetVertex = intersection.vertex(); float[] targetColor = targetColor(intersection); ! editor.getView().removeTempVertex(lockSnapVertex); ! editor.getView().clearColor(lockSnapVertex); ! editor.getView().removeTempEdge(lockEdgeExtention); ! editor.getView().removeTempEdge(lockHighlightEdge); ! editor.getView().clearStyle(lockHighlightEdge); if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); lockSnapVertex = actual.vertex().copy(); targetColor = targetColor(actual); ! editor.getView().addTempVertex(lockSnapVertex); ! editor.getView().changeColor(lockSnapVertex, targetColor); if (lockingEdge != null) { EdgeAttributes ea = new EdgeAttributes(); *************** *** 641,646 **** if (FALSE) { ! glv.getView().addTempEdge(lockHighlightEdge); ! glv.getView().changeEdgeStyle(lockHighlightEdge, ea); } --- 641,646 ---- if (FALSE) { ! editor.getView().addTempEdge(lockHighlightEdge); ! editor.getView().changeEdgeStyle(lockHighlightEdge, ea); } *************** *** 655,659 **** } lockEdgeExtention.setStrippled(true); ! glv.getView().addTempEdge(lockEdgeExtention); } } --- 655,659 ---- } lockEdgeExtention.setStrippled(true); ! editor.getView().addTempEdge(lockEdgeExtention); } } *************** *** 661,668 **** if (actual.type() == Intersection.PLANE_INTERSECTION) { target = null; ! glv.getView().removeTempVertex(lockSnapVertex); ! glv.getView().clearColor(lockSnapVertex); } ! glv.getView().makeTarget(target, targetColor); } } --- 661,668 ---- if (actual.type() == Intersection.PLANE_INTERSECTION) { target = null; ! editor.getView().removeTempVertex(lockSnapVertex); ! editor.getView().clearColor(lockSnapVertex); } ! editor.getView().makeTarget(target, targetColor); } } *************** *** 795,800 **** lockingEdge = null; lockingPlane = null; ! glv.getView().removeTempVertex(lockSnapVertex); ! glv.getView().clearColor(lockSnapVertex); lockSnapVertex = null; constructors(new LinkedList()); --- 795,800 ---- lockingEdge = null; lockingPlane = null; ! editor.getView().removeTempVertex(lockSnapVertex); ! editor.getView().clearColor(lockSnapVertex); lockSnapVertex = null; constructors(new LinkedList()); *************** *** 807,811 **** dragging = false; setTip(initialTip()); ! glv.repaint(); super.cleanUp(); } --- 807,811 ---- dragging = false; setTip(initialTip()); ! editor.repaint(); super.cleanUp(); } Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** EraserTool.java 18 Nov 2007 20:32:47 -0000 1.11 --- EraserTool.java 18 Nov 2007 21:30:17 -0000 1.12 *************** *** 27,35 **** /** * Constructor fo EraserTool ! * @param glv The GLView * @param cursor The Cursor */ ! public EraserTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 27,35 ---- /** * Constructor fo EraserTool ! * @param editor The GLView * @param cursor The Cursor */ ! public EraserTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 41,47 **** findTarget(e); if (relevant(target)) { ! glv.getView().makeTarget(target); } else { ! glv.getView().makeTarget(null); } } --- 41,47 ---- findTarget(e); if (relevant(target)) { ! editor.getView().makeTarget(target); } else { ! editor.getView().makeTarget(null); } } *************** *** 64,68 **** Project.getInstance().changed(target); target = null; ! glv.getView().makeTarget(null); Project.getInstance().checkpoint(); } --- 64,68 ---- Project.getInstance().changed(target); target = null; ! editor.getView().makeTarget(null); Project.getInstance().checkpoint(); } Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** MoveTool.java 18 Nov 2007 20:32:47 -0000 1.75 --- MoveTool.java 18 Nov 2007 21:30:17 -0000 1.76 *************** *** 53,61 **** /** * Constructor for MoveTool ! * @param glv The GLView * @param cursor The Cursor */ ! public MoveTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 53,61 ---- /** * Constructor for MoveTool ! * @param editor The GLView * @param cursor The Cursor */ ! public MoveTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 125,129 **** if (Selection.primary().isEmpty()) { findTarget(e, View.HANDLES); ! glv.getView().makeTarget(target); } else { current = findIntersection(e); --- 125,129 ---- if (Selection.primary().isEmpty()) { findTarget(e, View.HANDLES); ! editor.getView().makeTarget(target); } else { current = findIntersection(e); Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** RotationTool.java 18 Nov 2007 20:32:47 -0000 1.31 --- RotationTool.java 18 Nov 2007 21:30:17 -0000 1.32 *************** *** 65,73 **** /** * The Constructor ! * @param glv The 3D canvas * @param cursor The cursor */ ! public RotationTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 65,73 ---- /** * The Constructor ! * @param editor The 3D canvas * @param cursor The cursor */ ! public RotationTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 118,122 **** if (p1 != null && p2 != null && from != null && current != null) { angle = Math.toDegrees(totalAngle); ! glv.setLengthValue(MessageFormat.format("{0,number,###.##}", new Object[]{new Double(Math.round(angle * 100.0) / 100.0)})); } --- 118,122 ---- if (p1 != null && p2 != null && from != null && current != null) { angle = Math.toDegrees(totalAngle); ! editor.setLengthValue(MessageFormat.format("{0,number,###.##}", new Object[]{new Double(Math.round(angle * 100.0) / 100.0)})); } *************** *** 185,189 **** log.info("Disk were: " + onto); pro = new GlProtractor(onto, p1); ! glv.getView().addGlObjects3D(pro); setTip(thirdClickTip()); } --- 185,189 ---- log.info("Disk were: " + onto); pro = new GlProtractor(onto, p1); ! editor.getView().addGlObjects3D(pro); setTip(thirdClickTip()); } *************** *** 277,281 **** from = null; onto = null; ! glv.getView().removeGlObjects3D(pro); pro = null; previous = null; --- 277,281 ---- from = null; onto = null; ! editor.getView().removeGlObjects3D(pro); pro = null; previous = null; Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ArcTool.java 18 Nov 2007 20:32:47 -0000 1.21 --- ArcTool.java 18 Nov 2007 21:30:17 -0000 1.22 *************** *** 167,175 **** /** * Constructor ! * @param glv GLView * @param cursor Cursor */ ! public ArcTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 167,175 ---- /** * Constructor ! * @param editor GLView * @param cursor Cursor */ ! public ArcTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ControlledMoveTool.java 18 Nov 2007 20:32:47 -0000 1.11 --- ControlledMoveTool.java 18 Nov 2007 21:30:17 -0000 1.12 *************** *** 44,52 **** /** * ControlledMoveTool ! * @param glv GLView * @param cursor Cursor */ ! public ControlledMoveTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 44,52 ---- /** * ControlledMoveTool ! * @param editor GLView * @param cursor Cursor */ ! public ControlledMoveTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 213,217 **** double startx = e.getX(); double starty = e.getY(); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = startx; --- 213,217 ---- double startx = e.getX(); double starty = e.getY(); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = startx; Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TapeMeasure.java 18 Nov 2007 20:32:47 -0000 1.6 --- TapeMeasure.java 18 Nov 2007 21:30:17 -0000 1.7 *************** *** 37,45 **** /** * Constructor ! * @param glv GLView * @param cursor Cursor */ ! public TapeMeasure(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 37,45 ---- /** * Constructor ! * @param editor GLView * @param cursor Cursor */ ! public TapeMeasure(Editor editor, Cursor cursor) { ! super(editor, cursor); } Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** SpaceTool.java 18 Nov 2007 20:32:47 -0000 1.92 --- SpaceTool.java 18 Nov 2007 21:30:17 -0000 1.93 *************** *** 47,55 **** /** * Construct the SpaceTool ! * @param glv The GLView * @param cursor The cursor */ ! public SpaceTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 47,55 ---- /** * Construct the SpaceTool ! * @param editor The GLView * @param cursor The cursor */ ! public SpaceTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 60,64 **** @Override protected void pressed(MouseEvent e) { ! glv.setLengthValue(""); typing = false; boolean done = false; --- 60,64 ---- @Override protected void pressed(MouseEvent e) { ! editor.setLengthValue(""); typing = false; boolean done = false; *************** *** 80,84 **** } if (menu != null) { ! glv.popup(menu, e.getX(), e.getY()); } done = true; --- 80,84 ---- } if (menu != null) { ! editor.popup(menu, e.getX(), e.getY()); } done = true; *************** *** 89,93 **** if (target instanceof String) { String side = (String)target; ! glv.popup(makeSpaceMenu(side), e.getX(), e.getY()); } --- 89,93 ---- if (target instanceof String) { String side = (String)target; ! editor.popup(makeSpaceMenu(side), e.getX(), e.getY()); } *************** *** 136,143 **** shift.addActionListener(shiftListener); JMenuItem copy = new JMenuItem("Copy space assignment"); ! ActionListener copyListener = new CopyActionListener(surface, glv.getView()); copy.addActionListener(copyListener); JMenuItem paste = new JMenuItem("Paste space assignment"); ! ActionListener pasteListener = new PasteActionListener(surface, glv.getView()); paste.addActionListener(pasteListener); --- 136,143 ---- shift.addActionListener(shiftListener); JMenuItem copy = new JMenuItem("Copy space assignment"); ! ActionListener copyListener = new CopyActionListener(surface, editor.getView()); copy.addActionListener(copyListener); JMenuItem paste = new JMenuItem("Paste space assignment"); ! ActionListener pasteListener = new PasteActionListener(surface, editor.getView()); paste.addActionListener(pasteListener); *************** *** 160,164 **** private JPopupMenu spacePopup(String side) { JPopupMenu menu = new JPopupMenu(side); ! SpacePopupListener spl = new SpacePopupListener(side.equals("front"), glv.getView()); --- 160,164 ---- private JPopupMenu spacePopup(String side) { JPopupMenu menu = new JPopupMenu(side); ! SpacePopupListener spl = new SpacePopupListener(side.equals("front"), editor.getView()); *************** *** 230,234 **** public void actionPerformed(ActionEvent arg0) { if (space != null) { ! glv.getView().makeTarget(null); Selection.primary().set(space); } --- 230,234 ---- public void actionPerformed(ActionEvent arg0) { if (space != null) { ! editor.getView().makeTarget(null); Selection.primary().set(space); } *************** *** 241,245 **** if (space != null) { Selection.primary().clear(); ! glv.getView().makeTarget(null); space.edit(); } --- 241,245 ---- if (space != null) { Selection.primary().clear(); ! editor.getView().makeTarget(null); space.edit(); } *************** *** 319,323 **** Selection.primary().add(s); } else { ! glv.setLengthValue(result.toString()); } } --- 319,323 ---- Selection.primary().add(s); } else { ! editor.setLengthValue(result.toString()); } } Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CameraFlyTool.java 18 Nov 2007 20:32:47 -0000 1.12 --- CameraFlyTool.java 18 Nov 2007 21:30:17 -0000 1.13 *************** *** 27,35 **** /** * Constructor ! * @param glv The 3D canvas * @param cursor the cursor */ ! public CameraFlyTool(Editor glv, Cursor cursor) { ! super(glv, cursor); dragDelay = 0; } --- 27,35 ---- /** * Constructor ! * @param editor The 3D canvas * @param cursor the cursor */ ! public CameraFlyTool(Editor editor, Cursor cursor) { ! super(editor, cursor); dragDelay = 0; } Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AltMoveTool.java 18 Nov 2007 20:32:47 -0000 1.14 --- AltMoveTool.java 18 Nov 2007 21:30:17 -0000 1.15 *************** *** 43,51 **** /** ! * @param glv GLView * @param cursor Cursor */ ! public AltMoveTool(Editor glv, Cursor cursor) { ! super(glv, cursor); } --- 43,51 ---- /** ! * @param editor GLView * @param cursor Cursor */ ! public AltMoveTool(Editor editor, Cursor cursor) { ! super(editor, cursor); } *************** *** 84,90 **** if (system == null) { findTarget(e, View.OBJECTS); ! glv.getView().makeTarget(target); } else { ! Vertex hit = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); current = new Intersection(hit, Intersection.SURFACE, null); Vertex from = start.vertex(); --- 84,90 ---- if (system == null) { findTarget(e, View.OBJECTS); ! editor.getView().makeTarget(target); } else { ! Vertex hit = editor.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); current = new Intersection(hit, Intersection.SURFACE, null); Vertex from = start.vertex(); *************** *** 108,112 **** if (system == null) { findTarget(e, View.OBJECTS); ! glv.getView().makeTarget(target); if (target instanceof Surface) { surface = (Surface) target; --- 108,112 ---- if (system == null) { findTarget(e, View.OBJECTS); ! editor.getView().makeTarget(target); if (target instanceof Surface) { surface = (Surface) target; *************** *** 136,141 **** start = new Intersection(origin, Intersection.SURFACE, null); makeTarget(start); ! glv.getView().addTempConstructor(system); ! View view = glv.getView(); Transformation trans = view.transformation(); double x = e.getX(); --- 136,141 ---- start = new Intersection(origin, Intersection.SURFACE, null); makeTarget(start); ! editor.getView().addTempConstructor(system); ! View view = editor.getView(); Transformation trans = view.transformation(); double x = e.getX(); *************** *** 161,165 **** move(origin); } ! glv.getView().removeTempConstructor(system); surface = null; system = null; --- 161,165 ---- move(origin); } ! editor.getView().removeTempConstructor(system); surface = null; system = null; Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RelationTool.java 18 Nov 2007 20:32:47 -0000 1.6 --- RelationTool.java 18 Nov 2007 21:30:17 -0000 1.7 *************** *** 35,43 **** /** * Constructor for Pencil ! * @param glv GLView * @param cursor Cursor */ ! public RelationTool(Editor glv, Cursor cursor) { ! super(glv, cursor); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bcursorremove.gif"); --- 35,43 ---- /** * Constructor for Pencil ! * @param editor GLView * @param cursor Cursor */ ! public RelationTool(Editor editor, Cursor cursor) { ! super(editor, cursor); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource("Bcursorremove.gif"); *************** *** 71,75 **** current = findIntersection(e); findTarget(e, elements); ! glv.getView().makeTarget(target); if (current != null) { updateFeedback(); --- 71,75 ---- current = findIntersection(e); findTarget(e, elements); ! editor.getView().makeTarget(target); if (current != null) { updateFeedback(); *************** *** 123,127 **** } updateFeedback(); ! glv.repaint(); } } --- 123,127 ---- } updateFeedback(); ! editor.repaint(); } } Index: PanStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanStrategy.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PanStrategy.java 18 Nov 2007 20:32:47 -0000 1.4 --- PanStrategy.java 18 Nov 2007 21:30:17 -0000 1.5 *************** *** 23,27 **** /** The GLView */ ! private Editor glv; /** The x */ --- 23,27 ---- /** The GLView */ ! private Editor editor; /** The x */ *************** *** 34,41 **** /** * Constructor ! * @param glv GLView */ ! public PanStrategy(Editor glv) { ! this.glv = glv; } --- 34,41 ---- /** * Constructor ! * @param editor GLView */ ! public PanStrategy(Editor editor) { ! this.editor = editor; } *************** *** 61,65 **** */ public void dragged(MouseEvent e) { ! View view = glv.getView(); Camera c = Project.getInstance().getCurrentCamera(); double[] center = c.getCenter(); --- 61,65 ---- */ public void dragged(MouseEvent e) { ! View view = editor.getView(); Camera c = Project.getInstance().getCurrentCamera(); double[] center = c.getCenter(); Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ControlledExtrudeTool.java 18 Nov 2007 20:32:47 -0000 1.9 --- ControlledExtrudeTool.java 18 Nov 2007 21:30:17 -0000 1.10 *************** *** 56,64 **** /** * Tool constructor ! * @param glv The view to work in * @param cursor The cursor to use */ ! public ControlledExtrudeTool(Editor glv, Cursor cursor) { ! super(glv, cursor); extrusion = new HashSet<Surface>(); affected = new HashSet<Surface>(); --- 56,64 ---- /** * Tool constructor ! * @param editor The view to work in * @param cursor The cursor to use */ ! public ControlledExtrudeTool(Editor editor, Cursor cursor) { ! super(editor, cursor); extrusion = new HashSet<Surface>(); affected = new HashSet<Surface>(); *************** *** 79,83 **** @Override protected void moved(MouseEvent e) { ! glv.getView().makeTarget(null); ArrayList<Surface> starter = new ArrayList<Surface>(); if (topSurface != pressedSurface) { --- 79,83 ---- @Override protected void moved(MouseEvent e) { ! editor.getView().makeTarget(null); ArrayList<Surface> starter = new ArrayList<Surface>(); if (topSurface != pressedSurface) { *************** *** 90,94 **** Vertex far = new Vertex(x, y, 1.0); Edge ray = new Edge(near, far); ! Transformation transformation = glv.getView().transformation(); ray = transformation.unProject(ray); --- 90,94 ---- Vertex far = new Vertex(x, y, 1.0); Edge ray = new Edge(near, far); ! Transformation transformation = editor.getView().transformation(); ray = transformation.unProject(ray); *************** *** 96,100 **** // If the extrusion havn't started yet if (target instanceof Surface) { ! glv.getView().makeTarget(target); current = new Intersection(((Surface)target).intersection(ray), Intersection.SURFACE, target); --- 96,100 ---- // If the extrusion havn't started yet if (target instanceof Surface) { ! editor.getView().makeTarget(target); current = new Intersection(((Surface)target).intersection(ray), Intersection.SURFACE, target); *************** *** 199,203 **** start = current; pressedSurface = (Surface)target; ! Transformation transformation = glv.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); --- 199,203 ---- start = current; pressedSurface = (Surface)target; ! Transformation transformation = editor.getView().transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** AbstractTool.java 18 Nov 2007 20:32:47 -0000 1.137 --- AbstractTool.java 18 Nov 2007 21:30:17 -0000 1.138 *************** *** 123,127 **** /** The 3DView */ ! protected Editor glv = null; /** the object corresponding to the mouse */ --- 123,127 ---- /** The 3DView */ ! protected Editor editor = null; /** the object corresponding to the mouse */ *************** *** 160,178 **** /** * KeyListener for the GL Canvas ! * @param glv The 3D canvas * @param cursor The cursor */ ! public AbstractTool(Editor glv, Cursor cursor) { ! this.glv = glv; this.cursor = cursor; if (pan == null) { ! pan = new PanStrategy(glv); } if (select == null) { ! select = new SelectStrategy(glv); } if (orbit == null) { ! orbit = new OrbitStrategy(glv); } } --- 160,178 ---- /** * KeyListener for the GL Canvas ! * @param editor The 3D canvas * @param cursor The cursor */ ! public AbstractTool(Editor editor, Cursor cursor) { ! this.editor = editor; this.cursor = cursor; if (pan == null) { ! pan = new PanStrategy(editor); } if (select == null) { ! select = new SelectStrategy(editor); } if (orbit == null) { ! orbit = new OrbitStrategy(editor); } } *************** *** 183,187 **** protected void setActiveStrategy(Strategy which) { Tool tool = null; ! ToolFactory factory = ToolFactory.getFactory(glv); if (which == AbstractTool.pan) { tool = factory.get(Tool.PAN_TOOL); --- 183,187 ---- protected void setActiveStrategy(Strategy which) { Tool tool = null; ! ToolFactory factory = ToolFactory.getFactory(editor); if (which == AbstractTool.pan) { tool = factory.get(Tool.PAN_TOOL); *************** *** 200,204 **** tool = this; } ! glv.setCursor(tool.getCursor()); activeStrategy = which; } --- 200,204 ---- tool = this; } ! editor.setCursor(tool.getCursor()); activeStrategy = which; } *************** *** 224,229 **** cam.zoomin(); } ! glv.setFactor((int)cam.getFactor()); ! glv.repaint(false); } --- 224,229 ---- cam.zoomin(); } ! editor.setFactor((int)cam.getFactor()); ! editor.repaint(false); } *************** *** 251,255 **** */ public void setTip(String tip) { ! glv.setTip(tip); } --- 251,255 ---- */ public void setTip(String tip) { ! editor.setTip(tip); } *************** *** 260,264 **** public void setLength(double value) { int mm = (int) (value * 1000.0); ! glv.setLengthValue(Integer.toString(mm)); typing = false; } --- 260,264 ---- public void setLength(double value) { int mm = (int) (value * 1000.0); ! editor.setLengthValue(Integer.toString(mm)); typing = false; } *************** *** 268,272 **** */ public void clearLength() { ! glv.setLengthValue(""); } --- 268,272 ---- */ public void clearLength() { ! editor.setLengthValue(""); } *************** *** 275,279 **** */ public void clearTip() { ! glv.setTip(""); } --- 275,279 ---- */ public void clearTip() { ! editor.setTip(""); } *************** *** 306,316 **** if (e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = true; ! glv.setCursor(metaCursor); return; } if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_META) { setActiveStrategy(AbstractTool.select); ! glv.getView().makeTarget(null); ! glv.repaint(); return; } --- 306,316 ---- if (e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = true; ! editor.setCursor(metaCursor); return; } if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_META) { setActiveStrategy(AbstractTool.select); ! editor.getView().makeTarget(null); ! editor.repaint(); return; } *************** *** 343,354 **** Collection cams = Project.getInstance().getCameras(); Iterator it = cams.iterator(); ! glv.getView().removeGlObjects3D(glCams); glCams.clear(); while (it.hasNext()) { glCams.add(new GlCamera((Camera)it.next())); } ! glv.getView().addGlObjects3D(glCams); } ! glv.repaint(true); } --- 343,354 ---- Collection cams = Project.getInstance().getCameras(); Iterator it = cams.iterator(); ! editor.getView().removeGlObjects3D(glCams); glCams.clear(); while (it.hasNext()) { glCams.add(new GlCamera((Camera)it.next())); } ! editor.getView().addGlObjects3D(glCams); } ! editor.repaint(true); } *************** *** 363,370 **** if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; ! glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_S) { ! glv.getView().removeGlObjects3D(glCams); glCams.clear(); } --- 363,370 ---- if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; ! editor.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_S) { ! editor.getView().removeGlObjects3D(glCams); glCams.clear(); } *************** *** 404,408 **** previousPos[0] = x; previousPos[1] = y; ! glv.repaint(true); } --- 404,408 ---- previousPos[0] = x; previousPos[1] = y; ! editor.repaint(true); } *************** *** 424,428 **** previousPos[0] = x; previousPos[1] = y; ! glv.repaint(true); } --- 424,428 ---- previousPos[0] = x; previousPos[1] = y; ! editor.repaint(true); } *************** *** 462,466 **** previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; ! target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { setActiveStrategy(AbstractTool.pan); --- 462,466 ---- previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; ! target = editor.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { setActiveStrategy(AbstractTool.pan); *************** *** 479,483 **** } } ! glv.repaint(true); } --- 479,483 ---- } } ! editor.repaint(true); } *************** *** 496,500 **** setActiveStrategy(null); } ! glv.repaint(true); } --- 496,500 ---- setActiveStrategy(null); } ! editor.repaint(true); } *************** *** 508,512 **** while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! glv.getView().addTempEdge(constructor); } } --- 508,512 ---- while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! editor.getView().addTempEdge(constructor); } } *************** *** 522,526 **** while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! glv.getView().removeTempEdge(constructor); } } --- 522,526 ---- while (it.hasNext()) { Edge constructor = (Edge)it.next(); ! editor.getView().removeTempEdge(constructor); } } *************** *** 567,571 **** String value; if (typing) { ! value = glv.getLengthValue(); } else { value = ""; --- 567,571 ---- String value; if (typing... [truncated message content] |