src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java

Print this page




 295         paint(context, g);
 296         context.dispose();
 297     }
 298 
 299     /**
 300      * Paints the specified component.
 301      *
 302      * @param context context for the component being painted
 303      * @param g the {@code Graphics} object used for painting
 304      * @see #update(Graphics,JComponent)
 305      */
 306     protected void paint(SynthContext context, Graphics g) {
 307         paintContext = context;
 308 
 309         updateLeadSelectionRow();
 310 
 311         Rectangle paintBounds = g.getClipBounds();
 312         Insets insets = tree.getInsets();
 313         TreePath initialPath = getClosestPathForLocation(tree, 0,
 314                                                          paintBounds.y);
 315         Enumeration paintingEnumerator = treeState.getVisiblePathsFrom
 316                                               (initialPath);
 317         int row = treeState.getRowForPath(initialPath);
 318         int endY = paintBounds.y + paintBounds.height;
 319         TreeModel treeModel = tree.getModel();
 320         SynthContext cellContext = getContext(tree, Region.TREE_CELL);
 321 
 322         drawingCache.clear();
 323 
 324         setHashColor(context.getStyle().getColor(context,
 325                                                 ColorType.FOREGROUND));
 326 
 327         if (paintingEnumerator != null) {
 328             // First pass, draw the rows
 329 
 330             boolean done = false;
 331             boolean isExpanded;
 332             boolean hasBeenExpanded;
 333             boolean isLeaf;
 334             Rectangle rowBounds = new Rectangle(0, 0, tree.getWidth(),0);
 335             Rectangle bounds;




 295         paint(context, g);
 296         context.dispose();
 297     }
 298 
 299     /**
 300      * Paints the specified component.
 301      *
 302      * @param context context for the component being painted
 303      * @param g the {@code Graphics} object used for painting
 304      * @see #update(Graphics,JComponent)
 305      */
 306     protected void paint(SynthContext context, Graphics g) {
 307         paintContext = context;
 308 
 309         updateLeadSelectionRow();
 310 
 311         Rectangle paintBounds = g.getClipBounds();
 312         Insets insets = tree.getInsets();
 313         TreePath initialPath = getClosestPathForLocation(tree, 0,
 314                                                          paintBounds.y);
 315         Enumeration<?> paintingEnumerator = treeState.getVisiblePathsFrom
 316                                               (initialPath);
 317         int row = treeState.getRowForPath(initialPath);
 318         int endY = paintBounds.y + paintBounds.height;
 319         TreeModel treeModel = tree.getModel();
 320         SynthContext cellContext = getContext(tree, Region.TREE_CELL);
 321 
 322         drawingCache.clear();
 323 
 324         setHashColor(context.getStyle().getColor(context,
 325                                                 ColorType.FOREGROUND));
 326 
 327         if (paintingEnumerator != null) {
 328             // First pass, draw the rows
 329 
 330             boolean done = false;
 331             boolean isExpanded;
 332             boolean hasBeenExpanded;
 333             boolean isLeaf;
 334             Rectangle rowBounds = new Rectangle(0, 0, tree.getWidth(),0);
 335             Rectangle bounds;