/[gzz]/gzz/gzz/modules/pp/Win.java
ViewVC logotype

Diff of /gzz/gzz/modules/pp/Win.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.54 by tjl, Wed Oct 9 14:38:41 2002 UTC revision 1.55 by tjl, Sun Oct 20 11:45:59 2002 UTC
# Line 54  public static final String rcsid = "$Id$ Line 54  public static final String rcsid = "$Id$
54      /** The key used for the "add paper" function in the vobscene.      /** The key used for the "add paper" function in the vobscene.
55       */       */
56      public static final Object ADDPAPERKEY = new Object();      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");  
     }  
   
57      /** The current mode of the client.      /** The current mode of the client.
58       */       */
59      static int mode = MODE_BROWSE;      static int mode = MODE_BROWSE;
60    
61        private static PPDims d;
62    
63      /** The accursed cell.      /** The accursed cell.
64       */       */
65      Cell cursor;      Cell cursor;
# Line 116  public static final String rcsid = "$Id$ Line 109  public static final String rcsid = "$Id$
109    
110      /** The view shown in this window.      /** The view shown in this window.
111       */       */
112      BuoyView view = new BuoyView(keyer);      BuoyView view;
113    
114      PPActions ppactions;      PPActions ppactions;
115    
# Line 176  public static final String rcsid = "$Id$ Line 169  public static final String rcsid = "$Id$
169    
170      public Win(Cell cursor, PPActions ppactions, Runnable updateSpaceRun)      public Win(Cell cursor, PPActions ppactions, Runnable updateSpaceRun)
171                  throws RemoteException {                  throws RemoteException {
172            view = new BuoyView(cursor.space, keyer);
173          this.updateSpaceRun = updateSpaceRun;          this.updateSpaceRun = updateSpaceRun;
174          AbstractUpdateManager.addWindow(new Screen(          AbstractUpdateManager.addWindow(new Screen(
175                 GraphicsAPI.getInstance().createWindow(),                 GraphicsAPI.getInstance().createWindow(),
# Line 192  public static final String rcsid = "$Id$ Line 186  public static final String rcsid = "$Id$
186    
187          Space space = cursor.space;          Space space = cursor.space;
188    
189          initDims(space);          d = new PPDims(space);
190      }      }
191    
192      void startDrag(MouseEvent me, Cell clicked) {      void startDrag(MouseEvent me, Cell clicked) {
193          drag_x0 = me.getX();          drag_x0 = me.getX();
194          drag_y0 = me.getY();          drag_y0 = me.getY();
195          drag_zoom0 = zoom;          drag_zoom0 = zoom;
196          if(clicked!=null && clicked.s(d_contains, -1)!=null) {          if(clicked!=null && clicked.s(d.contains, -1)!=null) {
197              // Dragging a cell              // Dragging a cell
198              drag_cell = clicked;              drag_cell = clicked;
199              drag_origin = getNoteXY(clicked);              drag_origin = getNoteXY(clicked);
# Line 235  public static final String rcsid = "$Id$ Line 229  public static final String rcsid = "$Id$
229      }      }
230    
231      int[] getNoteXY(Cell note) {      int[] getNoteXY(Cell note) {
232          if(note.s(d_pan) == null) return null;          if(note.s(d.pan) == null) return null;
233          return Params.getInts(note.s(d_pan), d_pan, 2, null);          return Params.getInts(note.s(d.pan), d.pan, 2, null);
234      }      }
235    
236      /** Get the X and Y coordinates in the main viewport of the given mouse event.      /** Get the X and Y coordinates in the main viewport of the given mouse event.
# Line 303  public static final String rcsid = "$Id$ Line 297  public static final String rcsid = "$Id$
297                      setCursorTo(note);                      setCursorTo(note);
298                      offsetInCell = offs[0];                      offsetInCell = offs[0];
299                  } else {                  } else {
300                      setCursorTo(cursor.h(Win.d_contains));                      setCursorTo(cursor.h(Win.d.contains));
301                  }                  }
302                  // We always set the cursor to where the user clicked                  // We always set the cursor to where the user clicked
303                  // to give a consistent behaviour.                  // to give a consistent behaviour.
# Line 368  public static final String rcsid = "$Id$ Line 362  public static final String rcsid = "$Id$
362                  return;                  return;
363              }              }
364              // Text edit              // Text edit
365              p("Edit text "+c+" "+c.s(d_contains, -1)+"\n");              p("Edit text "+c+" "+c.s(d.contains, -1)+"\n");
366              if(c.s(d_contains, -1) == null) { // Not in edit mode              if(c.s(d.contains, -1) == null) { // Not in edit mode
367                  c = createNewNote(c, xctr, yctr);                  c = createNewNote(c, xctr, yctr);
368              }              }
369              // allow only on root clone // XXX Should we really?              // allow only on root clone // XXX Should we really?
# Line 387  public static final String rcsid = "$Id$ Line 381  public static final String rcsid = "$Id$
381                  } else if (c.t().equals("")) {                  } else if (c.t().equals("")) {
382                     // If it's empty, delete the cell and all associations.                     // If it's empty, delete the cell and all associations.
383                     mode = 0;                     mode = 0;
384                     setCursorTo(c.h(d_contains));                     setCursorTo(c.h(d.contains));
385                     ppactions.deleteNote(c.getId());                     ppactions.deleteNote(c.getId());
386                  }                  }
387              } else if(key.equalsIgnoreCase("Delete")) {              } else if(key.equalsIgnoreCase("Delete")) {
# Line 406  public static final String rcsid = "$Id$ Line 400  public static final String rcsid = "$Id$
400                  x = xy[0]; y = xy[1];                  x = xy[0]; y = xy[1];
401              }              }
402              // createNewNote(cursor, x, y + PlaneView.getLineOffset(zoom));              // createNewNote(cursor, x, y + PlaneView.getLineOffset(zoom));
403              if(oldNote.s(d_pan) != null) {              if(oldNote.s(d.pan) != null) {
404                  // There was the earlier note; split the text                  // There was the earlier note; split the text
405                  int l = oldNote.t().length();                  int l = oldNote.t().length();
406                  if(offs < l) {                  if(offs < l) {

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26