Changeset 4779 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-01-09T10:32:10+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/history
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r4775 r4779 56 56 @Override 57 57 public void tableChanged(TableModelEvent e) { 58 adjustColumnWidth(VersionTable.this, 0); 59 adjustColumnWidth(VersionTable.this, 4); 60 adjustColumnWidth(VersionTable.this, 5); 58 adjustColumnWidth(VersionTable.this, 0, 0); 59 adjustColumnWidth(VersionTable.this, 1, -8); 60 adjustColumnWidth(VersionTable.this, 2, -8); 61 adjustColumnWidth(VersionTable.this, 3, 0); 62 adjustColumnWidth(VersionTable.this, 4, 0); 63 adjustColumnWidth(VersionTable.this, 5, 0); 61 64 } 62 65 }); … … 213 216 } 214 217 215 private static void adjustColumnWidth(JTable tbl, int col) { 218 private static void adjustColumnWidth(JTable tbl, int col, int cellInset) { 216 219 int maxwidth = 0; 217 220 … … 220 223 Object val = tbl.getValueAt(row, col); 221 224 Component comp = tcr.getTableCellRendererComponent(tbl, val, false, false, row, col); 222 maxwidth = Math.max(comp.getPreferredSize().width, maxwidth); 225 maxwidth = Math.max(comp.getPreferredSize().width + cellInset, maxwidth); 223 226 } 224 227 TableCellRenderer tcr = tbl.getTableHeader().getDefaultRenderer(); 225 228 Object val = tbl.getColumnModel().getColumn(col).getHeaderValue(); 226 229 Component comp = tcr.getTableCellRendererComponent(tbl, val, false, false, -1, col); 227 maxwidth = Math.max(comp.getPreferredSize().width + Main.pref.getInteger("table.header-inset", 2), maxwidth);230 maxwidth = Math.max(comp.getPreferredSize().width + Main.pref.getInteger("table.header-inset", 0), maxwidth); 228 231 229 232 int spacing = tbl.getIntercellSpacing().width; -
trunk/src/org/openstreetmap/josm/gui/history/VersionTableColumnModel.java
r4601 r4779 30 30 col.setCellRenderer(bRenderer); 31 31 col.setCellEditor(new VersionTable.RadioButtonEditor()); 32 col.setMaxWidth(18);33 32 col.setResizable(false); 34 33 addColumn(col); … … 38 37 col.setCellRenderer(bRenderer); 39 38 col.setCellEditor(new VersionTable.RadioButtonEditor()); 40 col.setPreferredWidth(18);41 39 col.setResizable(false); 42 40 addColumn(col);
Note:
See TracChangeset
for help on using the changeset viewer.