Ignore:
Timestamp:
2015-12-17T00:12:03+01:00 (4 years ago)
Author:
Don-vip
Message:

sonar fixes + javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r9078 r9136  
    4747    private VersionTablePopupMenu popupMenu;
    4848    private final transient HistoryBrowserModel model;
     49
     50    /**
     51     * Constructs a new {@code VersionTable}.
     52     * @param model model used by the history browser
     53     */
     54    public VersionTable(HistoryBrowserModel model) {
     55        super(model.getVersionTableModel(), new VersionTableColumnModel());
     56        model.addObserver(this);
     57        build();
     58        this.model = model;
     59    }
    4960
    5061    protected void build() {
     
    93104    }
    94105
    95     /**
    96      * Constructs a new {@code VersionTable}.
    97      * @param model model used by the history browser
    98      */
    99     public VersionTable(HistoryBrowserModel model) {
    100         super(model.getVersionTableModel(), new VersionTableColumnModel());
    101         model.addObserver(this);
    102         build();
    103         this.model = model;
    104     }
    105 
    106106    // some kind of hack to prevent the table from scrolling to the
    107107    // right when clicking on the cells
     
    140140        @Override
    141141        protected int checkTableSelection(JTable table, Point p) {
    142             HistoryBrowserModel.VersionTableModel model = getVersionTableModel();
     142            HistoryBrowserModel.VersionTableModel tableModel = getVersionTableModel();
    143143            int row = rowAtPoint(p);
    144             if (row > -1 && !model.isLatest(row)) {
    145                 popupMenu.prepare(model.getPrimitive(row));
     144            if (row > -1 && !tableModel.isLatest(row)) {
     145                popupMenu.prepare(tableModel.getPrimitive(row));
    146146            }
    147147            return row;
     
    252252    }
    253253
     254    /**
     255     * Renderer for history radio buttons in columns A and B.
     256     */
    254257    public static class RadioButtonRenderer extends JRadioButton implements TableCellRenderer {
    255258
     
    263266    }
    264267
     268    /**
     269     * Editor for history radio buttons in columns A and B.
     270     */
    265271    public static class RadioButtonEditor extends DefaultCellEditor implements ItemListener {
    266272
     
    278284        @Override
    279285        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    280             if (value == null) return null;
     286            if (value == null)
     287                return null;
    281288            boolean val = (Boolean) value;
    282289            btn.setSelected(val);
     
    297304    }
    298305
     306    /**
     307     * Renderer for history version labels, allowing to define horizontal alignment.
     308     */
    299309    public static class AlignedRenderer extends JLabel implements TableCellRenderer {
    300310
Note: See TracChangeset for help on using the changeset viewer.