Changeset 2715 in josm for trunk/src/org/openstreetmap/josm/gui/help
- Timestamp:
- 2009-12-30T22:02:32+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/help
- Files:
-
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.