Rectangle lcdBounds = SkinUtil.adjustLcdGeometry(
lcdCanvas, currentLcdWidth, currentLcdHeight, scale, rotationId,
skinInfo.isPhoneShape());
+ if (lcdBounds == null) {
+ logger.severe("Failed to lcd information for phone shape skin.");
+ SkinUtil.openMessage(shell, null,
+ "Failed to read lcd information for phone shape skin.\n" +
+ "Check the contents of skin dbi file.",
+ SWT.ICON_ERROR, config);
+ System.exit(-1);
+ }
+
+ FormData dataCanvas = new FormData();
+ dataCanvas.left = new FormAttachment(0, lcdBounds.x);
+ dataCanvas.top = new FormAttachment(0, lcdBounds.y);
+ dataCanvas.width = lcdBounds.width;
+ dataCanvas.height = lcdBounds.height;
+ lcdCanvas.setLayoutData(dataCanvas);
if (skinInfo.isPhoneShape() == false) {
// /* folding button */
RotationType rotation = SkinRotation.getRotation(rotationId);
LcdType lcd = rotation.getLcd(); /* from dbi */
+ if (lcd == null) {
+ return null;
+ }
+
RegionType region = lcd.getRegion();
+ if (region == null) {
+ return null;
+ }
Integer left = region.getLeft();
Integer top = region.getTop();
lcdBounds.height = (int) (height * convertedScale);
}
- FormData data = new FormData();
- data.left = new FormAttachment(0, lcdBounds.x);
- data.top = new FormAttachment(0, lcdBounds.y);
- data.width = lcdBounds.width;
- data.height = lcdBounds.height;
- lcdCanvas.setLayoutData(data);
-
return lcdBounds;
}