- Timestamp:
- 2006-03-24T23:50:09+01:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 4 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/AboutAction.java
r68 r69 13 13 import java.util.regex.Pattern; 14 14 15 import javax.swing.JEditorPane;16 15 import javax.swing.JLabel; 17 16 import javax.swing.JOptionPane; … … 20 19 import javax.swing.JTabbedPane; 21 20 import javax.swing.JTextArea; 22 import javax.swing.event.HyperlinkEvent;23 import javax.swing.event.HyperlinkListener;24 21 25 22 import org.openstreetmap.josm.Main; 26 23 import org.openstreetmap.josm.gui.GBC; 27 24 import org.openstreetmap.josm.gui.ImageProvider; 25 import org.openstreetmap.josm.tools.UrlLabel; 28 26 29 27 /** … … 59 57 info.add(new JLabel("last change at "+time), GBC.eop()); 60 58 info.add(new JLabel("Homepage"), GBC.std().insets(0,0,10,0)); 61 JEditorPane homepage = new JEditorPane(); 62 homepage.setContentType("text/html"); 63 homepage.setText("<html><a href=\"http://wiki.eigenheimstrasse.de/wiki/JOSM\">" + 64 "http://wiki.eigenheimstrasse.de/wiki/JOSM</a></html>"); 65 homepage.setEditable(false); 66 homepage.setOpaque(false); 67 homepage.addHyperlinkListener(new HyperlinkListener(){ 68 public void hyperlinkUpdate(HyperlinkEvent e) { 69 if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { 70 //TODO: Open browser 71 } 72 } 73 }); 74 info.add(homepage, GBC.eol()); 59 info.add(new UrlLabel("http://wiki.eigenheimstrasse.de/wiki/JOSM"), GBC.eol()); 75 60 76 61 -
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r68 r69 10 10 import java.awt.event.MouseEvent; 11 11 import java.util.Collection; 12 import java.util.Map.Entry;13 12 14 13 import javax.swing.DefaultListModel; … … 27 26 import org.openstreetmap.josm.gui.MapFrame; 28 27 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 28 import org.openstreetmap.josm.tools.SearchCompiler; 29 29 30 30 /** … … 84 84 JLabel l = new JLabel("Please enter a search string."); 85 85 l.setToolTipText("<html>Fulltext search.<ul>" + 86 "<li>Baker Street - search for everything with 'Baker Street' in any key or name.</li>" + 87 "<li>name:Bak - search for every object with key=name and 'Bak' anywhere in the value.</li>" + 88 "<li>foot: - search for everything with the key=foot set to any value." + 86 "<li><code>Baker Street</code> - 'Baker' and 'Street' in any key or name.</li>" + 87 "<li><code>\"Baker Street\"</code> - 'Baker Street' in any key or name.</li>" + 88 "<li><code>name:Bak</code> - 'Bak' anywhere in the name.</li>" + 89 "<li><code>-name:Bak</code> - not 'Bak' in the name.</li>" + 90 "<li><code>foot:</code> - key=foot set to any value." + 89 91 "</ul></html>"); 90 92 lastSearch = (String)JOptionPane.showInputDialog(Main.main,l,"Search",JOptionPane.INFORMATION_MESSAGE,null,null,lastSearch); 91 93 if (lastSearch == null) 92 94 return; 93 Main.main.ds.clearSelection(); 94 for (OsmPrimitive osm : Main.main.ds.allNonDeletedPrimitives()) { 95 for (Entry<String, String> ent : osm.entrySet()) { 96 if (match(lastSearch, ent.getKey(), ent.getValue())) { 97 osm.setSelected(true); 98 break; 99 } 100 } 101 } 95 SearchCompiler.Match matcher = SearchCompiler.compile(lastSearch); 96 for (OsmPrimitive osm : Main.main.ds.allNonDeletedPrimitives()) 97 osm.setSelected(matcher.match(osm)); 102 98 selectionChanged(Main.main.ds.getSelected()); 103 99 Main.main.getMapFrame().repaint(); 104 }105 private boolean match(String search, String key, String value) {106 int colon = search.indexOf(':');107 if (colon == -1)108 return key.indexOf(search) != -1 || value.indexOf(search) != -1;109 String searchKey = search.substring(0, colon);110 String searchValue = search.substring(colon+1);111 if (searchKey.equals("type") && (searchValue.equals("segment")||searchValue.equals("way")||searchValue.equals("node")))112 return true;113 return key.equals(searchKey) && value.indexOf(searchValue) != -1;114 100 } 115 101 });
Note:
See TracChangeset
for help on using the changeset viewer.