com.sun.xml.registry.client.browser
Class ConceptsTree.ConceptsTreeCellRenderer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLabel
                  extended bycom.sun.xml.registry.client.browser.ConceptsTree.ConceptsTreeCellRenderer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants, javax.swing.tree.TreeCellRenderer
Enclosing class:
ConceptsTree

public class ConceptsTree.ConceptsTreeCellRenderer
extends javax.swing.JLabel
implements javax.swing.tree.TreeCellRenderer

DOCUMENT ME!

Version:
$Revision: 1.21 $
Author:
$author$
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Color backgroundNonSelectionColor
          Color to use for the background when the node isn't selected.
protected  java.awt.Color backgroundSelectionColor
          Color to use for the background when a node is selected.
protected  java.awt.Color borderSelectionColor
          Color to use for the background when the node isn't selected.
protected  javax.swing.Icon closedIcon
          Icon used to show non-leaf nodes that aren't expanded.
protected  javax.swing.Icon leafIcon
          Icon used to show leaf nodes.
protected  javax.swing.Icon openIcon
          Icon used to show non-leaf nodes that are expanded.
protected  boolean selected
          Is the value currently selected.
protected  java.awt.Color textNonSelectionColor
          Color to use for the foreground for non-selected nodes.
protected  java.awt.Color textSelectionColor
          Color to use for the foreground for selected nodes.
 
Fields inherited from class javax.swing.JLabel
labelFor
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ConceptsTree.ConceptsTreeCellRenderer()
          Returns a new instance of DefaultTreeCellRenderer.
 
Method Summary
 java.awt.Color getBackgroundNonSelectionColor()
          Returns the background color to be used for non selected nodes.
 java.awt.Color getBackgroundSelectionColor()
          Returns the color to use for the background if node is selected.
 java.awt.Color getBorderSelectionColor()
          Returns the color the border is drawn.
 javax.swing.Icon getClosedIcon()
          Returns the icon used to represent non-leaf nodes that are not expanded.
 javax.swing.Icon getDefaultClosedIcon()
          Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are not expanded.
 javax.swing.Icon getDefaultLeafIcon()
          Returns the default icon, for the current laf, that is used to represent leaf nodes.
 javax.swing.Icon getDefaultOpenIcon()
          Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are expanded.
 javax.swing.Icon getLeafIcon()
          Returns the icon used to represent leaf nodes.
 javax.swing.Icon getOpenIcon()
          Returns the icon used to represent non-leaf nodes that are expanded.
 java.awt.Dimension getPreferredSize()
          Overrides JComponent.getPreferredSize to return slightly wider preferred size value.
 java.awt.Color getTextNonSelectionColor()
          Returns the color the text is drawn with when the node isn't selected.
 java.awt.Color getTextSelectionColor()
          Returns the color the text is drawn with when the node is selected.
 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 passed in components.
 void paint(java.awt.Graphics g)
          Paints the value.
 void setBackgroundNonSelectionColor(java.awt.Color newColor)
          Sets the background color to be used for non selected nodes.
 void setBackgroundSelectionColor(java.awt.Color newColor)
          Sets the color to use for the background if node is selected.
 void setBorderSelectionColor(java.awt.Color newColor)
          Sets the color to use for the border.
 void setFont(java.awt.Font font)
          Sublcassed to only accept the font if it isn't a FonUIResource
 void setTextNonSelectionColor(java.awt.Color newColor)
          Sets the color the text is drawn with when the node isn't selected.
 void setTextSelectionColor(java.awt.Color newColor)
          Sets the color the text is drawn with when the node is selected.
 
Methods inherited from class javax.swing.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, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selected

protected boolean selected
Is the value currently selected.


closedIcon

protected transient javax.swing.Icon closedIcon
Icon used to show non-leaf nodes that aren't expanded.


leafIcon

protected transient javax.swing.Icon leafIcon
Icon used to show leaf nodes.


openIcon

protected transient javax.swing.Icon openIcon
Icon used to show non-leaf nodes that are expanded.


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 isn't selected.


borderSelectionColor

protected java.awt.Color borderSelectionColor
Color to use for the background when the node isn't selected.

Constructor Detail

ConceptsTree.ConceptsTreeCellRenderer

public ConceptsTree.ConceptsTreeCellRenderer()
Returns a new instance of DefaultTreeCellRenderer. Alignment is set to left aligned. Icons and text color are determined from the UIManager.

Method Detail

getDefaultOpenIcon

public javax.swing.Icon getDefaultOpenIcon()
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are expanded.

Returns:
DOCUMENT ME!

getDefaultClosedIcon

public javax.swing.Icon getDefaultClosedIcon()
Returns the default icon, for the current laf, that is used to represent non-leaf nodes that are not expanded.

Returns:
DOCUMENT ME!

getDefaultLeafIcon

public javax.swing.Icon getDefaultLeafIcon()
Returns the default icon, for the current laf, that is used to represent leaf nodes.

Returns:
DOCUMENT ME!

getOpenIcon

public javax.swing.Icon getOpenIcon()
Returns the icon used to represent non-leaf nodes that are expanded.

Returns:
DOCUMENT ME!

getClosedIcon

public javax.swing.Icon getClosedIcon()
Returns the icon used to represent non-leaf nodes that are not expanded.

Returns:
DOCUMENT ME!

getLeafIcon

public javax.swing.Icon getLeafIcon()
Returns the icon used to represent leaf nodes.

Returns:
DOCUMENT ME!

setTextSelectionColor

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

Parameters:
newColor - DOCUMENT ME!

getTextSelectionColor

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

Returns:
DOCUMENT ME!

setTextNonSelectionColor

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

Parameters:
newColor - DOCUMENT ME!

getTextNonSelectionColor

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

Returns:
DOCUMENT ME!

setBackgroundSelectionColor

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

Parameters:
newColor - DOCUMENT ME!

getBackgroundSelectionColor

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

Returns:
DOCUMENT ME!

setBackgroundNonSelectionColor

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

Parameters:
newColor - DOCUMENT ME!

getBackgroundNonSelectionColor

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

Returns:
DOCUMENT ME!

setBorderSelectionColor

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

Parameters:
newColor - DOCUMENT ME!

getBorderSelectionColor

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

Returns:
DOCUMENT ME!

setFont

public void setFont(java.awt.Font font)
Sublcassed to only accept the font if it isn't a FonUIResource

Parameters:
font - DOCUMENT ME!

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 passed in components. The value is set 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.

Specified by:
getTreeCellRendererComponent in interface javax.swing.tree.TreeCellRenderer
Parameters:
tree - DOCUMENT ME!
value - DOCUMENT ME!
sel - DOCUMENT ME!
expanded - DOCUMENT ME!
leaf - DOCUMENT ME!
row - DOCUMENT ME!
hasFocus - DOCUMENT ME!
Returns:
DOCUMENT ME!

paint

public void paint(java.awt.Graphics g)
Paints the value. The background is filled based on selected.

Parameters:
g - DOCUMENT ME!

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides JComponent.getPreferredSize to return slightly wider preferred size value.

Returns:
DOCUMENT ME!


Copyright © 2001-2004 OASIS. All Rights Reserved.