gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gzz/modules/pp/BuoyView.java gzz/mod...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gzz/modules/pp/BuoyView.java gzz/mod...
Date: Sun, 20 Oct 2002 07:45:59 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/20 07:45:59

Modified files:
        .              : TODO 
        gzz/modules/pp : BuoyView.java PPActionsImpl.java PlaneView.java 
                         Win.java 
Added files:
        gzz/modules/pp : PPDims.java 

Log message:
        A nicer way to use dim names

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.309&tr2=1.310&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPDims.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/BuoyView.java.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PPActionsImpl.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PlaneView.java.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/Win.java.diff?tr1=1.54&tr2=1.55&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.309 gzz/TODO:1.310
*** gzz/TODO:1.309      Sun Oct 20 04:19:40 2002
--- gzz/TODO    Sun Oct 20 07:45:58 2002
***************
*** 116,122 ****
                - larger structure 
                    + discard high-rez images (500kB/image) ?
                - adjust dicing [from frame rate???]
-               - use real nadir
            - gzz.info: xupdf demo movie clearly accessible
        - PP [deadline 5.11]
            - remove dead code (ViewportVob etc)
--- 116,121 ----
Index: gzz/gzz/modules/pp/BuoyView.java
diff -c gzz/gzz/modules/pp/BuoyView.java:1.29 
gzz/gzz/modules/pp/BuoyView.java:1.30
*** gzz/gzz/modules/pp/BuoyView.java:1.29       Wed Oct  9 10:38:41 2002
--- gzz/gzz/modules/pp/BuoyView.java    Sun Oct 20 07:45:58 2002
***************
*** 50,56 ****
   */
  
  public class BuoyView implements View {
! public static final String rcsid = "$Id: BuoyView.java,v 1.29 2002/10/09 
14:38:41 tjl Exp $";
      public static boolean dbg = false;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
--- 50,56 ----
   */
  
  public class BuoyView implements View {
! public static final String rcsid = "$Id: BuoyView.java,v 1.30 2002/10/20 
11:45:58 tjl Exp $";
      public static boolean dbg = false;
      private static void p(String s) { if(dbg) pa(s); }
      private static void pa(String s) { System.err.println(s); }
***************
*** 62,69 ****
  
      private VobKeyer keyer;
  
!     public BuoyView(VobKeyer keyer) {
          this.keyer = keyer;
      }
  
      static int bwid;
--- 62,72 ----
  
      private VobKeyer keyer;
  
!     PPDims d;
! 
!     public BuoyView(Space space, VobKeyer keyer) {
          this.keyer = keyer;
+       d = new PPDims(space);
      }
  
      static int bwid;
***************
*** 126,132 ****
        rbf = new CircleFloater4(into, 0, ctrx, ctry, rad, ctrx-rad, ctry);
  
  
!       planeView = new PlaneView(keyer, lbf, rbf);
  
        putBackground(into);
  
--- 129,136 ----
        rbf = new CircleFloater4(into, 0, ctrx, ctry, rad, ctrx-rad, ctry);
  
  
!       planeView = new PlaneView(context.getAccursed().space,
!                       keyer, lbf, rbf);
  
        putBackground(into);
  
***************
*** 163,169 ****
        int panx = Win.xctr, pany = Win.yctr;
        float zoom = Win.zoom;
        VobKeyer.Entry keyEntry = 
!                   keyer.getMainEntry( center.h(Win.d_contains) );
        planeView.renderSinglePaper(into, center,  x, y, w, h, 15,
                    panx, pany, zoom,
                    leftBuoys, rightBuoys, keyEntry);
--- 167,173 ----
        int panx = Win.xctr, pany = Win.yctr;
        float zoom = Win.zoom;
        VobKeyer.Entry keyEntry = 
!                   keyer.getMainEntry( center.h(d.contains) );
        planeView.renderSinglePaper(into, center,  x, y, w, h, 15,
                    panx, pany, zoom,
                    leftBuoys, rightBuoys, keyEntry);
***************
*** 179,185 ****
        if(cursor==null)
            return;
  
!       Cell plane = cursor.h(Win.d_contains);
  
        int vd = 10;
        float vx = x+w/3, vy = y + h/3, vw = 100, vh = 50;
--- 183,189 ----
        if(cursor==null)
            return;
  
!       Cell plane = cursor.h(d.contains);
  
        int vd = 10;
        float vx = x+w/3, vy = y + h/3, vw = 100, vh = 50;
***************
*** 205,211 ****
            plane = plane.s(d_1, -1);
        }
  
!       plane = cursor.h(Win.d_contains);
        plane = plane.s(d_1, 1);
  
        vd = 100;
--- 209,215 ----
            plane = plane.s(d_1, -1);
        }
  
!       plane = cursor.h(d.contains);
        plane = plane.s(d_1, 1);
  
        vd = 100;
Index: gzz/gzz/modules/pp/PPActionsImpl.java
diff -c gzz/gzz/modules/pp/PPActionsImpl.java:1.6 
gzz/gzz/modules/pp/PPActionsImpl.java:1.7
*** gzz/gzz/modules/pp/PPActionsImpl.java:1.6   Sun Oct  6 09:45:46 2002
--- gzz/gzz/modules/pp/PPActionsImpl.java       Sun Oct 20 07:45:58 2002
***************
*** 43,61 ****
  
      Cell center;
  
!     Dim d_contains, d_pan, d_association, d_1, d_clone;
  
      public PPActionsImpl(Space space) throws RemoteException {
        super();
        this.space = space; 
        center = space.getHomeCell();
        if(center.t()==null) center.setText("HOME");
!       d_contains = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-5");
!       d_pan = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-4");
!       d_association = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-7");
! 
!       d_1 = space.getDim(Ids.d_1);
!       d_clone = space.getDim(Ids.d_clone);
      }
  
  
--- 43,56 ----
  
      Cell center;
  
!     PPDims d;
  
      public PPActionsImpl(Space space) throws RemoteException {
        super();
        this.space = space; 
        center = space.getHomeCell();
        if(center.t()==null) center.setText("HOME");
!       d = new PPDims(space);
      }
  
  
***************
*** 63,69 ****
      //
      public String newPaper()
                    throws RemoteException { synchronized(space) {
!       Cell n = center.N(d_1);
        n.setText("Uusi paperi");
        return n.getId();
      }}
--- 58,64 ----
      //
      public String newPaper()
                    throws RemoteException { synchronized(space) {
!       Cell n = center.N(d.d1);
        n.setText("Uusi paperi");
        return n.getId();
      }}
***************
*** 73,83 ****
        Cell c = space.getCell(paperId);
  
        p("New note\n");
!       c = c.N(d_contains);
        c.setText(text); // XXX null content crashes
!       Cell arg = c.N(d_pan);
        arg.setText("" + x);
!       arg = arg.N(d_pan);
        arg.setText("" + y);
        return c.getId();
      }}
--- 68,78 ----
        Cell c = space.getCell(paperId);
  
        p("New note\n");
!       c = c.N(d.contains);
        c.setText(text); // XXX null content crashes
!       Cell arg = c.N(d.pan);
        arg.setText("" + x);
!       arg = arg.N(d.pan);
        arg.setText("" + y);
        return c.getId();
      }}
***************
*** 86,105 ****
                    throws RemoteException {
        Cell note = space.getCell(noteId);
          // Remove all occurrences
!         Cell c = note.h(d_clone);
          while(c!=null) {
!           c.excise(d_contains);
!           c.excise(d_association);
!           c = c.s(d_clone);
          }
      }
  
      public void moveNote(String noteId, int x, int y)
                    throws RemoteException { synchronized(space) {
        Cell note = space.getCell(noteId);
!       Cell arg = note.s(d_pan);
        arg.setText("" + x);
!       arg = arg.s(d_pan);
        arg.setText("" + y);
      }}
  
--- 81,100 ----
                    throws RemoteException {
        Cell note = space.getCell(noteId);
          // Remove all occurrences
!         Cell c = note.h(d.clone);
          while(c!=null) {
!           c.excise(d.contains);
!           c.excise(d.association);
!           c = c.s(d.clone);
          }
      }
  
      public void moveNote(String noteId, int x, int y)
                    throws RemoteException { synchronized(space) {
        Cell note = space.getCell(noteId);
!       Cell arg = note.s(d.pan);
        arg.setText("" + x);
!       arg = arg.s(d.pan);
        arg.setText("" + y);
      }}
  
***************
*** 108,114 ****
                    throws RemoteException { synchronized(space) {
        Cell note = space.getCell(noteId);
        Cell assoc = space.getCell(assocId);
!       note.zzclone().connect(d_association, side, assoc.zzclone());
      }}
  
      public void insertText(String noteId, int offs, String text)
--- 103,109 ----
                    throws RemoteException { synchronized(space) {
        Cell note = space.getCell(noteId);
        Cell assoc = space.getCell(assocId);
!       note.zzclone().connect(d.association, side, assoc.zzclone());
      }}
  
      public void insertText(String noteId, int offs, String text)
Index: gzz/gzz/modules/pp/PlaneView.java
diff -c gzz/gzz/modules/pp/PlaneView.java:1.54 
gzz/gzz/modules/pp/PlaneView.java:1.55
*** gzz/gzz/modules/pp/PlaneView.java:1.54      Tue Oct 15 09:29:18 2002
--- gzz/gzz/modules/pp/PlaneView.java   Sun Oct 20 07:45:58 2002
***************
*** 40,46 ****
   */
  
  public class PlaneView {
! public static final String rcsid = "$Id: PlaneView.java,v 1.54 2002/10/15 
13:29:18 tjl Exp $";
      public static boolean dbg = true;
      private static void pa(String s) { System.err.println(s); }
  
--- 40,46 ----
   */
  
  public class PlaneView {
! public static final String rcsid = "$Id: PlaneView.java,v 1.55 2002/10/20 
11:45:58 tjl Exp $";
      public static boolean dbg = true;
      private static void pa(String s) { System.err.println(s); }
  
***************
*** 56,68 ****
      VobKeyer keyer;
      Buoy4Floater rightfloater, leftfloater;
  
!     public PlaneView(VobKeyer keyer, Buoy4Floater leftfloater, 
                            Buoy4Floater rightfloater) {
          this.keyer = keyer;
        this.rightfloater = rightfloater;
        this.leftfloater = leftfloater;
      }
  
      /** Render a single paper into the given coordinate system
       * @param into The coordinate system which has the paper coordinates to 
       */
--- 56,71 ----
      VobKeyer keyer;
      Buoy4Floater rightfloater, leftfloater;
  
!     public PlaneView(Space space, VobKeyer keyer, Buoy4Floater leftfloater, 
                            Buoy4Floater rightfloater) {
          this.keyer = keyer;
        this.rightfloater = rightfloater;
        this.leftfloater = leftfloater;
+       d = new PPDims(space);
      }
  
+     PPDims d;
+ 
      /** Render a single paper into the given coordinate system
       * @param into The coordinate system which has the paper coordinates to 
       */
***************
*** 71,78 ****
  
        if(dbg) pa("GetPaperscene: "+cursor);
  
!       Cell plane = cursor.h(Win.d_contains);
!       Cell note = plane.s(Win.d_contains);
  
        BgVob bg = BgVob.create(plane);
        int bginto = vs.coords.ortho(viewport2screen, 500, 0, 0, 1, 1);
--- 74,81 ----
  
        if(dbg) pa("GetPaperscene: "+cursor);
  
!       Cell plane = cursor.h(d.contains);
!       Cell note = plane.s(d.contains);
  
        BgVob bg = BgVob.create(plane);
        int bginto = vs.coords.ortho(viewport2screen, 500, 0, 0, 1, 1);
***************
*** 92,98 ****
  
        while(note != null) { // For every note on the paper
            if(dbg) pa("Note: "+note);
!           int place[] = Params.getInts(note.s(Win.d_pan, 1), Win.d_pan, 2, 
null);
  
            int notex = place[0];
            int notey = place[1];
--- 95,101 ----
  
        while(note != null) { // For every note on the paper
            if(dbg) pa("Note: "+note);
!           int place[] = Params.getInts(note.s(d.pan, 1), d.pan, 2, null);
  
            int notex = place[0];
            int notey = place[1];
***************
*** 124,130 ****
                    placeNormalBuoys(vs, cs, note);
            }
  
!           note = note.s(Win.d_contains);
        }
      }
  
--- 127,133 ----
                    placeNormalBuoys(vs, cs, note);
            }
  
!           note = note.s(d.contains);
        }
      }
  
***************
*** 134,147 ****
        // show association candidates for the cell currently in edit
        // search only planes on d.user-1, look for same prefix
        
!       Cell plane = note.h(Win.d_contains);
        Cell start = plane.h(d_1); //.s(Dims.d_user_1_id);
        String cur = note.t();
        if(cur.length() >= 1)  {
            while(start != null) {
!               for(Cell otherNote = start.s(Win.d_contains); otherNote != null;
                        
!                   otherNote = otherNote.s(Win.d_contains)) {
                    /*
                    if(otherNote.equals(note)) continue;
                    if(otherNote.t().startsWith(cur)) {
--- 137,150 ----
        // show association candidates for the cell currently in edit
        // search only planes on d.user-1, look for same prefix
        
!       Cell plane = note.h(d.contains);
        Cell start = plane.h(d_1); //.s(Dims.d_user_1_id);
        String cur = note.t();
        if(cur.length() >= 1)  {
            while(start != null) {
!               for(Cell otherNote = start.s(d.contains); otherNote != null;
                        
!                   otherNote = otherNote.s(d.contains)) {
                    /*
                    if(otherNote.equals(note)) continue;
                    if(otherNote.t().startsWith(cur)) {
***************
*** 168,175 ****
        // proper margins
        for(Cell assoc = note; assoc != null; 
                assoc = assoc.s(d_clone)) {
!           Cell left = assoc.s(Win.d_association, -1);
!           Cell right = assoc.s(Win.d_association, 1);
            if(dbg) pa("BUOYS: LINKS");
            if(dbg) pa("left: "+left+" right: "+right);
            if(right != null) {
--- 171,178 ----
        // proper margins
        for(Cell assoc = note; assoc != null; 
                assoc = assoc.s(d_clone)) {
!           Cell left = assoc.s(d.association, -1);
!           Cell right = assoc.s(d.association, 1);
            if(dbg) pa("BUOYS: LINKS");
            if(dbg) pa("left: "+left+" right: "+right);
            if(right != null) {
***************
*** 191,197 ****
        int w = 200, h = 200;
        int magcs = vs.orthoCS(cs, "Mag", -10, -w/2, -h/2, w, h);
        center = center.getRootclone();
!       int place[] = Params.getInts(center.s(Win.d_pan, 1), Win.d_pan, 2, 
null);
        float scale = 0.01f;
        int p2v = vs.matcher.addSub(
                        cs, 
--- 194,200 ----
        int w = 200, h = 200;
        int magcs = vs.orthoCS(cs, "Mag", -10, -w/2, -h/2, w, h);
        center = center.getRootclone();
!       int place[] = Params.getInts(center.s(d.pan, 1), d.pan, 2, null);
        float scale = 0.01f;
        int p2v = vs.matcher.addSub(
                        cs, 
Index: gzz/gzz/modules/pp/Win.java
diff -c gzz/gzz/modules/pp/Win.java:1.54 gzz/gzz/modules/pp/Win.java:1.55
*** gzz/gzz/modules/pp/Win.java:1.54    Wed Oct  9 10:38:41 2002
--- gzz/gzz/modules/pp/Win.java Sun Oct 20 07:45:59 2002
***************
*** 36,42 ****
   */
  
  public class Win extends AbstractBinder implements Shower {
! public static final String rcsid = "$Id: Win.java,v 1.54 2002/10/09 14:38:41 
tjl Exp $";
      public static final boolean dbg = true;
      protected static void p(String s) { if(dbg) pa(s); }
      protected static void pa(String s) { System.err.println(s); }
--- 36,42 ----
   */
  
  public class Win extends AbstractBinder implements Shower {
! public static final String rcsid = "$Id: Win.java,v 1.55 2002/10/20 11:45:59 
tjl Exp $";
      public static final boolean dbg = true;
      protected static void p(String s) { if(dbg) pa(s); }
      protected static void pa(String s) { System.err.println(s); }
***************
*** 54,72 ****
      /** The key used for the "add paper" function in the vobscene.
       */
      public static final Object ADDPAPERKEY = new Object();
- 
-     static Dim d_contains, d_pan, d_association;
- 
-     public static void initDims(Space space) {
-       d_contains = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-5");
-       d_pan = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-4");
-       d_association = 
space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-7");
-     }
- 
      /** The current mode of the client.
       */
      static int mode = MODE_BROWSE; 
  
      /** The accursed cell.
       */
      Cell cursor;
--- 54,65 ----
      /** The key used for the "add paper" function in the vobscene.
       */
      public static final Object ADDPAPERKEY = new Object();
      /** The current mode of the client.
       */
      static int mode = MODE_BROWSE; 
  
+     private static PPDims d;
+ 
      /** The accursed cell.
       */
      Cell cursor;
***************
*** 116,122 ****
  
      /** The view shown in this window.
       */
!     BuoyView view = new BuoyView(keyer);
  
      PPActions ppactions;
  
--- 109,115 ----
  
      /** The view shown in this window.
       */
!     BuoyView view;
  
      PPActions ppactions;
  
***************
*** 176,181 ****
--- 169,175 ----
  
      public Win(Cell cursor, PPActions ppactions, Runnable updateSpaceRun)
                throws RemoteException {
+       view = new BuoyView(cursor.space, keyer);
        this.updateSpaceRun = updateSpaceRun;
        AbstractUpdateManager.addWindow(new Screen(
               GraphicsAPI.getInstance().createWindow(),
***************
*** 192,205 ****
  
        Space space = cursor.space;
  
!       initDims(space);
      }
  
      void startDrag(MouseEvent me, Cell clicked) {
        drag_x0 = me.getX();
        drag_y0 = me.getY();
        drag_zoom0 = zoom;
!       if(clicked!=null && clicked.s(d_contains, -1)!=null) {
            // Dragging a cell
            drag_cell = clicked;
            drag_origin = getNoteXY(clicked);
--- 186,199 ----
  
        Space space = cursor.space;
  
!       d = new PPDims(space);
      }
  
      void startDrag(MouseEvent me, Cell clicked) {
        drag_x0 = me.getX();
        drag_y0 = me.getY();
        drag_zoom0 = zoom;
!       if(clicked!=null && clicked.s(d.contains, -1)!=null) {
            // Dragging a cell
            drag_cell = clicked;
            drag_origin = getNoteXY(clicked);
***************
*** 235,242 ****
      }
  
      int[] getNoteXY(Cell note) {
!       if(note.s(d_pan) == null) return null;
!       return Params.getInts(note.s(d_pan), d_pan, 2, null);
      }
  
      /** Get the X and Y coordinates in the main viewport of the given mouse 
event.
--- 229,236 ----
      }
  
      int[] getNoteXY(Cell note) {
!       if(note.s(d.pan) == null) return null;
!       return Params.getInts(note.s(d.pan), d.pan, 2, null);
      }
  
      /** Get the X and Y coordinates in the main viewport of the given mouse 
event.
***************
*** 303,309 ****
                    setCursorTo(note);
                    offsetInCell = offs[0];
                } else {
!                   setCursorTo(cursor.h(Win.d_contains));
                }
                // We always set the cursor to where the user clicked
                // to give a consistent behaviour.
--- 297,303 ----
                    setCursorTo(note);
                    offsetInCell = offs[0];
                } else {
!                   setCursorTo(cursor.h(Win.d.contains));
                }
                // We always set the cursor to where the user clicked
                // to give a consistent behaviour.
***************
*** 368,375 ****
                return;
            }
            // Text edit
!           p("Edit text "+c+" "+c.s(d_contains, -1)+"\n");
!           if(c.s(d_contains, -1) == null) { // Not in edit mode
                c = createNewNote(c, xctr, yctr);
            }
            // allow only on root clone // XXX Should we really?
--- 362,369 ----
                return;
            }
            // Text edit
!           p("Edit text "+c+" "+c.s(d.contains, -1)+"\n");
!           if(c.s(d.contains, -1) == null) { // Not in edit mode
                c = createNewNote(c, xctr, yctr);
            }
            // allow only on root clone // XXX Should we really?
***************
*** 387,393 ****
                } else if (c.t().equals("")) {
                   // If it's empty, delete the cell and all associations.
                   mode = 0;
!                  setCursorTo(c.h(d_contains));
                   ppactions.deleteNote(c.getId());
                }
            } else if(key.equalsIgnoreCase("Delete")) {
--- 381,387 ----
                } else if (c.t().equals("")) {
                   // If it's empty, delete the cell and all associations.
                   mode = 0;
!                  setCursorTo(c.h(d.contains));
                   ppactions.deleteNote(c.getId());
                }
            } else if(key.equalsIgnoreCase("Delete")) {
***************
*** 406,412 ****
                x = xy[0]; y = xy[1];
            }
            // createNewNote(cursor, x, y + PlaneView.getLineOffset(zoom));
!           if(oldNote.s(d_pan) != null) {
                // There was the earlier note; split the text
                int l = oldNote.t().length();
                if(offs < l) {
--- 400,406 ----
                x = xy[0]; y = xy[1];
            }
            // createNewNote(cursor, x, y + PlaneView.getLineOffset(zoom));
!           if(oldNote.s(d.pan) != null) {
                // There was the earlier note; split the text
                int l = oldNote.t().length();
                if(offs < l) {




reply via email to

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