gzz-commits
[Top][All Lists]
Advanced

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

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


From: Matti Katila
Subject: [Gzz-commits] gzz/gzz/modules/pp PPActionsImpl.java PPView2.j...
Date: Fri, 10 Jan 2003 01:40:19 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/01/10 01:40:16

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

Log message:
        user friendlynes, viewmode, foo

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPActionsImpl.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPView2.java.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.53&tr2=1.54&r1=text&r2=text

Patches:
Index: gzz/gzz/modules/pp/PPActionsImpl.java
diff -u gzz/gzz/modules/pp/PPActionsImpl.java:1.11 
gzz/gzz/modules/pp/PPActionsImpl.java:1.12
--- gzz/gzz/modules/pp/PPActionsImpl.java:1.11  Thu Jan  9 11:51:07 2003
+++ gzz/gzz/modules/pp/PPActionsImpl.java       Fri Jan 10 01:40:16 2003
@@ -76,6 +76,9 @@
 
     public void deletePaper(String paperId) throws RemoteException 
     { synchronized(space) {
+
+       /* MUST DELETE ALL NOTES FIRST */
+
        space.delete(space.getCell(paperId));
     }}
 
@@ -97,6 +100,10 @@
 
     public void deleteNote(String noteId)
                    throws RemoteException {
+
+       /* MUST DELETE ALL ASSOCS FIRST */
+
+
        Cell note = space.getCell(noteId);
         // Remove all occurrences
         Cell c = note.h(d.clone);
Index: gzz/gzz/modules/pp/PPView2.java
diff -u gzz/gzz/modules/pp/PPView2.java:1.48 
gzz/gzz/modules/pp/PPView2.java:1.49
--- gzz/gzz/modules/pp/PPView2.java:1.48        Thu Jan  9 12:27:53 2003
+++ gzz/gzz/modules/pp/PPView2.java     Fri Jan 10 01:40:16 2003
@@ -36,12 +36,24 @@
 import java.util.*;
 
 public class PPView2 implements View {
-public static final String rcsid = "$Id: PPView2.java,v 1.48 2003/01/09 
17:27:53 mudyc Exp $";
+public static final String rcsid = "$Id: PPView2.java,v 1.49 2003/01/10 
06:40:16 mudyc Exp $";
     public static boolean dbg = true;
     private static void pa(String s) { System.err.println(s); }
 
     public static Object NEWPAPERKEY = new Object();
 
+    /** Modes */
+    final public int JUST_BROWSING = 1;
+
+    final public int TEXT_EDITING = 2;
+    public int TE_SIFT_X = 100;
+    public int TE_SIFT_Y = 50;
+
+    final public int LINK_KILLING = 3;
+
+    public int viewMode = JUST_BROWSING;
+
+    /** Events */
     private EventHandling ev_handler = EventHandling.i();
 
     // Geometry
@@ -419,6 +431,10 @@
        if(coords != null) {
            panx = coords[0];
            pany = coords[1];
+           if (viewMode == TEXT_EDITING) {
+               panx += TE_SIFT_X;
+               pany += TE_SIFT_Y;
+           }
        }
        setZoomPan(vs);
        pl.render(vs, frameCS, c2fCS);
Index: gzz/gzz/modules/pp/demotest.py
diff -u gzz/gzz/modules/pp/demotest.py:1.53 gzz/gzz/modules/pp/demotest.py:1.54
--- gzz/gzz/modules/pp/demotest.py:1.53 Fri Jan 10 01:04:40 2003
+++ gzz/gzz/modules/pp/demotest.py      Fri Jan 10 01:40:16 2003
@@ -110,12 +110,16 @@
         self.ppv.bgscale = 500
         self.poly = ["FILL", "LINE"]
         self.map = None
-        self.mode = 0
 
+    def setDefaultViewMode(self):
+        # set default settings
+        self.ppv.showLinkbuoys = 0
+        self.ppv.viewMode = self.ppv.JUST_BROWSING
 
     def key(self, key):
         #print 'key: ',key
-        self.ppv.showLinkbuoys = 0
+        self.setDefaultViewMode()
+
         if key == "Ctrl-T":
             c = self.avc.getAccursed()
             self.ppv.dump(c)
@@ -123,6 +127,10 @@
             self.ppv.test_Y = 1
         if key == "Ctrl-U":
             self.ppv.test_U = 1
+            
+        if key == "Alt-R":
+            os.system('make compile')
+            loadScenes()
         if key == "Ctrl-R":
             loadScenes()
         if key == "Ctrl-Q":
@@ -172,6 +180,7 @@
            self.ppv.showLinkbuoys = not self.ppv.showLinkbuoys
 
         if key == "Return":
+            self.ppv.viewMode = self.ppv.TEXT_EDITING
            c = self.avc.getAccursed()
            print "Acc: ",c
            if self.avc.getCursorOffset(c) < 0 or c.s(self.d.contains, -1) == 
None:
@@ -187,8 +196,8 @@
             
         if len(key) == 1 or key == "Backspace" or key == "Delete" \
                or key == "Left" or key == "Right":
-           mode = 1
 
+            self.ppv.viewMode = self.ppv.TEXT_EDITING
             self.ppv.showLinkbuoys = 1
             if key == "Left" or key == "Right":
                 self.ppv.showLinkbuoys = 0
@@ -221,7 +230,8 @@
                 if offs != 0:
                     self.avc.setCursorOffset(offs-1)
             if key == "Right":
-                self.avc.setCursorOffset(offs+1)
+                if offs < len(c.t()):
+                    self.avc.setCursorOffset(offs+1)
             
     def scene(self, vs):
        vs.map.put(background((0.4,0.5,0.8)))
@@ -234,7 +244,7 @@
 
 
     def mouse(self, ev):
-        self.ppv.showLinkbuoys = 0
+        self.setDefaultViewMode()
         ev_h = self.ppv.pp_events
         ev_h.vs = self.vs
         ev_h.context = self.avc




reply via email to

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