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,
java.lang.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.
|
protected void |
clampSplitAmount()
Called during layout to clamp the
splitAmount within the set limits. |
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 |
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.
|
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) |
childrenChanged, getMaxHeight, getMaxWidth, invalidate, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validateact, addActorAfter, applyTransform, applyTransform, clear, clearChildren, computeTransform, debugAll, drawChildren, drawDebug, drawDebugChildren, findActor, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toStringaddAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebugBounds, 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, hasParent, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFrontpublic SplitPane(Actor firstWidget, Actor secondWidget, boolean vertical, Skin skin)
firstWidget - May be null.secondWidget - May be null.public SplitPane(Actor firstWidget, Actor secondWidget, boolean vertical, Skin skin, java.lang.String styleName)
firstWidget - May be null.secondWidget - May be null.public SplitPane(Actor firstWidget, 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 - Should be multiplied with the actor's alpha, allowing a 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()
protected void clampSplitAmount()
splitAmount within the set limits. By default it imposes the limits of the
min amount, max amount, and min sizes of the children. This
method is internally called in response to layout, so it should not call WidgetGroup.invalidate().public float getMinSplitAmount()
public void setMinSplitAmount(float minAmount)
public float getMaxSplitAmount()
public void setMaxSplitAmount(float maxAmount)
public void setFirstWidget(Actor widget)
widget - May be null.public void setSecondWidget(Actor widget)
widget - May be null.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)
Groupcleared so the actions will be returned to their
pool, if any. This is not done automatically.removeActor in class Groupunfocus - If true, Stage.unfocus(Actor) is called.