Class FlowLayout
java.lang.Object
com.blackrook.gui.layout.FlowLayout
- All Implemented Interfaces:
GUILayout
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHorizontal alignment types.protected static classSpecial panel that acts as a "new line" in a flow.static enumVertical alignment types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<com.blackrook.gui.layout.FlowLayout.Flow> Vector of objects.static final floatDefault gap size.protected FlowLayout.HAlignmentHorizontal alignment type.protected floatHorizontal gap between objects.protected floatCurrent X space.protected floatCurrent Y space.protected FlowLayout.VAlignmentVertical alignment type.protected floatVertical gap between objects. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new FlowLayout with a LEFT horizontal alignment, TOP vertical alignment, and default gaps.Creates a new FlowLayout with a specific horizontal alignment, TOP vertical alignment, and default gaps.Creates a new FlowLayout with specific alignments and default gaps.FlowLayout(FlowLayout.HAlignment h, FlowLayout.VAlignment v, float hGap) Creates a new FlowLayout with specific alignments and horizontal gap.FlowLayout(FlowLayout.HAlignment h, FlowLayout.VAlignment v, float hGap, float vGap) Creates a new FlowLayout with specific alignments and gaps. -
Method Summary
Modifier and TypeMethodDescriptionstatic GUIObjectCreates a special panel that is used for deciding to create a new line in the flow layout.protected voidorientChildren(GUIObject parent) protected voidprepareLayout(GUIObject parent) voidresizeChild(GUIObject object, int index, int childTotal) Called when a child object needs resizing.
-
Field Details
-
DEFAULT_GAP
public static final float DEFAULT_GAPDefault gap size.- See Also:
-
hAlignment
Horizontal alignment type. -
vAlignment
Vertical alignment type. -
horizontalGap
protected float horizontalGapHorizontal gap between objects. -
verticalGap
protected float verticalGapVertical gap between objects. -
sizeX
protected float sizeXCurrent X space. -
sizeY
protected float sizeYCurrent Y space. -
currentLineup
Vector of objects.
-
-
Constructor Details
-
FlowLayout
public FlowLayout()Creates a new FlowLayout with a LEFT horizontal alignment, TOP vertical alignment, and default gaps. -
FlowLayout
Creates a new FlowLayout with a specific horizontal alignment, TOP vertical alignment, and default gaps.- Parameters:
h- the horizontal alignment of this layout.
-
FlowLayout
Creates a new FlowLayout with specific alignments and default gaps.- Parameters:
h- the horizontal alignment of this layout.v- the vertical alignment of this layout.
-
FlowLayout
Creates a new FlowLayout with specific alignments and horizontal gap.- Parameters:
h- the horizontal alignment of this layout.v- the vertical alignment of this layout.hGap- the gap between horizontal elements.
-
FlowLayout
Creates a new FlowLayout with specific alignments and gaps.- Parameters:
h- the horizontal alignment of this layout.v- the vertical alignment of this layout.hGap- the gap between horizontal elements.vGap- the gap between vertical elements.
-
-
Method Details
-
createNewLinePanel
Creates a special panel that is used for deciding to create a new line in the flow layout.- Returns:
- a new panel.
-
resizeChild
Description copied from interface:GUILayoutCalled when a child object needs resizing. DO NOT RESIZE THE PARENT OBJECT IN THIS METHOD, AS IT MAY CAUSE AN INFINITE LOOP TO OCCUR.- Specified by:
resizeChildin interfaceGUILayout- Parameters:
object- the object to resize.index- the child index while traversing through the list of children.childTotal- the total number of children.
-
prepareLayout
-
orientChildren
-