Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28668/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
AbstractPencil.java
Log Message:
Moving drag handling to abstractpencil
Index: AbstractPencil.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** AbstractPencil.java 5 Oct 2006 13:06:15 -0000 1.69
--- AbstractPencil.java 10 Oct 2006 14:59:33 -0000 1.70
***************
*** 97,100 ****
--- 97,106 ----
protected Timer timer;
+ /** Wherther or not the tool is doing some work */
+ protected boolean active;
+
+ /** Wherther or not the tool is dragging */
+ protected boolean dragging;
+
/**
* Constructor
***************
*** 107,110 ****
--- 113,117 ----
timer.setRepeats(false);
lock = false;
+ active = false;
plane = new Plane (0, 0, 1, 0);
}
***************
*** 618,621 ****
--- 625,650 ----
/**
+ * handles dragging
+ * @param e the mouseevent
+ */
+ protected void dragged(MouseEvent e) {
+ if (!dragging && active) {
+ dragging = true;
+ }
+ moved(e);
+ }
+
+ /**
+ * handles mouse-released
+ *@param e the mouseevent
+ */
+ protected void released(MouseEvent e) {
+ if (dragging) {
+ dragging = false;
+ pressed(e);
+ }
+ }
+
+ /**
* onVertex - current vertex is pressed
*/
***************
*** 772,775 ****
--- 801,806 ----
glv.repaint();
timer.stop();
+ active = false;
+ dragging = false;
super.cleanUp();
}
|