Class XmlTreeCellRenderer.XmlTreeCellUI

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener
    Enclosing class:
    XmlTreeCellRenderer

    private static class XmlTreeCellRenderer.XmlTreeCellUI
    extends javax.swing.plaf.basic.BasicLabelUI
    Custom UI for our renderer. This is basically a performance hack to avoid using HTML for our rendering. Swing's HTML rendering engine is very slow, making tree views many thousands of nodes large using HTML very slow for expand operations (our expandInitialNodes() method). This is caused by calls to get the preferred size of each HTML view. A "plain text" renderer that can paint the different colors itself is much faster (~ 4x faster), but still doesn't eliminate the issue for huge trees.
    • Field Summary

      • Fields inherited from class javax.swing.plaf.basic.BasicLabelUI

        labelUI
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private XmlTreeCellUI()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void installDefaults​(javax.swing.JLabel label)  
      protected void paintEnabledText​(javax.swing.JLabel l, java.awt.Graphics g, java.lang.String s, int textX, int textY)  
      protected void uninstallDefaults​(javax.swing.JLabel label)  
      • Methods inherited from class javax.swing.plaf.basic.BasicLabelUI

        createUI, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installKeyboardActions, installListeners, installUI, layoutCL, paint, paintDisabledText, propertyChange, uninstallComponents, uninstallKeyboardActions, uninstallListeners, uninstallUI
      • Methods inherited from class javax.swing.plaf.ComponentUI

        contains, getAccessibleChild, getAccessibleChildrenCount, update
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlTreeCellUI

        private XmlTreeCellUI()
    • Method Detail

      • installDefaults

        protected void installDefaults​(javax.swing.JLabel label)
        Overrides:
        installDefaults in class javax.swing.plaf.basic.BasicLabelUI
      • paintEnabledText

        protected void paintEnabledText​(javax.swing.JLabel l,
                                        java.awt.Graphics g,
                                        java.lang.String s,
                                        int textX,
                                        int textY)
        Overrides:
        paintEnabledText in class javax.swing.plaf.basic.BasicLabelUI
      • uninstallDefaults

        protected void uninstallDefaults​(javax.swing.JLabel label)
        Overrides:
        uninstallDefaults in class javax.swing.plaf.basic.BasicLabelUI