Class DefaultTreeCellRenderer
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, TreeCellRenderer
DefaultTreeCellRenderer. Extends
JLabel so its peer is the SJLabel surrogate (a real
Vaadin Component), satisfying the D_jtree_renderer_registry bridge's "return a Component-shaped
emulator" requirement — exactly
DefaultTableCellRenderer's shape (D_jtable_type_ports).
getTreeCellRendererComponent routes the value through
tree.convertValueToText(...) — the JDK-overridable formatting hook
— and picks the leaf / open / closed Icon for the JLabel icon slot
(D_icon_rendering Path 1: ImageIcon renders through the surrogate's
Vaadin-Image bridge). Icons default to null: the JDK defaults come
from UIManager / L&F, which is dropped per R_match_swing_errors sub-bucket (b), so a
fresh renderer shows text only until the app installs its own icons.
Selection / focus colour chrome (setBackgroundSelectionColor
et al.) stores and round-trips; only the rendered effect is declined,
because the Vaadin theme owns a Grid's row-selection styling and an inline-CSS
shadow would not reach the rendered snapshot anyway. Keeping the values is
R_decline_effect_only: the effect is droppable, the state never was. JDK's
DefaultTreeCellRenderer also overrides the
paint/validate family as performance no-ops; our paint pipeline doesn't
run (R_layouts_close_enough), so those overrides are omitted rather than replicated.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected Colorprotected Colorprotected Iconprotected booleanprotected Iconprotected Iconprotected booleanprotected Colorprotected ColorFields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSeegetDefaultLeafIcon().JDK sources these from UIManager; L&F dispatch is dropped per R_match_swing_errors sub-bucket (b), so the "default" icons are honestlynull.SeegetDefaultLeafIcon().getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) Build the rendering component forvalue.voidsetBackgroundNonSelectionColor(Color newColor) voidsetBackgroundSelectionColor(Color newColor) voidsetBorderSelectionColor(Color newColor) voidsetClosedIcon(Icon newIcon) Icon shown for collapsed non-leaf nodes.voidsetLeafIcon(Icon newIcon) Icon shown for leaf nodes.voidsetOpenIcon(Icon newIcon) Icon shown for expanded non-leaf nodes.voidsetTextNonSelectionColor(Color newColor) voidsetTextSelectionColor(Color newColor) Store the colour selected text paints in.Methods inherited from class JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUIMethods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, fireComponentEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Field Details
-
leafIcon
-
openIcon
-
closedIcon
-
textSelectionColor
-
textNonSelectionColor
-
backgroundSelectionColor
-
backgroundNonSelectionColor
-
borderSelectionColor
-
selected
protected boolean selected -
hasFocus
protected boolean hasFocus
-
-
Constructor Details
-
DefaultTreeCellRenderer
public DefaultTreeCellRenderer()
-
-
Method Details
-
setLeafIcon
Icon shown for leaf nodes.null(the default) renders no icon. -
getLeafIcon
-
setOpenIcon
Icon shown for expanded non-leaf nodes.nullrenders no icon. -
getOpenIcon
-
setClosedIcon
Icon shown for collapsed non-leaf nodes.nullrenders no icon. -
getClosedIcon
-
getDefaultLeafIcon
JDK sources these from UIManager; L&F dispatch is dropped per R_match_swing_errors sub-bucket (b), so the "default" icons are honestlynull. -
getDefaultOpenIcon
SeegetDefaultLeafIcon(). -
getDefaultClosedIcon
SeegetDefaultLeafIcon(). -
setTextSelectionColor
Store the colour selected text paints in. The value round-trips; the rendered effect is declined, since a Grid's selection chrome is the theme's ([D_theme_is_lookandfeel](../../../../../../emulators/decisions.md#D_theme_is_lookandfeel)).nullis stored as null and read back as null — the JDK keeps no fallback here, unlikeJTabbedPane's per-tab colours. -
getTextSelectionColor
-
setTextNonSelectionColor
- See Also:
-
getTextNonSelectionColor
-
setBackgroundSelectionColor
- See Also:
-
getBackgroundSelectionColor
-
setBackgroundNonSelectionColor
- See Also:
-
getBackgroundNonSelectionColor
-
setBorderSelectionColor
- See Also:
-
getBorderSelectionColor
-
getTreeCellRendererComponent
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) Description copied from interface:TreeCellRendererBuild the rendering component forvalue.- Specified by:
getTreeCellRendererComponentin interfaceTreeCellRenderer- Parameters:
tree- the rendering host — the emulatorJTreein emulator flow,nullfrom pure-surrogate contexts.value- the node to render.nullis valid.selected- whether the node is currently selected.expanded- whether the node is currently expanded.leaf- whether the node is a leaf per the model.row- the node's visible-row index, or-1when the node isn't currently displayed.hasFocus- alwaysfalsefrom the D_jtree_renderer_registry bridge — Vaadin TreeGrid has no per-cell focus signal at render time (R_vaadin_first sub-bucket (c)).
-