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
public class FlatListUI extends BasicListUI implements FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate forJList
.- UiDefault:
- List.font Font, List.background Color, List.foreground Color, List.selectionBackground Color, List.selectionForeground 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 javax.swing.plaf.basic.BasicListUI
BasicListUI.FocusHandler, BasicListUI.ListDataHandler, BasicListUI.ListSelectionHandler, BasicListUI.MouseInputHandler, BasicListUI.PropertyChangeHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
cellFocusColor
protected Insets
cellMargins
protected int
selectionArc
protected Color
selectionBackground
protected Color
selectionForeground
protected Color
selectionInactiveBackground
protected Color
selectionInactiveForeground
protected Insets
selectionInsets
protected Boolean
showCellFocusIndicator
-
Fields 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 Constructor Description FlatListUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyStyle(Object style)
protected Object
applyStyleProperty(String key, Object value)
protected FocusListener
createFocusListener()
protected ListSelectionListener
createListSelectionListener()
protected PropertyChangeListener
createPropertyChangeListener()
static ComponentUI
createUI(JComponent c)
Map<String,Class<?>>
getStyleableInfos(JComponent c)
Object
getStyleableValue(JComponent c, String key)
protected void
installDefaults()
protected void
installStyle()
void
installUI(JComponent c)
protected void
paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)
protected void
paintCellSelection(Graphics g, int row, int x, int y, int width, int height)
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.protected void
uninstallDefaults()
-
Methods 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, updateLayoutState
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update
-
-
-
-
Field Detail
-
selectionBackground
protected Color selectionBackground
-
selectionForeground
protected Color selectionForeground
-
selectionInactiveBackground
protected Color selectionInactiveBackground
-
selectionInactiveForeground
protected Color selectionInactiveForeground
-
selectionInsets
protected Insets selectionInsets
- Since:
- 3
-
selectionArc
protected int selectionArc
- Since:
- 3
-
cellMargins
protected Insets cellMargins
- Since:
- 2
-
cellFocusColor
protected Color cellFocusColor
- Since:
- 2
-
showCellFocusIndicator
protected Boolean showCellFocusIndicator
- Since:
- 2
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classBasicListUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classBasicListUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classBasicListUI
-
createFocusListener
protected FocusListener createFocusListener()
- Overrides:
createFocusListener
in classBasicListUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListener
in classBasicListUI
-
createListSelectionListener
protected ListSelectionListener createListSelectionListener()
- Overrides:
createListSelectionListener
in classBasicListUI
-
installStyle
protected void installStyle()
- Since:
- 2
-
applyStyle
protected void applyStyle(Object style)
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
paintCell
protected void paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)
- Overrides:
paintCell
in classBasicListUI
-
paintCellSelection
protected void paintCellSelection(Graphics g, int row, int x, int y, int width, int height)
- 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.
- Since:
- 3
-
-