37 |
static String str = "Marked cells:"; |
static String str = "Marked cells:"; |
38 |
|
|
39 |
|
|
40 |
public void render(VobScene sc, int into, Fallback fallback, |
public void render(VobScene vs, int into, Fallback fallback, |
41 |
Fallback.Win win) { |
Fallback.Win win) { |
42 |
java.awt.Dimension box = new java.awt.Dimension(); |
java.awt.Dimension boxsize = new java.awt.Dimension(); |
43 |
cv.getDefaultSize(1, box); |
cv.getDefaultSize(1, boxsize); |
44 |
|
|
45 |
int n = fallback.binder.marks.size(); |
int n = fallback.binder.marks.size(); |
46 |
if(n == 0) return; |
if(n == 0) return; |
47 |
|
|
48 |
float w = box.width, h = n * box.height; |
float w = boxsize.width, h = n * boxsize.height; |
49 |
|
|
50 |
java.awt.Dimension outer = sc.getSize(); |
java.awt.Dimension outer = vs.getSize(); |
51 |
|
|
52 |
float x = outer.width - w - PAD, |
float x = outer.width - w - PAD, |
53 |
y = outer.height - h - PAD; |
y = outer.height - h - PAD; |
54 |
|
|
55 |
int cs_list = sc.coordsys(into, KEY, 0, x, y, 2, 2); |
int cs_list = vs.coordsys(into, KEY, 0, x, y, 2, 2); |
56 |
|
|
57 |
|
Box b = new Box(); |
58 |
|
|
59 |
for(int i=0; i<n; i++) { |
for(int i=0; i<n; i++) { |
60 |
Mark m = (Mark)fallback.binder.marks.get(i); |
Mark m = (Mark)fallback.binder.marks.get(i); |
61 |
if(m.spans != null) return; // for now-- should show span(s) |
if(m.spans != null) return; // for now-- should show span(s) |
62 |
Cell c = m.cell; |
Cell c = m.cell; |
63 |
|
|
64 |
int cs = sc.coordsys(cs_list, c, 0, 0, i*box.height, 2, 2); |
int cs = vs.coordsys(cs_list, c, 0, 0, i*boxsize.height, 1, 1); |
65 |
|
b.set(vs, cs, boxsize.width, boxsize.height); |
66 |
|
|
67 |
cv.place(c, sc, cs, box.width, box.height, win); |
cv.place(c, vs, b, win); |
68 |
} |
} |
69 |
|
|
70 |
w = style.getWidth(str, 1); |
w = style.getWidth(str, 1); |
71 |
h = style.getHeight(1); |
h = style.getHeight(1); |
72 |
y -= h; |
y -= h; |
73 |
if(w > box.width) |
if(w > boxsize.width) |
74 |
x += box.width - w; |
x += boxsize.width - w; |
75 |
|
|
76 |
int cs = sc.coordsys(into, TEXT_KEY, 0, x, y, 2, 2); |
int cs = vs.coordsys(into, TEXT_KEY, 0, x, y, 2, 2); |
77 |
sc.map.put(new TextVob(style, str), cs); |
vs.map.put(new TextVob(style, str), cs); |
78 |
} |
} |
79 |
} |
} |