Package tripleplay.ui.layout
Class AbsoluteLayout
java.lang.Object
tripleplay.ui.Layout
tripleplay.ui.layout.AbsoluteLayout
A layout that positions elements at absolute coordinates (at either their preferred size or at a
manually specified size). Constraints are specified like so:
Group group = new Group(new AbsoluteLayout()).add(
AbsoluteLayout.at(new Label("+50+50"), 50, 50),
AbsoluteLayout.at(new Button("100x50+25+25"), 25, 25, 100, 50)
);
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Defines absolute layout constraints. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Element<?>>
Tat
(T elem, float x, float y) Positionselem
at the specified position, in its preferred size.static <T extends Element<?>>
Tat
(T elem, float x, float y, float width, float height) Constrainselem
to the specified position and size.static <T extends Element<?>>
Tat
(T elem, float x, float y, float width, float height, Style.HAlign halign, Style.VAlign valign) Constrainselem
to the specified size and aligns it relative to the given position using the given alignments.static <T extends Element<?>>
Tat
(T elem, float x, float y, Style.HAlign halign, Style.VAlign valign) Positionselem
relative to the given position using the given alignments.static <T extends Element<?>>
Tat
(T elem, pythagoras.f.IPoint position) Positionselem
at the specified position, in its preferred size.static <T extends Element<?>>
Tat
(T elem, pythagoras.f.IPoint position, pythagoras.f.IDimension size) Constrainselem
to the specified position and size.static <T extends Element<?>>
Tat
(T elem, pythagoras.f.IPoint position, pythagoras.f.IDimension size, Style.HAlign halign, Style.VAlign valign) Constrainselem
to the specified size and aligns it relative to the given position using the given alignments.static <T extends Element<?>>
Tat
(T elem, pythagoras.f.IPoint position, Style.HAlign halign, Style.VAlign valign) Positionselem
relative to the given position using the given alignments.static <T extends Element<?>>
TcenterAt
(T elem, float x, float y) Centerselem
on the specified position, in its preferred size.static <T extends Element<?>>
TcenterAt
(T elem, pythagoras.f.IPoint position) Centerselem
on the specified position, in its preferred size.pythagoras.f.Dimension
computeSize
(Container<?> elems, float hintX, float hintY) Computes and returns the size needed to arrange children of the supplied container according to their preferred size, given the specified x and y size hints.void
Lays out the supplied elements into a region of the specified dimensions.static AbsoluteLayout.Constraint
Creates a constraint to position an element uniformly.
-
Constructor Details
-
AbsoluteLayout
public AbsoluteLayout()
-
-
Method Details
-
uniform
Creates a constraint to position an element uniformly. The given box point is used for both the position and the origin. For example, ifBoxPoint.BR
is used, then the element will be positioned such that its bottom right corner is over the bottom right corner of the group. -
at
Positionselem
at the specified position, in its preferred size. -
at
Positionselem
at the specified position, in its preferred size. -
at
Constrainselem
to the specified position and size. -
at
public static <T extends Element<?>> T at(T elem, pythagoras.f.IPoint position, pythagoras.f.IDimension size) Constrainselem
to the specified position and size. -
at
public static <T extends Element<?>> T at(T elem, float x, float y, Style.HAlign halign, Style.VAlign valign) Positionselem
relative to the given position using the given alignments. -
at
public static <T extends Element<?>> T at(T elem, pythagoras.f.IPoint position, Style.HAlign halign, Style.VAlign valign) Positionselem
relative to the given position using the given alignments. -
at
public static <T extends Element<?>> T at(T elem, float x, float y, float width, float height, Style.HAlign halign, Style.VAlign valign) Constrainselem
to the specified size and aligns it relative to the given position using the given alignments. -
at
public static <T extends Element<?>> T at(T elem, pythagoras.f.IPoint position, pythagoras.f.IDimension size, Style.HAlign halign, Style.VAlign valign) Constrainselem
to the specified size and aligns it relative to the given position using the given alignments. -
centerAt
Centerselem
on the specified position, in its preferred size. -
centerAt
Centerselem
on the specified position, in its preferred size. -
computeSize
Description copied from class:Layout
Computes and returns the size needed to arrange children of the supplied container according to their preferred size, given the specified x and y size hints.- Specified by:
computeSize
in classLayout
-
layout
Description copied from class:Layout
Lays out the supplied elements into a region of the specified dimensions.
-