Package com.formdev.flatlaf.ui
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.
- Author:
- Karl Tauber
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.plaf.basic.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 javax.swing.plaf.basic.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 javax.swing.plaf.basic.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 javax.swing.plaf.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
- Since:
- 2
-
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
-