/[classpath]/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
ViewVC logotype

Diff of /classpath/javax/swing/tree/DefaultTreeCellRenderer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mark, Sat Jul 2 20:32:52 2005 UTC revision 1.8 by langel, Mon Jul 4 14:41:24 2005 UTC
# Line 116  public class DefaultTreeCellRenderer Line 116  public class DefaultTreeCellRenderer
116           * borderSelectionColor           * borderSelectionColor
117           */           */
118          protected Color borderSelectionColor;          protected Color borderSelectionColor;
119            
120    
121          // -------------------------------------------------------------          // -------------------------------------------------------------
122          // Initialization ---------------------------------------------          // Initialization ---------------------------------------------
# Line 380  public class DefaultTreeCellRenderer Line 381  public class DefaultTreeCellRenderer
381                  this.hasFocus = hasFocus;                  this.hasFocus = hasFocus;
382    
383                  if (leaf)                  if (leaf)
384                          setIcon(getLeafIcon());                          setLeafIcon(getLeafIcon());
385                  else if (expanded)                  else if (expanded)
386                          setIcon(getOpenIcon());                          setOpenIcon(getOpenIcon());
387                  else                  else
388                          setIcon(getClosedIcon());                          setClosedIcon(getClosedIcon());
389    
390                  setText(val.toString());                  setText(val.toString());
391                  setHorizontalAlignment(LEFT);                  setHorizontalAlignment(LEFT);
392                    setOpaque(true);
393                  setVerticalAlignment(TOP);                  setVerticalAlignment(TOP);
394                    setEnabled(true);
395                    setFont(getFont());
396    
397                    if (selected)
398                    {
399                            super.setBackground(getBackgroundSelectionColor());
400                            super.setForeground(getTextSelectionColor());
401                    }
402                    else
403                    {
404                            super.setBackground((tree.getParent()).getBackground());
405                            super.setForeground(getTextNonSelectionColor());
406                    }
407                    
408                    
409                  return this;                  return this;
410          }          }
411            
412            /**
413             * getFont
414             *
415             * @return the current Font
416             */
417            public Font getFont()
418            {
419                    return super.getFont();
420            }
421    
422          /**          /**
423           * paint           * paint

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26