Package com.formdev.flatlaf.ui
Class FlatTableUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TableUI
javax.swing.plaf.basic.BasicTableUI
com.formdev.flatlaf.ui.FlatTableUI
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
,FlatViewportUI.ViewportPainter
public class FlatTableUI
extends BasicTableUI
implements FlatStylingSupport.StyleableUI, FlatViewportUI.ViewportPainter
Provides the Flat LaF UI delegate for
JTable
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
Listener that watches for change of some table properties from application code.private static class
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTableUI
BasicTableUI.FocusHandler, BasicTableUI.KeyHandler, BasicTableUI.MouseInputHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Color
protected Insets
protected Dimension
private TableCellRenderer
private Dimension
private boolean
private boolean
private PropertyChangeListener
protected Color
protected Color
protected Color
protected Color
protected Boolean
protected boolean
protected boolean
protected boolean
Fields inherited from class javax.swing.plaf.basic.BasicTableUI
focusListener, keyListener, mouseInputListener, rendererPane, table
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyStyle
(Object style) protected Object
applyStyleProperty
(String key, Object value) protected FocusListener
static ComponentUI
getStyleableValue
(JComponent c, String key) protected boolean
protected void
protected void
protected void
protected void
void
void
paint
(Graphics g, JComponent c) void
paintViewport
(Graphics g, JComponent c, JViewport viewport) private void
Toggle selection colors from focused to inactive and vice versa.protected void
protected void
Methods inherited from class javax.swing.plaf.basic.BasicTableUI
createKeyListener, createMouseInputListener, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, uninstallKeyboardActions, uninstallUI
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Field Details
-
showHorizontalLines
protected boolean showHorizontalLines -
showVerticalLines
protected boolean showVerticalLines -
showTrailingVerticalLine
protected boolean showTrailingVerticalLine- Since:
- 1.6
-
intercellSpacing
-
selectionBackground
-
selectionForeground
-
selectionInactiveBackground
-
selectionInactiveForeground
-
cellMargins
- Since:
- 2
-
cellFocusColor
- Since:
- 2
-
showCellFocusIndicator
- Since:
- 2
-
oldShowHorizontalLines
private boolean oldShowHorizontalLines -
oldShowVerticalLines
private boolean oldShowVerticalLines -
oldIntercellSpacing
-
oldBooleanRenderer
-
propertyChangeListener
-
oldStyleValues
-
-
Constructor Details
-
FlatTableUI
public FlatTableUI()
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUI
in classBasicTableUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaults
in classBasicTableUI
-
uninstallDefaults
protected void uninstallDefaults()- Overrides:
uninstallDefaults
in classBasicTableUI
-
installListeners
protected void installListeners()- Overrides:
installListeners
in classBasicTableUI
-
uninstallListeners
protected void uninstallListeners()- Overrides:
uninstallListeners
in classBasicTableUI
-
createFocusListener
- Overrides:
createFocusListener
in classBasicTableUI
-
installKeyboardActions
protected void installKeyboardActions()- Overrides:
installKeyboardActions
in classBasicTableUI
-
installStyle
protected void installStyle()- Since:
- 2
-
applyStyle
- Since:
- 2
-
applyStyleProperty
- Since:
- 2
-
getStyleableInfos
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
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
- Overrides:
paint
in classBasicTableUI
-
hideLastVerticalLine
protected boolean hideLastVerticalLine() -
paintViewport
- Specified by:
paintViewport
in interfaceFlatViewportUI.ViewportPainter
- Since:
- 2.3
-