Class SchemaTreeTraverser.SchemaTreeCellRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.sun.xml.xsom.impl.util.SchemaTreeTraverser.SchemaTreeCellRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, TreeCellRenderer
Enclosing class:
SchemaTreeTraverser

public static class SchemaTreeTraverser.SchemaTreeCellRenderer extends JPanel implements TreeCellRenderer
Sample cell renderer for the schema tree.
Author:
Kirill Grouchnikov
See Also:
  • Field Details

    • iconLabel

      protected final JLabel iconLabel
      The icon label.
    • nameLabel

      protected final JLabel nameLabel
      The text label
    • selectedBackground

      public final Color selectedBackground
      Background color for selected cells (light brown).
    • selectedForeground

      public final Color selectedForeground
      Foreground color for selected cells, both text and border (dark brown).
    • nameFont

      public final Font nameFont
      Default font for the text label.
  • Constructor Details

    • SchemaTreeCellRenderer

      public SchemaTreeCellRenderer()
      Simple constructor.
  • Method Details

    • paintComponent

      public final void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • setValues

      protected final void setValues(Icon icon, String caption, boolean selected)
      Sets values for the icon and text of this renderer.
      Parameters:
      icon - Icon to show.
      caption - Text to show.
      selected - Selection indicator. If true, the renderer will be shown with different background and border settings.
    • getTreeCellRendererComponent

      public final Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
      Specified by:
      getTreeCellRendererComponent in interface TreeCellRenderer