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

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

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

revision 1.6 by tjl, Sun Oct 6 13:45:46 2002 UTC revision 1.7 by tjl, Sun Oct 20 11:45:58 2002 UTC
# Line 43  public class PPActionsImpl extends Unica Line 43  public class PPActionsImpl extends Unica
43    
44      Cell center;      Cell center;
45    
46      Dim d_contains, d_pan, d_association, d_1, d_clone;      PPDims d;
47    
48      public PPActionsImpl(Space space) throws RemoteException {      public PPActionsImpl(Space space) throws RemoteException {
49          super();          super();
50          this.space = space;          this.space = space;
51          center = space.getHomeCell();          center = space.getHomeCell();
52          if(center.t()==null) center.setText("HOME");          if(center.t()==null) center.setText("HOME");
53          d_contains = space.getDim("0000000008000000E99BD882A20004A0AD6630BFDA693D810DED76CAE65DA9B7E873053466C52E-5");          d = new PPDims(space);
         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);  
54      }      }
55    
56    
# Line 63  public class PPActionsImpl extends Unica Line 58  public class PPActionsImpl extends Unica
58      //      //
59      public String newPaper()      public String newPaper()
60                      throws RemoteException { synchronized(space) {                      throws RemoteException { synchronized(space) {
61          Cell n = center.N(d_1);          Cell n = center.N(d.d1);
62          n.setText("Uusi paperi");          n.setText("Uusi paperi");
63          return n.getId();          return n.getId();
64      }}      }}
# Line 73  public class PPActionsImpl extends Unica Line 68  public class PPActionsImpl extends Unica
68          Cell c = space.getCell(paperId);          Cell c = space.getCell(paperId);
69    
70          p("New note\n");          p("New note\n");
71          c = c.N(d_contains);          c = c.N(d.contains);
72          c.setText(text); // XXX null content crashes          c.setText(text); // XXX null content crashes
73          Cell arg = c.N(d_pan);          Cell arg = c.N(d.pan);
74          arg.setText("" + x);          arg.setText("" + x);
75          arg = arg.N(d_pan);          arg = arg.N(d.pan);
76          arg.setText("" + y);          arg.setText("" + y);
77          return c.getId();          return c.getId();
78      }}      }}
# Line 86  public class PPActionsImpl extends Unica Line 81  public class PPActionsImpl extends Unica
81                      throws RemoteException {                      throws RemoteException {
82          Cell note = space.getCell(noteId);          Cell note = space.getCell(noteId);
83          // Remove all occurrences          // Remove all occurrences
84          Cell c = note.h(d_clone);          Cell c = note.h(d.clone);
85          while(c!=null) {          while(c!=null) {
86              c.excise(d_contains);              c.excise(d.contains);
87              c.excise(d_association);              c.excise(d.association);
88              c = c.s(d_clone);              c = c.s(d.clone);
89          }          }
90      }      }
91    
92      public void moveNote(String noteId, int x, int y)      public void moveNote(String noteId, int x, int y)
93                      throws RemoteException { synchronized(space) {                      throws RemoteException { synchronized(space) {
94          Cell note = space.getCell(noteId);          Cell note = space.getCell(noteId);
95          Cell arg = note.s(d_pan);          Cell arg = note.s(d.pan);
96          arg.setText("" + x);          arg.setText("" + x);
97          arg = arg.s(d_pan);          arg = arg.s(d.pan);
98          arg.setText("" + y);          arg.setText("" + y);
99      }}      }}
100    
# Line 108  public class PPActionsImpl extends Unica Line 103  public class PPActionsImpl extends Unica
103                      throws RemoteException { synchronized(space) {                      throws RemoteException { synchronized(space) {
104          Cell note = space.getCell(noteId);          Cell note = space.getCell(noteId);
105          Cell assoc = space.getCell(assocId);          Cell assoc = space.getCell(assocId);
106          note.zzclone().connect(d_association, side, assoc.zzclone());          note.zzclone().connect(d.association, side, assoc.zzclone());
107      }}      }}
108    
109      public void insertText(String noteId, int offs, String text)      public void insertText(String noteId, int offs, String text)

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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