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 ColorcellFocusColorprotected InsetscellMarginsprotected intselectionArcprotected ColorselectionBackgroundprotected ColorselectionForegroundprotected ColorselectionInactiveBackgroundprotected ColorselectionInactiveForegroundprotected InsetsselectionInsetsprotected BooleanshowCellFocusIndicator-
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 voidapplyStyle(Object style)protected ObjectapplyStyleProperty(String key, Object value)protected FocusListenercreateFocusListener()protected ListSelectionListenercreateListSelectionListener()protected PropertyChangeListenercreatePropertyChangeListener()static ComponentUIcreateUI(JComponent c)Map<String,Class<?>>getStyleableInfos(JComponent c)ObjectgetStyleableValue(JComponent c, String key)protected voidinstallDefaults()protected voidinstallStyle()voidinstallUI(JComponent c)protected 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)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 voiduninstallDefaults()-
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:
installUIin classBasicListUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classBasicListUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classBasicListUI
-
createFocusListener
protected FocusListener createFocusListener()
- Overrides:
createFocusListenerin classBasicListUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListenerin classBasicListUI
-
createListSelectionListener
protected ListSelectionListener createListSelectionListener()
- Overrides:
createListSelectionListenerin 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:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- 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
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
-
-