Class DefTreeCellRenderer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--com.sun.java.swing.JComponent
                    |
                    +--com.sun.java.swing.JLabel
                          |
                          +--DefTreeCellRenderer

public class DefTreeCellRenderer
extends com.sun.java.swing.JLabel
implements com.sun.java.swing.tree.TreeCellRenderer

Formatierung des DefTrees
Merkmale:  rot
Einheiten: bold
Gruppen:   plain

See Also:
Serialized Form

Inner classes inherited from class com.sun.java.swing.JLabel
com.sun.java.swing.JLabel.AccessibleJLabel
 
Inner classes inherited from class com.sun.java.swing.JComponent
com.sun.java.swing.JComponent.AccessibleJComponent
 
Field Summary
protected static com.sun.java.swing.ImageIcon collapsedIcon
           
protected static com.sun.java.swing.ImageIcon collapsedIconMG
           
protected static java.awt.Font defaultFont
           
protected static com.sun.java.swing.ImageIcon expandedIcon
           
protected static com.sun.java.swing.ImageIcon expandedIconMG
           
protected static com.sun.java.swing.ImageIcon leafIcon
           
protected static java.awt.Font meFont
           
protected static com.sun.java.swing.ImageIcon rootIcon
           
protected  boolean selected
           
protected static java.awt.Color SelectedBackgroundColor
          Color to use for the background when selected.
 
Fields inherited from class com.sun.java.swing.JLabel
labelFor
 
Fields inherited from class com.sun.java.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
 
Constructor Summary
DefTreeCellRenderer(java.lang.String knoten)
           
 
Method Summary
 java.awt.Component getTreeCellRendererComponent(com.sun.java.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
           
static void main(java.lang.String[] args)
          Wird nur zum Testen benötigt, im Final-Release wieder rauswerfen !
 void paint(java.awt.Graphics g)
          paint is subclassed to draw the background correctly.
 
Methods inherited from class com.sun.java.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setFont, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class com.sun.java.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setBounds, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultFont

protected static java.awt.Font defaultFont

meFont

protected static java.awt.Font meFont

collapsedIcon

protected static com.sun.java.swing.ImageIcon collapsedIcon

expandedIcon

protected static com.sun.java.swing.ImageIcon expandedIcon

collapsedIconMG

protected static com.sun.java.swing.ImageIcon collapsedIconMG

expandedIconMG

protected static com.sun.java.swing.ImageIcon expandedIconMG

rootIcon

protected static com.sun.java.swing.ImageIcon rootIcon

leafIcon

protected static com.sun.java.swing.ImageIcon leafIcon

SelectedBackgroundColor

protected static final java.awt.Color SelectedBackgroundColor
Color to use for the background when selected.

selected

protected boolean selected
Constructor Detail

DefTreeCellRenderer

public DefTreeCellRenderer(java.lang.String knoten)
Method Detail

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(com.sun.java.swing.JTree tree,
                                                       java.lang.Object value,
                                                       boolean selected,
                                                       boolean expanded,
                                                       boolean leaf,
                                                       int row,
                                                       boolean hasFocus)
Specified by:
getTreeCellRendererComponent in interface com.sun.java.swing.tree.TreeCellRenderer

paint

public void paint(java.awt.Graphics g)
paint is subclassed to draw the background correctly. JLabel currently does not allow backgrounds other than white, and it will also fill behind the icon. Something that isn't desirable.
Overrides:
paint in class com.sun.java.swing.JComponent

main

public static void main(java.lang.String[] args)
Wird nur zum Testen benötigt, im Final-Release wieder rauswerfen !