- Timestamp:
- 2015-01-07T01:45:32+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r7771 r7933 42 42 * VersionTable shows a list of version in a {@link org.openstreetmap.josm.data.osm.history.History} 43 43 * of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive}. 44 * 44 * @since 1709 45 45 */ 46 46 public class VersionTable extends JTable implements Observer{ … … 93 93 } 94 94 95 /** 96 * Constructs a new {@code VersionTable}. 97 * @param model model used by the history browser 98 */ 95 99 public VersionTable(HistoryBrowserModel model) { 96 100 super(model.getVersionTableModel(), new VersionTableColumnModel()); … … 117 121 118 122 class MouseListener extends PopupMenuLauncher { 119 p ublicMouseListener() {123 private MouseListener() { 120 124 super(popupMenu); 121 125 } … … 126 130 int row = rowAtPoint(e.getPoint()); 127 131 int col = columnAtPoint(e.getPoint()); 128 if (row > 0 && (col == VersionTableColumnModel.COL_DATE || col == VersionTableColumnModel.COL_USER)) {132 if (row >= 0 && (col == VersionTableColumnModel.COL_DATE || col == VersionTableColumnModel.COL_USER)) { 129 133 model.getVersionTableModel().setCurrentPointInTime(row); 130 model.getVersionTableModel().setReferencePointInTime( row - 1);134 model.getVersionTableModel().setReferencePointInTime(Math.max(0, row - 1)); 131 135 } 132 136 } … … 231 235 232 236 @Override 233 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int column) { 237 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 238 int row, int column) { 234 239 setSelected(value != null && (Boolean)value); 235 240 setHorizontalAlignment(SwingConstants.CENTER); … … 242 247 private JRadioButton btn; 243 248 249 /** 250 * Constructs a new {@code RadioButtonEditor}. 251 */ 244 252 public RadioButtonEditor() { 245 253 super(new JCheckBox()); … … 270 278 271 279 public static class AlignedRenderer extends JLabel implements TableCellRenderer { 280 281 /** 282 * Constructs a new {@code AlignedRenderer}. 283 * @param hAlignment Horizontal alignement. One of the following constants defined in SwingConstants: 284 * LEFT, CENTER (the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILING 285 */ 272 286 public AlignedRenderer(int hAlignment) { 273 287 setHorizontalAlignment(hAlignment); 274 288 } 275 @Override 276 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int column) { 289 290 @Override 291 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, 292 int row, int column) { 277 293 String v = value.toString(); 278 294 setText(v); … … 298 314 tbl.getColumnModel().getColumn(col).setPreferredWidth(maxwidth + spacing); 299 315 } 300 301 316 }
Note:
See TracChangeset
for help on using the changeset viewer.