[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ArcTool.java, 1.9, 1.10
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-07-31 11:29:58
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12672 Modified Files: ArcTool.java Log Message: dragging and length field in arctool Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ArcTool.java 29 Mar 2006 13:18:29 -0000 1.9 --- ArcTool.java 31 Jul 2006 11:29:56 -0000 1.10 *************** *** 28,31 **** --- 28,37 ---- private Intersection end; + /** Wherther or not the arc tool is being dragged */ + private boolean dragging; + + /** Radius of the current arc */ + private double radius = 0; + /** * Update feedback *************** *** 103,107 **** if (inter != null) { Vertex center = inter.getFrom(); ! double radius = 0; double tetra1 = 0; double tetra2 = 0; --- 109,113 ---- if (inter != null) { Vertex center = inter.getFrom(); ! radius = 0; double tetra1 = 0; double tetra2 = 0; *************** *** 134,138 **** edges.add(edge); current = next; ! } } if (debug) { --- 140,144 ---- edges.add(edge); current = next; ! } } if (debug) { *************** *** 202,205 **** --- 208,215 ---- */ protected void dragged(MouseEvent e) { + if (!dragging) { + dragging = true; + } + moved(e); } *************** *** 209,214 **** --- 219,247 ---- */ protected void released(MouseEvent e) { + if (dragging) { + pressed(e); + dragging = false; + } } + + /** + * Update the length field + */ + protected void updateLength() { + if (end == null) { + super.updateLength(); + } else { + glv.setLength(radius); + } + } + + /** + * Clean up + */ + public void cleanUp() { + super.cleanUp(); + end = null; + } } |