- Timestamp:
- 2009-12-30T22:02:32+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r2709 r2715 50 50 import org.openstreetmap.josm.gui.SplashScreen; 51 51 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 52 import org.openstreetmap.josm.gui.help.HelpBrowser Proxy;52 import org.openstreetmap.josm.gui.help.HelpBrowser; 53 53 import org.openstreetmap.josm.gui.io.SaveLayersDialog; 54 54 import org.openstreetmap.josm.gui.layer.Layer; … … 392 392 } 393 393 } 394 }395 396 /**397 * Run any cleanup operation before exit398 *399 */400 public static void cleanupBeforeExit() {401 // try to close and exit the help browser running in another process402 //403 HelpBrowserProxy.getInstance().exit();404 394 } 405 395 -
trunk/src/org/openstreetmap/josm/actions/ExitAction.java
r2323 r2715 29 29 if (Main.saveUnsavedModifications()) { 30 30 Main.saveGuiGeometry(); 31 Main.cleanupBeforeExit();32 31 System.exit(0); 33 32 } -
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r2347 r2715 12 12 13 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.gui.help.HelpBrowser Proxy;14 import org.openstreetmap.josm.gui.help.HelpBrowser; 15 15 import org.openstreetmap.josm.gui.help.HelpUtil; 16 16 import org.openstreetmap.josm.tools.ImageProvider; … … 43 43 } 44 44 if (topic == null) { 45 HelpBrowser Proxy.getInstance().setUrlForHelpTopic("/");45 HelpBrowser.setUrlForHelpTopic("/"); 46 46 } else { 47 HelpBrowser Proxy.getInstance().setUrlForHelpTopic(topic);47 HelpBrowser.setUrlForHelpTopic(topic); 48 48 } 49 49 } else { 50 HelpBrowser Proxy.getInstance().setUrlForHelpTopic("/");50 HelpBrowser.setUrlForHelpTopic("/"); 51 51 } 52 52 } -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r2711 r2715 23 23 24 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.gui.help.HelpBrowser Proxy;25 import org.openstreetmap.josm.gui.help.HelpBrowser; 26 26 import org.openstreetmap.josm.gui.help.HelpUtil; 27 27 import org.openstreetmap.josm.tools.GBC; … … 486 486 487 487 public void actionPerformed(ActionEvent e) { 488 HelpBrowser Proxy.getInstance().setUrlForHelpTopic(helpTopic);488 HelpBrowser.setUrlForHelpTopic(helpTopic); 489 489 } 490 490 } -
trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
r2512 r2715 22 22 import javax.swing.KeyStroke; 23 23 24 import org.openstreetmap.josm.gui.help.HelpBrowser Proxy;24 import org.openstreetmap.josm.gui.help.HelpBrowser; 25 25 import org.openstreetmap.josm.gui.help.HelpUtil; 26 26 import org.openstreetmap.josm.tools.ImageProvider; … … 111 111 Action a = new AbstractAction() { 112 112 public void actionPerformed(ActionEvent e) { 113 HelpBrowser Proxy.getInstance().setUrlForHelpTopic(helpTopic);113 HelpBrowser.setUrlForHelpTopic(helpTopic); 114 114 } 115 115 }; -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r2641 r2715 55 55 return; 56 56 Main.saveGuiGeometry(); 57 Main.cleanupBeforeExit();58 57 System.exit(0); 59 58 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r2626 r2715 28 28 import org.openstreetmap.josm.gui.conflict.pair.ConflictResolver; 29 29 import org.openstreetmap.josm.gui.conflict.pair.properties.OperationCancelledException; 30 import org.openstreetmap.josm.gui.help.HelpBrowser Proxy;30 import org.openstreetmap.josm.gui.help.HelpBrowser; 31 31 import org.openstreetmap.josm.gui.help.HelpUtil; 32 32 import org.openstreetmap.josm.tools.ImageProvider; … … 188 188 189 189 public void actionPerformed(ActionEvent arg0) { 190 HelpBrowser Proxy.getInstance().setUrlForHelpTopic("/Dialog/ConflictDialog");190 HelpBrowser.setUrlForHelpTopic("/Dialog/ConflictDialog"); 191 191 } 192 192 } -
trunk/src/org/openstreetmap/josm/gui/help/ContextSensitiveHelpAction.java
r2512 r2715 52 52 public void actionPerformed(ActionEvent e) { 53 53 if (helpTopic != null) { 54 HelpBrowser Proxy.getInstance().setUrlForHelpTopic(helpTopic);54 HelpBrowser.setUrlForHelpTopic(helpTopic); 55 55 } 56 56 } -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r2626 r2715 7 7 8 8 import java.awt.BorderLayout; 9 import java.awt.Dimension; 10 import java.awt.Point; 9 11 import java.awt.Rectangle; 12 import java.awt.Toolkit; 10 13 import java.awt.event.ActionEvent; 11 14 import java.awt.event.KeyEvent; … … 32 35 import javax.swing.JToolBar; 33 36 import javax.swing.KeyStroke; 37 import javax.swing.SwingUtilities; 34 38 import javax.swing.event.HyperlinkEvent; 35 39 import javax.swing.event.HyperlinkListener; … … 48 52 import org.openstreetmap.josm.tools.ImageProvider; 49 53 import org.openstreetmap.josm.tools.OpenBrowser; 54 import org.openstreetmap.josm.tools.WindowGeometry; 50 55 51 56 public class HelpBrowser extends JFrame { … … 66 71 return instance; 67 72 } 73 74 /** 75 * Show the help page for help topic <code>helpTopic</code>. 76 * 77 * @param helpTopic the help topic 78 */ 79 public static void setUrlForHelpTopic(final String helpTopic) { 80 final HelpBrowser browser = getInstance(); 81 Runnable r = new Runnable() { 82 public void run() { 83 browser.openHelpTopic(helpTopic); 84 browser.setVisible(true); 85 browser.toFront(); 86 } 87 }; 88 SwingUtilities.invokeLater(r); 89 } 90 68 91 69 92 /** … … 101 124 BufferedReader reader = new BufferedReader( 102 125 new InputStreamReader( 103 getClass().getResourceAsStream(" help-browser.css")126 getClass().getResourceAsStream("/data/help-browser.css") 104 127 ) 105 128 ); … … 162 185 }); 163 186 187 setMinimumSize(new Dimension(400, 200)); 164 188 setTitle(tr("JOSM Help Browser")); 189 } 190 191 @Override 192 public void setVisible(boolean visible) { 193 if (visible) { 194 new WindowGeometry( 195 getClass().getName() + ".geometry", 196 WindowGeometry.centerInWindow( 197 getParent(), 198 new Dimension(600,400) 199 ) 200 ).apply(this); 201 } else if (!visible && isShowing()){ 202 new WindowGeometry(this).remember(getClass().getName() + ".geometry"); 203 } 204 super.setVisible(visible); 165 205 } 166 206 -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowserHistory.java
r2512 r2715 11 11 private int historyPos = 0; 12 12 13 public HelpBrowserHistory(HelpBrowser brow er) {14 this.browser = brow er;13 public HelpBrowserHistory(HelpBrowser browser) { 14 this.browser = browser; 15 15 history = new ArrayList<String>(); 16 16 }
Note:
See TracChangeset
for help on using the changeset viewer.