Class TerraTableViewHeaderSkin

    • Constructor Detail

      • TerraTableViewHeaderSkin

        public TerraTableViewHeaderSkin()
    • 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 ComponentSkin
        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
        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
        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
        Parameters:
        graphics - The graphics context in which to paint the visual.
      • isFocusable

        public boolean isFocusable()
        Description copied from class: ComponentSkin
        By default, skins are focusable.
        Specified by:
        isFocusable in interface Skin
        Overrides:
        isFocusable in class ComponentSkin
        Returns:
        true if this skin is focusable; false, otherwise.
      • getFont

        public java.awt.Font getFont()
      • setFont

        public void setFont​(java.awt.Font font)
      • setFont

        public final void setFont​(java.lang.String font)
      • setFont

        public final void setFont​(Dictionary<java.lang.String,​?> font)
      • getColor

        public java.awt.Color getColor()
      • setColor

        public void setColor​(java.awt.Color color)
      • setColor

        public final void setColor​(java.lang.String color)
      • setColor

        public final void setColor​(int color)
      • getDisabledColor

        public java.awt.Color getDisabledColor()
      • setDisabledColor

        public void setDisabledColor​(java.awt.Color disabledColor)
      • setDisabledColor

        public final void setDisabledColor​(java.lang.String disabledColor)
      • setDisabledColor

        public final void setDisabledColor​(int disabledColor)
      • getBackgroundColor

        public java.awt.Color getBackgroundColor()
      • setBackgroundColor

        public void setBackgroundColor​(java.awt.Color backgroundColor)
      • setBackgroundColor

        public final void setBackgroundColor​(java.lang.String backgroundColor)
      • setBackgroundColor

        public final void setBackgroundColor​(int backgroundColor)
      • getDisabledBackgroundColor

        public java.awt.Color getDisabledBackgroundColor()
      • setDisabledBackgroundColor

        public void setDisabledBackgroundColor​(java.awt.Color disabledBackgroundColor)
      • setDisabledBackgroundColor

        public final void setDisabledBackgroundColor​(java.lang.String disabledBackgroundColor)
      • setDisabledBackgroundColor

        public final void setDisabledBackgroundColor​(int disabledBackgroundColor)
      • getBorderColor

        public java.awt.Color getBorderColor()
      • setBorderColor

        public void setBorderColor​(java.awt.Color borderColor)
      • setBorderColor

        public final void setBorderColor​(java.lang.String borderColor)
      • setBorderColor

        public final void setBorderColor​(int borderColor)
      • getDisabledBorderColor

        public java.awt.Color getDisabledBorderColor()
      • setDisabledBorderColor

        public void setDisabledBorderColor​(java.awt.Color disabledBorderColor)
      • setDisabledBorderColor

        public final void setDisabledBorderColor​(java.lang.String disabledBorderColor)
      • setDisabledBorderColor

        public final void setDisabledBorderColor​(int disabledBorderColor)
      • getHeadersPressable

        public boolean getHeadersPressable()
      • setHeadersPressable

        public void setHeadersPressable​(boolean headersPressable)
      • getColumnsResizable

        public boolean getColumnsResizable()
      • setColumnsResizable

        public void setColumnsResizable​(boolean columnsResizable)
      • getIncludeTrailingVerticalGridLine

        public boolean getIncludeTrailingVerticalGridLine()
      • setIncludeTrailingVerticalGridLine

        public void setIncludeTrailingVerticalGridLine​(boolean includeTrailingVerticalGridLine)
      • enabledChanged

        public void enabledChanged​(Component component)
        Description copied from interface: ComponentStateListener
        Called when a component's enabled state has changed.

        Called both when the component is enabled and when it is disabled. The component's enabled flag has already been set when this method is called so the new state can be determined by calling the Component.isEnabled() method.

        Specified by:
        enabledChanged in interface ComponentStateListener
        Overrides:
        enabledChanged in class ComponentSkin
        Parameters:
        component - The component whose enabled state is changing.
      • mouseMove

        public boolean mouseMove​(Component component,
                                 int x,
                                 int y)
        Description copied from interface: ComponentMouseListener
        Called when the mouse is moved over a component.
        Specified by:
        mouseMove in interface ComponentMouseListener
        Overrides:
        mouseMove in class ComponentSkin
        Parameters:
        component - Component that is under the mouse.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate (default return).
      • mouseDown

        public boolean mouseDown​(Component component,
                                 Mouse.Button button,
                                 int x,
                                 int y)
        Description copied from interface: ComponentMouseButtonListener
        Called when a mouse button is pressed over a component.
        Specified by:
        mouseDown in interface ComponentMouseButtonListener
        Overrides:
        mouseDown in class ComponentSkin
        Parameters:
        component - Component that is under the mouse pointer.
        button - Which mouse button was pressed.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • mouseUp

        public boolean mouseUp​(Component component,
                               Mouse.Button button,
                               int x,
                               int y)
        Description copied from interface: ComponentMouseButtonListener
        Called when a mouse button is released over a component.
        Specified by:
        mouseUp in interface ComponentMouseButtonListener
        Overrides:
        mouseUp in class ComponentSkin
        Parameters:
        component - Component user the mouse pointer.
        button - Which mouse button that was released.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • mouseClick

        public boolean mouseClick​(Component component,
                                  Mouse.Button button,
                                  int x,
                                  int y,
                                  int count)
        Description copied from interface: ComponentMouseButtonListener
        Called when a mouse button is clicked over a component.
        Specified by:
        mouseClick in interface ComponentMouseButtonListener
        Overrides:
        mouseClick in class ComponentSkin
        Parameters:
        component - Component user the mouse pointer.
        button - Which mouse button was clicked.
        x - X position of the mouse.
        y - Y position of the mouse.
        count - Number of clicks (1 = single click, 2 = double click, etc.).
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • tableViewChanged

        public void tableViewChanged​(TableViewHeader tableViewHeader,
                                     TableView previousTableView)
        Description copied from interface: TableViewHeaderListener
        Called when a table view header's table view has changed.
        Specified by:
        tableViewChanged in interface TableViewHeaderListener
        Parameters:
        tableViewHeader - The source of this event.
        previousTableView - The table view that used to be associated with this header.
      • columnInserted

        public void columnInserted​(TableView tableView,
                                   int index)
        Description copied from interface: TableViewColumnListener
        Called when a column is inserted into a table view's column sequence.
        Specified by:
        columnInserted in interface TableViewColumnListener
        Parameters:
        tableView - The table view that has changed.
        index - Where the new column has been inserted.
      • columnsRemoved

        public void columnsRemoved​(TableView tableView,
                                   int index,
                                   Sequence<TableView.Column> columns)
        Description copied from interface: TableViewColumnListener
        Called when columns are removed from a table view's column sequence.
        Specified by:
        columnsRemoved in interface TableViewColumnListener
        Parameters:
        tableView - The table view that has changed.
        index - The starting location of the removed columns.
        columns - The actual sequence of columns that were removed.
      • columnWidthChanged

        public void columnWidthChanged​(TableView.Column column,
                                       int previousWidth,
                                       boolean previousRelative)
        Description copied from interface: TableViewColumnListener
        Called when a column's width has changed.
        Specified by:
        columnWidthChanged in interface TableViewColumnListener
        Parameters:
        column - The column that changed.
        previousWidth - The previous numeric value of the column width.
        previousRelative - Whether the previous width was relative or not.
      • columnWidthLimitsChanged

        public void columnWidthLimitsChanged​(TableView.Column column,
                                             int previousMinimumWidth,
                                             int previousMaximumWidth)
        Description copied from interface: TableViewColumnListener
        Called when a column's width limits have changed.
        Specified by:
        columnWidthLimitsChanged in interface TableViewColumnListener
        Parameters:
        column - The source of this event.
        previousMinimumWidth - The previous minimum column width.
        previousMaximumWidth - The previous maximum column width.
      • sortAdded

        public void sortAdded​(TableView tableView,
                              java.lang.String columnName)
        Description copied from interface: TableViewSortListener
        Called when a sort has been added to a table view.
        Specified by:
        sortAdded in interface TableViewSortListener
        Parameters:
        tableView - The source of this event.
        columnName - The new column name added to the sort criteria.
      • sortUpdated

        public void sortUpdated​(TableView tableView,
                                java.lang.String columnName,
                                SortDirection previousSortDirection)
        Description copied from interface: TableViewSortListener
        Called when a sort has been updated in a table view.
        Specified by:
        sortUpdated in interface TableViewSortListener
        Parameters:
        tableView - The source of this event.
        columnName - The column that was updated.
        previousSortDirection - The previous value of the sort direction for this column.
      • sortRemoved

        public void sortRemoved​(TableView tableView,
                                java.lang.String columnName,
                                SortDirection sortDirection)
        Description copied from interface: TableViewSortListener
        Called when a sort has been removed from a table view.
        Specified by:
        sortRemoved in interface TableViewSortListener
        Parameters:
        tableView - The source of this event.
        columnName - The column name that was removed from the sort criteria.
        sortDirection - What the sort direction was for this column.