Class FlatTreeUI

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTreeUI

        javax.swing.plaf.basic.BasicTreeUI.CellEditorHandler, javax.swing.plaf.basic.BasicTreeUI.ComponentHandler, javax.swing.plaf.basic.BasicTreeUI.FocusHandler, javax.swing.plaf.basic.BasicTreeUI.KeyHandler, javax.swing.plaf.basic.BasicTreeUI.MouseHandler, javax.swing.plaf.basic.BasicTreeUI.MouseInputHandler, javax.swing.plaf.basic.BasicTreeUI.NodeDimensionsHandler, javax.swing.plaf.basic.BasicTreeUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.SelectionModelPropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction, javax.swing.plaf.basic.BasicTreeUI.TreeExpansionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeHomeAction, javax.swing.plaf.basic.BasicTreeUI.TreeIncrementAction, javax.swing.plaf.basic.BasicTreeUI.TreeModelHandler, javax.swing.plaf.basic.BasicTreeUI.TreePageAction, javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeToggleAction, javax.swing.plaf.basic.BasicTreeUI.TreeTraverseAction
    • Constructor Summary

      Constructors 
      Constructor Description
      FlatTreeUI()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void applyStyle​(java.lang.Object style)  
      protected java.lang.Object applyStyleProperty​(java.lang.String key, java.lang.Object value)  
      protected java.awt.event.MouseListener createMouseListener()  
      protected java.beans.PropertyChangeListener createPropertyChangeListener()  
      protected javax.swing.event.TreeSelectionListener createTreeSelectionListener()  
      static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)  
      protected java.awt.Rectangle getDropLineRect​(javax.swing.JTree.DropLocation loc)  
      java.awt.Rectangle getPathBounds​(javax.swing.JTree tree, javax.swing.tree.TreePath path)  
      java.util.Map<java.lang.String,​java.lang.Class<?>> getStyleableInfos​(javax.swing.JComponent c)  
      java.lang.Object getStyleableValue​(javax.swing.JComponent c, java.lang.String key)  
      protected void installDefaults()  
      protected void installStyle()  
      void installUI​(javax.swing.JComponent c)  
      private boolean isDropRow​(int row)
      Checks whether dropping on a row.
      protected boolean isPaintSelection()  
      protected boolean isWideSelection()  
      void paint​(java.awt.Graphics g, javax.swing.JComponent c)  
      private void paintCellBackground​(java.awt.Graphics g, java.awt.Component rendererComponent, java.awt.Rectangle bounds, int row, boolean paintSelection)  
      protected void paintHorizontalLine​(java.awt.Graphics g, javax.swing.JComponent c, int y, int left, int right)  
      protected void paintRow​(java.awt.Graphics g, java.awt.Rectangle clipBounds, java.awt.Insets insets, java.awt.Rectangle bounds, javax.swing.tree.TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
      Similar to super.paintRow(), but supports wide selection and uses inactive selection background/foreground if tree is not focused.
      protected void paintVerticalLine​(java.awt.Graphics g, javax.swing.JComponent c, int x, int top, int bottom)  
      private void paintWideSelection​(java.awt.Graphics g, java.awt.Rectangle bounds, int row)  
      private void repaintWideDropLocation​(javax.swing.JTree.DropLocation loc)  
      private java.awt.Color setRendererBackgroundSelectionColor​(java.awt.Component rendererComponent, java.awt.Color color)  
      private java.awt.Color setRendererBorderSelectionColor​(java.awt.Component rendererComponent, java.awt.Color color)  
      private void setRendererForeground​(java.awt.Component rendererComponent, java.awt.Color color)  
      protected void uninstallDefaults()  
      protected void updateRenderer()  
      private boolean useUnitedRoundedSelection()  
      • Methods inherited from class javax.swing.plaf.basic.BasicTreeUI

        cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createDefaultCellEditor, createDefaultCellRenderer, createFocusListener, createKeyListener, createLayoutCache, createNodeDimensions, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getCollapsedIcon, getEditingPath, getExpandedIcon, getHashColor, getHorizontalLegBuffer, getLastChildPath, getLeadSelectionRow, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installKeyboardActions, installListeners, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintDropLine, paintExpandControl, paintHorizontalPartOfLeg, paintVerticalPartOfLeg, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, selectPathForEvent, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setModel, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallComponents, uninstallKeyboardActions, uninstallListeners, uninstallUI, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateSize
      • 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
    • Field Detail

      • selectionBackground

        protected java.awt.Color selectionBackground
      • selectionForeground

        protected java.awt.Color selectionForeground
      • selectionInactiveBackground

        protected java.awt.Color selectionInactiveBackground
      • selectionInactiveForeground

        protected java.awt.Color selectionInactiveForeground
      • selectionBorderColor

        protected java.awt.Color selectionBorderColor
      • selectionInsets

        protected java.awt.Insets selectionInsets
        Since:
        3
      • selectionArc

        protected int selectionArc
        Since:
        3
      • wideSelection

        protected boolean wideSelection
      • showCellFocusIndicator

        protected boolean showCellFocusIndicator
      • showDefaultIcons

        protected boolean showDefaultIcons
        Since:
        3
      • iconArrowType

        public java.lang.String iconArrowType
        Since:
        2
      • iconExpandedColor

        public java.awt.Color iconExpandedColor
        Since:
        2
      • iconCollapsedColor

        public java.awt.Color iconCollapsedColor
        Since:
        2
      • iconLeafColor

        public java.awt.Color iconLeafColor
        Since:
        2
      • iconClosedColor

        public java.awt.Color iconClosedColor
        Since:
        2
      • iconOpenColor

        public java.awt.Color iconOpenColor
        Since:
        2
      • paintSelection

        protected boolean paintSelection
        Since:
        2
      • defaultLeafIcon

        private javax.swing.Icon defaultLeafIcon
      • defaultClosedIcon

        private javax.swing.Icon defaultClosedIcon
      • defaultOpenIcon

        private javax.swing.Icon defaultOpenIcon
      • paintLines

        private boolean paintLines
      • defaultCellNonSelectionBackground

        private java.awt.Color defaultCellNonSelectionBackground
      • defaultSelectionBackground

        private java.awt.Color defaultSelectionBackground
      • defaultSelectionForeground

        private java.awt.Color defaultSelectionForeground
      • defaultSelectionBorderColor

        private java.awt.Color defaultSelectionBorderColor
      • oldStyleValues

        private java.util.Map<java.lang.String,​java.lang.Object> oldStyleValues
    • Constructor Detail

      • FlatTreeUI

        public FlatTreeUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)
      • installUI

        public void installUI​(javax.swing.JComponent c)
        Overrides:
        installUI in class javax.swing.plaf.basic.BasicTreeUI
      • installDefaults

        protected void installDefaults()
        Overrides:
        installDefaults in class javax.swing.plaf.basic.BasicTreeUI
      • uninstallDefaults

        protected void uninstallDefaults()
        Overrides:
        uninstallDefaults in class javax.swing.plaf.basic.BasicTreeUI
      • updateRenderer

        protected void updateRenderer()
        Overrides:
        updateRenderer in class javax.swing.plaf.basic.BasicTreeUI
      • createMouseListener

        protected java.awt.event.MouseListener createMouseListener()
        Overrides:
        createMouseListener in class javax.swing.plaf.basic.BasicTreeUI
      • createPropertyChangeListener

        protected java.beans.PropertyChangeListener createPropertyChangeListener()
        Overrides:
        createPropertyChangeListener in class javax.swing.plaf.basic.BasicTreeUI
      • repaintWideDropLocation

        private void repaintWideDropLocation​(javax.swing.JTree.DropLocation loc)
      • createTreeSelectionListener

        protected javax.swing.event.TreeSelectionListener createTreeSelectionListener()
        Overrides:
        createTreeSelectionListener in class javax.swing.plaf.basic.BasicTreeUI
      • getPathBounds

        public java.awt.Rectangle getPathBounds​(javax.swing.JTree tree,
                                                javax.swing.tree.TreePath path)
        Overrides:
        getPathBounds in class javax.swing.plaf.basic.BasicTreeUI
      • installStyle

        protected void installStyle()
        Since:
        2
      • applyStyle

        protected void applyStyle​(java.lang.Object style)
        Since:
        2
      • applyStyleProperty

        protected java.lang.Object applyStyleProperty​(java.lang.String key,
                                                      java.lang.Object value)
        Since:
        2
      • paint

        public void paint​(java.awt.Graphics g,
                          javax.swing.JComponent c)
        Overrides:
        paint in class javax.swing.plaf.basic.BasicTreeUI
      • paintRow

        protected void paintRow​(java.awt.Graphics g,
                                java.awt.Rectangle clipBounds,
                                java.awt.Insets insets,
                                java.awt.Rectangle bounds,
                                javax.swing.tree.TreePath path,
                                int row,
                                boolean isExpanded,
                                boolean hasBeenExpanded,
                                boolean isLeaf)
        Similar to super.paintRow(), but supports wide selection and uses inactive selection background/foreground if tree is not focused.
        Overrides:
        paintRow in class javax.swing.plaf.basic.BasicTreeUI
      • setRendererBackgroundSelectionColor

        private java.awt.Color setRendererBackgroundSelectionColor​(java.awt.Component rendererComponent,
                                                                   java.awt.Color color)
      • setRendererForeground

        private void setRendererForeground​(java.awt.Component rendererComponent,
                                           java.awt.Color color)
      • setRendererBorderSelectionColor

        private java.awt.Color setRendererBorderSelectionColor​(java.awt.Component rendererComponent,
                                                               java.awt.Color color)
      • paintWideSelection

        private void paintWideSelection​(java.awt.Graphics g,
                                        java.awt.Rectangle bounds,
                                        int row)
      • paintCellBackground

        private void paintCellBackground​(java.awt.Graphics g,
                                         java.awt.Component rendererComponent,
                                         java.awt.Rectangle bounds,
                                         int row,
                                         boolean paintSelection)
      • useUnitedRoundedSelection

        private boolean useUnitedRoundedSelection()
      • paintVerticalLine

        protected void paintVerticalLine​(java.awt.Graphics g,
                                         javax.swing.JComponent c,
                                         int x,
                                         int top,
                                         int bottom)
        Overrides:
        paintVerticalLine in class javax.swing.plaf.basic.BasicTreeUI
      • paintHorizontalLine

        protected void paintHorizontalLine​(java.awt.Graphics g,
                                           javax.swing.JComponent c,
                                           int y,
                                           int left,
                                           int right)
        Overrides:
        paintHorizontalLine in class javax.swing.plaf.basic.BasicTreeUI
      • isDropRow

        private boolean isDropRow​(int row)
        Checks whether dropping on a row. See DefaultTreeCellRenderer.getTreeCellRendererComponent().
      • getDropLineRect

        protected java.awt.Rectangle getDropLineRect​(javax.swing.JTree.DropLocation loc)
        Overrides:
        getDropLineRect in class javax.swing.plaf.basic.BasicTreeUI
      • isWideSelection

        protected boolean isWideSelection()
      • isPaintSelection

        protected boolean isPaintSelection()