gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] fenfire/org/fenfire demo/buoyoing.py util/Contr...


From: Tuomas J. Lukka
Subject: [Gzz-commits] fenfire/org/fenfire demo/buoyoing.py util/Contr...
Date: Sat, 02 Aug 2003 04:21:47 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/08/02 04:21:47

Modified files:
        org/fenfire/demo: buoyoing.py 
        org/fenfire/util: ControlBinding.java 
        org/fenfire/view/buoy: AbstractMainNode2D.java 
                               FisheyeMainNode2D.java 

Log message:
        Uncompilable due to libvob change. Inching to compilability. Small 
object-oriented change to ControlBinding

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/demo/buoyoing.py.diff?tr1=1.99&tr2=1.100&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/util/ControlBinding.java.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/FisheyeMainNode2D.java.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/demo/buoyoing.py
diff -u fenfire/org/fenfire/demo/buoyoing.py:1.99 
fenfire/org/fenfire/demo/buoyoing.py:1.100
--- fenfire/org/fenfire/demo/buoyoing.py:1.99   Wed Jul 30 06:32:10 2003
+++ fenfire/org/fenfire/demo/buoyoing.py        Sat Aug  2 04:21:47 2003
@@ -326,7 +326,7 @@
     def mouse(self, ev, oldvs):
         if dbg: pa(ev)
 
-        if ev.getID() == ev.MOUSE_RELEASED:
+        if ev.getType() == ev.MOUSE_RELEASED:
             ctrl.removePressState()
             self.context.states.clean()
             w.setCursor('default')
@@ -335,7 +335,7 @@
        #return 0
 
         # ...then see context
-        if ev.getID() != ev.MOUSE_CLICKED:
+        if ev.getType() != ev.MOUSE_CLICKED:
             return 0
         planes = []
         for single in self.mgr.singles:
@@ -355,7 +355,7 @@
 
 
     def buoyMouse(self, mgr, ev, single, link):
-        if ev.getID() != ev.MOUSE_CLICKED:
+        if ev.getType() != ev.MOUSE_CLICKED:
             return 1
 
         if not (ev.getModifiers() in [ev.BUTTON1_MASK, ev.BUTTON3_MASK]):
Index: fenfire/org/fenfire/util/ControlBinding.java
diff -u fenfire/org/fenfire/util/ControlBinding.java:1.10 
fenfire/org/fenfire/util/ControlBinding.java:1.11
--- fenfire/org/fenfire/util/ControlBinding.java:1.10   Tue Jul  1 12:33:33 2003
+++ fenfire/org/fenfire/util/ControlBinding.java        Sat Aug  2 04:21:47 2003
@@ -239,37 +239,42 @@
     
     class Event {
         final public Object obj;
-        final public int mask;
+        final public int modifiers;
+        final public int button;
         final public boolean invert;
         final public float scale;
         final public Object dir;
-        public Event(Object obj, int mask, float scale, 
+        public Event(Object obj, int modifiers, int button, 
+                       float scale, 
                     boolean invert, Object direction) {
             this.obj=obj; this.mask=mask; this.invert=invert; 
            this.scale=scale; this.dir=direction;
         }
+       public boolean matches(VobMouseEvent event) {
+           if(event.getModifiers() == modifiers &&
+               event.getButton() == button) return true;
+           return false;
+       }
     }    
 
 
-    public boolean hasBinding(MouseEvent event) {
-       if (event.getID() == event.MOUSE_PRESSED)
+    public boolean hasBinding(VobMouseEvent event) {
+       if (event.getType() == event.MOUSE_PRESSED)
            return true;
-       else if (event.getID() == event.MOUSE_WHEEL) {
+       else if (event.getType() == event.MOUSE_WHEEL) {
             for (int i=0; i<wheels.size(); i++)
                return true;
         }
-       else if (event.getID() == event.MOUSE_CLICKED) {
+       else if (event.getType() == event.MOUSE_CLICKED) {
            for (int i=0; i<clicks.size(); i++) {
                 Event e = (Event)clicks.get(i);
-               if (event.getModifiers() == e.mask)
-                   return true;
+               if(e.matches(event)) return true;
             }
         } 
-        else if (event.getID() == event.MOUSE_DRAGGED) {
+        else if (event.getType() == event.MOUSE_DRAGGED) {
             for (int i=0; i<drags.size(); i++) {
                 Event e = (Event)drags.get(i);
-                if (event.getModifiers() == e.mask)
-                   return true;
+               if(e.matches(event)) return true;
             }
         }
         return false;
Index: fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java
diff -u fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java:1.36 
fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java:1.37
--- fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java:1.36  Wed Jul 30 
06:32:10 2003
+++ fenfire/org/fenfire/view/buoy/AbstractMainNode2D.java       Sat Aug  2 
04:21:47 2003
@@ -32,8 +32,6 @@
 import org.nongnu.libvob.impl.DefaultVobMatcher;
 import org.nongnu.libvob.buoy.*;
 
-import java.awt.event.MouseEvent;
-
 /** A BuoyViewMainNode showing a 2D plane rendered through
  *  a View2D. This class implements the keyboard and mouse
  *  command for moving on the spatial plane.
@@ -209,7 +207,7 @@
        return false;
     }
 
-    public boolean mouseClickHit(MouseEvent e, VobScene oldVobScene, float[] 
zout) {
+    public boolean mouseClickHit(VobMouseEvent e, VobScene oldVobScene, 
float[] zout) {
        float[] pt = new float[] { e.getX(), e.getY(), 0 };
        float[] sq = new float[2];
        oldVobScene.coords.inverseTransformPoints3(
@@ -263,7 +261,7 @@
        focus.setZoom(zoom);     
     }
 
-    public boolean mouse(MouseEvent e, VobScene oldVobScene) {
+    public boolean mouse(VobMouseEvent e, VobScene oldVobScene) {
        return controller.handleEvent(this, e, oldVobScene);
     }
 
Index: fenfire/org/fenfire/view/buoy/FisheyeMainNode2D.java
diff -u fenfire/org/fenfire/view/buoy/FisheyeMainNode2D.java:1.13 
fenfire/org/fenfire/view/buoy/FisheyeMainNode2D.java:1.14
--- fenfire/org/fenfire/view/buoy/FisheyeMainNode2D.java:1.13   Tue Jul  1 
12:33:33 2003
+++ fenfire/org/fenfire/view/buoy/FisheyeMainNode2D.java        Sat Aug  2 
04:21:47 2003
@@ -33,7 +33,6 @@
 import org.nongnu.libvob.impl.DefaultVobMatcher;
 import org.nongnu.libvob.buoy.*;
 
-import java.awt.event.MouseEvent;
 
 public class FisheyeMainNode2D extends AbstractMainNode2D {
     public static boolean dbg = true;
@@ -103,7 +102,7 @@
     }
     
 
-    public boolean mouse(MouseEvent e, VobScene oldVobScene) {
+    public boolean mouse(VobMouseEvent e, VobScene oldVobScene) {
        if(fisheyeState.event(e)) {
            setZoomPan(oldVobScene, box2screen);
            return true;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]