Class FlatTableUI

    • Field Detail

      • showHorizontalLines

        protected boolean showHorizontalLines
      • showVerticalLines

        protected boolean showVerticalLines
      • showTrailingVerticalLine

        protected boolean showTrailingVerticalLine
        Since:
        1.6
      • intercellSpacing

        protected java.awt.Dimension intercellSpacing
      • selectionBackground

        protected java.awt.Color selectionBackground
      • selectionForeground

        protected java.awt.Color selectionForeground
      • selectionInactiveBackground

        protected java.awt.Color selectionInactiveBackground
      • selectionInactiveForeground

        protected java.awt.Color selectionInactiveForeground
      • selectionInsets

        protected java.awt.Insets selectionInsets
        Since:
        3.5
      • selectionArc

        protected int selectionArc
        Since:
        3.5
      • cellMargins

        protected java.awt.Insets cellMargins
        Since:
        2
      • cellFocusColor

        protected java.awt.Color cellFocusColor
        Since:
        2
      • showCellFocusIndicator

        protected java.lang.Boolean showCellFocusIndicator
        Since:
        2
      • oldShowHorizontalLines

        private boolean oldShowHorizontalLines
      • oldShowVerticalLines

        private boolean oldShowVerticalLines
      • oldIntercellSpacing

        private java.awt.Dimension oldIntercellSpacing
      • oldBooleanRenderer

        private javax.swing.table.TableCellRenderer oldBooleanRenderer
      • propertyChangeListener

        private java.beans.PropertyChangeListener propertyChangeListener
      • outsideAlternateRowsListener

        private java.awt.event.ComponentListener outsideAlternateRowsListener
      • rowSelectionListener

        private javax.swing.event.ListSelectionListener rowSelectionListener
      • columnSelectionListener

        private javax.swing.event.TableColumnModelListener columnSelectionListener
      • oldStyleValues

        private java.util.Map<java.lang.String,​java.lang.Object> oldStyleValues
    • Constructor Detail

      • FlatTableUI

        public FlatTableUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)
      • installUI

        public void installUI​(javax.swing.JComponent c)
        Overrides:
        installUI in class javax.swing.plaf.basic.BasicTableUI
      • installDefaults

        protected void installDefaults()
        Overrides:
        installDefaults in class javax.swing.plaf.basic.BasicTableUI
      • uninstallDefaults

        protected void uninstallDefaults()
        Overrides:
        uninstallDefaults in class javax.swing.plaf.basic.BasicTableUI
      • installListeners

        protected void installListeners()
        Overrides:
        installListeners in class javax.swing.plaf.basic.BasicTableUI
      • uninstallListeners

        protected void uninstallListeners()
        Overrides:
        uninstallListeners in class javax.swing.plaf.basic.BasicTableUI
      • createFocusListener

        protected java.awt.event.FocusListener createFocusListener()
        Overrides:
        createFocusListener in class javax.swing.plaf.basic.BasicTableUI
      • installKeyboardActions

        protected void installKeyboardActions()
        Overrides:
        installKeyboardActions in class javax.swing.plaf.basic.BasicTableUI
      • installStyle

        protected void installStyle()
        Since:
        2
      • applyStyle

        protected void applyStyle​(java.lang.Object style)
        Since:
        2
      • applyStyleProperty

        protected java.lang.Object applyStyleProperty​(java.lang.String key,
                                                      java.lang.Object value)
        Since:
        2
      • toggleSelectionColors

        private void toggleSelectionColors()
        Toggle selection colors from focused to inactive and vice versa. This is not an optimal solution but much easier than rewriting the whole paint methods. Using a LaF specific renderer was avoided because often a custom renderer is already used in applications. Then either the inactive colors are not used, or the application has to be changed to extend a FlatLaf renderer.
      • paint

        public void paint​(java.awt.Graphics g,
                          javax.swing.JComponent c)
        Overrides:
        paint in class javax.swing.plaf.basic.BasicTableUI
      • hideLastVerticalLine

        protected boolean hideLastVerticalLine()
      • paintAlternateRowBackground

        protected void paintAlternateRowBackground​(java.awt.Graphics g,
                                                   int row,
                                                   int column,
                                                   int x,
                                                   int y,
                                                   int width,
                                                   int height)
        Paints (rounded) alternate row background. Supports selectionArc and selectionInsets.

        Note: This method is only invoked if either selection arc is greater than zero or if selection insets are not empty.

        Since:
        3.5
      • paintCellSelection

        protected void paintCellSelection​(java.awt.Graphics g,
                                          int row,
                                          int column,
                                          int x,
                                          int y,
                                          int width,
                                          int height)
        Paints (rounded) cell selection. Supports selectionArc and selectionInsets.

        Note: This method is only invoked if either selection arc is greater than zero or if selection insets are not empty.

        Since:
        3.5
      • paintCellSelection

        public static void paintCellSelection​(javax.swing.JTable table,
                                              java.awt.Graphics g,
                                              int row,
                                              int column,
                                              int x,
                                              int y,
                                              int width,
                                              int height)
        Paints a cell selection at the given coordinates. The selection color must be set on the graphics context.

        This method is intended for use in custom cell renderers to support selectionArc and selectionInsets.

        Since:
        3.5
      • installRepaintRoundedSelectionListeners

        private void installRepaintRoundedSelectionListeners()
      • repaintRoundedRowSelection

        private void repaintRoundedRowSelection​(javax.swing.event.ListSelectionEvent e)
      • repaintRoundedColumnSelection

        private void repaintRoundedColumnSelection​(javax.swing.event.ListSelectionEvent e)