Changeset 431 in josm for trunk/src/org/openstreetmap/josm/gui/MainApplet.java
- Timestamp:
- 2007-10-26T21:58:25+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplet.java
r298 r431 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.applet.AppletStub; 7 import java.applet.AppletContext; 6 8 import java.awt.GridBagLayout; 7 9 import java.awt.event.ActionEvent; 8 10 import java.awt.event.KeyEvent; 11 import java.io.File; 12 import java.net.URL; 9 13 import java.util.Arrays; 10 14 import java.util.Collection; … … 14 18 15 19 import javax.swing.JApplet; 20 import javax.swing.JFrame; 16 21 import javax.swing.JLabel; 17 22 import javax.swing.JOptionPane; … … 55 60 56 61 private Map<String, Collection<String>> args = new HashMap<String, Collection<String>>(); 57 private UploadPreferencesAction uploadPreferences = new UploadPreferencesAction();58 62 59 63 @Override public String[][] getParameterInfo() { … … 101 105 // remove offending stuff from JOSM (that would break the SecurityManager) 102 106 m.remove(m.fileMenu); 103 m.editMenu.add( uploadPreferences);107 m.editMenu.add(new UploadPreferencesAction()); 104 108 m.open.setEnabled(false); 105 109 m.exit.setEnabled(false); … … 118 122 return v; 119 123 } 124 125 public static void main(String[] args) { 126 final JFrame frame = new JFrame("Java OpenStreetMap Applet"); 127 MainApplet applet = new MainApplet(); 128 applet.setStub(new AppletStub() { 129 public void appletResize(int w, int h) { 130 frame.resize(w, h); 131 } 132 133 public AppletContext getAppletContext() { 134 return null; 135 } 136 137 public URL getCodeBase() { 138 try { 139 return new File(".").toURI().toURL(); 140 } catch (Exception e) { 141 e.printStackTrace(); 142 return null; 143 } 144 } 145 146 public URL getDocumentBase() { 147 return getCodeBase(); 148 } 149 150 public String getParameter(String k) { 151 return null; 152 } 153 154 public boolean isActive() { 155 return true; 156 } 157 }); 158 applet.init(); 159 applet.start(); 160 frame.setContentPane(applet); 161 frame.setVisible(true); 162 } 120 163 }
Note:
See TracChangeset
for help on using the changeset viewer.