/[classpath]/classpath/javax/swing/table/DefaultTableCellRenderer.java
ViewVC logotype

Diff of /classpath/javax/swing/table/DefaultTableCellRenderer.java

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

revision 1.19 by langel, Thu Nov 3 22:06:11 2005 UTC revision 1.20 by rabbit78, Thu Nov 3 22:26:10 2005 UTC
# Line 72  public class DefaultTableCellRenderer ex Line 72  public class DefaultTableCellRenderer ex
72    }    }
73    
74    /**    /**
75       * Stores the color set by setForeground().
76       */
77      Color foreground;
78    
79      /**
80       * Stores the color set by setBackground().
81       */
82      Color background;
83    
84      /**
85     * Creates a default table cell renderer with an empty border.     * Creates a default table cell renderer with an empty border.
86     */     */
87    public DefaultTableCellRenderer()    public DefaultTableCellRenderer()
# Line 87  public class DefaultTableCellRenderer ex Line 97  public class DefaultTableCellRenderer ex
97    public void setForeground(Color c)    public void setForeground(Color c)
98    {    {
99      super.setForeground(c);      super.setForeground(c);
100        foreground = c;
101    }    }
102    
103    /**    /**
# Line 97  public class DefaultTableCellRenderer ex Line 108  public class DefaultTableCellRenderer ex
108    public void setBackground(Color c)    public void setBackground(Color c)
109    {    {
110      super.setBackground(c);      super.setBackground(c);
111        background = c;
112    }    }
113    
114    /**    /**
# Line 146  public class DefaultTableCellRenderer ex Line 158  public class DefaultTableCellRenderer ex
158        }        }
159      else      else
160        {        {
161          setBackground(table.getBackground());          if (background != null)
162          setForeground(table.getForeground());            setBackground(background);
163            else
164              setBackground(table.getBackground());
165            if (foreground != null)
166              setForeground(foreground);
167            else
168              setForeground(table.getForeground());
169        }        }
170    
171      if (hasFocus)      if (hasFocus)
172        {        setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
         if (!(getBackground() instanceof ColorUIResource))  
           setBackground(table.getBackground());  
         setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));  
       }  
173      else      else
174        setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));        setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
175    

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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