(DeviceDisplayImpl deviceDisplay, int width, int height)
| 174 | } |
| 175 | |
| 176 | public static void setDeviceSize(DeviceDisplayImpl deviceDisplay, int width, int height) { |
| 177 | // move the soft buttons |
| 178 | int menuh = 0; |
| 179 | Enumeration en = DeviceFactory.getDevice().getSoftButtons().elements(); |
| 180 | while (en.hasMoreElements()) { |
| 181 | SoftButton button = (SoftButton) en.nextElement(); |
| 182 | Rectangle paintable = button.getPaintable(); |
| 183 | paintable.y = height - paintable.height; |
| 184 | menuh = paintable.height; |
| 185 | } |
| 186 | // resize the display area |
| 187 | deviceDisplay.setDisplayPaintable(new Rectangle(0, 0, width, height - menuh)); |
| 188 | deviceDisplay.setDisplayRectangle(new Rectangle(0, 0, width, height)); |
| 189 | ((SwingDisplayComponent) devicePanel.getDisplayComponent()).init(); |
| 190 | // update display |
| 191 | MIDletAccess ma = MIDletBridge.getMIDletAccess(); |
| 192 | if (ma == null) { |
| 193 | return; |
| 194 | } |
| 195 | DisplayAccess da = ma.getDisplayAccess(); |
| 196 | if (da != null) { |
| 197 | da.sizeChanged(); |
| 198 | deviceDisplay.repaint(0, 0, deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight()); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | protected void updateDevice() { |
| 203 | devicePanel.init(); |
no test coverage detected