Class javax.help.plaf.basic.BasicSearchCellRenderer

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----javax.swing.JComponent
                            |
                            +----javax.swing.JPanel
                                    |
                                    +----javax.help.plaf.basic.BasicSearchCellRenderer

public class BasicSearchCellRenderer
extends javax.swing.JPanel
implements javax.swing.tree.TreeCellRenderer
Displays an search entry in a tree.


selected

protected boolean selected
Is the value currently selected.

textSelectionColor

protected java.awt.Color textSelectionColor
Color to use for the foreground for selected nodes.

textNonSelectionColor

protected java.awt.Color textNonSelectionColor
Color to use for the foreground for non-selected nodes.

backgroundSelectionColor

protected java.awt.Color backgroundSelectionColor
Color to use for the background when a node is selected.

backgroundNonSelectionColor

protected java.awt.Color backgroundNonSelectionColor
Color to use for the background when the node is not selected.

borderSelectionColor

protected java.awt.Color borderSelectionColor
Color to use for the background when the node is not selected.

map

protected Map map
Map to use for rendering included images.

hits

protected javax.help.plaf.basic.BasicSearchCellRenderer.ValueJLabel hits
Hits

quality

protected javax.help.plaf.basic.BasicSearchCellRenderer.ValueJLabel quality
Quality

title

protected javax.swing.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.

setTextSelectionColor

public void setTextSelectionColor(java.awt.Color newColor)
Sets the color the text is drawn with when the node is selected.

getTextSelectionColor

public java.awt.Color getTextSelectionColor()
Returns the color the text is drawn with when the node is selected.

setTextNonSelectionColor

public void setTextNonSelectionColor(java.awt.Color newColor)
Sets the color the text is drawn with when the node is not selected.

getTextNonSelectionColor

public java.awt.Color getTextNonSelectionColor()
Returns the color the text is drawn with when the node is not selected.

setBackgroundSelectionColor

public void setBackgroundSelectionColor(java.awt.Color newColor)
Sets the color to use for the background if the node is selected.

getBackgroundSelectionColor

public java.awt.Color getBackgroundSelectionColor()
Returns the color to use for the background if the node is selected.

setBackgroundNonSelectionColor

public void setBackgroundNonSelectionColor(java.awt.Color newColor)
Sets the background color to be used for unselected nodes.

getBackgroundNonSelectionColor

public java.awt.Color getBackgroundNonSelectionColor()
Returns the background color to be used for unselected nodes.

setBorderSelectionColor

public void setBorderSelectionColor(java.awt.Color newColor)
Sets the color to use for the border.

getBorderSelectionColor

public java.awt.Color getBorderSelectionColor()
Returns the the border color.

setFont

public void setFont(java.awt.Font font)
Subclassed to only accept the font if it is not a FontUIResource.
Overrides:
setFont in class javax.swing.JComponent

setBackground

public void setBackground(java.awt.Color color)
Subclassed to only accept the color if it is not a ColorUIResource.
Overrides:
setBackground in class javax.swing.JComponent

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                              java.lang.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.
Implements:
getTreeCellRendererComponent in interface javax.swing.tree.TreeCellRenderer

paint

public void paint(java.awt.Graphics g)
Paints the value. The background is filled based on selected color.
Overrides:
paint in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides JComponent.getPreferredSize to return slightly taller preferred size value.
Overrides:
getPreferredSize in class javax.swing.JComponent