gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gzz/modules/pp PPMouseEvents.java PPView2.j...


From: Matti Katila
Subject: [Gzz-commits] gzz/gzz/modules/pp PPMouseEvents.java PPView2.j...
Date: Thu, 09 Jan 2003 07:15:31 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/01/09 07:15:31

Modified files:
        gzz/modules/pp : PPMouseEvents.java PPView2.java demotest.py 

Log message:
        bugs.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPMouseEvents.java.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPView2.java.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.49&tr2=1.50&r1=text&r2=text

Patches:
Index: gzz/gzz/modules/pp/PPMouseEvents.java
diff -u gzz/gzz/modules/pp/PPMouseEvents.java:1.19 
gzz/gzz/modules/pp/PPMouseEvents.java:1.20
--- gzz/gzz/modules/pp/PPMouseEvents.java:1.19  Wed Jan  8 10:33:33 2003
+++ gzz/gzz/modules/pp/PPMouseEvents.java       Thu Jan  9 07:15:31 2003
@@ -28,7 +28,7 @@
  */
 
 public class PPMouseEvents {
-public static final String rcsid = "$Id: PPMouseEvents.java,v 1.19 2003/01/08 
15:33:33 mudyc Exp $";
+public static final String rcsid = "$Id: PPMouseEvents.java,v 1.20 2003/01/09 
12:15:31 mudyc Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.out.println(s); }
 
@@ -196,7 +196,7 @@
        public void event(MouseEvent ev, EventHandling.MousePressState p_state,
                          Object[] obs) {
            context.setAccursed((Cell)obs[0]);
-           ppv.addInterp("shortcut"+obs[0].toString(), obs[2]);
+           ppv.addInterp("shortcut", obs[2]);
            AbstractUpdateManager.chg();
        }
     }
@@ -206,7 +206,7 @@
                          Object[] obs) {
            context.setAccursed((Cell)obs[0]);
            ppv.addInterp("link"+obs[1].toString(), obs[2]);
-           ppv.addInterp("main", obs[3]);
+           ppv.addInterp("link", obs[5]);
            AbstractUpdateManager.chg();         
        }
     } 
@@ -294,7 +294,6 @@
            if (p_state.getButtons() == ev.BUTTON3_MASK) {
                ppv.zoom = m_ev.last_zoom * (float) 
                    Math.exp((p_state.getY() - ev.getY())/150.0);
-               pa(""+ppv.zoom);
                ppv.replaceNewScene = true;
            }
            // moving in mainVP and event passing
Index: gzz/gzz/modules/pp/PPView2.java
diff -u gzz/gzz/modules/pp/PPView2.java:1.45 
gzz/gzz/modules/pp/PPView2.java:1.46
--- gzz/gzz/modules/pp/PPView2.java:1.45        Wed Jan  8 04:51:57 2003
+++ gzz/gzz/modules/pp/PPView2.java     Thu Jan  9 07:15:31 2003
@@ -36,7 +36,7 @@
 import java.util.*;
 
 public class PPView2 implements View {
-public static final String rcsid = "$Id: PPView2.java,v 1.45 2003/01/08 
09:51:57 mudyc Exp $";
+public static final String rcsid = "$Id: PPView2.java,v 1.46 2003/01/09 
12:15:31 mudyc Exp $";
     public static boolean dbg = true;
     private static void pa(String s) { System.err.println(s); }
 
@@ -135,6 +135,11 @@
     public boolean useStencil = true;
 
     /* jython publics */
+    public boolean test_U=false;
+    public boolean test_Y=false;
+    public int OLD_Y = -1;
+    public int OLD_U = -1;
+
     public PPMouseEvents pp_events;
     public boolean replaceNewScene = false;
     public PPActions ppactions;
@@ -263,20 +268,12 @@
        VobScene vs;
        Buoy4Floater floater;
        
-       // Nadir CS
-       final int nadir_point_cs;
-
        BFloater(int dir, VobScene vs) {
            this.dir = dir;
            this.vs = vs;
            floater = new CircleFloater4(vs, 0,
                centerX(vs), buoyCenterY, buoyRadius,
                centerX(vs) - dir * buoyRadius, buoyCenterY);
-
-           nadir_point_cs =  vs.orthoBoxCS(0, "nadir_frame"+dir, 0, 
-                                          leftPanelRealWidth + 0.5f*mainWidth,
-                                          mainHeight*2.0f,
-                                          1, 1, 2, 2);
        }
        public void buoy(final int anchor, final Cell c, Cell connectedFrom) {
            Object key ; 
@@ -288,6 +285,13 @@
            int actr = vs.translateCS(anchorUnit, "TR12", .5f, .5f);
            int buoycs = floater.buoyCoordsys(actr, key);
 
+
+           // Nadir CS
+           final int nadir_point_cs;
+           nadir_point_cs =  vs.orthoBoxCS(0, "nadir_point"+c, 0, 
+                                          leftPanelRealWidth + 0.5f*mainWidth,
+                                          mainHeight*2.0f,
+                                          1, 1, 2, 2);
            final int nadir_buoy = 
                ((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs);
            vs.matcher.add(nadir_buoy, "NADIR"+c.toString() );
@@ -297,35 +301,23 @@
                    -buoyVPWidth/2, -buoyVPHeight/2, 1, 1, 
                    buoyVPWidth, buoyVPHeight);
            vs.activate(frameCS);
+           // XXX Pan
+           int[] pan = getCoords(c);
+           final int c2fCS = vs.coords.ortho(0, 0, 
+                   -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);
+           vs.matcher.add(frameCS, c2fCS, "C2F");
+
            ev_handler.onClick(frameCS, "Link CLICK",
                               new Object[]{ c, connectedFrom, new 
Integer(MAIN_CS),
-                                            new Integer(frameCS), new 
Integer(anchor)});
+                                            new Integer(frameCS), new 
Integer(anchor),
+                                            new Integer(buoycs)});
            ev_handler.onDrag(frameCS, "Drag buoy");
 
-
-           // XXX hehheh...  remember that new accursed have already been set!
-           /*
-           if (pp_events.context != null && 
-               interps.get("link"+pp_events.context.getAccursed().toString()) 
!= null) {
-               ((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(frameCS, 
-                  
((Integer)interps.get("link"+pp_events.context.getAccursed().toString())).intValue()
-               );
-           }
-           */
-
-
            if (interps.get("link"+c.toString()) != null) {
-               ((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(frameCS, 
+               
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(nadir_buoy, 
                   ((Integer)interps.get("link"+c.toString())).intValue());
            }
 
-
-           // XXX Pan
-           int[] pan = getCoords(c);
-           final int c2fCS = vs.coords.ortho(0, 0, 
-                   -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);
-           vs.matcher.add(frameCS, c2fCS, "C2F");
-
            buoyqueue.add(new Runnable() {
                public void run() {
                    buoy_vc.setAccursed(c);
@@ -364,7 +356,6 @@
     public void render(VobScene vs, int intoCS, ViewContext context) {
        ev_handler.cleanCallers();
 
-
        buoy_vc.setCellView(cellview);
 
        buoy_singlePlane = new SinglePlane();
@@ -397,7 +388,13 @@
                (-mainWidth)/2, -mainHeight/2, 1, 1, 
                mainWidth, mainHeight);
        vs.activate(frameCS);
-       MAIN_CS = frameCS;
+
+       // cell to frame CS
+       int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);
+       vs.matcher.add(frameCS, c2fCS, "C2F");
+
+       MAIN_CS = mainctr;
+
        ev_handler.onClick(frameCS, "Click MAINVP",
                           new Object[]{ new Integer(mainctr), new 
Integer(frameCS)}
                           );
@@ -406,17 +403,17 @@
                          );
        pp_events.setKingCS(frameCS);
 
-       if (interps.get("main") != null) {
+       if (interps.get("link") != null) {
+           ((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, 
+               ((Integer)interps.get("link")).intValue());
+       }
+       if (interps.get("shortcut") != null) {
            ((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, 
-               ((Integer)interps.get("main")).intValue());
+               ((Integer)interps.get("shortcut")).intValue());
        }
        
 
 
-       // cell to frame CS
-       int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);
-       vs.matcher.add(frameCS, c2fCS, "C2F");
-
 
        int[] coords = getCoords(context.getAccursed());
        if(coords != null) {
@@ -456,6 +453,8 @@
 
            float scale = style.getScaleByHeight(40);
 
+
+
            // put the "New paper" -text
            TextVob new_paper_button = new TextVob(style, "Uusi paperi");
            float width = new_paper_button.getWidth(scale);
@@ -474,6 +473,18 @@
            ev_handler.onClick(new_paper_button_frame, "Add new paper");
 
 
+           // testing
+           int barY = -1;
+           if (test_Y) {
+               barY = vs.translateCS(0, "Y", 1000, 100, 0);
+               pa("***foobar*** "+barY);
+               test_Y = false;
+           }
+           if (OLD_Y > 0 && barY >0)
+               
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(new_paper_button_cs, 
OLD_Y);
+           OLD_Y = barY;
+
+
            // put the "Add photo" -text
            TextVob add_photo_button = new TextVob(style, "Liita kuva");
            width = add_photo_button.getWidth(scale);
@@ -539,29 +550,51 @@
            int i=0;
            for(float y = 1.5f*leftPanelObjectHeight; p != null; 
                y += leftPanelObjectHeight) {
-               int fr; 
+               int fr, ctr=-1; 
                if (i==0) { 
-                   int ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 100,
+                   ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 100,
                                                                   x, y, 1, 0, 
0, 1);
                    fr = vs.orthoBoxCS(ctr, "frame", 100, 
                                       -leftPanelRealWidth/2, 
-leftPanelRealHeight/2,
                                       1, 1, leftPanelRealWidth, 
leftPanelRealHeight);
-                   vs.matcher.add(ctr, "ctrl_home");
+                   vs.matcher.add(ctr, "ctr");
+
+                   //((DefaultVobMatcher)vs.matcher).dumpByParent(fr);
+
                }
                else {
                    fr = cs_gen.getNextCS();
+                   //ctrl = vs.map.
+                   ctr = ((GLVobCoorder)vs.coords).getParent(fr);
                }
 
                vs.activate(fr);
-               ev_handler.onClick(fr, "Shortcut link", new Object[]{p, new 
Integer(MAIN_CS), new Integer(fr)});
-               if (interps.get("shortcut"+p.toString()) != null) {
-                   
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, 
-                        
((Integer)interps.get("shortcut"+p.toString())).intValue());
-               }
-
                int c2f = vs.coords.ortho(0, 11, 0, 0, 
                                          leftPanelZoom, leftPanelZoom);
                vs.matcher.add(fr, c2f, "C2F");
+
+               ev_handler.onClick(fr, "Shortcut link", new Object[]{p, new 
Integer(MAIN_CS), new Integer(ctr)});
+               /*
+               if (interps.get("shortcut") != null) {
+                   
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(MAIN_CS, 
+                        ((Integer)interps.get("shortcut")).intValue());
+               }
+               */
+
+               if (i ==0) {
+                   // testing
+                   int barU = -1;
+                   if (test_U) {
+                       barU = vs.translateCS(0, "Y", 1000, 100, 0);
+                       pa("***foobar*** "+barU);
+                       test_U = false;
+                   }
+                   if (OLD_U > 0 && barU >0)
+                       
((DefaultVobMatcher)vs.matcher).keymapSingleCoordsys(ctr, OLD_U);
+                   OLD_U = barU;
+               }
+
+
 
                buoy_vc.setAccursed(p);
                buoy_singlePlane.render(vs, fr, c2f);
Index: gzz/gzz/modules/pp/demotest.py
diff -u gzz/gzz/modules/pp/demotest.py:1.49 gzz/gzz/modules/pp/demotest.py:1.50
--- gzz/gzz/modules/pp/demotest.py:1.49 Wed Jan  8 10:33:33 2003
+++ gzz/gzz/modules/pp/demotest.py      Thu Jan  9 07:15:31 2003
@@ -114,8 +114,15 @@
 
 
     def key(self, key):
+        if key == "Ctrl-Y":
+            self.ppv.test_Y = 1
+        if key == "Ctrl-U":
+            self.ppv.test_U = 1
         if key == "Ctrl-R":
             loadScenes()
+        if key == "Ctrl-Q":
+            clean_data('except_pkg')
+            System.exit(43)
        if key == "Ctrl-I":
            print "INTERPLIST"
            self.vs.dump()
@@ -200,11 +207,12 @@
        #vs.matcher.setKeyMap(self.map)
        self.vs = vs
 
+
     def mouse(self, ev):
         ev_h = self.ppv.pp_events
         ev_h.vs = self.vs
         ev_h.context = self.avc
-        gzz.modules.pp.EventHandling.i().handleEvent(self.vs, ev);
+        gzz.modules.pp.EventHandling.i().handleEvent(self.vs, ev)
         if ev.getID() == ev.MOUSE_PRESSED:
             self.ppv.replaceNewScene = 0
             return




reply via email to

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