Changeset 4779 in josm for trunk/src/org


Ignore:
Timestamp:
2012-01-09T10:32:10+01:00 (12 years ago)
Author:
bastiK
Message:

see #7219 - CT-Column-Title in history window only displays ...

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  
    5656            @Override
    5757            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);
    6164            }
    6265        });
     
    213216    }
    214217
    215     private static void adjustColumnWidth(JTable tbl, int col) {
     218    private static void adjustColumnWidth(JTable tbl, int col, int cellInset) {
    216219        int maxwidth = 0;
    217220
     
    220223            Object val = tbl.getValueAt(row, col);
    221224            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);
    223226        }
    224227        TableCellRenderer tcr = tbl.getTableHeader().getDefaultRenderer();
    225228        Object val = tbl.getColumnModel().getColumn(col).getHeaderValue();
    226229        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);
    228231
    229232        int spacing = tbl.getIntercellSpacing().width;
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTableColumnModel.java

    r4601 r4779  
    3030        col.setCellRenderer(bRenderer);
    3131        col.setCellEditor(new VersionTable.RadioButtonEditor());
    32         col.setMaxWidth(18);
    3332        col.setResizable(false);
    3433        addColumn(col);
     
    3837        col.setCellRenderer(bRenderer);
    3938        col.setCellEditor(new VersionTable.RadioButtonEditor());
    40         col.setPreferredWidth(18);
    4139        col.setResizable(false);
    4240        addColumn(col);
Note: See TracChangeset for help on using the changeset viewer.