pivot.wtk
Class TablePane

java.lang.Object
  extended by pivot.wtk.Component
      extended by pivot.wtk.Container
          extended by pivot.wtk.TablePane
All Implemented Interfaces:
Iterable<Component>, Sequence<Component>, ConstrainedVisual, Visual

public class TablePane
extends Container

Container that arranges components in a two-dimensional grid, optionally spanning multiple rows and columns.

Author:
tvolkert

Nested Class Summary
static class TablePane.Column
          Represents a table pane column.
 class TablePane.ColumnSequence
          Class that manages a table pane's column list.
static class TablePane.Row
          Represents a table pane row.
 class TablePane.RowSequence
          Class that manages a table pane's row list.
static interface TablePane.Skin
          Table pane skin interface.
protected static class TablePane.TablePaneAttributes
          Defines table pane component attributes.
 
Nested classes/interfaces inherited from class pivot.wtk.Component
Component.Attributes, Component.ComponentDictionary, Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Nested classes/interfaces inherited from interface pivot.collections.Sequence
Sequence.Search, Sequence.Sort, Sequence.Tree
 
Field Summary
static String RELATIVE_SIZE_INDICATOR
           
 
Constructor Summary
TablePane()
          Creates a new TablePane with empty row and column sequences.
TablePane(Sequence<TablePane.Column> columns)
          Creates a new TablePane with the specified columns.
 
Method Summary
 Component getCellComponent(int rowIndex, int columnIndex)
          Gets the component at the specified cell in this table pane.
 int getColumnAt(int x)
          Returns the index of the column at a given location.
 Bounds getColumnBounds(int column)
          Returns the bounds of a given column.
 TablePane.ColumnSequence getColumns()
          Returns the table pane column sequence.
static int getColumnSpan(Component component)
           
 int getRowAt(int y)
          Returns the index of the row at a given location.
 Bounds getRowBounds(int row)
          Returns the bounds of a given row.
 TablePane.RowSequence getRows()
          Returns the table pane row sequence.
static int getRowSpan(Component component)
           
 ListenerList<TablePaneAttributeListener> getTablePaneAttributeListeners()
          Returns the table pane attribute listener list.
 ListenerList<TablePaneListener> getTablePaneListeners()
          Returns the table pane listener list.
 Sequence<Component> remove(int index, int count)
          Overrides the base method to check whether or not a cell component is being removed, and fires the appropriate event in that case.
 void setCellComponent(int row, int column, Component component)
          Sets the component at the specified cell in this table pane.
static void setColumnSpan(Component component, int columnSpan)
           
static void setRowSpan(Component component, int rowSpan)
           
protected  void setSkin(Skin skin)
          Sets the skin, replacing any previous skin.
 
Methods inherited from class pivot.wtk.Container
add, containsFocus, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getContextKey, getDescendantAt, getFocusTraversalPolicy, getLength, indexOf, insert, isAncestor, isFocusable, iterator, load, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, removeAll, requestFocus, setContextKey, setEnabled, setFocusTraversalPolicy, setParent, setTooltip, setVisible, store, update, validate
 
Methods inherited from class pivot.wtk.Component
clearFocus, clearFocus, finalize, getAttributes, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentDragDropListeners, getComponentKeyListeners, getComponentLayoutListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponents, getComponentStateListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getGraphics, getHandle, getHeight, getLocation, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipText, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWindow, getX, getY, installSkin, invalidate, isBlocked, isDisplayable, isEnabled, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, load, mapPointFromAncestor, mapPointToAncestor, mouseOver, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttributes, setCursor, setCursor, setDisplayable, setDragSource, setDropTarget, setFocused, setHeight, setLocation, setLocation, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setStyles, setStyles, setStyles, setTooltipText, setWidth, setX, setY, store, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RELATIVE_SIZE_INDICATOR

public static final String RELATIVE_SIZE_INDICATOR
See Also:
Constant Field Values
Constructor Detail

TablePane

public TablePane()
Creates a new TablePane with empty row and column sequences.


TablePane

public TablePane(Sequence<TablePane.Column> columns)
Creates a new TablePane with the specified columns.

Parameters:
columns - The column sequence to use. A copy of this sequence will be made
Method Detail

setSkin

protected void setSkin(Skin skin)
Description copied from class: Component
Sets the skin, replacing any previous skin.

Overrides:
setSkin in class Component
Parameters:
skin - The new skin.

getRows

public TablePane.RowSequence getRows()
Returns the table pane row sequence.

Returns:
The table pane row sequence

getRowAt

public int getRowAt(int y)
Returns the index of the row at a given location.

Parameters:
y - The y-coordinate of the row to identify.
Returns:
The row index, or -1 if there is no row at the given y-coordinate.

getRowBounds

public Bounds getRowBounds(int row)
Returns the bounds of a given row.

Parameters:
row - The row index.

getColumns

public TablePane.ColumnSequence getColumns()
Returns the table pane column sequence.

Returns:
The table pane column sequence

getColumnAt

public int getColumnAt(int x)
Returns the index of the column at a given location.

Parameters:
x - The x-coordinate of the column to identify.
Returns:
The column index, or -1 if there is no column at the given x-coordinate.

getColumnBounds

public Bounds getColumnBounds(int column)
Returns the bounds of a given column.

Parameters:
column - The column index.

getCellComponent

public Component getCellComponent(int rowIndex,
                                  int columnIndex)
Gets the component at the specified cell in this table pane.

Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
Returns:
The component in the specified cell, or null if the cell is empty

setCellComponent

public void setCellComponent(int row,
                             int column,
                             Component component)
Sets the component at the specified cell in this table pane.

Parameters:
row - The row index of the cell
column - The column index of the cell
component - The component to place in the specified cell, or null to empty the cell

remove

public Sequence<Component> remove(int index,
                                  int count)
Overrides the base method to check whether or not a cell component is being removed, and fires the appropriate event in that case.

Specified by:
remove in interface Sequence<Component>
Overrides:
remove in class Container
Parameters:
index - The index at which components were removed
count - The number of components removed
Returns:
The sequence of components that were removed

getTablePaneListeners

public ListenerList<TablePaneListener> getTablePaneListeners()
Returns the table pane listener list.


getTablePaneAttributeListeners

public ListenerList<TablePaneAttributeListener> getTablePaneAttributeListeners()
Returns the table pane attribute listener list.


getRowSpan

public static int getRowSpan(Component component)

setRowSpan

public static void setRowSpan(Component component,
                              int rowSpan)

getColumnSpan

public static int getColumnSpan(Component component)

setColumnSpan

public static void setColumnSpan(Component component,
                                 int columnSpan)