public class ComponentUtils
extends java.lang.Object
Constructor and Description |
---|
ComponentUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getComponentIndex(java.awt.Component c,
java.awt.Container container)
Returns the index of the given component in the given container.
|
static java.awt.geom.Rectangle2D |
getDefaultStringSize(java.lang.String text)
Returns the bounds of the given string.
|
static int |
getStringHeight(java.awt.Component c)
Returns the height of the given component.
|
static java.awt.Dimension |
getStringSize(java.awt.Component c,
java.lang.String text)
Returns the size of the given text computed towards to the given
component.
|
static int |
getStringWidth(java.awt.Component c,
java.lang.String text)
Returns the width in pixels of a text.
|
static void |
updateComponentTreeUI(java.awt.Component c)
A simple minded look and feel change: ask each node in the tree
to
updateUI() -- that is, to initialize its UI property
with the current look and feel. |
public static int getStringWidth(java.awt.Component c, java.lang.String text)
c
- the component where the text is containedtext
- the text to measurepublic static java.awt.Dimension getStringSize(java.awt.Component c, java.lang.String text)
c
- the component where the text is containedtext
- the text to measurepublic static int getStringHeight(java.awt.Component c)
c
- the component where the text is containedpublic static java.awt.geom.Rectangle2D getDefaultStringSize(java.lang.String text)
text
- the string to measurepublic static void updateComponentTreeUI(java.awt.Component c)
updateUI()
-- that is, to initialize its UI property
with the current look and feel.c
- UI component.public static int getComponentIndex(java.awt.Component c, java.awt.Container container)
c
- the Component to look forcontainer
- the parent container, where this component is added
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.