Class Cell<T extends Element>

java.lang.Object
arc.scene.ui.layout.Cell<T>
All Implemented Interfaces:
Pool.Poolable

public class Cell<T extends Element> extends Object implements Pool.Poolable
A cell for a Table.
  • Constructor Details

    • Cell

      public Cell()
  • Method Details

    • 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).
    • setLayout

      public void setLayout(Table table)
    • setElement

      public <A extends Element> Cell<A> setElement(A newElement)
      Sets the element in this cell and adds the element to the cell's table. If null, removes any current element.
    • clearElement

      public Cell<T> clearElement()
      Removes the current element for the cell, if any.
    • with

      public Cell<T> with(Cons<T> c)
    • self

      public Cell<T> self(Cons<Cell<T>> c)
    • get

      public T get()
      getElement shortcut
    • hasElement

      public boolean hasElement()
      Returns true if the cell's element is not null.
    • prefWidth

      public float prefWidth()
    • prefHeight

      public float prefHeight()
    • maxWidth

      public float maxWidth()
    • maxHeight

      public float maxHeight()
    • minWidth

      public float minWidth()
    • minHeight

      public float minHeight()
    • tooltip

      public Cell<T> tooltip(String text)
    • tooltip

      public Cell<T> tooltip(Cons<Table> builder)
    • 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.
    • name

      public Cell<T> name(String name)
    • update

      public Cell<T> update(Cons<T> updater)
    • disabled

      public Cell<T> disabled(Boolf<T> vis)
    • scrollX

      public Cell<T> scrollX(boolean allowScrollX)
    • scrollY

      public Cell<T> scrollY(boolean allowScrollY)
    • disabled

      public Cell<T> disabled(boolean disabled)
    • touchable

      public Cell<T> touchable(Touchable touchable)
    • touchable

      public Cell<T> touchable(Prov<Touchable> touchable)
    • visible

      public Cell<T> visible(Boolp prov)
    • visible

      public Cell<T> visible(boolean visible)
    • scaling

      public Cell<T> scaling(Scaling scaling)
    • valid

      public Cell<T> valid(TextField.TextFieldValidator val)
    • maxTextLength

      public Cell<T> maxTextLength(int length)
      For text fields.
    • wrap

      public Cell<T> wrap()
    • ellipsis

      public Cell<T> ellipsis(boolean ellipsis)
    • labelAlign

      public Cell<T> labelAlign(int label, int line)
    • labelAlign

      public Cell<T> labelAlign(int label)
    • group

      public <N extends Button> Cell<T> group(ButtonGroup<N> group)
    • wrapLabel

      public Cell<T> wrapLabel(boolean toggle)
    • checked

      public Cell<T> checked(boolean toggle)
    • checked

      public Cell<T> checked(Boolf<T> toggle)
    • fontScale

      public Cell<T> fontScale(float scale)
    • color

      public Cell<T> color(Color color)
    • margin

      public Cell<T> margin(float margin)
    • marginTop

      public Cell<T> marginTop(float margin)
    • marginBottom

      public Cell<T> marginBottom(float margin)
    • marginLeft

      public Cell<T> marginLeft(float margin)
    • marginRight

      public Cell<T> marginRight(float margin)
    • width

      public Cell<T> width(float width)
      Sets the minWidth, prefWidth, and maxWidth to the specified value.
    • style

      public Cell<T> style(Style style)
      Sets the button or label style.
    • height

      public Cell<T> height(float height)
      Sets the minHeight, prefHeight, and maxHeight to the specified value.
    • 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)
    • maxSize

      public Cell<T> maxSize(float size)
      Sets the maxWidth and maxHeight to the specified value.
    • maxSize

      public Cell<T> maxSize(float width, float height)
      Sets the maxWidth and maxHeight to the specified values.
    • maxWidth

      public Cell<T> maxWidth(float maxWidth)
    • maxHeight

      public Cell<T> maxHeight(float maxHeight)
    • pad

      public Cell<T> pad(float pad)
      Sets the marginTop, marginLeft, marginBottom, and marginRight 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 element 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 element 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 element within the cell.
    • left

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

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

      public Cell<T> right()
      Adds Align.right and clears Align.left for the alignment of the element 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 x, boolean y)
    • setBounds

      public void setBounds(float x, float y, float width, float height)
    • isEndRow

      public boolean isEndRow()
    • 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
    • set

      public Cell<T> set(Cell cell)
    • toString

      public String toString()
      Overrides:
      toString in class Object