public class SplitPane extends WidgetGroup
Minimum and maximum split amounts can be set to limit the motion of the resizing handle. The handle position is also prevented
from shrinking the children below their minimum sizes. If these limits over-constrain the handle, it will be locked and placed
at an averaged location, resulting in cropped children. The minimum child size can be ignored (allowing dynamic cropping) by
wrapping the child in a Container with a minimum size of 0 and fill() set, or by
overriding clampSplitAmount().
The preferred size of a SplitPane is that of the child widgets and the size of the SplitPane.SplitPaneStyle.handle. The widgets
are sized depending on the SplitPane size and the split position.
| Modifier and Type | Class and Description |
|---|---|
static class |
SplitPane.SplitPaneStyle
The style for a splitpane, see
SplitPane. |
| Constructor and Description |
|---|
SplitPane(Actor firstWidget,
Actor secondWidget,
boolean vertical,
Skin skin) |
SplitPane(Actor firstWidget,
Actor secondWidget,
boolean vertical,
Skin skin,
String styleName) |
SplitPane(Actor firstWidget,
Actor secondWidget,
boolean vertical,
SplitPane.SplitPaneStyle style) |
| Modifier and Type | Method and Description |
|---|---|
void |
addActor(Actor actor)
Adds an actor as a child of this group, removing it from its previous parent.
|
void |
addActorAt(int index,
Actor actor)
Adds an actor as a child of this group at a specific index, removing it from its previous parent.
|
void |
addActorBefore(Actor actorBefore,
Actor actor)
Adds an actor as a child of this group immediately before another child actor, removing it from its previous parent.
|
void |
draw(Batch batch,
float parentAlpha)
If this method is overridden, the super method or
WidgetGroup.validate() should be called to ensure the widget group is laid
out. |
float |
getMaxSplitAmount() |
float |
getMinHeight() |
float |
getMinSplitAmount() |
float |
getMinWidth() |
float |
getPrefHeight() |
float |
getPrefWidth() |
float |
getSplitAmount() |
SplitPane.SplitPaneStyle |
getStyle()
Returns the split pane's style.
|
boolean |
isCursorOverHandle() |
boolean |
isVertical() |
void |
layout()
Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls
Layout.invalidate() on any each child whose width or height has changed, and calls Layout.validate() on each
child. |
boolean |
removeActor(Actor actor)
Removes an actor from this group and unfocuses it.
|
boolean |
removeActor(Actor actor,
boolean unfocus)
Removes an actor from this group.
|
Actor |
removeActorAt(int index,
boolean unfocus)
Removes an actor from this group.
|
void |
setFirstWidget(Actor widget) |
void |
setMaxSplitAmount(float maxAmount) |
void |
setMinSplitAmount(float minAmount) |
void |
setSecondWidget(Actor widget) |
void |
setSplitAmount(float splitAmount) |
void |
setStyle(SplitPane.SplitPaneStyle style) |
void |
setVertical(boolean vertical) |
getMaxHeight, getMaxWidth, invalidate, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, validateact, addActorAfter, clear, clear, clearChildren, clearChildren, debugAll, drawDebug, findActor, getChild, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, setCullingArea, setDebug, setTransform, swapActor, swapActor, toStringaddAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFrontpublic SplitPane(@Null Actor firstWidget, @Null Actor secondWidget, boolean vertical, Skin skin)
firstWidget - May be null.secondWidget - May be null.public SplitPane(@Null Actor firstWidget, @Null Actor secondWidget, boolean vertical, Skin skin, String styleName)
firstWidget - May be null.secondWidget - May be null.public SplitPane(@Null Actor firstWidget, @Null Actor secondWidget, boolean vertical, SplitPane.SplitPaneStyle style)
firstWidget - May be null.secondWidget - May be null.public void setStyle(SplitPane.SplitPaneStyle style)
public SplitPane.SplitPaneStyle getStyle()
setStyle(SplitPaneStyle)
is called.public void layout()
LayoutLayout.invalidate() on any each child whose width or height has changed, and calls Layout.validate() on each
child. This method should almost never be called directly, instead Layout.validate() should be used.layout in interface Layoutlayout in class WidgetGrouppublic float getPrefWidth()
getPrefWidth in interface LayoutgetPrefWidth in class WidgetGrouppublic float getPrefHeight()
getPrefHeight in interface LayoutgetPrefHeight in class WidgetGrouppublic float getMinWidth()
getMinWidth in interface LayoutgetMinWidth in class WidgetGrouppublic float getMinHeight()
getMinHeight in interface LayoutgetMinHeight in class WidgetGrouppublic void setVertical(boolean vertical)
public boolean isVertical()
public void draw(Batch batch, float parentAlpha)
WidgetGroupWidgetGroup.validate() should be called to ensure the widget group is laid
out.draw in class WidgetGroupparentAlpha - The parent alpha, to be multiplied with this actor's alpha, allowing the parent's alpha to affect all
children.public void setSplitAmount(float splitAmount)
splitAmount - The split amount between the min and max amount. This parameter is clamped during layout. See
clampSplitAmount().public float getSplitAmount()
public float getMinSplitAmount()
public void setMinSplitAmount(float minAmount)
public float getMaxSplitAmount()
public void setMaxSplitAmount(float maxAmount)
public void addActor(Actor actor)
Grouppublic void addActorAt(int index,
Actor actor)
GroupaddActorAt in class Groupindex - May be greater than the number of children.public void addActorBefore(Actor actorBefore, Actor actor)
GroupaddActorBefore in class Grouppublic boolean removeActor(Actor actor)
GroupGroup.removeActor(Actor, boolean) with true.removeActor in class Grouppublic boolean removeActor(Actor actor, boolean unfocus)
GroupGroup.removeActorAt(int, boolean) with the actor's child index.removeActor in class Grouppublic Actor removeActorAt(int index, boolean unfocus)
Groupcleared so the actions will be returned to their
pool, if any. This is not done automatically.removeActorAt in class Groupunfocus - If true, Stage.unfocus(Actor) is called.public boolean isCursorOverHandle()
Copyright © 2021. All rights reserved.