()
| 121 | }; |
| 122 | |
| 123 | public Main() { |
| 124 | setTitle("BombusMod"); |
| 125 | |
| 126 | addWindowListener(windowListener); |
| 127 | |
| 128 | getContentPane().add(createContents(getContentPane()), "Center"); |
| 129 | |
| 130 | StaticData.getInstance().setAssetsLoader(new AssetsLoader() { |
| 131 | @Override |
| 132 | public InputStream getResourceAsStream(String resource) { |
| 133 | return Thread.currentThread().getContextClassLoader().getResourceAsStream(resource.substring(1)); |
| 134 | } |
| 135 | }); |
| 136 | StaticData.getInstance().setVersionInfo(new VersionInfo() { |
| 137 | @Override |
| 138 | public String getVersionNumber() { |
| 139 | return "X"; |
| 140 | } |
| 141 | }); |
| 142 | this.common = new Common(emulatorContext); |
| 143 | common.setRecordStoreManager(new FileRecordStoreManager()); |
| 144 | J2SEDevice device = new J2SEDevice(emulatorContext); |
| 145 | common.setDevice(device); |
| 146 | J2SEDeviceDisplay deviceDisplay = (J2SEDeviceDisplay)emulatorContext.getDeviceDisplay(); |
| 147 | deviceDisplay.setBackgroundColor(new Color(0x000000)); |
| 148 | deviceDisplay.setForegroundColor(new Color(0xffffff)); |
| 149 | deviceDisplay.setResizable(true); |
| 150 | setDeviceSize(deviceDisplay, 640, 480); |
| 151 | MIDlet midlet = common.initMIDlet(false); |
| 152 | SwingUtilities.invokeLater(new Runnable() { |
| 153 | public void run() { |
| 154 | MIDletAccess ma = MIDletBridge.getMIDletAccess(midlet); |
| 155 | if (ma != null) { |
| 156 | try { |
| 157 | ma.startApp(); |
| 158 | } catch (MIDletStateChangeException e) { |
| 159 | e.printStackTrace(); |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | }); |
| 164 | |
| 165 | updateDevice(); |
| 166 | } |
| 167 | |
| 168 | protected Component createContents(Container parent) { |
| 169 | devicePanel = new SwingDeviceComponent(); |
nothing calls this directly
no test coverage detected