public class DefaultListCellRenderer<T> extends Label implements ListCellRenderer<T>, CellRenderer<T>
ListCellRenderer
for more information about the use and purpose of this classBASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR
Constructor and Description |
---|
DefaultListCellRenderer()
Creates a new instance of DefaultCellRenderer
|
DefaultListCellRenderer(boolean showNumbers)
Creates a new instance of DefaultCellRenderer
|
Modifier and Type | Method and Description |
---|---|
Component |
getCellRendererComponent(Component list,
Object model,
T value,
int index,
boolean isSelected)
Returns a component instance that is already set to render "value".
|
Component |
getFocusComponent(Component list)
Returns a component instance that is painted under the currently focused renderer
and is animated to provide smooth scrolling.
|
Component |
getListCellRendererComponent(List list,
T value,
int index,
boolean isSelected)
Returns a component instance that is already set to render "value".
|
Component |
getListFocusComponent(List list)
Returns a component instance that is painted under the currently focused renderer
and is animated to provide smooth scrolling.
|
int |
getSelectionTransparency()
The background transparency factor to apply to the selection focus
|
Style |
getStyle()
Returns the current Component Style allowing code to draw the current component, you
should normally use getUnselected/Pressed/DisabledStyle() and not this method since
it will return different values based on component state.
|
protected void |
initLaf(UIManager uim)
This method initializes the Component defaults constants
|
boolean |
isAlwaysRenderSelection()
Indicates that selection should always be rendered regardless of the status of the shouldRenderSelection flag
|
boolean |
isRightAlignNumbers() |
boolean |
isShowNumbers()
Indicate whether numbering should exist for the default cell renderer
|
static boolean |
isShowNumbersDefault()
Indicates whether the default list cell renderer will show numbers by default
when constructed
|
void |
refreshTheme(boolean merge)
Makes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME!
|
void |
repaint()
Overriden to do nothing and remove a performance issue where renderer changes
perform needless repaint calls
|
void |
setAlwaysRenderSelection(boolean alwaysRenderSelection)
Indicates that selection should always be rendered regardless of the status of the shouldRenderSelection flag
|
void |
setRightAlignNumbers(boolean rightAlignNumbers) |
void |
setSelectionTransparency(int selectionTransparency)
The background transparency factor to apply to the selection focus
|
void |
setShowNumbers(boolean showNumbers)
Indicate whether numbering should exist for the default cell renderer
|
static void |
setShowNumbersDefault(boolean def)
Indicates whether the default list cell renderer will show numbers by default
when constructed
|
animate, bindProperty, calcPreferredSize, getAlignment, getBadgeStyleComponent, getBadgeText, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBoundPropertyValue, getDefaultGap, getFontIcon, getFontIconSize, getGap, getIcon, getIconFont, getIconStyleComponent, getIconUIID, getMask, getMaskedIcon, getMaskName, getMaterialIcon, getMaterialIconSize, getMaxAutoSize, getMinAutoSize, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getShiftMillimeters, getShiftMillimetersF, getShiftText, getStringWidth, getText, getTextPosition, getTextSelectionSupport, getVerticalAlignment, initUnselectedStyle, isAutoSizeMode, isDefaultTickerEnabled, isEndsWith3Points, isLegacyRenderer, isShouldLocalize, isShowEvenIfBlank, isTextSelectionEnabled, isTickerEnabled, isTickerRunning, laidOut, paint, paramString, setAlignment, setAutoSizeMode, setBadgeText, setBadgeUIID, setBoundPropertyValue, setDefaultGap, setDefaultTickerEnabled, setEndsWith3Points, setFontIcon, setFontIcon, setFontIcon, setGap, setIcon, setIconUIID, setLegacyRenderer, setMask, setMaskName, setMaterialIcon, setMaterialIcon, setMaxAutoSize, setMinAutoSize, setPropertyValue, setShiftMillimeters, setShiftMillimeters, setShiftText, setShouldLocalize, setShowEvenIfBlank, setText, setTextPosition, setTextSelectionEnabled, setTickerEnabled, setUIID, setVerticalAlignment, shouldTickerStart, startTicker, startTicker, stopTicker, styleChanged, unbindProperty
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, blocksSideSwipe, calcScrollSize, cancelRepaints, clearClientProperties, contains, containsOrOwns, createStyleAnimation, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, fireClicked, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBorder, getBottomGap, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getGridPosX, getGridPosY, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getTabIndex, getTensileLength, getTooltip, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initComponent, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSelectableInteraction, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyPressed, keyReleased, keyRepeated, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBlockLead, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, toImage, toString, updateNativeOverlay, visibleBoundsContains
public DefaultListCellRenderer()
public DefaultListCellRenderer(boolean showNumbers)
showNumbers
- indicates numbers should be shownprotected void initLaf(UIManager uim)
public void refreshTheme(boolean merge)
refreshTheme
in class Label
merge
- indicates if the current styles should be merged with the new stylespublic Component getCellRendererComponent(Component list, Object model, T value, int index, boolean isSelected)
getCellRendererComponent
in interface CellRenderer<T>
list
- the list componentmodel
- the model behind the rendervalue
- the value to renderindex
- the index in the listisSelected
- whether the entry is selectedpublic Style getStyle()
public Component getListCellRendererComponent(List list, T value, int index, boolean isSelected)
getListCellRendererComponent
in interface ListCellRenderer<T>
list
- the list componentvalue
- the value to renderindex
- the index in the listisSelected
- whether the entry is selectedpublic Component getListFocusComponent(List list)
getListFocusComponent
in interface ListCellRenderer<T>
list
- the parent listComponent.setSmoothScrolling(boolean)
public void repaint()
public boolean isShowNumbers()
public void setShowNumbers(boolean showNumbers)
showNumbers
- indicate whether numbering should exist for the default cell rendererpublic int getSelectionTransparency()
public void setSelectionTransparency(int selectionTransparency)
selectionTransparency
- the selection transperancy valuepublic static void setShowNumbersDefault(boolean def)
def
- true to show numbers for all renderers created in the futurepublic static boolean isShowNumbersDefault()
public Component getFocusComponent(Component list)
getFocusComponent
in interface CellRenderer<T>
list
- the parent listComponent.setSmoothScrolling(boolean)
public boolean isRightAlignNumbers()
public void setRightAlignNumbers(boolean rightAlignNumbers)
rightAlignNumbers
- the rightAlignNumbers to setpublic boolean isAlwaysRenderSelection()
public void setAlwaysRenderSelection(boolean alwaysRenderSelection)
alwaysRenderSelection
- the alwaysRenderSelection to set