gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob org/nongnu/libvob/impl/gl/GLScreen.java ...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob org/nongnu/libvob/impl/gl/GLScreen.java ...
Date: Fri, 16 May 2003 10:00:37 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/05/16 10:00:36

Modified files:
        org/nongnu/libvob/impl/gl: GLScreen.java 
        vob/buoy       : buoymanager.py 

Log message:
        Mouse wheel events

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/impl/gl/GLScreen.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/buoy/buoymanager.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: libvob/org/nongnu/libvob/impl/gl/GLScreen.java
diff -u libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.4 
libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.5
--- libvob/org/nongnu/libvob/impl/gl/GLScreen.java:1.4  Fri May 16 07:02:41 2003
+++ libvob/org/nongnu/libvob/impl/gl/GLScreen.java      Fri May 16 10:00:36 2003
@@ -29,6 +29,7 @@
 import java.awt.Cursor;
 
 import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
 import java.awt.event.InputEvent;
 
 import java.util.HashMap;
@@ -36,7 +37,7 @@
 import org.nongnu.libvob.gl.*;
 
 public class GLScreen extends GLRenderingSurface implements GraphicsAPI.Window 
{
-public static final String rcsid = "$Id: GLScreen.java,v 1.4 2003/05/16 
11:02:41 humppake Exp $";
+public static final String rcsid = "$Id: GLScreen.java,v 1.5 2003/05/16 
14:00:36 tjl Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -109,6 +110,22 @@
            }
 
            public void mouse(int x, int y, int button, int what) {
+               // Handle mouse wheel.
+               if(button == 4 || button == 5) {
+                   int r = (button == 4 ? 1 : -1);
+                   MouseWheelEvent ev = new MouseWheelEvent(fakeSource,
+                           MouseWheelEvent.MOUSE_WHEEL,
+                           0,
+                           0,
+                           x, y,
+                           1,
+                           false,
+                           MouseWheelEvent.WHEEL_UNIT_SCROLL,
+                           r, r);
+                   binder.mouse(ev);
+                   return;
+               }
+
                if(dbg) pa("GLScreen mouseEvent: "+x+" "+y+" "+button+" "+what);
                MouseEvent ev = null;
                switch(what) {
Index: libvob/vob/buoy/buoymanager.py
diff -u libvob/vob/buoy/buoymanager.py:1.17 libvob/vob/buoy/buoymanager.py:1.18
--- libvob/vob/buoy/buoymanager.py:1.17 Fri May 16 08:14:29 2003
+++ libvob/vob/buoy/buoymanager.py      Fri May 16 10:00:36 2003
@@ -23,7 +23,7 @@
 from __future__ import nested_scopes
 import jarray
 
-import org.nongnu.libvob as vob
+import vob
 from org.nongnu.libvob.buoy import BuoyLinkListener
 
 from vob.putil.misc import *
@@ -213,7 +213,8 @@
                    nadirCS)
 
     def mouse(self, ev):
-       # print ev
+       if self.geometer.mouse(ev, self.vs):
+           return 
        x, y = ev.getX(), ev.getY()
        cs = self.vs.getCSAt(0, x, y, None)
        for single in self.singles:
@@ -244,6 +245,8 @@
                return
 
 
+vob.impl.gl.GLScreen.dbg = 1
+
 class SingleGeometer:
     def place(self, vs):
        ctrx = vs.size.width / 2
@@ -263,74 +266,6 @@
                                    buoywidth, buoyheight)
 
        return [(into, buoyinto)]
-
-
-class RealBuoyManager:
-
-    def __init__(self, mainNode, connectors):
-       self.single = SingleFocusManager(mainNode, connectors)
-       self.replaceScene = None
-
-    def key(self, key):
-        if key == "Print":
-            saveanim.saveframe("buoyoing.png", w)
-       else:
-           self.single.mainNode.keystroke(key)
-            
-       vob.AbstractUpdateManager.chg()
-       pass
-
-    def mouse(self, ev):
-       # print ev
-       x, y = ev.getX(), ev.getY()
-       cs = self.vs.getCSAt(0, x, y, None)
-       link = self.single.cs.get(cs, None)
-       # print "IN CS: ",cs, link
-       if link == None:
-           if self.single.mainNode.mouse(ev, self.vs):
-               self.replaceScene = self.vs
-               vob.AbstractUpdateManager.setNoAnimation()
-               vob.AbstractUpdateManager.chg()
-       else:
-            if ev.getID() != ev.MOUSE_CLICKED:
-                return
-
-            self.single.followLink(link)
-            vob.AbstractUpdateManager.chg()
-
-
-    def scene(self, vs):
-       if self.replaceScene: 
-           sc = self.replaceScene
-           self.replaceScene = None
-           return sc
-       self.vs = vs
-
-
-       ctrx = vs.size.width / 2
-       ctry = vs.size.height * .485 # A *little* above real ctr
-
-       nadirCS = vs.translateCS(0, "NADIRORIGIN", ctrx, 
-                   2.5 * vs.size.height)
-
-       vs.put(background((.36, .74, 1.0)))
-
-       center = vs.translateCS(0, "FocusCenter", ctrx, ctry)
-
-       mainsize = vs.size.width * .6
-       buoywidth = vs.size.width * .8
-       buoyheight = vs.size.height * .8
-
-       into = vs.orthoBoxCS(center, "FocusFrame", 0, 
-                              -mainsize/2, -mainsize/2, 1, 1, mainsize, 
mainsize)
-
-       buoyinto = vs.orthoBoxCS(center, "BuoyFrame", 0,
-                               -buoywidth/2, -buoyheight/2, 1, 1, 
-                                   buoywidth, buoyheight)
-
-       self.single.drawscene(vs, into, buoyinto, nadirCS)
-                       
-
-    def getVs(self):
-        return self.vs;
+    def mouse(self, ev, oldvs):
+       return 0
 




reply via email to

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