Changeset 11519 in josm for trunk/src/org
- Timestamp:
- 2017-01-31T23:27:09+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
r11366 r11519 20 20 import javax.swing.event.TableModelEvent; 21 21 import javax.swing.event.TableModelListener; 22 import javax.swing.table.TableModel;23 22 24 23 import org.openstreetmap.josm.Main; … … 318 317 } 319 318 320 private static PrimitiveId primitiveIdAtRow(TableModel model, int row) { 321 DiffTableModel castedModel = (DiffTableModel) model; 322 Long id = (Long) castedModel.getValueAt(row, 0).value; 319 private static PrimitiveId primitiveIdAtRow(DiffTableModel model, int row) { 320 Long id = (Long) model.getValueAt(row, 0).value; 323 321 return id == null ? null : new SimplePrimitiveId(id, OsmPrimitiveType.NODE); 324 322 } … … 332 330 protected int checkTableSelection(JTable table, Point p) { 333 331 int row = super.checkTableSelection(table, p); 334 popupMenu.prepare(primitiveIdAtRow( table.getModel(), row));332 popupMenu.prepare(primitiveIdAtRow((DiffTableModel) table.getModel(), row)); 335 333 return row; 336 334 } … … 353 351 if (row <= 0) 354 352 return; 355 PrimitiveId pid = primitiveIdAtRow( table.getModel(), row);353 PrimitiveId pid = primitiveIdAtRow((DiffTableModel) table.getModel(), row); 356 354 if (pid == null || pid.isNew()) 357 355 return; -
trunk/src/org/openstreetmap/josm/gui/layer/JumpToMarkerActions.java
r8836 r11519 45 45 private abstract static class JumpToMarker extends AbstractAction implements MultikeyShortcutAction { 46 46 47 private final transient Layer layer;47 private final transient JumpToMarkerLayer layer; 48 48 private final transient Shortcut multikeyShortcut; 49 49 private transient WeakReference<Layer> lastLayer; 50 50 51 51 JumpToMarker(JumpToMarkerLayer layer, Shortcut shortcut) { 52 this.layer = (Layer)layer;52 this.layer = layer; 53 53 this.multikeyShortcut = shortcut; 54 54 this.multikeyShortcut.setAccelerator(this); … … 74 74 if (l != null) { 75 75 if (l instanceof JumpToMarkerLayer) { 76 execute( l);76 execute((JumpToMarkerLayer) l); 77 77 } 78 78 } else if (repeat && lastLayer != null) { 79 79 l = lastLayer.get(); 80 if (LayerListDialog.isLayerValid(l) ) {81 execute( l);80 if (LayerListDialog.isLayerValid(l) && l instanceof JumpToMarkerLayer) { 81 execute((JumpToMarkerLayer) l); 82 82 } 83 83 } 84 84 } 85 85 86 protected abstract void execute( Layer l);86 protected abstract void execute(JumpToMarkerLayer l); 87 87 88 88 @Override … … 110 110 111 111 @Override 112 protected void execute( Layer l) {113 ((JumpToMarkerLayer) l).jumpToNextMarker();114 setLastLayer( l);112 protected void execute(JumpToMarkerLayer l) { 113 l.jumpToNextMarker(); 114 setLastLayer((Layer) l); 115 115 } 116 116 } … … 126 126 127 127 @Override 128 protected void execute( Layer l) {129 ((JumpToMarkerLayer) l).jumpToPreviousMarker();130 setLastLayer( l);128 protected void execute(JumpToMarkerLayer l) { 129 l.jumpToPreviousMarker(); 130 setLastLayer((Layer) l); 131 131 } 132 132 }
Note:
See TracChangeset
for help on using the changeset viewer.