MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / setDeviceSize

Method setDeviceSize

desktop/src/main/java/org/microemu/app/Main.java:176–200  ·  view source on GitHub ↗
(DeviceDisplayImpl deviceDisplay, int width, int height)

Source from the content-addressed store, hash-verified

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();

Callers 2

MainMethod · 0.95
componentResizedMethod · 0.95

Calls 14

getDeviceMethod · 0.95
getPaintableMethod · 0.95
getMIDletAccessMethod · 0.95
getDisplayAccessMethod · 0.95
sizeChangedMethod · 0.95
elementsMethod · 0.80
getDisplayComponentMethod · 0.80
getSoftButtonsMethod · 0.65
setDisplayPaintableMethod · 0.65
setDisplayRectangleMethod · 0.65
initMethod · 0.65
repaintMethod · 0.65

Tested by

no test coverage detected