50 |
TextStyle style; |
TextStyle style; |
51 |
SimpleLinebreaker breaker = new SimpleLinebreaker(); |
SimpleLinebreaker breaker = new SimpleLinebreaker(); |
52 |
|
|
53 |
|
|
54 |
|
String widthString; |
55 |
|
|
56 |
public LinebrokenCellContentView(TextStyle style) { |
public LinebrokenCellContentView(TextStyle style) { |
57 |
|
this(style, "XXXXXXXXXX"); |
58 |
|
} |
59 |
|
|
60 |
|
public LinebrokenCellContentView(TextStyle style, String widthString) { |
61 |
this.style = style; |
this.style = style; |
62 |
|
this.widthString = widthString; |
63 |
} |
} |
64 |
|
|
65 |
/** Get the height necessary to layout *all* text in a cell, |
/** Get the height necessary to layout *all* text in a cell, |
71 |
return br.getHeight(); |
return br.getHeight(); |
72 |
} |
} |
73 |
|
|
74 |
|
public void getSize(Cell c, float scale, ViewContext context, |
75 |
|
float[] out) { |
76 |
|
String s; |
77 |
|
if(c != null) |
78 |
|
s = c.t(); |
79 |
|
else |
80 |
|
s = widthString; |
81 |
|
|
82 |
|
float w = style.getWidth(s, scale); |
83 |
|
float h; |
84 |
|
if(c != null) |
85 |
|
h = getHeight(c, w, scale); |
86 |
|
else |
87 |
|
h = style.getHeight(scale); |
88 |
|
|
89 |
|
out[0] = w/scale; |
90 |
|
out[1] = h/scale; |
91 |
|
} |
92 |
|
|
93 |
static Rectangle box = new Rectangle(); |
static Rectangle box = new Rectangle(); |
94 |
float[] boxwh = new float[2]; |
float[] boxwh = new float[2]; |
95 |
public void place(Cell c, VobScene vs, int box, |
public void place(Cell c, VobScene vs, int box, |