Class SubstanceDefaultTreeCellRenderer

    • Field Detail

      • selected

        protected boolean selected
        Is the value currently selected.
      • hasFocus

        protected boolean hasFocus
        True if has focus.
    • Constructor Detail

      • SubstanceDefaultTreeCellRenderer

        public SubstanceDefaultTreeCellRenderer()
        Returns a new instance of SubstanceDefaultTreeCellRenderer. Alignment is set to left aligned. Icons and text color are determined from the UIManager.
    • Method Detail

      • getDefaultOpenIcon

        public Icon getDefaultOpenIcon()
        Returns the default icon that is used to represent non-leaf nodes that are expanded.
        Returns:
        The default icon for non-leaf expanded nodes.
      • getDefaultClosedIcon

        public Icon getDefaultClosedIcon()
        Returns the default icon that is used to represent non-leaf nodes that are not expanded.
        Returns:
        The default icon for non-leaf non-expanded nodes.
      • getDefaultLeafIcon

        public Icon getDefaultLeafIcon()
        Returns the default icon that is used to represent leaf nodes.
        Returns:
        The default icon for leaf nodes.
      • setFont

        public void setFont​(Font font)
        Subclassed to map FontUIResources to null. If font is null, or a FontUIResource, this has the effect of letting the font of the JTree show through. On the other hand, if font is non-null, and not a FontUIResource, the font becomes font.
        Overrides:
        setFont in class JComponent
      • getFont

        public Font getFont()
        Gets the font of this component.
        Specified by:
        getFont in interface MenuContainer
        Overrides:
        getFont in class Component
        Returns:
        this component's font; if a font has not been set for this component, the font of its parent is returned
      • getTreeCellRendererComponent

        public Component getTreeCellRendererComponent​(JTree tree,
                                                      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 the tree with convertValueToText, which ultimately invokes toString on value. 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 TreeCellRenderer
      • getPreferredSize

        public Dimension getPreferredSize()
        Overrides JComponent.getPreferredSize to return slightly wider preferred size value.
        Overrides:
        getPreferredSize in class JComponent
      • repaint

        public void repaint​(long tm,
                            int x,
                            int y,
                            int width,
                            int height)
        Overridden for performance reasons. See the Implementation Note for more information.
        Overrides:
        repaint in class JComponent