Class MultiColumnSortTableHeaderCellRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, TableCellRenderer

public class MultiColumnSortTableHeaderCellRenderer extends DefaultTableHeaderCellRenderer
An extension of DefaultTableHeaderCellRenderer that paints sort icons on the header of each sorted column with varying opacity.
See Also:
  • Constructor Details

    • MultiColumnSortTableHeaderCellRenderer

      public MultiColumnSortTableHeaderCellRenderer()
      Constructs a MultisortTableHeaderCellRenderer with a default alpha of 0.5.
    • MultiColumnSortTableHeaderCellRenderer

      public MultiColumnSortTableHeaderCellRenderer(float alpha)
      Constructs a MultisortTableHeaderCellRenderer with the specified alpha. A lower value represents greater contrast between icons, while a higher value can make more sort icons visible.
      Parameters:
      alpha - the opacity, in the range 0.0F to 1.0F. Recommended range: 0.5F to 0.7F.
  • Method Details

    • getIcon

      public Icon getIcon(JTable table, int column)
      Overridden to return an icon suitable to a sorted column, or null if the column is unsorted. The icon for the primary sorted column is fully opaque, and the opacity is reduced by a factor of alpha for each subsequent sort index.
      Overrides:
      getIcon in class DefaultTableHeaderCellRenderer
      Parameters:
      table - the JTable.
      column - the column index.
      Returns:
      the sort icon with appropriate opacity, or null if the column is unsorted.