gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gzz/modules/pp PPView2.java demotest.py Eve...


From: Matti Katila
Subject: [Gzz-commits] gzz/gzz/modules/pp PPView2.java demotest.py Eve...
Date: Thu, 19 Dec 2002 11:06:20 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   02/12/19 11:06:20

Modified files:
        gzz/modules/pp : PPView2.java demotest.py 
Added files:
        gzz/modules/pp : EventHandling.java PPEvents.java 

Log message:
        event handling - anyone who is interested take a look!

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/EventHandling.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPEvents.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPView2.java.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.31&tr2=1.32&r1=text&r2=text

Patches:
Index: gzz/gzz/modules/pp/PPView2.java
diff -u gzz/gzz/modules/pp/PPView2.java:1.26 
gzz/gzz/modules/pp/PPView2.java:1.27
--- gzz/gzz/modules/pp/PPView2.java:1.26        Thu Dec 12 10:35:03 2002
+++ gzz/gzz/modules/pp/PPView2.java     Thu Dec 19 11:06:20 2002
@@ -41,6 +41,10 @@
 
     public static Object NEWPAPERKEY = new Object();
 
+    private EventHandling ev_handler = EventHandling.i();
+    public PPEvents pp_events;
+
+
     // Geometry
 
     /** The width of the main view.
@@ -176,7 +180,7 @@
            vs.matcher.add(frameCS, paper2screen, "PAPER2S");
            final int bg2screen = vs.scaleCS(paper2screen, "BGSCA", 
                                        bgscale, bgscale);
-           
+   
 
            final Cell cursor = context.getAccursed();
            final Cell plane = cursor.h(d.contains);
@@ -274,26 +278,41 @@
            final int anchorUnit = vs.unitSqCS(anchor, "AUSQ"); 
            int actr = vs.translateCS(anchorUnit, "TR12", .5f, .5f);
            int buoycs = floater.buoyCoordsys(actr, key);
-          
 
-           final int nadir_buoy = 
((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs);
-           //vs.matcher.add(buoycs, nadir_buoy, "nadir_frameCS");
-           vs.matcher.add(nadir_buoy, "nadir_frameCS");
+           /*
+           final int nadir_buoy = 
+               ((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs);
+           vs.matcher.add(nadir_buoy, "NADIR");
+           */
+           //vs.matcher.add(nadir_buoy, new Pair(c, connectedFrom));
 
 
            final int frameCS = vs.orthoBoxCS(buoycs, "frame", 0, 
-           //final int frameCS = vs.orthoBoxCS(nadir_buoy, "frame", 0, 
                    -buoyVPWidth/2, -buoyVPHeight/2, 1, 1, 
                    buoyVPWidth, buoyVPHeight);
            vs.activate(frameCS);
 
 
+           float[] bar = { 0,0,0 };
+           float [] foo= new float[3];
+           vs.coords.transformPoints3(frameCS, bar, foo);
+           for (int i=0; i<foo.length; i++) {
+               pa("CS: "+foo[i]);
+           }
+
+           final GLVobCoorder glc = (GLVobCoorder)vs.coords;
+           float[] sqs = new float[2];
+           glc.getSqSize(frameCS, sqs);
+           if (sqs[1] < 5) return;
+           pa("size: Sqs frame: "+sqs[0]+" "+sqs[1]);
+
+
+
            // 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(buoycs, c2fCS, "C2F");
-           //vs.matcher.add(nadir_buoy, c2fCS, "C2F");
 
 
            buoyqueue.add(new Runnable() {
@@ -317,6 +336,7 @@
        this.window = w;
        this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan);
        this.ppactions = ppactions;
+       pp_events = new PPEvents(ppactions);
     }
 
     TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20);
@@ -418,6 +438,7 @@
                      new_paper_button.getHeight(scale) + 
new_paper_button.getDepth(scale));
            vs.activate(new_paper_button_frame);
            vs.map.put(new_paper_button, new_paper_button_cs);
+           ev_handler.onClick(new_paper_button_frame, "Add new paper", null);
 
            // put the "Delete paper" -text
            TextVob delete_paper_button = new TextVob(style, "Tuhoa paperi");
@@ -430,6 +451,7 @@
                      delete_paper_button.getHeight(scale) + 
delete_paper_button.getDepth(scale));
            vs.activate(delete_paper_button_frame);
            vs.map.put(delete_paper_button, delete_paper_button_cs);
+           ev_handler.onClick(delete_paper_button_frame, "Delete paper", null);
 
 
 
@@ -465,18 +487,12 @@
                if (i==0) { 
                    ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 100,
                                                                   x, y, 1, 0, 
0, 1);
-
-                   //vs.matcher.add(ctr, new Pair(p, null));
-                   //vs.matcher.add(ctr, new Pair(p, p));
-
                    fr = vs.orthoBoxCS(ctr, "frame", 100, 
                                       -leftPanelRealWidth/2, 
-leftPanelRealHeight/2,
                                       1, 1, leftPanelRealWidth, 
leftPanelRealHeight);
                }
                else {
                    ctr = cs_gen.getNextCS(0);
-                   //vs.matcher.add(ctr, new Pair(p, p));
-                   //vs.matcher.add(ctr, new Pair(p, null));
                    fr = cs_gen.getNextCS(1);
                    vs.matcher.add(ctr, fr, "frame");
                }
@@ -486,6 +502,8 @@
 
                //vs.matcher.add(ctr, new Pair(p, null));
                vs.matcher.add(ctr, new Pair(p, p));
+               //vs.matcher.add(ctr, new Pair(p, new Cell(space, 
"dasfdsaffsa")));
+               //vs.matcher.add(ctr, p);
                vs.activate(fr);
 
                int c2f = vs.coords.ortho(0, 11, 0, 0, 
@@ -633,6 +651,7 @@
 
 
        if(!"frame".equals(vs.matcher.getKey(cs))) {
+           /*
            try {
                if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) {
                    ppactions.newPaper();
@@ -647,14 +666,13 @@
                    pa("WRONG KEY! "+vs.matcher.getKey(cs));
                }
            } catch (Exception e) { pa(e.getMessage()); }
+           */
+
            return null;
        }
        
        // Get its parent
        int vp = ((GLVobCoorder)vs.coords).getParent(cs);
-       if ("Nadir".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {
-           vp = ((GLVobCoorder)vs.coords).getParent(vp);
-       }
        Object key = vs.matcher.getKey(vp);
 
        pa("pushed key: "+ key +" parent vp: " +vp);
@@ -663,11 +681,20 @@
            pa("Main viewport");
            setCursorToMain(vs, x, y, context, cs, vp);
        }
+
+       // left panel test -this doesn't interpolate(animate).
+       if (key instanceof Cell) {
+           ((AbstractViewContext)context).setAccursed((Cell)key);
+           return new HashMap();
+       }
+
+
        if(! (key instanceof Pair)) {
            pa("Key is not pair!!! HELP "+key);
            
            return null;
        }
+
        Pair p = (Pair)key;
        Map r = new HashMap();
        r.put("MAINVP", p);
@@ -678,7 +705,43 @@
        // is the one we are moving to. To do this, we have to look at
        // the parent coordinate systems.
 
+       pa("Ask CoordSystem!");
+       pa(""+ ((GLVobCoorder)vs.coords).getCoordSystemStr(vp));
+       if ("Nadir".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {
+           pa("NADIR?");
+           vp = ((GLVobCoorder)vs.coords).getParent(vp);
+       }
+       pa("What it was?" + vp);
+
+       if ("OrthoBox".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) 
{
+
+           pa("ORTHOG");
+
+           //Pair p = (Pair)key;
+           
+           int vvp = ((GLVobCoorder)vs.coords).getParent(vp);
+           Object key2 = vs.matcher.getKey(vvp);
+           p = (Pair)key2;
+
+           Object cell = vs.matcher.getKey(((Integer)p.first).intValue());
+
+           p = (Pair)key;
+
+           Object n;
+           if(cell.equals(p.first)) n = p.second;
+           else n = p.first;
+           pa("New: "+n);
+
+           ((AbstractViewContext)context).setAccursed((Cell)n);
+
+           return r;
+       }
+
+
        if 
("BuoyOnCircle".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {
+
+           pa("Buoy!!!");
+
            int tr12 = ((GLVobCoorder)vs.coords).getBuoyOnCircleAnchor(vp); // 
XXX... reverse of BFloater
            pa("tr12: "+tr12);
            pa(" "+vs.matcher.getKey(tr12));
Index: gzz/gzz/modules/pp/demotest.py
diff -u gzz/gzz/modules/pp/demotest.py:1.31 gzz/gzz/modules/pp/demotest.py:1.32
--- gzz/gzz/modules/pp/demotest.py:1.31 Thu Dec 19 06:09:36 2002
+++ gzz/gzz/modules/pp/demotest.py      Thu Dec 19 11:06:20 2002
@@ -170,6 +170,8 @@
        vs.matcher.setKeyMap(self.map)
        self.vs = vs
     def mouse(self, ev):
+        gzz.modules.pp.EventHandling.i().handleEvent(self.vs, ev);
+
        if ev.getID() == ev.MOUSE_CLICKED:
            if self.ppv.showLinkbuoys:
                p = self.ppv.getMakeLinkOrSetCursor(self.vs, ev.getX(), 
ev.getY(),



reply via email to

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