Class Cell<T extends Actor>
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.ui.Cell<T>
-
- All Implemented Interfaces:
Pool.Poolable
public class Cell<T extends Actor> extends java.lang.Object implements Pool.Poolable
A cell for aTable
.
-
-
Constructor Summary
Constructors Constructor Description Cell()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Cell<T>
align(int align)
Sets the alignment of the actor within the cell.Cell<T>
bottom()
AddsAlign.bottom
and clearsAlign.top
for the alignment of the actor within the cell.Cell<T>
center()
Sets the alignment of the actor within the cell toAlign.center
.Cell<T>
clearActor()
Removes the current actor for the cell, if any.Cell<T>
colspan(int colspan)
static Cell
defaults()
Returns the defaults to use for all cells.Cell<T>
expand()
Sets expandX and expandY to 1.Cell<T>
expand(boolean x, boolean y)
Sets expandX and expandY to 1 if true, 0 if false.Cell<T>
expand(int x, int y)
Cell<T>
expandX()
Sets expandX to 1.Cell<T>
expandY()
Sets expandY to 1.Cell<T>
fill()
Sets fillX and fillY to 1.Cell<T>
fill(boolean fill)
Sets fillX and fillY to 1 if true, 0 if false.Cell<T>
fill(boolean x, boolean y)
Sets fillX and fillY to 1 if true, 0 if false.Cell<T>
fill(float x, float y)
Cell<T>
fillX()
Sets fillX to 1.Cell<T>
fillY()
Sets fillY to 1.T
getActor()
Returns the actor for this cell, or null.float
getActorHeight()
float
getActorWidth()
float
getActorX()
float
getActorY()
java.lang.Integer
getAlign()
java.lang.Integer
getColspan()
int
getColumn()
float
getComputedPadBottom()
The actual amount of combined padding and spacing from the last layout.float
getComputedPadLeft()
The actual amount of combined padding and spacing from the last layout.float
getComputedPadRight()
The actual amount of combined padding and spacing from the last layout.float
getComputedPadTop()
The actual amount of combined padding and spacing from the last layout.java.lang.Integer
getExpandX()
java.lang.Integer
getExpandY()
java.lang.Float
getFillX()
java.lang.Float
getFillY()
float
getMaxHeight()
Value
getMaxHeightValue()
float
getMaxWidth()
Value
getMaxWidthValue()
float
getMinHeight()
Value
getMinHeightValue()
float
getMinWidth()
Value
getMinWidthValue()
float
getPadBottom()
Value
getPadBottomValue()
float
getPadLeft()
Value
getPadLeftValue()
float
getPadRight()
Value
getPadRightValue()
float
getPadTop()
Value
getPadTopValue()
float
getPadX()
ReturnsgetPadLeft()
plusgetPadRight()
.float
getPadY()
ReturnsgetPadTop()
plusgetPadBottom()
.float
getPrefHeight()
Value
getPrefHeightValue()
float
getPrefWidth()
Value
getPrefWidthValue()
int
getRow()
float
getSpaceBottom()
Value
getSpaceBottomValue()
float
getSpaceLeft()
Value
getSpaceLeftValue()
float
getSpaceRight()
Value
getSpaceRightValue()
float
getSpaceTop()
Value
getSpaceTopValue()
Table
getTable()
java.lang.Boolean
getUniformX()
java.lang.Boolean
getUniformY()
Cell<T>
grow()
Sets expandX, expandY, fillX, and fillY to 1.Cell<T>
growX()
Sets expandX and fillX to 1.Cell<T>
growY()
Sets expandY and fillY to 1.boolean
hasActor()
Returns true if the cell's actor is not null.Cell<T>
height(float height)
Sets the minHeight, prefHeight, and maxHeight to the specified value.Cell<T>
height(Value height)
Sets the minHeight, prefHeight, and maxHeight to the specified value.boolean
isEndRow()
Returns true if this cell is the last cell in the row.Cell<T>
left()
AddsAlign.left
and clearsAlign.right
for the alignment of the actor within the cell.Cell<T>
maxHeight(float maxHeight)
If the maxHeight is 0, no maximum height is used.Cell<T>
maxHeight(Value maxHeight)
If the maxHeight is 0, no maximum height is used.Cell<T>
maxSize(float size)
Sets the maxWidth and maxHeight to the specified value.Cell<T>
maxSize(float width, float height)
Sets the maxWidth and maxHeight to the specified values.Cell<T>
maxSize(Value size)
Sets the maxWidth and maxHeight to the specified value.Cell<T>
maxSize(Value width, Value height)
Sets the maxWidth and maxHeight to the specified values.Cell<T>
maxWidth(float maxWidth)
If the maxWidth is 0, no maximum width is used.Cell<T>
maxWidth(Value maxWidth)
If the maxWidth is 0, no maximum width is used.Cell<T>
minHeight(float minHeight)
Cell<T>
minHeight(Value minHeight)
Cell<T>
minSize(float size)
Sets the minWidth and minHeight to the specified value.Cell<T>
minSize(float width, float height)
Sets the minWidth and minHeight to the specified values.Cell<T>
minSize(Value size)
Sets the minWidth and minHeight to the specified value.Cell<T>
minSize(Value width, Value height)
Sets the minWidth and minHeight to the specified values.Cell<T>
minWidth(float minWidth)
Cell<T>
minWidth(Value minWidth)
Cell<T>
pad(float pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value.Cell<T>
pad(float top, float left, float bottom, float right)
Cell<T>
pad(Value pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value.Cell<T>
pad(Value top, Value left, Value bottom, Value right)
Cell<T>
padBottom(float padBottom)
Cell<T>
padBottom(Value padBottom)
Cell<T>
padLeft(float padLeft)
Cell<T>
padLeft(Value padLeft)
Cell<T>
padRight(float padRight)
Cell<T>
padRight(Value padRight)
Cell<T>
padTop(float padTop)
Cell<T>
padTop(Value padTop)
Cell<T>
prefHeight(float prefHeight)
Cell<T>
prefHeight(Value prefHeight)
Cell<T>
prefSize(float size)
Sets the prefWidth and prefHeight to the specified values.Cell<T>
prefSize(float width, float height)
Sets the prefWidth and prefHeight to the specified value.Cell<T>
prefSize(Value size)
Sets the prefWidth and prefHeight to the specified value.Cell<T>
prefSize(Value width, Value height)
Sets the prefWidth and prefHeight to the specified values.Cell<T>
prefWidth(float prefWidth)
Cell<T>
prefWidth(Value prefWidth)
void
reset()
Reset state so the cell can be reused, setting all constraints to theirdefault
values.Cell<T>
right()
AddsAlign.right
and clearsAlign.left
for the alignment of the actor within the cell.void
row()
<A extends Actor>
Cell<A>setActor(A newActor)
Sets the actor in this cell and adds the actor to the cell's table.void
setActorBounds(float x, float y, float width, float height)
void
setActorHeight(float actorHeight)
void
setActorWidth(float actorWidth)
void
setActorX(float actorX)
void
setActorY(float actorY)
void
setTable(Table table)
Cell<T>
size(float size)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value.Cell<T>
size(float width, float height)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values.Cell<T>
size(Value size)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value.Cell<T>
size(Value width, Value height)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values.Cell<T>
space(float space)
Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value.Cell<T>
space(float top, float left, float bottom, float right)
The space cannot be < 0.Cell<T>
space(Value space)
Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value.Cell<T>
space(Value top, Value left, Value bottom, Value right)
Cell<T>
spaceBottom(float spaceBottom)
The space cannot be < 0.Cell<T>
spaceBottom(Value spaceBottom)
Cell<T>
spaceLeft(float spaceLeft)
The space cannot be < 0.Cell<T>
spaceLeft(Value spaceLeft)
Cell<T>
spaceRight(float spaceRight)
The space cannot be < 0.Cell<T>
spaceRight(Value spaceRight)
Cell<T>
spaceTop(float spaceTop)
The space cannot be < 0.Cell<T>
spaceTop(Value spaceTop)
Cell<T>
top()
AddsAlign.top
and clearsAlign.bottom
for the alignment of the actor within the cell.java.lang.String
toString()
Cell<T>
uniform()
Sets uniformX and uniformY to true.Cell<T>
uniform(boolean uniform)
Cell<T>
uniform(boolean x, boolean y)
Cell<T>
uniformX()
Sets uniformX to true.Cell<T>
uniformY()
Sets uniformY to true.Cell<T>
width(float width)
Sets the minWidth, prefWidth, and maxWidth to the specified value.Cell<T>
width(Value width)
Sets the minWidth, prefWidth, and maxWidth to the specified value.
-
-
-
Method Detail
-
setTable
public void setTable(Table table)
-
setActor
public <A extends Actor> Cell<A> setActor(@Null A newActor)
Sets the actor in this cell and adds the actor to the cell's table. If null, removes any current actor.
-
hasActor
public boolean hasActor()
Returns true if the cell's actor is not null.
-
size
public Cell<T> size(Value size)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value.
-
size
public Cell<T> size(Value width, Value height)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values.
-
size
public Cell<T> size(float size)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value.
-
size
public Cell<T> size(float width, float height)
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values.
-
width
public Cell<T> width(Value width)
Sets the minWidth, prefWidth, and maxWidth to the specified value.
-
width
public Cell<T> width(float width)
Sets the minWidth, prefWidth, and maxWidth to the specified value.
-
height
public Cell<T> height(Value height)
Sets the minHeight, prefHeight, and maxHeight to the specified value.
-
height
public Cell<T> height(float height)
Sets the minHeight, prefHeight, and maxHeight to the specified value.
-
minSize
public Cell<T> minSize(Value width, Value height)
Sets the minWidth and minHeight to the specified values.
-
minSize
public Cell<T> minSize(float width, float height)
Sets the minWidth and minHeight to the specified values.
-
prefSize
public Cell<T> prefSize(Value size)
Sets the prefWidth and prefHeight to the specified value.
-
prefSize
public Cell<T> prefSize(Value width, Value height)
Sets the prefWidth and prefHeight to the specified values.
-
prefSize
public Cell<T> prefSize(float width, float height)
Sets the prefWidth and prefHeight to the specified value.
-
prefSize
public Cell<T> prefSize(float size)
Sets the prefWidth and prefHeight to the specified values.
-
maxSize
public Cell<T> maxSize(Value size)
Sets the maxWidth and maxHeight to the specified value. If the max size is 0, no maximum size is used.
-
maxSize
public Cell<T> maxSize(Value width, Value height)
Sets the maxWidth and maxHeight to the specified values. If the max size is 0, no maximum size is used.
-
maxHeight
public Cell<T> maxHeight(Value maxHeight)
If the maxHeight is 0, no maximum height is used.
-
maxSize
public Cell<T> maxSize(float size)
Sets the maxWidth and maxHeight to the specified value. If the max size is 0, no maximum size is used.
-
maxSize
public Cell<T> maxSize(float width, float height)
Sets the maxWidth and maxHeight to the specified values. If the max size is 0, no maximum size is used.
-
maxHeight
public Cell<T> maxHeight(float maxHeight)
If the maxHeight is 0, no maximum height is used.
-
space
public Cell<T> space(Value space)
Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value.
-
space
public Cell<T> space(float space)
Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value. The space cannot be < 0.
-
space
public Cell<T> space(float top, float left, float bottom, float right)
The space cannot be < 0.
-
pad
public Cell<T> pad(Value pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value.
-
pad
public Cell<T> pad(float pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value.
-
align
public Cell<T> align(int align)
Sets the alignment of the actor within the cell. Set toAlign.center
,Align.top
,Align.bottom
,Align.left
,Align.right
, or any combination of those.
-
center
public Cell<T> center()
Sets the alignment of the actor within the cell toAlign.center
. This clears any other alignment.
-
top
public Cell<T> top()
AddsAlign.top
and clearsAlign.bottom
for the alignment of the actor within the cell.
-
left
public Cell<T> left()
AddsAlign.left
and clearsAlign.right
for the alignment of the actor within the cell.
-
bottom
public Cell<T> bottom()
AddsAlign.bottom
and clearsAlign.top
for the alignment of the actor within the cell.
-
right
public Cell<T> right()
AddsAlign.right
and clearsAlign.left
for the alignment of the actor within the cell.
-
expand
public Cell<T> expand(boolean x, boolean y)
Sets expandX and expandY to 1 if true, 0 if false.
-
setActorBounds
public void setActorBounds(float x, float y, float width, float height)
-
getActorX
public float getActorX()
-
setActorX
public void setActorX(float actorX)
-
getActorY
public float getActorY()
-
setActorY
public void setActorY(float actorY)
-
getActorWidth
public float getActorWidth()
-
setActorWidth
public void setActorWidth(float actorWidth)
-
getActorHeight
public float getActorHeight()
-
setActorHeight
public void setActorHeight(float actorHeight)
-
getColumn
public int getColumn()
-
getRow
public int getRow()
-
getMinWidthValue
@Null public Value getMinWidthValue()
- Returns:
- May be null if this cell is row defaults.
-
getMinWidth
public float getMinWidth()
-
getMinHeightValue
@Null public Value getMinHeightValue()
- Returns:
- May be null if this cell is row defaults.
-
getMinHeight
public float getMinHeight()
-
getPrefWidthValue
@Null public Value getPrefWidthValue()
- Returns:
- May be null if this cell is row defaults.
-
getPrefWidth
public float getPrefWidth()
-
getPrefHeightValue
@Null public Value getPrefHeightValue()
- Returns:
- May be null if this cell is row defaults.
-
getPrefHeight
public float getPrefHeight()
-
getMaxWidthValue
@Null public Value getMaxWidthValue()
- Returns:
- May be null if this cell is row defaults.
-
getMaxWidth
public float getMaxWidth()
-
getMaxHeightValue
@Null public Value getMaxHeightValue()
- Returns:
- May be null if this cell is row defaults.
-
getMaxHeight
public float getMaxHeight()
-
getSpaceTopValue
@Null public Value getSpaceTopValue()
- Returns:
- May be null if this value is not set.
-
getSpaceTop
public float getSpaceTop()
-
getSpaceLeftValue
@Null public Value getSpaceLeftValue()
- Returns:
- May be null if this value is not set.
-
getSpaceLeft
public float getSpaceLeft()
-
getSpaceBottomValue
@Null public Value getSpaceBottomValue()
- Returns:
- May be null if this value is not set.
-
getSpaceBottom
public float getSpaceBottom()
-
getSpaceRightValue
@Null public Value getSpaceRightValue()
- Returns:
- May be null if this value is not set.
-
getSpaceRight
public float getSpaceRight()
-
getPadTop
public float getPadTop()
-
getPadLeft
public float getPadLeft()
-
getPadBottomValue
@Null public Value getPadBottomValue()
- Returns:
- May be null if this value is not set.
-
getPadBottom
public float getPadBottom()
-
getPadRightValue
@Null public Value getPadRightValue()
- Returns:
- May be null if this value is not set.
-
getPadRight
public float getPadRight()
-
getPadX
public float getPadX()
ReturnsgetPadLeft()
plusgetPadRight()
.
-
getPadY
public float getPadY()
ReturnsgetPadTop()
plusgetPadBottom()
.
-
getFillX
@Null public java.lang.Float getFillX()
-
getFillY
@Null public java.lang.Float getFillY()
-
getAlign
@Null public java.lang.Integer getAlign()
-
getExpandX
@Null public java.lang.Integer getExpandX()
-
getExpandY
@Null public java.lang.Integer getExpandY()
-
getColspan
@Null public java.lang.Integer getColspan()
-
getUniformX
@Null public java.lang.Boolean getUniformX()
-
getUniformY
@Null public java.lang.Boolean getUniformY()
-
isEndRow
public boolean isEndRow()
Returns true if this cell is the last cell in the row.
-
getComputedPadTop
public float getComputedPadTop()
The actual amount of combined padding and spacing from the last layout.
-
getComputedPadLeft
public float getComputedPadLeft()
The actual amount of combined padding and spacing from the last layout.
-
getComputedPadBottom
public float getComputedPadBottom()
The actual amount of combined padding and spacing from the last layout.
-
getComputedPadRight
public float getComputedPadRight()
The actual amount of combined padding and spacing from the last layout.
-
row
public void row()
-
getTable
public Table getTable()
-
reset
public void reset()
Reset state so the cell can be reused, setting all constraints to theirdefault
values.- Specified by:
reset
in interfacePool.Poolable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
defaults
public static Cell defaults()
Returns the defaults to use for all cells. This can be used to avoid needing to set the same defaults for every table (eg, for spacing).
-
-