Changeset 2308 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-10-25T12:05:31+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r2081 r2308 93 93 static public void setUserAgent() { 94 94 Properties sysProp = System.getProperties(); 95 sysProp.put("http.agent", "JOSM/1.5 ("+(version.equals(tr("UNKNOWN"))?"UNKNOWN":version)+" "+LanguageInfo.get LanguageCode()+")");95 sysProp.put("http.agent", "JOSM/1.5 ("+(version.equals(tr("UNKNOWN"))?"UNKNOWN":version)+" "+LanguageInfo.getJOSMLocaleCode()+")"); 96 96 System.setProperties(sysProp); 97 97 } -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r2273 r2308 107 107 TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways); 108 108 109 110 109 // try to build a new way which includes all the combined 111 110 // ways -
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r2274 r2308 9 9 10 10 import javax.swing.AbstractAction; 11 import javax.swing.AbstractButton;12 import javax.swing.Action;13 import javax.swing.JComponent;14 import javax.swing.JMenu;15 11 import javax.swing.SwingUtilities; 16 12 17 13 import org.openstreetmap.josm.Main; 18 14 import org.openstreetmap.josm.gui.help.HelpBrowserProxy; 19 import org.openstreetmap.josm.gui.help.Help ful;15 import org.openstreetmap.josm.gui.help.HelpUtil; 20 16 import org.openstreetmap.josm.tools.ImageProvider; 21 17 … … 23 19 * Open a help browser and displays lightweight online help. 24 20 * 25 * @author imi26 21 */ 27 22 public class HelpAction extends AbstractAction { 28 29 30 private String pathhelp = Main.pref.get("help.pathhelp", "Help/");31 private String pathmenu = Main.pref.get("help.pathmenu", "Menu/");32 23 33 24 public HelpAction() { … … 43 34 if (mouse != null) { 44 35 c = SwingUtilities.getDeepestComponentAt(c, mouse.x, mouse.y); 45 topic = contextSensitiveHelp(c);36 topic = HelpUtil.getContextSpecificHelpTopic(c); 46 37 } else { 47 38 topic = null; … … 49 40 } else { 50 41 Point mouse = Main.parent.getMousePosition(); 51 topic = contextSensitiveHelp(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y));42 topic = HelpUtil.getContextSpecificHelpTopic(SwingUtilities.getDeepestComponentAt(Main.parent, mouse.x, mouse.y)); 52 43 } 53 44 if (topic == null) { 54 HelpBrowserProxy.getInstance().setUrlForHelpTopic(" Help");45 HelpBrowserProxy.getInstance().setUrlForHelpTopic("/"); 55 46 } else { 56 help(topic);47 HelpBrowserProxy.getInstance().setUrlForHelpTopic(topic); 57 48 } 58 49 } else { 59 HelpBrowserProxy.getInstance().setUrlForHelpTopic(" Help");50 HelpBrowserProxy.getInstance().setUrlForHelpTopic("/"); 60 51 } 61 52 } 62 63 /**64 * @return The topic of the help. <code>null</code> for "don't know"65 */66 private String contextSensitiveHelp(Object c) {67 if (c == null)68 return null;69 if (c instanceof Helpful)70 return ((Helpful)c).helpTopic();71 if (c instanceof JMenu) {72 JMenu b = (JMenu)c;73 if (b.getClientProperty("help") != null)74 return (String)b.getClientProperty("help");75 return pathmenu+b.getText();76 }77 if (c instanceof AbstractButton) {78 AbstractButton b = (AbstractButton)c;79 if (b.getClientProperty("help") != null)80 return (String)b.getClientProperty("help");81 return contextSensitiveHelp(((AbstractButton)c).getAction());82 }83 if (c instanceof Action)84 return (String)((Action)c).getValue("help");85 if (c instanceof JComponent && ((JComponent)c).getClientProperty("help") != null)86 return (String)((JComponent)c).getClientProperty("help");87 if (c instanceof Component)88 return contextSensitiveHelp(((Component)c).getParent());89 return null;90 }91 92 /**93 * Displays the help (or browse on the already open help) on the online page94 * with the given help topic. Use this for larger help descriptions.95 */96 public void help(String topic) {97 HelpBrowserProxy.getInstance().setUrlForHelpTopic(pathhelp + topic);98 }99 53 } -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r2285 r2308 91 91 tr("Close dialog and cancel downloading") 92 92 }); 93 dialog.configureContextsensitiveHelp(" Help/Action/OpenLocation", true /* show help button */);93 dialog.configureContextsensitiveHelp("/Action/OpenLocation", true /* show help button */); 94 94 dialog.showDialog(); 95 95 if (dialog.getValue() != 1) return; -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r2181 r2308 142 142 c = DeleteCommand.deleteWithReferences(getEditLayer(),getCurrentDataSet().getSelected()); 143 143 } else { 144 c = DeleteCommand.delete(getEditLayer(),getCurrentDataSet().getSelected(), !alt );144 c = DeleteCommand.delete(getEditLayer(),getCurrentDataSet().getSelected(), !alt /* also delete nodes in way */); 145 145 } 146 146 if (c != null) { … … 309 309 * @param e MouseEvent from which modifiers and position are taken 310 310 * @param int modifiers For explanation: @see updateCursor 311 * @param Simulate Set to true if the user shouldbe bugged with additional311 * @param silet Set to true if the user should not be bugged with additional 312 312 * dialogs 313 313 * @return 314 314 */ 315 private Command buildDeleteCommands(MouseEvent e, int modifiers, boolean si mulate) {315 private Command buildDeleteCommands(MouseEvent e, int modifiers, boolean silent) { 316 316 // Note: CTRL is the only modifier that is checked in MouseMove, don't 317 317 // forget updating it there … … 330 330 c = DeleteCommand.deleteWithReferences(getEditLayer(),Collections.singleton((OsmPrimitive)ws.way),true); 331 331 } else { 332 c = DeleteCommand.delete(getEditLayer(),Collections.singleton((OsmPrimitive)ws.way), !alt, si mulate);332 c = DeleteCommand.delete(getEditLayer(),Collections.singleton((OsmPrimitive)ws.way), !alt, silent); 333 333 } 334 334 } … … 336 336 c = DeleteCommand.deleteWithReferences(getEditLayer(),Collections.singleton(sel)); 337 337 } else { 338 c = DeleteCommand.delete(getEditLayer(),Collections.singleton(sel), !alt, si mulate);338 c = DeleteCommand.delete(getEditLayer(),Collections.singleton(sel), !alt, silent); 339 339 } 340 340
Note:
See TracChangeset
for help on using the changeset viewer.