public class PixelLayoutUtils
extends java.lang.Object
Constructor and Description |
---|
PixelLayoutUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
alignAbove(UiElement element,
UiElement alignToElement,
HorizontalAlignment horizontalAlignment)
Aligns the bottom edge of a
UiElement to the top of another element |
static void |
alignBelow(UiElement element,
UiElement alignToElement,
HorizontalAlignment horizontalAlignment)
Aligns the top edge of a
UiElement to the bottom of another element |
static void |
alignEdgeToEdge(UiElement element,
UiElement alignToElement,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment)
Aligns the edges of a
UiElement to the edges of another element. |
static void |
alignLeftOf(UiElement element,
UiElement alignToElement,
VerticalAlignment verticalAlignment)
Aligns the right edge of a
UiElement to the left edge of another element |
static void |
alignRightOf(UiElement element,
UiElement alignToElement,
VerticalAlignment verticalAlignment)
Aligns the left edge of this element to the right edge of another element
|
static boolean |
isOperationsComplete() |
static void |
resizeScrollContentHeightToContents(ScrollBox scrollBox) |
static void |
setHeightToContentHeight(UiElement element,
UiElement matchElement)
Sets the height of one
UiElement to match the content height of another element. |
static void |
setHeightToHeight(UiElement element,
UiElement matchElement)
Sets the height of one
UiElement to match the height of another element |
static void |
setWidthToContentWidth(UiElement element,
UiElement matchElement)
Sets the width of one
UiElement to match the content width of another element. |
static void |
setWidthToWidth(UiElement element,
UiElement matchElement)
Sets the width of one
UiElement to match the width of another element |
static void |
shrinkToContents(ParentUiElement parentUiElement,
boolean recursive,
java.lang.Runnable callback)
Shrinks the width and height for a
ParentUiElement based on its children |
static void |
snapTo(UiElement element,
UiElement snapToElement)
|
static void |
snapTo(UiElement element,
UiElement snapToElement,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment)
Snaps the edge of a
UiElement to the edge of another element. |
static void |
update(float delta) |
public static void update(float delta)
public static boolean isOperationsComplete()
public static void shrinkToContents(ParentUiElement parentUiElement, boolean recursive, java.lang.Runnable callback)
ParentUiElement
based on its childrenparentUiElement
- The ParentUiElement
to setpublic static void alignEdgeToEdge(UiElement element, UiElement alignToElement, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
UiElement
to the edges of another element.element
- The UiElement
to perform alignment onalignToElement
- The UiElement
to align with. Note: This can also be the UiContainer
horizontalAlignment
- HorizontalAlignment.LEFT
aligns the right-side of this element to the left side of the align element.
HorizontalAlignment.CENTER
aligns the center of this element to the center of the align element.
HorizontalAlignment.RIGHT
aligns the left-side of this element to the right-side of the align element.verticalAlignment
- VerticalAlignment.TOP
aligns the bottom-side of this element to the top-side of the align element.
VerticalAlignment.MIDDLE
aligns the middle of this element to the middle of the align element.
VerticalAlignment.BOTTOM
aligns the top-side of this element to the bottom-side of the align element.public static void alignLeftOf(UiElement element, UiElement alignToElement, VerticalAlignment verticalAlignment)
UiElement
to the left edge of another elementelement
- The UiElement
to perform alignment onalignToElement
- The UiElement
to align with. Note: This can also be the UiContainer
verticalAlignment
- VerticalAlignment.TOP
aligns the top-side of this element to the top-side of the align element.
* VerticalAlignment.MIDDLE
aligns the middle of this element to the middle of the align element.
* VerticalAlignment.BOTTOM
aligns the bottom-side of this element to the bottom-side of the align element.public static void alignRightOf(UiElement element, UiElement alignToElement, VerticalAlignment verticalAlignment)
element
- The UiElement
to perform alignment onalignToElement
- The UiElement
to align with. Note: This can also be the UiContainer
verticalAlignment
- VerticalAlignment.TOP
aligns the top-side of this element to the top-side of the align element.
* VerticalAlignment.MIDDLE
aligns the middle of this element to the middle of the align element.
* VerticalAlignment.BOTTOM
aligns the bottom-side of this element to the bottom-side of the align element.public static void alignBelow(UiElement element, UiElement alignToElement, HorizontalAlignment horizontalAlignment)
UiElement
to the bottom of another elementelement
- The UiElement
to perform alignment onalignToElement
- The UiElement
to align with. Note: This can also be the UiContainer
horizontalAlignment
- HorizontalAlignment.LEFT
aligns the left-side of this element to the left side of the align element.
HorizontalAlignment.CENTER
aligns the center of this element to the center of the align element.
HorizontalAlignment.RIGHT
aligns the right-side of this element to the right-side of the align element.public static void alignAbove(UiElement element, UiElement alignToElement, HorizontalAlignment horizontalAlignment)
UiElement
to the top of another elementelement
- The UiElement
to perform alignment onalignToElement
- The UiElement
to align with. Note: This can also be the UiContainer
horizontalAlignment
- HorizontalAlignment.LEFT
aligns the left-side of this element to the left side of the align element.
* HorizontalAlignment.CENTER
aligns the center of this element to the center of the align element.
* HorizontalAlignment.RIGHT
aligns the right-side of this element to the right-side of the align element.public static void snapTo(UiElement element, UiElement snapToElement)
element
- The UiElement
to perform alignment onsnapToElement
- The UiElement
to snap to. Note: This can also be the UiContainer
public static void snapTo(UiElement element, UiElement snapToElement, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
UiElement
to the edge of another element.element
- The UiElement
to perform alignment onsnapToElement
- The UiElement
to snap to. Note: This can also be the UiContainer
horizontalAlignment
- The HorizontalAlignment
of this element within the area of the align elementverticalAlignment
- The VerticalAlignment
of this element within the area of the align elementpublic static void setWidthToWidth(UiElement element, UiElement matchElement)
UiElement
to match the width of another elementpublic static void setWidthToContentWidth(UiElement element, UiElement matchElement)
UiElement
to match the content width of another element. Note: content width = (width - margin - padding)public static void setHeightToHeight(UiElement element, UiElement matchElement)
UiElement
to match the height of another elementpublic static void setHeightToContentHeight(UiElement element, UiElement matchElement)
UiElement
to match the content height of another element. Note: content height = (height - margin - padding)public static void resizeScrollContentHeightToContents(ScrollBox scrollBox)