public class GuiUtils
extends java.lang.Object
Gui
related functions.Modifier | Constructor and Description |
---|---|
private |
GuiUtils()
Private constructor to prevent instantiation.
|
Modifier and Type | Method and Description |
---|---|
static int |
getElementX(java.awt.Component element)
Returns an element's absolute screen coordinate.
|
static int |
getElementY(java.awt.Component element)
Returns an element's absolute screen coordinate.
|
static Gui |
getGui(java.awt.Component element)
Returns the
Gui an element is part of. |
static java.awt.Dimension |
getTextDimension(java.lang.String text,
java.awt.FontMetrics fontMetrics)
Returns the extents of a string when rendered in a given
Font on
this component. |
public static int getElementX(@NotNull java.awt.Component element)
element
- the elementpublic static int getElementY(@NotNull java.awt.Component element)
element
- the element@Nullable public static Gui getGui(@NotNull java.awt.Component element)
Gui
an element is part of.element
- the elementnull
@NotNull public static java.awt.Dimension getTextDimension(@NotNull java.lang.String text, @NotNull java.awt.FontMetrics fontMetrics)
Font
on
this component.text
- the textfontMetrics
- the font metrics for the font