Changeset 62 in josm
- Timestamp:
- 2006-03-16T00:02:54+01:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java
r61 r62 43 43 */ 44 44 public AddWayAction(MapFrame mapFrame, MapMode followMode) { 45 super("Add Way", "addway", "Combine linesegments to a new way.", KeyEvent.VK_W, mapFrame);45 super("Add Way", "addway", "Combine selected segments to a new way.", KeyEvent.VK_W, mapFrame); 46 46 this.followMode = followMode; 47 47 } -
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r36 r62 273 273 b.addActionListener(actionListener); 274 274 b.setToolTipText(tooltip); 275 b.setMnemonic(mnemonic);275 //b.setMnemonic(mnemonic); TODO disabled until mapmodes have no Alt in their hotkey. 276 276 return b; 277 277 } -
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r61 r62 14 14 import javax.swing.DefaultListModel; 15 15 import javax.swing.JButton; 16 import javax.swing.JLabel; 16 17 import javax.swing.JList; 17 18 import javax.swing.JOptionPane; … … 80 81 button.setToolTipText("Search for objects."); 81 82 button.addActionListener(new ActionListener(){ 83 private String lastSearch = ""; 82 84 public void actionPerformed(ActionEvent e) { 83 String search = JOptionPane.showInputDialog(Main.main, "Please enter a search string", "Search", JOptionPane.INFORMATION_MESSAGE); 84 if (search == null) 85 JLabel l = new JLabel("Please enter a search string."); 86 l.setToolTipText("<html>Fulltext search.<ul>" + 87 "<li>Baker Street - search for everything with 'Baker Street' in any key or name.</li>" + 88 "<li>name:Bak - search for every object with key=name and 'Bak' anywhere in the value.</li>" + 89 "<li>foot: - search for everything with the key=foot set to any value." + 90 "</ul></html>"); 91 lastSearch = (String)JOptionPane.showInputDialog(Main.main,l,"Search",JOptionPane.INFORMATION_MESSAGE,null,null,lastSearch); 92 if (lastSearch == null) 85 93 return; 86 94 Main.main.ds.clearSelection(); … … 88 96 if (osm.keys != null) { 89 97 for (Entry<Key, String> ent : osm.keys.entrySet()) { 90 if ( search.indexOf(ent.getKey().name) != -1 || search.indexOf(ent.getValue()) != -1) {98 if (match(lastSearch, ent.getKey(), ent.getValue())) { 91 99 osm.setSelected(true); 92 100 break; … … 97 105 selectionChanged(Main.main.ds.getSelected()); 98 106 Main.main.getMapFrame().repaint(); 107 } 108 private boolean match(String search, Key key, String value) { 109 int colon = search.indexOf(':'); 110 if (colon == -1) 111 return key.name.indexOf(search) != -1 || value.indexOf(search) != -1; 112 return key.name.equals(search.substring(0, colon)) && value.indexOf(search.substring(colon+1)) != -1; 99 113 } 100 114 });
Note:
See TracChangeset
for help on using the changeset viewer.