Changeset 32644 in osm for applications
- Timestamp:
- 2016-07-12T21:19:35+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java
r32551 r32644 31 31 private DefaultListModel<String> listModel = new DefaultListModel<>(); 32 32 private JList<String> searchResult = new JList<>(listModel); 33 private List<Marker> searchResultObjectCache = new ArrayList<>();33 private transient List<Marker> searchResultObjectCache = new ArrayList<>(); 34 34 private boolean firstTimeSearch = true; 35 35 … … 81 81 82 82 @Override 83 public void keyPressed(KeyEvent arg0) {83 public void keyPressed(KeyEvent e) { 84 84 // Do nothing 85 85 } 86 86 87 87 @Override 88 public void keyReleased(KeyEvent arg0) {88 public void keyReleased(KeyEvent e) { 89 89 updateSearchResults(); 90 90 } 91 91 92 92 @Override 93 public void keyTyped(KeyEvent arg0) {93 public void keyTyped(KeyEvent e) { 94 94 firstTimeSearch = false; 95 95 } … … 99 99 if (e.getSource() == searchResult) { 100 100 //click on the search result box 101 Marker marker = searchResultObjectCache.get(searchResult.getSelectedIndex()); 102 Main.map.mapView.zoomTo(marker.getCoor()); 101 int idx = searchResult.getSelectedIndex(); 102 if (idx >= 0) { 103 Marker marker = searchResultObjectCache.get(idx); 104 Main.map.mapView.zoomTo(marker.getCoor()); 105 } 103 106 } 104 107 } 105 108 106 109 @Override 107 public void mouseEntered(MouseEvent arg0) {110 public void mouseEntered(MouseEvent e) { 108 111 // Do nothing 109 112 } 110 113 111 114 @Override 112 public void mouseExited(MouseEvent arg0) {115 public void mouseExited(MouseEvent e) { 113 116 // Do nothing 114 117 } 115 118 116 119 @Override 117 public void mousePressed(MouseEvent arg0) {120 public void mousePressed(MouseEvent e) { 118 121 if (searchPattern.getSelectedText() == null) { 119 122 searchPattern.selectAll(); … … 122 125 123 126 @Override 124 public void mouseReleased(MouseEvent arg0) {127 public void mouseReleased(MouseEvent e) { 125 128 // Do nothing 126 129 }
Note:
See TracChangeset
for help on using the changeset viewer.