Class FlatListUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ListUI
javax.swing.plaf.basic.BasicListUI
com.formdev.flatlaf.ui.FlatListUI
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate for
JList.
- UiDefault:
- List.font Font, List.background Color, List.foreground Color, List.selectionBackground Color, List.selectionForeground Color, List.alternateRowColor Color, List.dropLineColor Color, List.border Border, List.cellRenderer ListCellRenderer, FileChooser.listFont Font used if client property List.isFileList is true , List.cellNoFocusBorder Border, List.focusCellHighlightBorder Border, List.focusSelectedCellHighlightBorder Border, List.dropCellBackground Color, List.dropCellForeground Color , List.selectionInactiveBackground Color, List.selectionInactiveForeground Color, List.selectionInsets Insets, List.selectionArc int , List.cellMargins Insets, List.cellFocusColor Color, List.showCellFocusIndicator boolean
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicListUI
BasicListUI.FocusHandler, BasicListUI.ListDataHandler, BasicListUI.ListSelectionHandler, BasicListUI.MouseInputHandler, BasicListUI.PropertyChangeHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected Colorprotected Insetsprotected intprotected Colorprotected Colorprotected Colorprotected Colorprotected Insetsprotected BooleanFields inherited from class BasicListUI
cellHeight, cellHeights, cellRendererChanged, cellWidth, fixedCellHeightChanged, fixedCellWidthChanged, focusListener, fontChanged, list, listDataListener, listSelectionListener, modelChanged, mouseInputListener, propertyChangeListener, prototypeCellValueChanged, rendererPane, selectionModelChanged, updateLayoutStateNeeded -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyStyle(Object style) protected ObjectapplyStyleProperty(String key, Object value) protected FocusListenerprotected ListSelectionListenerprotected PropertyChangeListenerstatic ComponentUIgetStyleableValue(JComponent c, String key) protected voidprotected voidvoidprotected voidpaintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex) protected voidpaintCellSelection(Graphics g, int row, int x, int y, int width, int height) Paints (rounded) cell selection.static voidpaintCellSelection(JList<?> list, Graphics g, int row, int x, int y, int width, int height) Paints a cell selection at the given coordinates.protected voidMethods inherited from class BasicListUI
convertRowToY, convertYToRow, createListDataListener, createMouseInputListener, getBaseline, getBaselineResizeBehavior, getCellBounds, getPreferredSize, getRowHeight, indexToLocation, installKeyboardActions, installListeners, locationToIndex, maybeUpdateLayoutState, paint, selectNextIndex, selectPreviousIndex, uninstallKeyboardActions, uninstallListeners, uninstallUI, updateLayoutStateMethods inherited from class ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update
-
Field Details
-
selectionBackground
-
selectionForeground
-
selectionInactiveBackground
-
selectionInactiveForeground
-
alternateRowColor
- Since:
- 3.6
-
selectionInsets
- Since:
- 3
-
selectionArc
protected int selectionArc- Since:
- 3
-
cellMargins
- Since:
- 2
-
cellFocusColor
- Since:
- 2
-
showCellFocusIndicator
- Since:
- 2
-
-
Constructor Details
-
FlatListUI
public FlatListUI()
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUIin classBasicListUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaultsin classBasicListUI
-
uninstallDefaults
protected void uninstallDefaults()- Overrides:
uninstallDefaultsin classBasicListUI
-
createFocusListener
- Overrides:
createFocusListenerin classBasicListUI
-
createPropertyChangeListener
- Overrides:
createPropertyChangeListenerin classBasicListUI
-
createListSelectionListener
- Overrides:
createListSelectionListenerin classBasicListUI
-
installStyle
protected void installStyle()- Since:
- 2
-
applyStyle
- Since:
- 2
-
applyStyleProperty
-
getStyleableInfos
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Since:
- 2
-
getStyleableValue
- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableUI- Since:
- 2.5
-
paintCell
protected void paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex) - Overrides:
paintCellin classBasicListUI
-
paintCellSelection
Paints (rounded) cell selection. SupportsselectionArcandselectionInsets.Note: This method is only invoked if either selection arc is greater than zero or if selection insets are not empty.
- Since:
- 3
-
paintCellSelection
public static void paintCellSelection(JList<?> list, Graphics g, int row, 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
selectionArcandselectionInsets.- Since:
- 3
-