From: GiWoong Kim Date: Mon, 15 Jul 2013 10:52:04 +0000 (+0900) Subject: skin: Key Window is docked when PhoneShapeSkin is moved X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~902 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe23f024325e606e8248d24ad7860fd03994267c;p=sdk%2Femulator%2Fqemu.git skin: Key Window is docked when PhoneShapeSkin is moved Key Window is docked when PhoneShapeSkin is moved Change-Id: I2df17a62c814a91899a96dad40b7576a36cd29b0 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index ef3f5becba..6d2c7f1ef5 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -1262,7 +1262,7 @@ public class EmulatorSkin { final MenuItem scaleThreeQtrItem = new MenuItem(menu, SWT.RADIO); scaleThreeQtrItem.setText("3/4x"); scaleThreeQtrItem.setData(Scale.SCALE_75); - scaleList.add( scaleThreeQtrItem ); + scaleList.add(scaleThreeQtrItem); final MenuItem scalehalfItem = new MenuItem(menu, SWT.RADIO); scalehalfItem.setText("1/2x"); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java index d50a289a7f..fe13555a15 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java @@ -153,7 +153,7 @@ public class EmulatorSkinMain { logger.severe("Fail to load skin information file."); Shell temp = new Shell(Display.getDefault()); - MessageBox messageBox = new MessageBox( temp, SWT.ICON_ERROR ); + MessageBox messageBox = new MessageBox(temp, SWT.ICON_ERROR); messageBox.setText("Emulator"); messageBox.setMessage("Fail to load \"" + SKIN_INFO_FILE_NAME + "\" file\n" + "Check if the file is corrupted or missing from the following path.\n" + @@ -200,7 +200,7 @@ public class EmulatorSkinMain { EmulatorConfig.validateSkinConfigProperties(configProperties); /* load dbi file */ - EmulatorUI dbiContents = loadDbi(skinPath); + EmulatorUI dbiContents = loadXMLForSkin(skinPath); if (null == dbiContents) { logger.severe("Fail to load dbi file."); @@ -439,7 +439,7 @@ public class EmulatorSkinMain { return map; } - private static EmulatorUI loadDbi(String skinPath) { + private static EmulatorUI loadXMLForSkin(String skinPath) { String dbiPath = skinPath + File.separator + DBI_FILE_NAME; logger.info("load dbi file from " + dbiPath); @@ -447,25 +447,22 @@ public class EmulatorSkinMain { EmulatorUI emulatorUI = null; try { - fis = new FileInputStream(dbiPath); - logger.info( "============ dbi contents ============" ); - byte[] bytes = IOUtil.getBytes( fis ); - logger.info( new String( bytes, "UTF-8" ) ); - logger.info( "=======================================" ); - - emulatorUI = JaxbUtil.unmarshal( bytes, EmulatorUI.class ); - - } catch ( IOException e ) { - logger.log( Level.SEVERE, e.getMessage(), e ); - } catch ( JaxbException e ) { - logger.log( Level.SEVERE, e.getMessage(), e ); + logger.info("============ dbi contents ============"); + byte[] bytes = IOUtil.getBytes(fis); + logger.info(new String(bytes, "UTF-8")); + logger.info("======================================="); + + emulatorUI = JaxbUtil.unmarshal(bytes, EmulatorUI.class); + } catch (IOException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + } catch (JaxbException e) { + logger.log(Level.SEVERE, e.getMessage(), e); } finally { - IOUtil.close( fis ); + IOUtil.close(fis); } return emulatorUI; - } private static Properties loadProperties( String filePath, boolean create ) { diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/PhoneShapeSkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/PhoneShapeSkinComposer.java index b1e85598e8..341321405d 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/PhoneShapeSkinComposer.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/PhoneShapeSkinComposer.java @@ -333,6 +333,11 @@ public class PhoneShapeSkinComposer implements ISkinComposer { int y = previousLocation.y + (e.y - grabPosition.y); shell.setLocation(x, y); + + if (skin.keyWindow != null) { + skin.keyWindow.redock(false, false); + } + return; } @@ -394,6 +399,11 @@ public class PhoneShapeSkinComposer implements ISkinComposer { isGrabbedShell = false; grabPosition.x = grabPosition.y = 0; + if (skin.keyWindow != null) { + skin.keyWindow.redock(false, true); + } + + /* HW key handling */ HWKey pressedHWKey = currentState.getCurrentPressedHWKey(); if (pressedHWKey == null) { return; @@ -430,6 +440,7 @@ public class PhoneShapeSkinComposer implements ISkinComposer { grabPosition.x = e.x; grabPosition.y = e.y; + /* HW key handling */ final HWKey hwKey = SkinUtil.getHWKey(e.x, e.y, currentState.getCurrentRotationId(), currentState.getCurrentScale()); if (hwKey == null) {