51 |
this.style = style; |
this.style = style; |
52 |
} |
} |
53 |
|
|
54 |
public void place(Cell c, VobScene v, Box box, |
float[] boxwh = new float[2]; |
55 |
|
public void place(Cell c, VobScene vs, int box, |
56 |
ViewContext context) { |
ViewContext context) { |
57 |
String s = c.t(); |
String s = c.t(); |
58 |
if (s == null) s = ""; |
if (s == null) s = ""; |
80 |
float left = style.getWidth(s.substring(0, center), scale); |
float left = style.getWidth(s.substring(0, center), scale); |
81 |
float right = width - left; |
float right = width - left; |
82 |
|
|
83 |
float middle = box.getWidth() / 2.0f; |
vs.coords.getSqSize(box, boxwh); |
84 |
|
float middle = boxwh[0] / 2.0f; |
85 |
|
|
86 |
// Possibly offset text so cursor is visible. |
// Possibly offset text so cursor is visible. |
87 |
float textOffset; |
float textOffset; |
88 |
if(width < box.getWidth()) textOffset = 0; |
if(width < boxwh[0]) textOffset = 0; |
89 |
else if(left < middle) textOffset = 0; |
else if(left < middle) textOffset = 0; |
90 |
else if(right < middle) textOffset = (- width + box.getWidth()); |
else if(right < middle) textOffset = (- width + boxwh[0]); |
91 |
else textOffset = (- left + middle); |
else textOffset = (- left + middle); |
92 |
|
|
93 |
Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1); |
Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1); |
94 |
int offsetcs = v.orthoCS(box.getWHCoordsys(), key, 0, textOffset, 0, 1, 1); |
int offsetcs = vs.orthoCS(box, key, 0, textOffset, 0, 1, 1); |
95 |
|
|
96 |
placeVob(c, v, offsetcs, box.getWidth(), box.getHeight(), brBefore, brAfter, offs, context, scale); |
placeVob(c, vs, offsetcs, boxwh[0], boxwh[1], brBefore, brAfter, offs, context, scale); |
97 |
} |
} |
98 |
|
|
99 |
static Object WH_KEY = new Object(); |
static Object WH_KEY = new Object(); |