avatar

578

Upgrade to Quaqua 5, which fixes many minor Mac UI bugs.

by mrs, 27 Jul, 2008 07:29 PM
371 578  
3737   private int mRow = 0;
3838   private boolean mSelected = false;
3939 
40   private class Colors {
40   private static class Colors {
4141     Color mForeground;
4242     Color mBackground;
4343 
------
7171                                                  boolean isSelected, boolean hasFocus,
7272                                                  int row, int column) {
7373     column = table.convertColumnIndexToModel(column);
74     Component returnComponent;
7574     if(value instanceof Icon) {
7675       setHorizontalAlignment(JLabel.CENTER);
7776     } else {
7877       setHorizontalAlignment(JLabel.LEFT);
7978     }
80     returnComponent = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
79     Component returnComponent = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
8180 
8281     AuctionEntry ae = (AuctionEntry)table.getValueAt(row, -1);
8382     if(ae == null) return returnComponent;
543 578  
9292   }
9393 
9494   private void setDefaults(String inName, String defaultColumn) {
95    String sortByColumn;
96    String sortDirection;
95     columnStateList.clear();
9796 
98    columnStateList.clear();
99 
10097    for(int i=0; ; i++) {
101    if(i==0) {
98       String sortByColumn;
99       String sortDirection;
100       if(i==0) {
102101    // Initially sort by ending time, ascending.
103102    sortByColumn = JConfig.queryDisplayProperty(inName + ".sort_by", defaultColumn);
104103    sortDirection = JConfig.queryDisplayProperty(inName + ".sort_direction", "ascending");
------
174173   }
175174 
176175   private void restoreSelection(Selection selection) {
177     boolean lead_selected = false;
178176     _table.clearSelection();   // call overridden version
179177 
178     boolean lead_selected = false;
180179     for (int i = 0; i < selection.selected.length; i++) {
181180       int selected = selection.selected[i];
182181       if(selected != selection.lead && selected != -1) {
------
237236     });
238237   }
239238 
240   private class SortHeaderRenderer extends JLabel implements TableCellRenderer {
239   private static class SortHeaderRenderer extends JLabel implements TableCellRenderer {
241240     public SortHeaderRenderer() {
242241       setHorizontalTextPosition(LEFT);
243242       setHorizontalAlignment(CENTER);
------
315314   // Add a mouse listener to the Table to trigger a table sort
316315   // when a column heading is clicked in the JTable.
317316   public void addMouseListenerToHeaderInTable(JTable table) {
318     ColumnState columnState;
319317     TableColumnModel tableColumnModel = table.getColumnModel();
320     TableColumn tableColumn;
321318 
322319     _table = table;
323320 
324321     // Restore the header as it was saved
325322     for(int i=0; i < columnStateList.size(); i++) {
326      columnState = columnStateList.get(i);
323       ColumnState columnState = columnStateList.get(i);
327324       int viewCol = table.convertColumnIndexToView(columnState.getColumn());
328325       if(viewCol != -1) {
329         tableColumn = tableColumnModel.getColumn(viewCol);
326         TableColumn tableColumn = tableColumnModel.getColumn(viewCol);
330327 
331328         // Save original header
332329         String headerValue = (String) tableColumn.getHeaderValue();
------
345342   }
346343 
347344   public void removeColumn(String colId, JTable table) {
348     ColumnState cs;
349345     for(int i=0; i<columnStateList.size(); i++) {
350       cs = columnStateList.get(i);
346       ColumnState cs = columnStateList.get(i);
351347       if(cs.getHeaderValue().equals(colId)) {
352348         columnStateList.remove(cs);
353349         i--;