Package com.prineside.tdi2.scene2d.ui
Class Cell<T extends Actor>
java.lang.Object
com.prineside.tdi2.scene2d.ui.Cell<T>
- All Implemented Interfaces:
Pool.Poolable
A cell for a
Table
.- Author:
- Nathan Sweet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalign
(int align) Sets the alignment of the actor within the cell.bottom()
AddsAlign.bottom
and clearsAlign.top
for the alignment of the actor within the cell.center()
Sets the alignment of the actor within the cell toAlign.center
.Removes the current actor for the cell, if any.colspan
(int colspan) static Cell
defaults()
Returns the defaults to use for all cells.expand()
Sets expandX and expandY to 1.expand
(boolean x, boolean y) Sets expandX and expandY to 1 if true, 0 if false.expand
(int x, int y) expandX()
Sets expandX to 1.expandY()
Sets expandY to 1.fill()
Sets fillX and fillY to 1.fill
(boolean fill) Sets fillX and fillY to 1 if true, 0 if false.fill
(boolean x, boolean y) Sets fillX and fillY to 1 if true, 0 if false.fill
(float x, float y) fillX()
Sets fillX to 1.fillY()
Sets fillY to 1.getActor()
Returns the actor for this cell, or null.float
float
float
float
getAlign()
int
float
The actual amount of combined padding and spacing from the last layout.float
The actual amount of combined padding and spacing from the last layout.float
The actual amount of combined padding and spacing from the last layout.float
The actual amount of combined padding and spacing from the last layout.getFillX()
getFillY()
float
float
float
float
float
float
float
float
float
getPadX()
ReturnsgetPadLeft()
plusgetPadRight()
.float
getPadY()
ReturnsgetPadTop()
plusgetPadBottom()
.float
float
int
getRow()
float
float
float
float
getTable()
grow()
Sets expandX, expandY, fillX, and fillY to 1.growX()
Sets expandX and fillX to 1.growY()
Sets expandY and fillY to 1.boolean
hasActor()
Returns true if the cell's actor is not null.height
(float height) Sets the minHeight, prefHeight, and maxHeight to the specified value.Sets the minHeight, prefHeight, and maxHeight to the specified value.boolean
isEndRow()
Returns true if this cell is the last cell in the row.left()
AddsAlign.left
and clearsAlign.right
for the alignment of the actor within the cell.maxHeight
(float maxHeight) If the maxHeight is 0, no maximum height is used.If the maxHeight is 0, no maximum height is used.maxSize
(float size) Sets the maxWidth and maxHeight to the specified value.maxSize
(float width, float height) Sets the maxWidth and maxHeight to the specified values.Sets the maxWidth and maxHeight to the specified value.Sets the maxWidth and maxHeight to the specified values.maxWidth
(float maxWidth) If the maxWidth is 0, no maximum width is used.If the maxWidth is 0, no maximum width is used.minHeight
(float minHeight) minSize
(float size) Sets the minWidth and minHeight to the specified value.minSize
(float width, float height) Sets the minWidth and minHeight to the specified values.Sets the minWidth and minHeight to the specified value.Sets the minWidth and minHeight to the specified values.minWidth
(float minWidth) pad
(float pad) Sets the padTop, padLeft, padBottom, and padRight to the specified value.pad
(float top, float left, float bottom, float right) Sets the padTop, padLeft, padBottom, and padRight to the specified value.padBottom
(float padBottom) padLeft
(float padLeft) padRight
(float padRight) padTop
(float padTop) prefHeight
(float prefHeight) prefHeight
(Value prefHeight) prefSize
(float size) Sets the prefWidth and prefHeight to the specified values.prefSize
(float width, float height) Sets the prefWidth and prefHeight to the specified value.Sets the prefWidth and prefHeight to the specified value.Sets the prefWidth and prefHeight to the specified values.prefWidth
(float prefWidth) void
reset()
Reset state so the cell can be reused, setting all constraints to theirdefault
values.right()
AddsAlign.right
and clearsAlign.left
for the alignment of the actor within the cell.void
row()
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
size
(float size) Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value.size
(float width, float height) Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values.Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value.Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values.space
(float space) Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value.space
(float top, float left, float bottom, float right) The space cannot be < 0.Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value.spaceBottom
(float spaceBottom) The space cannot be < 0.spaceBottom
(Value spaceBottom) spaceLeft
(float spaceLeft) The space cannot be < 0.spaceRight
(float spaceRight) The space cannot be < 0.spaceRight
(Value spaceRight) spaceTop
(float spaceTop) The space cannot be < 0.top()
AddsAlign.top
and clearsAlign.bottom
for the alignment of the actor within the cell.toString()
uniform()
Sets uniformX and uniformY to true.uniform
(boolean uniform) uniform
(boolean x, boolean y) uniformX()
Sets uniformX to true.uniformY()
Sets uniformY to true.width
(float width) Sets the minWidth, prefWidth, and maxWidth to the specified value.Sets the minWidth, prefWidth, and maxWidth to the specified value.
-
Constructor Details
-
Cell
public Cell()
-
-
Method Details
-
setTable
-
setActor
Sets the actor in this cell and adds the actor to the cell's table. If null, removes any current actor. -
clearActor
Removes the current actor for the cell, if any. -
getActor
Returns the actor for this cell, or null. -
hasActor
public boolean hasActor()Returns true if the cell's actor is not null. -
size
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value. -
size
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values. -
size
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified value. -
size
Sets the minWidth, prefWidth, maxWidth, minHeight, prefHeight, and maxHeight to the specified values. -
width
Sets the minWidth, prefWidth, and maxWidth to the specified value. -
width
Sets the minWidth, prefWidth, and maxWidth to the specified value. -
height
Sets the minHeight, prefHeight, and maxHeight to the specified value. -
height
Sets the minHeight, prefHeight, and maxHeight to the specified value. -
minSize
Sets the minWidth and minHeight to the specified value. -
minSize
Sets the minWidth and minHeight to the specified values. -
minWidth
-
minHeight
-
minSize
Sets the minWidth and minHeight to the specified value. -
minSize
Sets the minWidth and minHeight to the specified values. -
minWidth
-
minHeight
-
prefSize
Sets the prefWidth and prefHeight to the specified value. -
prefSize
Sets the prefWidth and prefHeight to the specified values. -
prefWidth
-
prefHeight
-
prefSize
Sets the prefWidth and prefHeight to the specified value. -
prefSize
Sets the prefWidth and prefHeight to the specified values. -
prefWidth
-
prefHeight
-
maxSize
Sets the maxWidth and maxHeight to the specified value. If the max size is 0, no maximum size is used. -
maxSize
Sets the maxWidth and maxHeight to the specified values. If the max size is 0, no maximum size is used. -
maxWidth
If the maxWidth is 0, no maximum width is used. -
maxHeight
If the maxHeight is 0, no maximum height is used. -
maxSize
Sets the maxWidth and maxHeight to the specified value. If the max size is 0, no maximum size is used. -
maxSize
Sets the maxWidth and maxHeight to the specified values. If the max size is 0, no maximum size is used. -
maxWidth
If the maxWidth is 0, no maximum width is used. -
maxHeight
If the maxHeight is 0, no maximum height is used. -
space
Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value. -
space
-
spaceTop
-
spaceLeft
-
spaceBottom
-
spaceRight
-
space
Sets the spaceTop, spaceLeft, spaceBottom, and spaceRight to the specified value. The space cannot be < 0. -
space
The space cannot be < 0. -
spaceTop
The space cannot be < 0. -
spaceLeft
The space cannot be < 0. -
spaceBottom
The space cannot be < 0. -
spaceRight
The space cannot be < 0. -
pad
Sets the padTop, padLeft, padBottom, and padRight to the specified value. -
pad
-
padTop
-
padLeft
-
padBottom
-
padRight
-
pad
Sets the padTop, padLeft, padBottom, and padRight to the specified value. -
pad
-
padTop
-
padLeft
-
padBottom
-
padRight
-
fill
Sets fillX and fillY to 1. -
fillX
Sets fillX to 1. -
fillY
Sets fillY to 1. -
fill
-
fill
Sets fillX and fillY to 1 if true, 0 if false. -
fill
Sets fillX and fillY to 1 if true, 0 if false. -
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
Sets the alignment of the actor within the cell toAlign.center
. This clears any other alignment. -
top
AddsAlign.top
and clearsAlign.bottom
for the alignment of the actor within the cell. -
left
AddsAlign.left
and clearsAlign.right
for the alignment of the actor within the cell. -
bottom
AddsAlign.bottom
and clearsAlign.top
for the alignment of the actor within the cell. -
right
AddsAlign.right
and clearsAlign.left
for the alignment of the actor within the cell. -
grow
Sets expandX, expandY, fillX, and fillY to 1. -
growX
Sets expandX and fillX to 1. -
growY
Sets expandY and fillY to 1. -
expand
Sets expandX and expandY to 1. -
expandX
Sets expandX to 1. -
expandY
Sets expandY to 1. -
expand
-
expand
Sets expandX and expandY to 1 if true, 0 if false. -
colspan
-
uniform
Sets uniformX and uniformY to true. -
uniformX
Sets uniformX to true. -
uniformY
Sets uniformY to true. -
uniform
-
uniform
-
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
- Returns:
- May be null if this cell is row defaults.
-
getMinWidth
public float getMinWidth() -
getMinHeightValue
- Returns:
- May be null if this cell is row defaults.
-
getMinHeight
public float getMinHeight() -
getPrefWidthValue
- Returns:
- May be null if this cell is row defaults.
-
getPrefWidth
public float getPrefWidth() -
getPrefHeightValue
- Returns:
- May be null if this cell is row defaults.
-
getPrefHeight
public float getPrefHeight() -
getMaxWidthValue
- Returns:
- May be null if this cell is row defaults.
-
getMaxWidth
public float getMaxWidth() -
getMaxHeightValue
- Returns:
- May be null if this cell is row defaults.
-
getMaxHeight
public float getMaxHeight() -
getSpaceTopValue
- Returns:
- May be null if this value is not set.
-
getSpaceTop
public float getSpaceTop() -
getSpaceLeftValue
- Returns:
- May be null if this value is not set.
-
getSpaceLeft
public float getSpaceLeft() -
getSpaceBottomValue
- Returns:
- May be null if this value is not set.
-
getSpaceBottom
public float getSpaceBottom() -
getSpaceRightValue
- Returns:
- May be null if this value is not set.
-
getSpaceRight
public float getSpaceRight() -
getPadTopValue
- Returns:
- May be null if this value is not set.
-
getPadTop
public float getPadTop() -
getPadLeftValue
- Returns:
- May be null if this value is not set.
-
getPadLeft
public float getPadLeft() -
getPadBottomValue
- Returns:
- May be null if this value is not set.
-
getPadBottom
public float getPadBottom() -
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
-
getFillY
-
getAlign
-
getExpandX
-
getExpandY
-
getColspan
-
getUniformX
-
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
-
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
-
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).
-