public class TreeCell
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
backgroundColor
Color to use for the background when the node isn't selected.
|
protected java.awt.Color |
backgroundSelectedColor
Color to use for the background when a node is selected.
|
protected java.awt.Color |
borderSelectedColor
Color to use for the focus indicator when the node has focus.
|
protected javax.swing.JCheckBox |
checkBox
Checkbox component
|
protected boolean |
drawDashedFocusIndicator
Whether to draw dashed focus indicator
|
protected boolean |
drawsFocusBorderAroundIcon
Whether to draw focus border around icon
|
protected boolean |
fillBackground
Whether to fill background
|
protected java.awt.Color |
focusBackgroundColor
Color to draw the focus indicator in, determined from the background color.
|
protected java.awt.Color |
foregroundColor
Color to use for the foreground for non-selected nodes.
|
protected java.awt.Color |
foregroundSelectedColor
Color to use for the foreground for selected nodes.
|
protected boolean |
hasFocus
State : has focus
|
protected boolean |
isSelected
State : selected
|
protected javax.swing.JLabel |
label
Label
|
protected static int |
rowHeight
Row height
|
private static long |
serialVersionUID |
protected javax.swing.JTree |
tree
Parent tree
|
protected java.awt.Color |
treeBackgroundColor
Background color of the tree.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
TreeCell()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
doLayout() |
java.awt.Color |
getBackgroundColor()
Returns the background color to be used for non selected nodes.
|
java.awt.Color |
getBackgroundSelectedColor()
Returns the color to use for the background if node is selected.
|
java.awt.Color |
getBorderSelectedColor()
Returns the color the border is drawn.
|
java.awt.Font |
getFont() |
java.awt.Color |
getForegroundColor()
Returns the color the text is drawn with when the node isn't selected.
|
java.awt.Color |
getForegroundSelectedColor()
Returns the color the text is drawn with when the node is selected.
|
java.awt.Dimension |
getPreferredSize() |
void |
paint(java.awt.Graphics g)
Paints the value.
|
private void |
paintFocus(java.awt.Graphics g,
int x,
int y,
int w,
int h,
java.awt.Color notColor)
Paint focus
|
void |
setBackground(java.awt.Color color0) |
void |
setBackgroundColor(java.awt.Color color)
Sets the background color to be used for non selected nodes.
|
void |
setBackgroundSelectedColor(java.awt.Color color)
Sets the color to use for the background if node is selected.
|
void |
setBorderSelectedColor(java.awt.Color color)
Sets the color to use for the border.
|
void |
setFont(java.awt.Font font0) |
void |
setForeground(java.awt.Color color) |
void |
setForegroundColor(java.awt.Color color)
Sets the color the text is drawn with when the node isn't selected.
|
void |
setForegroundSelectedColor(java.awt.Color color)
Sets the color the text is drawn with when the node is selected.
|
void |
setHasFocus(boolean hasFocus)
Set focus
|
void |
setIsSelected(boolean isSelected)
Set selected
|
void |
setText(java.lang.String name)
Set text
|
void |
setTicked(boolean isTicked)
Set ticked
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, 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, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, validateTree
action, 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, 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, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
protected static final int rowHeight
protected javax.swing.JTree tree
protected final javax.swing.JCheckBox checkBox
protected final javax.swing.JLabel label
protected java.awt.Color foregroundColor
protected java.awt.Color backgroundColor
protected java.awt.Color backgroundSelectedColor
protected java.awt.Color foregroundSelectedColor
protected java.awt.Color borderSelectedColor
protected java.awt.Color treeBackgroundColor
protected java.awt.Color focusBackgroundColor
protected boolean isSelected
protected boolean hasFocus
protected boolean fillBackground
protected final boolean drawsFocusBorderAroundIcon
protected final boolean drawDashedFocusIndicator
public void setBackgroundColor(java.awt.Color color)
color
- colorpublic java.awt.Color getBackgroundColor()
public void setForegroundColor(java.awt.Color color)
color
- colorpublic java.awt.Color getForegroundColor()
public void setForegroundSelectedColor(java.awt.Color color)
color
- colorpublic java.awt.Color getForegroundSelectedColor()
public void setBackgroundSelectedColor(java.awt.Color color)
color
- colorpublic java.awt.Color getBackgroundSelectedColor()
public void setBorderSelectedColor(java.awt.Color color)
color
- colorpublic java.awt.Color getBorderSelectedColor()
public void setBackground(java.awt.Color color0)
setBackground
in class javax.swing.JComponent
public void setForeground(java.awt.Color color)
setForeground
in class javax.swing.JComponent
public void setFont(java.awt.Font font0)
setFont
in class javax.swing.JComponent
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public void setText(java.lang.String name)
name
- relation namepublic void setTicked(boolean isTicked)
isTicked
- whether this cell is tickedpublic void setIsSelected(boolean isSelected)
isSelected
- whether this cell is selectedpublic void setHasFocus(boolean hasFocus)
hasFocus
- whether this cell has focuspublic java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void doLayout()
doLayout
in class java.awt.Container
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
private void paintFocus(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color notColor)
g
- graphicsx
- start xy
- start xw
- widthh
- heightnotColor
- inverse color