24 |
package gzz.view; |
package gzz.view; |
25 |
import gzz.client.*; |
import gzz.client.*; |
26 |
import gzz.*; |
import gzz.*; |
27 |
|
import gzz.zzutil.Containment; |
28 |
import gzz.errors.*; |
import gzz.errors.*; |
29 |
import gzz.vob.*; |
import gzz.vob.*; |
30 |
import gzz.vob.impl.*; |
import gzz.vob.impl.*; |
63 |
float[] out) { |
float[] out) { |
64 |
String s; |
String s; |
65 |
if(c != null) |
if(c != null) |
66 |
s = c.t(); |
s = Containment.getContainedText(c); |
67 |
else |
else |
68 |
s = widthString; |
s = widthString; |
69 |
out[0] = style.getWidth(s, scale) / scale; |
out[0] = style.getWidth(s, scale) / scale; |
74 |
java.awt.Point point; |
java.awt.Point point; |
75 |
public void place(Cell c, VobScene vs, int box, |
public void place(Cell c, VobScene vs, int box, |
76 |
ViewContext context) { |
ViewContext context) { |
77 |
String s = c.t(); |
String s = Containment.getContainedText(c); |
78 |
if (s == null) s = ""; |
if (s == null) s = ""; |
79 |
int offs = context.getCursorOffset(c); |
int offs = context.getCursorOffset(c); |
80 |
if(dbg) pa("TextCellContentview: '"+s+"' "+offs); |
if(dbg) pa("TextCellContentview: '"+s+"' "+offs); |
138 |
protected void placeVob(Cell c, VobScene vs, int cs, int start, int end, |
protected void placeVob(Cell c, VobScene vs, int cs, int start, int end, |
139 |
int offs, ViewContext context, float h, float scaled_h, float scale) { |
int offs, ViewContext context, float h, float scaled_h, float scale) { |
140 |
// XXX should optimize for common case: no substring() |
// XXX should optimize for common case: no substring() |
141 |
TextVob vob = new TextVob(style, c.t().substring(start, end)); |
TextVob vob = new TextVob(style, Containment.getContainedText(c).substring(start, end)); |
142 |
int cs_scaled = vs.orthoCS(cs, WH_KEY, 0, 0, 0, h, h); |
int cs_scaled = vs.orthoCS(cs, WH_KEY, 0, 0, 0, h, h); |
143 |
vs.map.put(vob, cs_scaled); |
vs.map.put(vob, cs_scaled); |
144 |
|
|
145 |
if(offs >= 0 && offs >= start && offs <= end) { |
if(offs >= 0 && offs >= start && offs <= end) { |
146 |
float x = style.getWidth(c.t().substring(start, offs), scale); |
float x = style.getWidth(Containment.getContainedText(c).substring(start, offs), scale); |
147 |
x *= h/scaled_h; |
x *= h/scaled_h; |
148 |
int cs_cursor = vs.orthoCS(cs, CURS_KEY, -1, x+1, 0, 0, h); |
int cs_cursor = vs.orthoCS(cs, CURS_KEY, -1, x+1, 0, 0, h); |
149 |
// v.map.put(new TextCursorVob(vob, offs), cs); |
// v.map.put(new TextCursorVob(vob, offs), cs); |