|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.extjs.gxt.ui.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(El 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(com.google.gwt.user.client.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. |
static TextMetrics |
get()
Returns the singleton instance. |
int |
getHeight(java.lang.String html)
Returns the measured height of the specified text. |
Size |
getSize(java.lang.String html)
Returns the size of the specified text based on the internal element's style and width properties. |
int |
getWidth(java.lang.String html)
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TextMetrics get()
public void bind(com.google.gwt.user.client.Element el)
el - the elementpublic void bind(El el)
el - the elementpublic int getHeight(java.lang.String html)
setFixedWidth(int) if necessary.
html - the html content to be measured
public Size getSize(java.lang.String html)
html - the html string to measure
public int getWidth(java.lang.String html)
html - the html content 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 | ||||||||