Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## echopointng.tree
Interface TreeCellRenderer

All Known Implementing Classes:
  DefaultTreeCellRenderer

    public interface TreeCellRenderer

The `TreeCellRender` is responsible for returning Components used to render a Tree node. In the most general form the `getTreeCellRendererText` method will be called to return a `LabelEx` component that contains the tree node's :

- text
- icon
- vertical text alignment
- background
- foreground
- font

A more specific case is when a Component is to be returned as the Tree cell. In this case the `getTreeCellRendererComponent` method will be called to provide the component for the Tree cell.

Method Summary
`Component` | `getTreeCellRendererComponent(Tree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf)` Returns a Component that will be rendered as a Tree cell.
`Label` | `getTreeCellRendererText(Tree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf)` Returns a LabelEx that will be used to render a Tree cell.

Method Detail

### getTreeCellRendererComponent

    Component getTreeCellRendererComponent(Tree tree,
                                           java.lang.Object value,
                                           boolean selected,
                                           boolean expanded,
                                           boolean leaf)

  Returns a Component that will be rendered as a Tree cell.

  If `selected` is true, the cell will be drawn as if selected. If `expanded` is true the node is currently expanded and if `leaf` is true the node represets a leaf `tree` is the Tree the receiver is being configured for.

  This method is called second by the tree rendering code, and only after the getTreeCellRendererText method has returned null.

  The returned Component MUST be a unqiue Component since it will be rendered as the Tree cell.

  Returns:
    Component that is used to draw the value.

### getTreeCellRendererText

    Label getTreeCellRendererText(Tree tree,
                                  java.lang.Object value,
                                  boolean selected,
                                  boolean expanded,
                                  boolean leaf)

  Returns a LabelEx that will be used to render a Tree cell. The following attributes are used to render the Tree cell.
  - text
  - icon
  - vertical text alignment
  - background
  - foreground
  - font

  If `selected` is true, the cell will be drawn as if selected. If `expanded` is true the node is currently expanded and if `leaf` is true the node represets a leaf `tree` is the Tree the receiver is being configured for.

  This method is called first by the tree rendering code. If this returns null, then the getTreeCellRendererComponent method is then invoked.

  The returned LabelEx does NOT have to be a unqiue Component since only the public values of the LabelEx are used by the the Tree rendering code. Therefore it does NOT have to be a Component in the Echo heirarchy nor does it have to be a unique LabelEx object.

  You could return the same LabelEx object back each time this method is called, only changing the background, forground, font and icon as appropriate.

  Returns the LabelEx that is used to draw the Tree cell.

  Returns:
    LabelEx that is used to draw the Tree cell.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD