Package com.prineside.tdi2.scene2d.utils
Interface Layout
- All Known Implementing Classes:
AnimatedImage
,Button
,ButtonHoldHint
,CheckBox
,Container
,EffectTooltip
,EnemyViewer
,FancyButton
,HighlightActor
,HorizontalGroup
,Image
,ImageButton
,ImageTextButton
,ImageWithParentColor
,Label
,LabelButton
,LabelToggleButton
,LabelWithShadow
,LimitedWidthLabel
,List
,ListClassUsagesWindow
,ListenerGroupViewer
,MapEditorUi.ToolButton
,PieChartActor
,ProgressBar
,QuadActor
,ScrollPane
,SelectBox
,SelectBox.SelectBoxScrollPane
,SimulationScreen.RunningSimCell
,Slider
,SplitPane
,Stack
,Table
,TableButton
,TextArea
,TextButton
,TextField
,TextField.ContextMenu
,TextFieldXPlatform
,Touchpad
,TrailMultilineActor
,Tree
,VerticalGroup
,WebView
,Widget
,WidgetGroup
,Window
public interface Layout
Provides methods for an actor to participate in layout and to provide a minimum, preferred, and maximum size.
- Author:
- Nathan Sweet
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Zero indicates no max height.float
Zero indicates no max width.float
float
float
float
void
Invalidates this actor's layout, causinglayout()
to happen the next timevalidate()
is called.void
Invalidates this actor and its ascendants, callinginvalidate()
on each.void
layout()
Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child, callsinvalidate()
on any each child whose width or height has changed, and callsvalidate()
on each child.void
pack()
Sizes this actor to its preferred width and height, then callsvalidate()
.void
setFillParent
(boolean fillParent) If true, this actor will be sized to the parent invalidate()
.void
setLayoutEnabled
(boolean enabled) Enables or disables the layout for this actor and all child actors, recursively.void
validate()
Ensures the actor has been laid out.
-
Method Details
-
layout
void layout()Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child, callsinvalidate()
on any each child whose width or height has changed, and callsvalidate()
on each child. This method should almost never be called directly, insteadvalidate()
should be used. -
invalidate
void invalidate()Invalidates this actor's layout, causinglayout()
to happen the next timevalidate()
is called. This method should be called when state changes in the actor that requires a layout but does not change the minimum, preferred, maximum, or actual size of the actor (meaning it does not affect the parent actor's layout). -
invalidateHierarchy
void invalidateHierarchy()Invalidates this actor and its ascendants, callinginvalidate()
on each. This method should be called when state changes in the actor that affects the minimum, preferred, maximum, or actual size of the actor (meaning it potentially affects the parent actor's layout). -
validate
void validate()Ensures the actor has been laid out. Callslayout()
ifinvalidate()
has been called since the last timevalidate()
was called, or if the actor otherwise needs to be laid out. This method is usually called inActor.draw(Batch, float)
by the actor itself before drawing is performed. -
pack
void pack()Sizes this actor to its preferred width and height, then callsvalidate()
.Generally this method should not be called in an actor's constructor because it calls
layout()
, which means a subclass would have layout() called before the subclass' constructor. Instead, in constructors simply set the actor's size togetPrefWidth()
andgetPrefHeight()
. This allows the actor to have a size at construction time for more convenient use with groups that do not layout their children. -
setFillParent
void setFillParent(boolean fillParent) If true, this actor will be sized to the parent invalidate()
. If the parent is the stage, the actor will be sized to the stage. This method is for convenience only when the widget's parent does not set the size of its children (such as the stage). -
setLayoutEnabled
void setLayoutEnabled(boolean enabled) Enables or disables the layout for this actor and all child actors, recursively. When false,validate()
will not cause a layout to occur. This can be useful when an actor will be manipulated externally, such as with actions. Default is true. -
getMinWidth
float getMinWidth() -
getMinHeight
float getMinHeight() -
getPrefWidth
float getPrefWidth() -
getPrefHeight
float getPrefHeight() -
getMaxWidth
float getMaxWidth()Zero indicates no max width. -
getMaxHeight
float getMaxHeight()Zero indicates no max height.
-