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; |
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); |
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; |