E - component typeU - component UI typeD - decoration typepublic class ListPainter<E extends javax.swing.JList,U extends WebListUI,D extends IDecoration<E,D>> extends AbstractDecorationPainter<E,U,D> implements IListPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected int |
cellHeight |
protected int[] |
cellHeights |
protected int |
cellWidth |
protected java.lang.Integer |
columnCount |
protected IListItemPainter |
hoverPainter
Hover list item decoration painter.
|
protected java.lang.Integer |
layoutOrientation
Painting variables.
|
protected java.lang.Integer |
listHeight |
protected javax.swing.event.ListSelectionListener |
listSelectionListener
Listeners.
|
protected java.lang.Integer |
listWidth |
protected java.lang.Integer |
preferredHeight |
protected javax.swing.CellRendererPane |
rendererPane |
protected java.lang.Integer |
rowsPerColumn |
protected IListItemPainter |
selectionPainter
Selected list items decoration painter.
|
ancestor, DECORATION_STATES_PROPERTY, decorationCache, decorations, focused, focusStateTracker, hierarchyTracker, hover, hoverStateTracker, neighboursTracker, statescomponent, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
ListPainter() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
adjustIndex(int index,
E list)
Returns corrected item index.
|
protected int |
convertLocationToColumn(int x,
int y)
Returns the column at the location specified by X and Y coordinates.
|
protected int |
convertLocationToRow(int x,
int y0,
boolean closest)
Returns the row at the location specified by X and Y coordinates.
|
protected int |
convertLocationToRowInColumn(int y,
int column)
Returns the closest row that starts at the specified y-location in the passed in column.
|
protected int |
getHeight(int column,
int row)
Returns the height of the cell at the passed in location.
|
protected int |
getModelIndex(int column,
int row)
Returns the model index for the specified display location.
|
protected int |
getRowCount(int column)
Returns the number of rows in the given column.
|
protected java.util.List<java.awt.Rectangle> |
getSelectionRects()
Returns list of list selections bounds.
|
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
boolean |
isHoverDecorationSupported()
Returns whether or not hover item decoration is supported by this list painter.
|
protected void |
paintCell(java.awt.Graphics2D g2d,
int index,
java.awt.Rectangle rowBounds,
javax.swing.ListCellRenderer cellRenderer,
javax.swing.ListModel dataModel,
javax.swing.ListSelectionModel selModel,
int leadIndex)
Paint one List cell: compute the relevant state, get the "rubber stamp" cell renderer component, and then use the CellRendererPane
to paint it.
|
protected void |
paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints content decorated by this painter.
|
protected void |
paintDropLocation(java.awt.Graphics2D g2d)
Paints list drop location.
|
protected void |
paintHoverCellBackground(java.awt.Graphics2D g2d)
Paints hover cell highlight.
|
protected void |
paintList(java.awt.Graphics2D g2d)
Paints existing list items.
|
protected void |
paintSelectedCellsBackground(java.awt.Graphics2D g2d)
Paints special WebLaF list cells selection.
|
void |
prepareToPaint(java.lang.Integer layoutOrientation,
java.lang.Integer listHeight,
java.lang.Integer listWidth,
java.lang.Integer columnCount,
java.lang.Integer rowsPerColumn,
java.lang.Integer preferredHeight,
int cellWidth,
int cellHeight,
int[] cellHeights)
Prepares painter to pain list.
|
protected void |
repaintSelection()
Repaints all rectangles containing list selections.
|
void |
uninstall(E c,
U ui)
Called when painter is installed into some component.
|
adjustBounds, asList, collectDecorationStates, getBorders, getDecoration, getDecorations, getDecorationSize, getDecorationStates, getPreferredSize, getSectionPainters, installFocusListener, installHierarchyListener, installHoverListener, isDecorated, isDecorationPaintAllowed, isEnabled, isFocused, isHover, isOpaque, isOpaqueDecorated, isOpaqueUndecorated, isPlainBackgroundPaintAllowed, paint, propertyChange, provideShape, uninstallFocusListener, uninstallHierarchyListener, uninstallHoverListener, updateDecorationState, usesState, usesStateaddPainterListener, b, borderChange, getCompleteBorder, i, i, i, installPropertyChangeListener, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPainterListener, getBorders, getPreferredSize, isOpaque, paint, removePainterListener@DefaultPainter(value=ListItemPainter.class) protected IListItemPainter hoverPainter
@DefaultPainter(value=ListItemPainter.class) protected IListItemPainter selectionPainter
protected javax.swing.event.ListSelectionListener listSelectionListener
protected java.lang.Integer layoutOrientation
protected javax.swing.CellRendererPane rendererPane
protected java.lang.Integer listHeight
protected java.lang.Integer listWidth
protected java.lang.Integer columnCount
protected java.lang.Integer preferredHeight
protected java.lang.Integer rowsPerColumn
protected int cellWidth
protected int cellHeight
protected int[] cellHeights
public void install(E c, U ui)
Painterinstall in interface Painter<E extends javax.swing.JList,U extends WebListUI>install in class AbstractDecorationPainter<E extends javax.swing.JList,U extends WebListUI,D extends IDecoration<E,D>>c - component this painter is being installed ontoui - component UIpublic void uninstall(E c, U ui)
Painteruninstall in interface Painter<E extends javax.swing.JList,U extends WebListUI>uninstall in class AbstractDecorationPainter<E extends javax.swing.JList,U extends WebListUI,D extends IDecoration<E,D>>c - component this painter is being uninstalled fromui - component UIpublic void prepareToPaint(java.lang.Integer layoutOrientation,
java.lang.Integer listHeight,
java.lang.Integer listWidth,
java.lang.Integer columnCount,
java.lang.Integer rowsPerColumn,
java.lang.Integer preferredHeight,
int cellWidth,
int cellHeight,
int[] cellHeights)
IListPainterprepareToPaint in interface IListPainter<E extends javax.swing.JList,U extends WebListUI>layoutOrientation - cached layout orientationlistHeight - cached list heightlistWidth - cached list widthcolumnCount - cached column countrowsPerColumn - cached rows per column amountpreferredHeight - cached preferred heightcellWidth - cached cell widthcellHeight - cached cell heightcellHeights - cached cell heightsprotected void paintContent(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
AbstractDecorationPainterpaintContent in class AbstractDecorationPainter<E extends javax.swing.JList,U extends WebListUI,D extends IDecoration<E,D>>g2d - graphics contextbounds - painting boundsc - painted componentui - painted component UIprotected void paintList(java.awt.Graphics2D g2d)
g2d - graphics contextprotected int getHeight(int column,
int row)
column - list columnrow - list rowprotected int getModelIndex(int column,
int row)
column x row is beyond the length of the model, this will return the model size - 1.column - list columnrow - list rowprotected int getRowCount(int column)
column - column indexprotected int convertLocationToRowInColumn(int y,
int column)
y - Y locationcolumn - column indexprotected int convertLocationToRow(int x,
int y0,
boolean closest)
closest is true and the location doesn't exactly match a particular location, closest row will be returned.x - X locationy0 - Y locationclosest - whether or not should try finding closest row if exact location doesn't match anyprotected int convertLocationToColumn(int x,
int y)
x - X locationy - Y locationprotected int adjustIndex(int index,
E list)
index - list item indexlist - painted listprotected void paintDropLocation(java.awt.Graphics2D g2d)
g2d - graphics contextprotected void paintCell(java.awt.Graphics2D g2d,
int index,
java.awt.Rectangle rowBounds,
javax.swing.ListCellRenderer cellRenderer,
javax.swing.ListModel dataModel,
javax.swing.ListSelectionModel selModel,
int leadIndex)
g2d - graphics contextindex - cell indexrowBounds - cell boundscellRenderer - cell rendererdataModel - list modelselModel - list selection modelleadIndex - lead cell indexAbstractDecorationPainter.paint(java.awt.Graphics2D, java.awt.Rectangle, E, U)public boolean isHoverDecorationSupported()
IListPainterisHoverDecorationSupported in interface IListPainter<E extends javax.swing.JList,U extends WebListUI>protected void paintHoverCellBackground(java.awt.Graphics2D g2d)
g2d - graphics contextprotected void paintSelectedCellsBackground(java.awt.Graphics2D g2d)
g2d - graphics contextprotected java.util.List<java.awt.Rectangle> getSelectionRects()
protected void repaintSelection()