118 |
FontMetrics fm = getFontMetrics(); |
FontMetrics fm = getFontMetrics(); |
119 |
|
|
120 |
if (axis == Y_AXIS) |
if (axis == Y_AXIS) |
121 |
return fm.getHeight(); |
return super.getPreferredSpan(axis); |
122 |
|
|
123 |
String text; |
String text; |
124 |
Element elem = getElement(); |
Element elem = getElement(); |
134 |
text = ""; |
text = ""; |
135 |
} |
} |
136 |
|
|
137 |
return fm.stringWidth(text); |
return fm.stringWidth(text) + 30; |
138 |
} |
} |
139 |
|
|
140 |
public int getResizeWeight(int axis) |
public int getResizeWeight(int axis) |
159 |
{ |
{ |
160 |
Shape newAlloc = adjustAllocation(shape); |
Shape newAlloc = adjustAllocation(shape); |
161 |
super.insertUpdate(ev, newAlloc, vf); |
super.insertUpdate(ev, newAlloc, vf); |
162 |
|
getContainer().repaint(); |
163 |
} |
} |
164 |
|
|
165 |
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) |
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) |
166 |
{ |
{ |
167 |
Shape newAlloc = adjustAllocation(shape); |
Shape newAlloc = adjustAllocation(shape); |
168 |
super.removeUpdate(ev, newAlloc, vf); |
super.removeUpdate(ev, newAlloc, vf); |
169 |
|
getContainer().repaint(); |
170 |
} |
} |
171 |
|
|
172 |
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) |
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) |
173 |
{ |
{ |
174 |
Shape newAlloc = adjustAllocation(shape); |
Shape newAlloc = adjustAllocation(shape); |
175 |
super.removeUpdate(ev, newAlloc, vf); |
super.removeUpdate(ev, newAlloc, vf); |
176 |
|
getContainer().repaint(); |
177 |
} |
} |
178 |
|
|
179 |
public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) |
public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) |