org.apache.pivot.wtk
Class GridPane

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

@DefaultProperty(value="rows")
public class GridPane
extends Container

Container that arranges components in a two-dimensional grid, where every cell is the same size.


Nested Class Summary
static class GridPane.Filler
          Component that can be used as filler for empty cells.
static class GridPane.Row
          Represents a grid pane row.
 class GridPane.RowSequence
          Class that manages a grid pane's row list.
static interface GridPane.Skin
          Grid pane skin interface.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDT_Checker
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
 
Constructor Summary
GridPane()
          Creates a new grid pane.
GridPane(int columnCount)
          Creates a new grid pane with the specified column count.
 
Method Summary
 Component getCellComponent(int rowIndex, int columnIndex)
          Gets the component at the specified cell in this grid 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.
 int getColumnCount()
          Returns the number of columns in the grid pane.
 ListenerList<GridPaneListener> getGridPaneListeners()
          Returns the grid pane listener list.
 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.
 GridPane.RowSequence getRows()
          Returns the grid pane row sequence.
 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 setColumnCount(int columnCount)
          Sets the number of columns in the grid pane.
protected  void setSkin(Skin skin)
          Sets the skin, replacing any previous skin.
 
Methods inherited from class org.apache.pivot.wtk.Container
add, assertEventDispatchThread, assertEventDispatchThread, clear, containsFocus, descendantAdded, descendantGainedFocus, descendantLostFocus, descendantRemoved, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, load, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, setParent, setVisible, store, transferFocus, update
 
Methods inherited from class org.apache.pivot.wtk.Component
clearFocus, contains, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseOver, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setCursor, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridPane

public GridPane()
Creates a new grid pane.


GridPane

public GridPane(int columnCount)
Creates a new grid pane with the specified column count.

Parameters:
columnCount -
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.

getColumnCount

public int getColumnCount()
Returns the number of columns in the grid pane.


setColumnCount

public void setColumnCount(int columnCount)
Sets the number of columns in the grid pane.

Parameters:
columnCount -

getRows

public GridPane.RowSequence getRows()
Returns the grid pane row sequence.

Returns:
The grid 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.

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 grid 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

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

getGridPaneListeners

public ListenerList<GridPaneListener> getGridPaneListeners()
Returns the grid pane listener list.