} catch (ScreenShotException ex) {
screenShotDialog = null;
-
logger.log(Level.SEVERE, ex.getMessage(), ex);
+
SkinUtil.openMessage(shell, null,
"Fail to create a screen shot.", SWT.ICON_ERROR, config);
} catch (Exception ex) {
screenShotDialog = null;
-
- /* defense exception handling */
logger.log(Level.SEVERE, ex.getMessage(), ex);
- String errorMessage = "Internal Error.\n[" + ex.getMessage() + "]";
- SkinUtil.openMessage(shell, null, errorMessage, SWT.ICON_ERROR, config);
+
+ SkinUtil.openMessage(shell, null, "ScreenShot is not ready.\n" +
+ "Please wait until the emulator is completely boot up.",
+ SWT.ICON_WARNING, config);
}
}
screenShotDialog.open();
} catch (ScreenShotException ex) {
+ screenShotDialog = null;
logger.log(Level.SEVERE, ex.getMessage(), ex);
+
SkinUtil.openMessage(shell, null,
"Fail to create a screen shot.", SWT.ICON_ERROR, config);
} catch (Exception ex) {
- // defense exception handling.
+ screenShotDialog = null;
logger.log(Level.SEVERE, ex.getMessage(), ex);
- String errorMessage = "Internal Error.\n[" + ex.getMessage() + "]";
- SkinUtil.openMessage(shell, null, errorMessage, SWT.ICON_ERROR, config);
- } finally {
- screenShotDialog = null;
+ SkinUtil.openMessage(shell, null, "ScreenShot is not ready.\n" +
+ "Please wait until the emulator is completely boot up.",
+ SWT.ICON_WARNING, config);
}
}
}
@Override
public void widgetSelected(SelectionEvent e) {
if (!communicator.isSensorDaemonStarted()) {
- SkinUtil.openMessage(shell, null,
- "SDB is not ready.\nPlease wait until the emulator is completely boot up.",
+ SkinUtil.openMessage(shell, null, "SDB is not ready.\n" +
+ "Please wait until the emulator is completely boot up.",
SWT.ICON_WARNING, config);
return;
}
EmulatorConfig config, Image icon) throws ScreenShotException {
super(parent, communicator, emulatorSkin, config, icon);
}
-
+
protected void capture() throws ScreenShotException {
DataTranfer dataTranfer = communicator.sendToQEMU( SendCommand.SCREEN_SHOT, null, true );
byte[] receivedData = communicator.getReceivedData( dataTranfer );