Class PanelBasedTreeCellRenderer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.client.util.gui.tree.PanelBasedTreeCellRenderer
- All Implemented Interfaces:
- ImageObserver,- MenuContainer,- Serializable,- Accessible,- ListCellRenderer,- TreeCellRenderer
- Direct Known Subclasses:
- BeanCellRenderer,- DBBrowseTree.TreeRenderer,- NamedQueryBrowseTree.TreeRenderer,- TableBrowseTree.TreeRenderer,- com.inductiveautomation.ignition.designer.tags.tree.TagRenderer
public class PanelBasedTreeCellRenderer
extends JPanel
implements TreeCellRenderer, ListCellRenderer
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class javax.swing.JPanelJPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponentJComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.ContainerContainer.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.ComponentComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ColorColor to use for the background when the node isn't selected.protected ColorColor to use for the background when a node is selected.protected ColorColor to use for the focus indicator when the node has focus.protected booleanTrue if has focus.protected intprotected JLabelprotected booleanIs the value currently selected.protected intprotected ColorColor to use for the foreground for non-selected nodes.protected ColorColor to use for the foreground for selected nodes.Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidprotected voidprotected voidaddSubText(JLabel subText) getIcon()getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) getText()getToolTipText(MouseEvent event) Overridden to provide the tooltip text for the sub component in this JPanel under the given mouse eventgetTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) booleanvoidPaints the value.protected booleanprotected voidprotected voidvoidsetBackgroundNonSelectionColor(Color backgroundNonSelectionColor) voidsetBackgroundSelectionColor(Color backgroundSelectionColor) voidsetBorderSelectionColor(Color borderSelectionColor) voidsetDrawsFocusBorderAroundIcon(boolean drawsFocusBorderAroundIcon) voidvoidvoidvoidsetTextNonSelectionColor(Color textNonSelectionColor) voidsetTextSelectionColor(Color textSelectionColor) voidsetToolTipText(String text) protected StringvalueToText(Object value) Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
- 
Field Details- 
selectedprotected boolean selectedIs the value currently selected.
- 
hasFocusprotected boolean hasFocusTrue if has focus.
- 
textSelectionColorColor to use for the foreground for selected nodes.
- 
textNonSelectionColorColor to use for the foreground for non-selected nodes.
- 
backgroundSelectionColorColor to use for the background when a node is selected.
- 
backgroundNonSelectionColorColor to use for the background when the node isn't selected.
- 
borderSelectionColorColor to use for the focus indicator when the node has focus.
- 
label
- 
iconCountprotected int iconCount
- 
subTextIndexprotected int subTextIndex
 
- 
- 
Constructor Details- 
PanelBasedTreeCellRendererpublic PanelBasedTreeCellRenderer()
 
- 
- 
Method Details- 
paintBackgroundprotected boolean paintBackground()
- 
addIcon
- 
addIcon
- 
addSubText
- 
removeSubTextprotected void removeSubText()
- 
removeAllIconsprotected void removeAllIcons()
- 
getToolTipTextOverridden to provide the tooltip text for the sub component in this JPanel under the given mouse event- Overrides:
- getToolTipTextin class- JComponent
 
- 
getTreeCellRendererComponentpublic Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) - Specified by:
- getTreeCellRendererComponentin interface- TreeCellRenderer
 
- 
getListCellRendererComponentpublic Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) - Specified by:
- getListCellRendererComponentin interface- ListCellRenderer
 
- 
valueToText
- 
paintPaints the value. The background is filled based on selected.- Overrides:
- paintin class- JComponent
 
- 
getBackgroundNonSelectionColor- Returns:
- Returns the backgroundNonSelectionColor.
 
- 
setBackgroundNonSelectionColor- Parameters:
- backgroundNonSelectionColor- The backgroundNonSelectionColor to set.
 
- 
getBackgroundSelectionColor- Returns:
- Returns the backgroundSelectionColor.
 
- 
setBackgroundSelectionColor- Parameters:
- backgroundSelectionColor- The backgroundSelectionColor to set.
 
- 
getBorderSelectionColor- Returns:
- Returns the borderSelectionColor.
 
- 
setBorderSelectionColor- Parameters:
- borderSelectionColor- The borderSelectionColor to set.
 
- 
isDrawsFocusBorderAroundIconpublic boolean isDrawsFocusBorderAroundIcon()- Returns:
- Returns the drawsFocusBorderAroundIcon.
 
- 
setDrawsFocusBorderAroundIconpublic void setDrawsFocusBorderAroundIcon(boolean drawsFocusBorderAroundIcon) - Parameters:
- drawsFocusBorderAroundIcon- The drawsFocusBorderAroundIcon to set.
 
- 
getTextNonSelectionColor- Returns:
- Returns the textNonSelectionColor.
 
- 
setTextNonSelectionColor- Parameters:
- textNonSelectionColor- The textNonSelectionColor to set.
 
- 
getTextSelectionColor- Returns:
- Returns the textSelectionColor.
 
- 
setTextSelectionColor- Parameters:
- textSelectionColor- The textSelectionColor to set.
 
- 
getIcon
- 
getText
- 
setIcon
- 
setText
- 
setFont- Overrides:
- setFontin class- JComponent
 
- 
setToolTipText- Overrides:
- setToolTipTextin class- JComponent
 
 
-