Class GridPaneSkin

    • Constructor Detail

      • GridPaneSkin

        public GridPaneSkin()
        Default constructor.
    • Method Detail

      • install

        public void install​(Component component)
        Description copied from class: ComponentSkin
        Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.
        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.
        Returns:
        The preferred width given the height 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.
        Returns:
        The preferred height given the width constraint.
      • getBaseline

        public int getBaseline​(int width,
                               int height)
        Description copied from class: ComponentSkin
        Should be implemented in every subclass.

        The default implementation here simply returns -1 (no baseline).

        Specified by:
        getBaseline in interface ConstrainedVisual
        Overrides:
        getBaseline in class ComponentSkin
        Parameters:
        width - Constrained width to compute the baseline for.
        height - Constrained height to compute the baseline for.
        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​(java.awt.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 final Insets getPadding()
        Returns:
        The padding that will be reserved around the grid pane during layout.
      • setPadding

        public final void setPadding​(Insets padding)
        Sets the padding that will be reserved around the grid pane during layout.
        Parameters:
        padding - The individual padding values for each side.
      • setPadding

        public final void setPadding​(int padding)
        Sets the padding that will be reserved around the grid pane during layout.
        Parameters:
        padding - The single value to use for all sides.
      • setPadding

        public final void setPadding​(Dictionary<java.lang.String,​?> padding)
        Sets the padding that will be reserved around the grid pane during layout.
        Parameters:
        padding - The dictionary of padding values, containing "top", "bottom", "left, and "right" entries.
      • setPadding

        public final void setPadding​(Sequence<?> padding)
        Sets the padding that will be reserved around the grid pane during layout.
        Parameters:
        padding - A sequence with values in the order {top, left, bottom, right}.
      • setPadding

        public final void setPadding​(java.lang.Number padding)
        Sets the padding that will be reserved around the grid pane during layout.
        Parameters:
        padding - The single value to use for all sides.
      • setPadding

        public final void setPadding​(java.lang.String padding)
        Sets the padding that will be reserved around the grid pane during layout.
        Parameters:
        padding - A JSON-format string containing the padding values.
      • getHorizontalSpacing

        public final int getHorizontalSpacing()
        Returns:
        The spacing that will be applied in between the grid pane's columns during layout.
      • setHorizontalSpacing

        public final void setHorizontalSpacing​(int horizontalSpacing)
        Sets the spacing that will be applied in between the grid pane's columns during layout.
        Parameters:
        horizontalSpacing - The non-negative spacing value between columns.
      • getVerticalSpacing

        public final int getVerticalSpacing()
        Returns:
        The spacing that will be applied in between the grid pane's rows during layout.
      • setVerticalSpacing

        public final void setVerticalSpacing​(int verticalSpacing)
        Sets the spacing that will be applied in between the grid pane's rows during layout.
        Parameters:
        verticalSpacing - The non-negative spacing value between rows.
      • getShowHorizontalGridLines

        public final boolean getShowHorizontalGridLines()
        Returns:
        Whether or not horizontal grid lines will be painted in between the grid pane's rows.
      • setShowHorizontalGridLines

        public final void setShowHorizontalGridLines​(boolean showHorizontalGridLines)
        Sets whether or not horizontal grid lines will be painted in between the grid pane's rows.
        Parameters:
        showHorizontalGridLines - Whether to show horizontal grid lines.
      • getShowVerticalGridLines

        public final boolean getShowVerticalGridLines()
        Returns:
        Whether or not vertical grid lines will be painted in between the grid pane's columns.
      • setShowVerticalGridLines

        public final void setShowVerticalGridLines​(boolean showVerticalGridLines)
        Sets whether or not vertical grid lines will be painted in between the grid pane's columns.
        Parameters:
        showVerticalGridLines - Whether to show the vertical grid lines.
      • getHorizontalGridColor

        public final java.awt.Color getHorizontalGridColor()
        Returns:
        The color used to paint the grid pane's horizontal grid lines.
      • setHorizontalGridColor

        public final void setHorizontalGridColor​(java.awt.Color horizontalGridColor)
        Sets the color used to paint the grid pane's horizontal grid lines.
        Parameters:
        horizontalGridColor - The new color for the horizontal grid lines.
      • setHorizontalGridColor

        public final void setHorizontalGridColor​(java.lang.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 final java.awt.Color getVerticalGridColor()
        Returns:
        The color used to paint the grid pane's vertical grid lines.
      • setVerticalGridColor

        public final void setVerticalGridColor​(java.awt.Color verticalGridColor)
        Sets the color used to paint the grid pane's vertical grid lines.
        Parameters:
        verticalGridColor - The new color for vertical grid lines.
      • setVerticalGridColor

        public final void setVerticalGridColor​(java.lang.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.
      • 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
        Parameters:
        gridPane - The grid pane that has changed.
        previousColumnCount - The previous column count for the grid.
      • 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
        Parameters:
        gridPane - The grid pane that has changed.
        index - The index of the row that was just inserted.
      • 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
        Parameters:
        gridPane - The grid pane that has changed.
        index - The starting index of the row(s) that were removed.
        rows - The complete sequence of removed rows.
      • 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
        Parameters:
        row - The parent row of the cell that was inserted.
        column - The column index of the inserted cell.
      • cellsRemoved

        public void cellsRemoved​(GridPane.Row row,
                                 int column,
                                 Sequence<Component> removed)
        Description copied from interface: GridPaneListener
        Called when cells have been removed from a grid pane.
        Specified by:
        cellsRemoved in interface GridPaneListener
        Parameters:
        row - The parent row of the removed cell(s).
        column - The starting column index of the removed cells.
        removed - The complete sequence of removed cells.
      • 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
        Parameters:
        row - The parent row object of the updated cell.
        column - The column index of the updated cell.
        previousComponent - The previous contents of this cell.