javax.help.plaf.basic
Class BasicSearchCellRenderer
JPanel
javax.help.plaf.basic.BasicSearchCellRenderer
- TreeCellRenderer
public class BasicSearchCellRenderer
extends JPanel
implements TreeCellRenderer
Displays an search entry in a tree.
protected Color | backgroundNonSelectionColor - Color to use for the background when the node is not selected.
|
protected Color | backgroundSelectionColor - Color to use for the background when a node is selected.
|
protected Color | borderSelectionColor - Color to use for the background when the node is not selected.
|
protected javax.help.plaf.basic.BasicSearchCellRenderer.ValueJLabel | hits - Hits
|
protected Map | map - Map to use for rendering included images.
|
protected javax.help.plaf.basic.BasicSearchCellRenderer.ValueJLabel | quality - Quality
|
protected boolean | selected - Is the value currently selected.
|
protected Color | textNonSelectionColor - Color to use for the foreground for non-selected nodes.
|
protected Color | textSelectionColor - Color to use for the foreground for selected nodes.
|
protected JLabel | title - Title
|
backgroundNonSelectionColor
protected Color backgroundNonSelectionColor
Color to use for the background when the node is not selected.
backgroundSelectionColor
protected Color backgroundSelectionColor
Color to use for the background when a node is selected.
borderSelectionColor
protected Color borderSelectionColor
Color to use for the background when the node is not selected.
hits
protected javax.help.plaf.basic.BasicSearchCellRenderer.ValueJLabel hits
Hits
map
protected Map map
Map to use for rendering included images.
quality
protected javax.help.plaf.basic.BasicSearchCellRenderer.ValueJLabel quality
Quality
selected
protected boolean selected
Is the value currently selected.
textNonSelectionColor
protected Color textNonSelectionColor
Color to use for the foreground for non-selected nodes.
textSelectionColor
protected Color textSelectionColor
Color to use for the foreground for selected nodes.
title
protected JLabel title
Title
BasicSearchCellRenderer
public BasicSearchCellRenderer(Map map)
Returns a new instance of BasicSearchCellRender. Left alignment is
set. Icons and text color are determined from the
UIManager.
getBackgroundNonSelectionColor
public Color getBackgroundNonSelectionColor()
Returns the background color to be used for unselected nodes.
getBackgroundSelectionColor
public Color getBackgroundSelectionColor()
Returns the color to use for the background if the node is selected.
getBorderSelectionColor
public Color getBorderSelectionColor()
Returns the the border color.
getPreferredSize
public Dimension getPreferredSize()
Overrides JComponent.getPreferredSize
to
return slightly taller preferred size value.
getTextNonSelectionColor
public Color getTextNonSelectionColor()
Returns the color the text is drawn with when the node is not selected.
getTextSelectionColor
public Color getTextSelectionColor()
Returns the color the text is drawn with when the node is selected.
getTreeCellRendererComponent
public Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
Configures the renderer based on the components passed in.
Sets the value from messaging value with toString().
The foreground color is set based on the selection and the icon
is set based on on leaf and expanded.
paint
public void paint(Graphics g)
Paints the value. The background is filled based on selected color.
setBackground
public void setBackground(Color color)
Subclassed to only accept the color if it is not a ColorUIResource.
setBackgroundNonSelectionColor
public void setBackgroundNonSelectionColor(Color newColor)
Sets the background color to be used for unselected nodes.
setBackgroundSelectionColor
public void setBackgroundSelectionColor(Color newColor)
Sets the color to use for the background if the node is selected.
setBorderSelectionColor
public void setBorderSelectionColor(Color newColor)
Sets the color to use for the border.
setFont
public void setFont(Font font)
Subclassed to only accept the font if it is not a FontUIResource.
setTextNonSelectionColor
public void setTextNonSelectionColor(Color newColor)
Sets the color the text is drawn with when the node is not selected.
setTextSelectionColor
public void setTextSelectionColor(Color newColor)
Sets the color the text is drawn with when the node is selected.