public class UI2dContainer extends UI2dComponent implements UIContainer, Iterable<UIObject>
Modifier and Type | Class and Description |
---|---|
static class |
UI2dContainer.ArrowKeyFocus |
static class |
UI2dContainer.Layout |
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
UI2dContainer(float x,
float y,
float w,
float h) |
Modifier and Type | Method and Description |
---|---|
UI2dContainer |
addChildren(UI2dComponent... children) |
protected UI2dContainer |
addTopLevelComponent(UI2dComponent child) |
UI2dComponent |
getChild(int i) |
List<UIObject> |
getChildren() |
float |
getContentHeight()
Returns the height of the content container
|
UIObject |
getContentTarget()
Returns the object that elements are added to when placed in this container.
|
float |
getContentWidth()
Returns the width of the content container
|
Iterator<UIObject> |
iterator() |
static UI2dContainer |
newHorizontalContainer(float height) |
static UI2dContainer |
newHorizontalContainer(float height,
float childSpacing) |
static UI2dContainer |
newHorizontalContainer(float height,
float childSpacing,
UI2dComponent... children) |
static UI2dContainer |
newVerticalContainer(float width) |
static UI2dContainer |
newVerticalContainer(float width,
float childSpacing) |
static UI2dContainer |
newVerticalContainer(float width,
float childSpacing,
UI2dComponent... children) |
protected void |
onKeyPressed(KeyEvent keyEvent,
char keyChar,
int keyCode)
Subclasses override to receive key events
|
protected void |
reflow() |
UI2dContainer |
removeAllChildren() |
UI2dContainer |
setArrowKeyFocus(UI2dContainer.ArrowKeyFocus keyFocus) |
UI2dContainer |
setChildMargin(float childMargin)
Deprecated.
|
UI2dContainer |
setChildSpacing(float childSpacing)
Sets the spacing between child objects when a layout is in use
|
UI2dContainer |
setChildSpacing(float childSpacingY,
float childSpacingX)
Sets the spacing between child objects when a layout is in use
|
UI2dContainer |
setContentHeight(float h) |
UI2dContainer |
setContentSize(float w,
float h) |
protected UI2dContainer |
setContentTarget(UI2dContainer contentTarget) |
UI2dContainer |
setContentWidth(float w) |
UI2dContainer |
setLayout(UI2dContainer.Layout layout) |
UI2dContainer |
setMinHeight(float minHeight) |
UI2dContainer |
setMinWidth(float minWidth) |
UI2dContainer |
setPadding(float padding) |
UI2dContainer |
setPadding(float yPadding,
float xPadding) |
UI2dContainer |
setPadding(float topPadding,
float rightPadding,
float bottomPadding,
float leftPadding) |
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, onResize, redraw, removeFromContainer, setBackground, setBackgroundColor, setBorder, setBorderColor, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setY
addLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onBlur, onDraw, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMousePressed, onMouseReleased, onMouseWheel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static UI2dContainer newHorizontalContainer(float height)
public static UI2dContainer newHorizontalContainer(float height, float childSpacing)
public static UI2dContainer newHorizontalContainer(float height, float childSpacing, UI2dComponent... children)
public static UI2dContainer newVerticalContainer(float width)
public static UI2dContainer newVerticalContainer(float width, float childSpacing)
public static UI2dContainer newVerticalContainer(float width, float childSpacing, UI2dComponent... children)
public UI2dContainer setPadding(float padding)
public UI2dContainer setPadding(float yPadding, float xPadding)
public UI2dContainer setPadding(float topPadding, float rightPadding, float bottomPadding, float leftPadding)
@Deprecated public UI2dContainer setChildMargin(float childMargin)
setChildSpacing(float)
insteadchildMargin
- Spacing between child objectspublic UI2dContainer setChildSpacing(float childSpacing)
childSpacing
- Spacing between child objectspublic UI2dContainer setChildSpacing(float childSpacingY, float childSpacingX)
childSpacingY
- Vertical spacing between child objectschildSpacingX
- Horizontal spacing between child objectspublic UI2dContainer setMinWidth(float minWidth)
public UI2dContainer setMinHeight(float minHeight)
public UI2dContainer setLayout(UI2dContainer.Layout layout)
public UI2dContainer setArrowKeyFocus(UI2dContainer.ArrowKeyFocus keyFocus)
public UI2dContainer addChildren(UI2dComponent... children)
protected void reflow()
protected UI2dContainer setContentTarget(UI2dContainer contentTarget)
protected UI2dContainer addTopLevelComponent(UI2dComponent child)
public UIObject getContentTarget()
getContentTarget
in interface UIContainer
public float getContentWidth()
UIContainer
getContentWidth
in interface UIContainer
public float getContentHeight()
UIContainer
getContentHeight
in interface UIContainer
public UI2dContainer setContentWidth(float w)
public UI2dContainer setContentHeight(float h)
public UI2dContainer setContentSize(float w, float h)
public UI2dContainer removeAllChildren()
public UI2dComponent getChild(int i)
protected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UIEventHandler
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valueLX library by Mark C. Slee. © 2012-2020