org.apache.pivot.wtk.skin
Class GridPaneSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ContainerSkin
          extended by org.apache.pivot.wtk.skin.GridPaneSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, ContainerListener, ContainerMouseListener, GridPane.Skin, GridPaneListener, Skin, Visual
Direct Known Subclasses:
TerraGridPaneSkin

public class GridPaneSkin
extends ContainerSkin
implements GridPane.Skin, GridPaneListener

Grid pane skin.


Nested Class Summary
protected  class GridPaneSkin.Metadata
          Provides metadata about the grid pane that skins use in performing preferred size calculations and layout.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.GridPaneListener
GridPaneListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Constructor Summary
GridPaneSkin()
           
 
Method Summary
 void cellInserted(GridPane.Row row, int column)
          Called when a cell has been inserted into a grid pane.
 void cellsRemoved(GridPane.Row row, int column, Sequence<Component> removed)
          Called when cell's have been removed from a grid pane.
 void cellUpdated(GridPane.Row row, int column, Component previousComponent)
          Called when a cell has been updated in a grid pane.
 void columnCountChanged(GridPane gridPane, int previousColumnCount)
          Called when a grid pane's column count has changed.
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 int getColumnAt(int x)
           
 Bounds getColumnBounds(int column)
           
 Color getHorizontalGridColor()
          Gets the color used to paint the grid pane's horizontal grid lines.
 int getHorizontalSpacing()
          Gets the spacing that will be applied in between the grid pane's columns during layout.
 Insets getPadding()
          Gets the padding that will be reserved around the grid pane during layout.
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 Dimensions getPreferredSize()
          Returns the visual's unconstrained preferred size.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getRowAt(int y)
           
 Bounds getRowBounds(int row)
           
 boolean getShowHorizontalGridLines()
          Tells whether or not horizontal grid lines will be painted in between the grid pane's rows.
 boolean getShowVerticalGridLines()
          Tells whether or not vertical grid lines will be painted in between the grid pane's columns.
 Color getVerticalGridColor()
          Gets the color used to paint the grid pane's vertical grid lines.
 int getVerticalSpacing()
          Gets the spacing that will be applied in between the grid pane's rows during layout.
 void install(Component component)
          Associates a skin with a component.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void paint(Graphics2D graphics)
          Paints the visual.
 void rowInserted(GridPane gridPane, int index)
          Called when a row has been inserted into a grid pane.
 void rowsRemoved(GridPane gridPane, int index, Sequence<GridPane.Row> rows)
          Called when rows have been removed from a grid pane.
 void setHorizontalGridColor(Color horizontalGridColor)
          Sets the color used to paint the grid pane's horizontal grid lines.
 void setHorizontalGridColor(String horizontalGridColor)
          Sets the color used to paint the grid pane's horizontal grid lines.
 void setHorizontalSpacing(int horizontalSpacing)
          Sets the spacing that will be applied in between the grid pane's columns during layout.
 void setPadding(Dictionary<String,?> padding)
          Sets the padding that will be reserved around the grid pane during layout.
 void setPadding(Insets padding)
          Sets the padding that will be reserved around the grid pane during layout.
 void setPadding(int padding)
          Sets the padding that will be reserved around the grid pane during layout.
 void setPadding(Number padding)
          Sets the padding that will be reserved around the grid pane during layout.
 void setPadding(String padding)
          Sets the padding that will be reserved around the grid pane during layout.
 void setShowHorizontalGridLines(boolean showHorizontalGridLines)
          Sets whether or not horizontal grid lines will be painted in between the grid pane's rows.
 void setShowVerticalGridLines(boolean showVerticalGridLines)
          Sets whether or not vertical grid lines will be painted in between the grid pane's columns.
 void setVerticalGridColor(Color verticalGridColor)
          Sets the color used to paint the grid pane's vertical grid lines.
 void setVerticalGridColor(String verticalGridColor)
          Sets the color used to paint the grid pane's vertical grid lines.
 void setVerticalSpacing(int verticalSpacing)
          Sets the spacing that will be applied in between the grid pane's rows during layout.
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridPaneSkin

public GridPaneSkin()
Method Detail

install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class ContainerSkin
Parameters:
component - The component to which the skin is being attached.

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Overrides:
getPreferredWidth in class ContainerSkin
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Overrides:
getPreferredHeight in class ContainerSkin
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

getBaseline

public int getBaseline(int width,
                       int height)
Description copied from interface: ConstrainedVisual
Returns the baseline for a given width and height.

Specified by:
getBaseline in interface ConstrainedVisual
Overrides:
getBaseline in class ComponentSkin
Returns:
The baseline relative to the origin of this visual, or -1 if this visual does not have a baseline.

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.

Specified by:
layout in interface Skin

paint

public void paint(Graphics2D graphics)
Description copied from interface: Visual
Paints the visual.

Specified by:
paint in interface Visual
Overrides:
paint in class ContainerSkin
Parameters:
graphics - The graphics context in which to paint the visual.

getPadding

public Insets getPadding()
Gets the padding that will be reserved around the grid pane during layout.


setPadding

public void setPadding(Insets padding)
Sets the padding that will be reserved around the grid pane during layout.


setPadding

public final void setPadding(int padding)
Sets the padding that will be reserved around the grid pane during layout.


setPadding

public final void setPadding(Dictionary<String,?> padding)
Sets the padding that will be reserved around the grid pane during layout.


setPadding

public final void setPadding(Number padding)
Sets the padding that will be reserved around the grid pane during layout.


setPadding

public final void setPadding(String padding)
Sets the padding that will be reserved around the grid pane during layout.


getHorizontalSpacing

public int getHorizontalSpacing()
Gets the spacing that will be applied in between the grid pane's columns during layout.


setHorizontalSpacing

public void setHorizontalSpacing(int horizontalSpacing)
Sets the spacing that will be applied in between the grid pane's columns during layout.


getVerticalSpacing

public int getVerticalSpacing()
Gets the spacing that will be applied in between the grid pane's rows during layout.


setVerticalSpacing

public void setVerticalSpacing(int verticalSpacing)
Sets the spacing that will be applied in between the grid pane's rows during layout.


getShowHorizontalGridLines

public boolean getShowHorizontalGridLines()
Tells whether or not horizontal grid lines will be painted in between the grid pane's rows.


setShowHorizontalGridLines

public void setShowHorizontalGridLines(boolean showHorizontalGridLines)
Sets whether or not horizontal grid lines will be painted in between the grid pane's rows.


getShowVerticalGridLines

public boolean getShowVerticalGridLines()
Tells whether or not vertical grid lines will be painted in between the grid pane's columns.


setShowVerticalGridLines

public void setShowVerticalGridLines(boolean showVerticalGridLines)
Sets whether or not vertical grid lines will be painted in between the grid pane's columns.


getHorizontalGridColor

public Color getHorizontalGridColor()
Gets the color used to paint the grid pane's horizontal grid lines.


setHorizontalGridColor

public void setHorizontalGridColor(Color horizontalGridColor)
Sets the color used to paint the grid pane's horizontal grid lines.


setHorizontalGridColor

public final void setHorizontalGridColor(String horizontalGridColor)
Sets the color used to paint the grid pane's horizontal grid lines.

Parameters:
horizontalGridColor - Any of the color values recognized by Pivot.

getVerticalGridColor

public Color getVerticalGridColor()
Gets the color used to paint the grid pane's vertical grid lines.


setVerticalGridColor

public void setVerticalGridColor(Color verticalGridColor)
Sets the color used to paint the grid pane's vertical grid lines.


setVerticalGridColor

public final void setVerticalGridColor(String verticalGridColor)
Sets the color used to paint the grid pane's vertical grid lines.

Parameters:
verticalGridColor - Any of the color values recognized by Pivot.

getRowAt

public int getRowAt(int y)
Specified by:
getRowAt in interface GridPane.Skin

getRowBounds

public Bounds getRowBounds(int row)
Specified by:
getRowBounds in interface GridPane.Skin

getColumnAt

public int getColumnAt(int x)
Specified by:
getColumnAt in interface GridPane.Skin

getColumnBounds

public Bounds getColumnBounds(int column)
Specified by:
getColumnBounds in interface GridPane.Skin

columnCountChanged

public void columnCountChanged(GridPane gridPane,
                               int previousColumnCount)
Description copied from interface: GridPaneListener
Called when a grid pane's column count has changed.

Specified by:
columnCountChanged in interface GridPaneListener

rowInserted

public void rowInserted(GridPane gridPane,
                        int index)
Description copied from interface: GridPaneListener
Called when a row has been inserted into a grid pane.

Specified by:
rowInserted in interface GridPaneListener

rowsRemoved

public void rowsRemoved(GridPane gridPane,
                        int index,
                        Sequence<GridPane.Row> rows)
Description copied from interface: GridPaneListener
Called when rows have been removed from a grid pane.

Specified by:
rowsRemoved in interface GridPaneListener

cellInserted

public void cellInserted(GridPane.Row row,
                         int column)
Description copied from interface: GridPaneListener
Called when a cell has been inserted into a grid pane.

Specified by:
cellInserted in interface GridPaneListener

cellsRemoved

public void cellsRemoved(GridPane.Row row,
                         int column,
                         Sequence<Component> removed)
Description copied from interface: GridPaneListener
Called when cell's have been removed from a grid pane.

Specified by:
cellsRemoved in interface GridPaneListener

cellUpdated

public void cellUpdated(GridPane.Row row,
                        int column,
                        Component previousComponent)
Description copied from interface: GridPaneListener
Called when a cell has been updated in a grid pane.

Specified by:
cellUpdated in interface GridPaneListener