/[gzz]/gzz/gzz/view/CoordinatePlaneView.java
ViewVC logotype

Diff of /gzz/gzz/view/CoordinatePlaneView.java

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

revision 1.1 by tjl, Wed Oct 30 19:10:17 2002 UTC revision 1.2 by tjl, Fri Nov 1 19:53:52 2002 UTC
# Line 19  public static final String rcsid = "$Id$ Line 19  public static final String rcsid = "$Id$
19      private Dim d_rank;      private Dim d_rank;
20      private Dim d_coords;      private Dim d_coords;
21    
22      private Box cursorBox;      private int cursorBox;
23    
24      public CoordinatePlaneView(Dim d_rank, Dim d_coords) {      public CoordinatePlaneView(Dim d_rank, Dim d_coords) {
25          this.d_rank = d_rank;          this.d_rank = d_rank;
# Line 27  public static final String rcsid = "$Id$ Line 27  public static final String rcsid = "$Id$
27      }      }
28      /** Get the box into which the cursor cell was placed.      /** Get the box into which the cursor cell was placed.
29       */       */
30      public Box getCursorBox() { return cursorBox; }      public int getCursorBox() { return cursorBox; }
31    
32      public void render(VobScene vs, int into, ViewContext context) {      public void render(VobScene vs, int into, ViewContext context) {
33          Cell cur = context.getAccursed();          Cell cur = context.getAccursed();
34          Cell item = cur.h(d_rank);          Cell item = cur.h(d_rank);
35          Cell head = item;          Cell head = item;
         Box b = new Box();  
36          float[] bs = new float[2];          float[] bs = new float[2];
37          cursorBox = null;          cursorBox = -1;
38          CellInBox cv = context.getCellView();          CellInBox cv = context.getCellView();
39          while(item != null) { // for every item:          while(item != null) { // for every item:
40              Cell firstCoord = item.s(d_coords, 1);              Cell firstCoord = item.s(d_coords, 1);
# Line 43  public static final String rcsid = "$Id$ Line 42  public static final String rcsid = "$Id$
42              if(firstCoord != null) {              if(firstCoord != null) {
43                  int[] place = gzz.client.Params.getInts(firstCoord, d_coords, 2, null);                  int[] place = gzz.client.Params.getInts(firstCoord, d_coords, 2, null);
44                  cv.getSize(item, bs);                  cv.getSize(item, bs);
45                  int whc = vs.translateCS(into, item, place[0], place[1]);  
46                  b.set(vs, whc, bs[0], bs[1]);                  int box = vs.orthoBoxCS(into, item, 0, place[0], place[1], 1, 1, bs[0], bs[1]);
47                  cv.place(item, vs, b, context);  
48                    cv.place(item, vs, box, context);
49                  if(item.equals(cur))                  if(item.equals(cur))
50                      cursorBox = (Box)b.clone();                      cursorBox = box;
51              }              }
52              item = item.s(d_rank);              item = item.s(d_rank);
53              if(head.equals(item)) break;              if(head.equals(item)) break;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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