|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.core.client.util.TextMetrics
public class TextMetrics
Provides precise pixel measurements for blocks of text so that you can determine exactly how high and wide, in pixels, a given block of text will be.
| Method Summary | |
|---|---|
void |
bind(Element el)
Binds this TextMetrics instance to an element from which to copy existing CSS styles that can affect the size of the rendered text. |
void |
bind(java.lang.String className)
|
void |
bind(XElement el)
Binds this TextMetrics instance to an element from which to copy existing CSS styles that can affect the size of the rendered text. |
static TextMetrics |
get()
Returns the singleton instance. |
int |
getHeight(java.lang.String text)
Returns the measured height of the specified text. |
Size |
getSize(java.lang.String text)
Returns the size of the specified text based on the internal element's style and width properties. |
int |
getWidth(java.lang.String text)
Returns the measured width of the specified text. |
void |
setFixedWidth(int width)
Sets a fixed width on the internal measurement element. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TextMetrics get()
public void bind(Element el)
el - the elementpublic void bind(XElement el)
el - the elementpublic void bind(java.lang.String className)
public int getHeight(java.lang.String text)
setFixedWidth(int) if necessary.
text - the text to be measured
public Size getSize(java.lang.String text)
text - the text to measure
public int getWidth(java.lang.String text)
text - the text to measure
public void setFixedWidth(int width)
width - the width to set on the element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||