/[classpath]/classpath/javax/swing/plaf/basic/BasicListUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicListUI.java

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

revision 1.13 by rabbit78, Sun Feb 27 16:02:20 2005 UTC revision 1.14 by rabbit78, Sun Feb 27 20:35:55 2005 UTC
# Line 53  import java.awt.event.MouseEvent; Line 53  import java.awt.event.MouseEvent;
53  import java.beans.PropertyChangeEvent;  import java.beans.PropertyChangeEvent;
54  import java.beans.PropertyChangeListener;  import java.beans.PropertyChangeListener;
55    
56    import javax.swing.CellRendererPane;
57  import javax.swing.JComponent;  import javax.swing.JComponent;
58  import javax.swing.JList;  import javax.swing.JList;
59  import javax.swing.ListCellRenderer;  import javax.swing.ListCellRenderer;
# Line 343  public class BasicListUI extends ListUI Line 344  public class BasicListUI extends ListUI
344    protected int updateLayoutStateNeeded;    protected int updateLayoutStateNeeded;
345    
346    /**    /**
347       * The {@link CellRendererPane} that is used for painting.
348       */
349      protected CellRendererPane rendererPane;
350    
351      /**
352     * Calculate the height of a particular row. If there is a fixed {@link     * Calculate the height of a particular row. If there is a fixed {@link
353     * #cellHeight}, return it; otherwise return the specific row height     * #cellHeight}, return it; otherwise return the specific row height
354     * requested from the {@link #cellHeights} array. If the requested row     * requested from the {@link #cellHeights} array. If the requested row
# Line 513  public class BasicListUI extends ListUI Line 519  public class BasicListUI extends ListUI
519      propertyChangeListener = new PropertyChangeHandler();      propertyChangeListener = new PropertyChangeHandler();
520      componentListener = new ComponentHandler();      componentListener = new ComponentHandler();
521      updateLayoutStateNeeded = 1;      updateLayoutStateNeeded = 1;
522        rendererPane = new CellRendererPane();
523    }    }
524    
525    /**    /**
# Line 676  public class BasicListUI extends ListUI Line 683  public class BasicListUI extends ListUI
683      Component comp = rend.getListCellRendererComponent(list,      Component comp = rend.getListCellRendererComponent(list,
684                                                         data.getElementAt(row),                                                         data.getElementAt(row),
685                                                         0, is_sel, has_focus);                                                         0, is_sel, has_focus);
686      g.translate(bounds.x, bounds.y);      //comp.setBounds(new Rectangle(0, 0, bounds.width, bounds.height));
687      comp.setBounds(new Rectangle(0, 0, bounds.width, bounds.height));      //comp.paint(g);
688      comp.paint(g);      rendererPane.paintComponent(g, comp, list, bounds);
     g.translate(-bounds.x, -bounds.y);  
689    }    }
690    
691    /**    /**

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

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