Class Cell<T extends Actor>

java.lang.Object
com.prineside.tdi2.scene2d.ui.Cell<T>
All Implemented Interfaces:
Pool.Poolable

public class Cell<T extends Actor> extends Object implements Pool.Poolable
A cell for a Table.
Author:
Nathan Sweet
  • Constructor Details

    • Cell

      public Cell()
  • Method Details

    • 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.
    • clearActor

      public Cell<T> clearActor()
      Removes the current actor for the cell, if any.
    • getActor

      @Null public T getActor()
      Returns the actor for this cell, or null.
    • 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 size)
      Sets the minWidth and minHeight to the specified value.
    • minSize

      public Cell<T> minSize(Value width, Value height)
      Sets the minWidth and minHeight to the specified values.
    • minWidth

      public Cell<T> minWidth(Value minWidth)
    • minHeight

      public Cell<T> minHeight(Value minHeight)
    • minSize

      public Cell<T> minSize(float size)
      Sets the minWidth and minHeight to the specified value.
    • minSize

      public Cell<T> minSize(float width, float height)
      Sets the minWidth and minHeight to the specified values.
    • minWidth

      public Cell<T> minWidth(float minWidth)
    • minHeight

      public Cell<T> minHeight(float minHeight)
    • 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.
    • prefWidth

      public Cell<T> prefWidth(Value prefWidth)
    • prefHeight

      public Cell<T> prefHeight(Value prefHeight)
    • 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.
    • prefWidth

      public Cell<T> prefWidth(float prefWidth)
    • prefHeight

      public Cell<T> prefHeight(float prefHeight)
    • 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.
    • maxWidth

      public Cell<T> maxWidth(Value maxWidth)
      If the maxWidth is 0, no maximum width 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.
    • maxWidth

      public Cell<T> maxWidth(float maxWidth)
      If the maxWidth is 0, no maximum width 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(Value top, Value left, Value bottom, Value right)
    • spaceTop

      public Cell<T> spaceTop(Value spaceTop)
    • spaceLeft

      public Cell<T> spaceLeft(Value spaceLeft)
    • spaceBottom

      public Cell<T> spaceBottom(Value spaceBottom)
    • spaceRight

      public Cell<T> spaceRight(Value spaceRight)
    • 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.
    • spaceTop

      public Cell<T> spaceTop(float spaceTop)
      The space cannot be < 0.
    • spaceLeft

      public Cell<T> spaceLeft(float spaceLeft)
      The space cannot be < 0.
    • spaceBottom

      public Cell<T> spaceBottom(float spaceBottom)
      The space cannot be < 0.
    • spaceRight

      public Cell<T> spaceRight(float spaceRight)
      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(Value top, Value left, Value bottom, Value right)
    • padTop

      public Cell<T> padTop(Value padTop)
    • padLeft

      public Cell<T> padLeft(Value padLeft)
    • padBottom

      public Cell<T> padBottom(Value padBottom)
    • padRight

      public Cell<T> padRight(Value padRight)
    • pad

      public Cell<T> pad(float pad)
      Sets the padTop, padLeft, padBottom, and padRight to the specified value.
    • pad

      public Cell<T> pad(float top, float left, float bottom, float right)
    • padTop

      public Cell<T> padTop(float padTop)
    • padLeft

      public Cell<T> padLeft(float padLeft)
    • padBottom

      public Cell<T> padBottom(float padBottom)
    • padRight

      public Cell<T> padRight(float padRight)
    • fill

      public Cell<T> fill()
      Sets fillX and fillY to 1.
    • fillX

      public Cell<T> fillX()
      Sets fillX to 1.
    • fillY

      public Cell<T> fillY()
      Sets fillY to 1.
    • fill

      public Cell<T> fill(float x, float y)
    • fill

      public Cell<T> fill(boolean x, boolean y)
      Sets fillX and fillY to 1 if true, 0 if false.
    • fill

      public Cell<T> fill(boolean fill)
      Sets fillX and fillY to 1 if true, 0 if false.
    • align

      public Cell<T> align(int align)
      Sets the alignment of the actor within the cell. Set to Align.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 to Align.center. This clears any other alignment.
    • top

      public Cell<T> top()
      Adds Align.top and clears Align.bottom for the alignment of the actor within the cell.
    • left

      public Cell<T> left()
      Adds Align.left and clears Align.right for the alignment of the actor within the cell.
    • bottom

      public Cell<T> bottom()
      Adds Align.bottom and clears Align.top for the alignment of the actor within the cell.
    • right

      public Cell<T> right()
      Adds Align.right and clears Align.left for the alignment of the actor within the cell.
    • grow

      public Cell<T> grow()
      Sets expandX, expandY, fillX, and fillY to 1.
    • growX

      public Cell<T> growX()
      Sets expandX and fillX to 1.
    • growY

      public Cell<T> growY()
      Sets expandY and fillY to 1.
    • expand

      public Cell<T> expand()
      Sets expandX and expandY to 1.
    • expandX

      public Cell<T> expandX()
      Sets expandX to 1.
    • expandY

      public Cell<T> expandY()
      Sets expandY to 1.
    • expand

      public Cell<T> expand(int x, int y)
    • expand

      public Cell<T> expand(boolean x, boolean y)
      Sets expandX and expandY to 1 if true, 0 if false.
    • colspan

      public Cell<T> colspan(int colspan)
    • uniform

      public Cell<T> uniform()
      Sets uniformX and uniformY to true.
    • uniformX

      public Cell<T> uniformX()
      Sets uniformX to true.
    • uniformY

      public Cell<T> uniformY()
      Sets uniformY to true.
    • uniform

      public Cell<T> uniform(boolean uniform)
    • uniform

      public Cell<T> uniform(boolean x, boolean y)
    • 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()
    • getPadTopValue

      @Null public Value getPadTopValue()
      Returns:
      May be null if this value is not set.
    • getPadTop

      public float getPadTop()
    • getPadLeftValue

      @Null public Value getPadLeftValue()
      Returns:
      May be null if this value is not set.
    • 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()
    • getPadY

      public float getPadY()
    • getFillX

      @Null public Float getFillX()
    • getFillY

      @Null public Float getFillY()
    • getAlign

      @Null public Integer getAlign()
    • getExpandX

      @Null public Integer getExpandX()
    • getExpandY

      @Null public Integer getExpandY()
    • getColspan

      @Null public Integer getColspan()
    • getUniformX

      @Null public Boolean getUniformX()
    • getUniformY

      @Null public 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 their default values.
      Specified by:
      reset in interface Pool.Poolable
    • toString

      public String toString()
      Overrides:
      toString in class 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).