C# Class Nez.UI.Table

A group that sizes and positions children using table constraints. By default, {@link #getTouchable()} is {@link Touchable#childrenOnly}. The preferred and minimum sizes are that of the chdebugn when laid out in columns and rows.
Inheritance: Group
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Свойство Type Description
backgroundBottom Value
backgroundLeft Value
backgroundRight Value
backgroundTop Value
clip bool
debugCellColor Color
debugElementColor Color
debugTableColor Color

Protected Properties

Свойство Type Description
_background IDrawable

Méthodes publiques

Méthode Description
Table ( ) : System
add ( ) : Cell

Adds a cell without an element

add ( Element element ) : Cell

Adds a new cell to the table with the specified element.

add ( string text ) : Cell

Adds a new cell with a label

addDebugRect ( float x, float y, float w, float h, Color color ) : void
align ( int align ) : Table

Alignment of the logical table within the table element. Set to {@link Align#center}, {@link Align#top}, {@link Align#bottom} {@link Align#left}, {@link Align#right}, or any combination of those.

bottom ( ) : Table

Adds {@link Align#bottom} and clears {@link Align#top} for the alignment of the logical table within the table element.

center ( ) : Table

Sets the alignment of the logical table within the table element to {@link Align#center}. This clears any other alignment.

clearChildren ( ) : void

Removes all elements and cells from the table

computeDebugRects ( float x, float y, float layoutX, float layoutY, float layoutWidth, float layoutHeight, float tableWidth, float tableHeight, float hpadding, float vpadding ) : void
computeSize ( ) : void
debugAll ( ) : Table

Turn on all debug lines (table, cell, and element)

debugCell ( ) : Table

Turns on cell debug lines.

debugElement ( ) : Table

Turns on element debug lines.

debugRender ( Graphics graphics ) : void
debugTable ( ) : Table

Turns on table debug lines.

defaults ( ) : Cell

The cell values that will be used as the defaults for all cells.

draw ( Graphics graphics, float parentAlpha ) : void
endRow ( ) : void
getAlign ( ) : int
getBackground ( ) : IDrawable
getCell ( Element element ) : Cell

Returns the cell for the specified element in this table, or null.

getCells ( ) : List

returns all the Cells in the table

getColumnDefaults ( int column ) : Cell

Gets the cell values that will be used as the defaults for all cells in the specified column. Columns are indexed starting at 0

getColumnWidth ( int columnIndex ) : float

Returns the width of the specified column.

getColumns ( ) : int
getPadBottom ( ) : float
getPadBottomValue ( ) : Value
getPadLeft ( ) : float
getPadLeftValue ( ) : Value
getPadRight ( ) : float
getPadRightValue ( ) : Value
getPadTop ( ) : float
getPadTopValue ( ) : Value
getPadX ( ) : float

Returns {@link #getPadLeft()} plus {@link #getPadRight()}.

getPadY ( ) : float

Returns {@link #getPadTop()} plus {@link #getPadBottom()}.

getRowDefaults ( ) : Cell

gets the current Cell defaults. This is the same value returned by a call to row()

getRowHeight ( int rowIndex ) : float

Returns the height of the specified row.

getRows ( ) : int
hit ( Vector2 point ) : Element
invalidate ( ) : void
layout ( ) : void
layout ( float layoutX, float layoutY, float layoutWidth, float layoutHeight ) : void

Positions and sizes children of the table using the cell associated with each child. The values given are the position within the parent and size of the table.

left ( ) : Table

Adds {@link Align#left} and clears {@link Align#right} for the alignment of the logical table within the table element.

pad ( Value pad ) : Table

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.

pad ( Value top, Value left, Value bottom, Value right ) : Table
pad ( float pad ) : Table

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.

pad ( float top, float left, float bottom, float right ) : Table
padBottom ( Value padBottom ) : Table

Padding at the bottom edge of the table.

padBottom ( float padBottom ) : Table

Padding at the bottom edge of the table.

padLeft ( Value padLeft ) : Table

Padding at the left edge of the table.

padLeft ( float padLeft ) : Table

Padding at the left edge of the table.

padRight ( Value padRight ) : Table

Padding at the right edge of the table.

padRight ( float padRight ) : Table

Padding at the right edge of the table.

padTop ( Value padTop ) : Table

Padding at the top edge of the table.

padTop ( float padTop ) : Table

Padding at the top edge of the table.

removeElement ( Element element ) : bool
reset ( ) : void

Removes all elements and cells from the table (same as {@link #clear()}) and additionally resets all table properties and cell, column, and row defaults.

right ( ) : Table

Adds {@link Align#right} and clears {@link Align#left} for the alignment of the logical table within the table element.

round ( bool round ) : Table

If true (the default), positions and sizes are rounded to integers.

row ( ) : Cell

Indicates that subsequent cells should be added to a new row and returns the cell values that will be used as the defaults for all cells in the new row.

setBackground ( IDrawable background ) : Table

background may be null to clear the background.

setDebug ( bool enabled ) : void

enables/disables all debug lines (table, cell, and widget)

setFillParent ( bool fillParent ) : Table
stack ( ) : Cell

Adds a new cell to the table with the specified elements in a {@link Stack}.

tableDebug ( TableDebug tableDebug ) : Table

Turns debug lines on or off.

top ( ) : Table

Adds {@link Align#top} and clears {@link Align#bottom} for the alignment of the logical table within the table element.

Méthodes protégées

Méthode Description
drawBackground ( Graphics graphics, float parentAlpha, float x, float y ) : void

Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.

Private Methods

Méthode Description
ensureSize ( float array, int size ) : float[]
obtainCell ( ) : Cell

Method Details

Table() public méthode

public Table ( ) : System
Résultat System

add() public méthode

Adds a cell without an element
public add ( ) : Cell
Résultat Cell

add() public méthode

Adds a new cell to the table with the specified element.
public add ( Element element ) : Cell
element Element element.
Résultat Cell

add() public méthode

Adds a new cell with a label
public add ( string text ) : Cell
text string Text.
Résultat Cell

addDebugRect() public méthode

public addDebugRect ( float x, float y, float w, float h, Color color ) : void
x float
y float
w float
h float
color Color
Résultat void

align() public méthode

Alignment of the logical table within the table element. Set to {@link Align#center}, {@link Align#top}, {@link Align#bottom} {@link Align#left}, {@link Align#right}, or any combination of those.
public align ( int align ) : Table
align int Align.
Résultat Table

bottom() public méthode

Adds {@link Align#bottom} and clears {@link Align#top} for the alignment of the logical table within the table element.
public bottom ( ) : Table
Résultat Table

center() public méthode

Sets the alignment of the logical table within the table element to {@link Align#center}. This clears any other alignment.
public center ( ) : Table
Résultat Table

clearChildren() public méthode

Removes all elements and cells from the table
public clearChildren ( ) : void
Résultat void

computeDebugRects() public méthode

public computeDebugRects ( float x, float y, float layoutX, float layoutY, float layoutWidth, float layoutHeight, float tableWidth, float tableHeight, float hpadding, float vpadding ) : void
x float
y float
layoutX float
layoutY float
layoutWidth float
layoutHeight float
tableWidth float
tableHeight float
hpadding float
vpadding float
Résultat void

computeSize() public méthode

public computeSize ( ) : void
Résultat void

debugAll() public méthode

Turn on all debug lines (table, cell, and element)
public debugAll ( ) : Table
Résultat Table

debugCell() public méthode

Turns on cell debug lines.
public debugCell ( ) : Table
Résultat Table

debugElement() public méthode

Turns on element debug lines.
public debugElement ( ) : Table
Résultat Table

debugRender() public méthode

public debugRender ( Graphics graphics ) : void
graphics Graphics
Résultat void

debugTable() public méthode

Turns on table debug lines.
public debugTable ( ) : Table
Résultat Table

defaults() public méthode

The cell values that will be used as the defaults for all cells.
public defaults ( ) : Cell
Résultat Cell

draw() public méthode

public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics
parentAlpha float
Résultat void

drawBackground() protected méthode

Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.
protected drawBackground ( Graphics graphics, float parentAlpha, float x, float y ) : void
graphics Graphics Graphics.
parentAlpha float Parent alpha.
x float The x coordinate.
y float The y coordinate.
Résultat void

endRow() public méthode

public endRow ( ) : void
Résultat void

getAlign() public méthode

public getAlign ( ) : int
Résultat int

getBackground() public méthode

public getBackground ( ) : IDrawable
Résultat IDrawable

getCell() public méthode

Returns the cell for the specified element in this table, or null.
public getCell ( Element element ) : Cell
element Element element.
Résultat Cell

getCells() public méthode

returns all the Cells in the table
public getCells ( ) : List
Résultat List

getColumnDefaults() public méthode

Gets the cell values that will be used as the defaults for all cells in the specified column. Columns are indexed starting at 0
public getColumnDefaults ( int column ) : Cell
column int Column.
Résultat Cell

getColumnWidth() public méthode

Returns the width of the specified column.
public getColumnWidth ( int columnIndex ) : float
columnIndex int Column index.
Résultat float

getColumns() public méthode

public getColumns ( ) : int
Résultat int

getPadBottom() public méthode

public getPadBottom ( ) : float
Résultat float

getPadBottomValue() public méthode

public getPadBottomValue ( ) : Value
Résultat Value

getPadLeft() public méthode

public getPadLeft ( ) : float
Résultat float

getPadLeftValue() public méthode

public getPadLeftValue ( ) : Value
Résultat Value

getPadRight() public méthode

public getPadRight ( ) : float
Résultat float

getPadRightValue() public méthode

public getPadRightValue ( ) : Value
Résultat Value

getPadTop() public méthode

public getPadTop ( ) : float
Résultat float

getPadTopValue() public méthode

public getPadTopValue ( ) : Value
Résultat Value

getPadX() public méthode

Returns {@link #getPadLeft()} plus {@link #getPadRight()}.
public getPadX ( ) : float
Résultat float

getPadY() public méthode

Returns {@link #getPadTop()} plus {@link #getPadBottom()}.
public getPadY ( ) : float
Résultat float

getRowDefaults() public méthode

gets the current Cell defaults. This is the same value returned by a call to row()
public getRowDefaults ( ) : Cell
Résultat Cell

getRowHeight() public méthode

Returns the height of the specified row.
public getRowHeight ( int rowIndex ) : float
rowIndex int Row index.
Résultat float

getRows() public méthode

public getRows ( ) : int
Résultat int

hit() public méthode

public hit ( Vector2 point ) : Element
point Vector2
Résultat Element

invalidate() public méthode

public invalidate ( ) : void
Résultat void

layout() public méthode

public layout ( ) : void
Résultat void

layout() public méthode

Positions and sizes children of the table using the cell associated with each child. The values given are the position within the parent and size of the table.
public layout ( float layoutX, float layoutY, float layoutWidth, float layoutHeight ) : void
layoutX float Layout x.
layoutY float Layout y.
layoutWidth float Layout width.
layoutHeight float Layout height.
Résultat void

left() public méthode

Adds {@link Align#left} and clears {@link Align#right} for the alignment of the logical table within the table element.
public left ( ) : Table
Résultat Table

pad() public méthode

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.
public pad ( Value pad ) : Table
pad Value Pad.
Résultat Table

pad() public méthode

public pad ( Value top, Value left, Value bottom, Value right ) : Table
top Value
left Value
bottom Value
right Value
Résultat Table

pad() public méthode

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.
public pad ( float pad ) : Table
pad float Pad.
Résultat Table

pad() public méthode

public pad ( float top, float left, float bottom, float right ) : Table
top float
left float
bottom float
right float
Résultat Table

padBottom() public méthode

Padding at the bottom edge of the table.
public padBottom ( Value padBottom ) : Table
padBottom Value Pad bottom.
Résultat Table

padBottom() public méthode

Padding at the bottom edge of the table.
public padBottom ( float padBottom ) : Table
padBottom float Pad bottom.
Résultat Table

padLeft() public méthode

Padding at the left edge of the table.
public padLeft ( Value padLeft ) : Table
padLeft Value Pad left.
Résultat Table

padLeft() public méthode

Padding at the left edge of the table.
public padLeft ( float padLeft ) : Table
padLeft float Pad left.
Résultat Table

padRight() public méthode

Padding at the right edge of the table.
public padRight ( Value padRight ) : Table
padRight Value Pad right.
Résultat Table

padRight() public méthode

Padding at the right edge of the table.
public padRight ( float padRight ) : Table
padRight float Pad right.
Résultat Table

padTop() public méthode

Padding at the top edge of the table.
public padTop ( Value padTop ) : Table
padTop Value Pad top.
Résultat Table

padTop() public méthode

Padding at the top edge of the table.
public padTop ( float padTop ) : Table
padTop float Pad top.
Résultat Table

removeElement() public méthode

public removeElement ( Element element ) : bool
element Element
Résultat bool

reset() public méthode

Removes all elements and cells from the table (same as {@link #clear()}) and additionally resets all table properties and cell, column, and row defaults.
public reset ( ) : void
Résultat void

right() public méthode

Adds {@link Align#right} and clears {@link Align#left} for the alignment of the logical table within the table element.
public right ( ) : Table
Résultat Table

round() public méthode

If true (the default), positions and sizes are rounded to integers.
public round ( bool round ) : Table
round bool If set to true round.
Résultat Table

row() public méthode

Indicates that subsequent cells should be added to a new row and returns the cell values that will be used as the defaults for all cells in the new row.
public row ( ) : Cell
Résultat Cell

setBackground() public méthode

background may be null to clear the background.
public setBackground ( IDrawable background ) : Table
background IDrawable Background.
Résultat Table

setDebug() public méthode

enables/disables all debug lines (table, cell, and widget)
public setDebug ( bool enabled ) : void
enabled bool If set to true enabled.
Résultat void

setFillParent() public méthode

public setFillParent ( bool fillParent ) : Table
fillParent bool
Résultat Table

stack() public méthode

Adds a new cell to the table with the specified elements in a {@link Stack}.
public stack ( ) : Cell
Résultat Cell

tableDebug() public méthode

Turns debug lines on or off.
public tableDebug ( TableDebug tableDebug ) : Table
tableDebug TableDebug Table debug.
Résultat Table

top() public méthode

Adds {@link Align#top} and clears {@link Align#bottom} for the alignment of the logical table within the table element.
public top ( ) : Table
Résultat Table

Property Details

_background protected_oe property

protected IDrawable _background
Résultat IDrawable

backgroundBottom static_oe public_oe property

static public Value,Nez.UI backgroundBottom
Résultat Value

backgroundLeft static_oe public_oe property

static public Value,Nez.UI backgroundLeft
Résultat Value

backgroundRight static_oe public_oe property

static public Value,Nez.UI backgroundRight
Résultat Value

backgroundTop static_oe public_oe property

static public Value,Nez.UI backgroundTop
Résultat Value

clip public_oe property

public bool clip
Résultat bool

debugCellColor static_oe public_oe property

static public Color debugCellColor
Résultat Color

debugElementColor static_oe public_oe property

static public Color debugElementColor
Résultat Color

debugTableColor static_oe public_oe property

static public Color debugTableColor
Résultat Color