From e22f2954cb0a0d03d5fae5c327c2c7ed8c03dd58 Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Mon, 17 Dec 2012 21:01:58 +0900 Subject: [PATCH] skin: hide a emulator shell hide a shell while emulator rotation/scaling Signed-off-by: GiWoong Kim --- .../org/tizen/emulator/skin/EmulatorSkin.java | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) 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 f642830a7a..876dc1e013 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 @@ -1159,25 +1159,25 @@ public class EmulatorSkin { SelectionAdapter selectionAdapter = new SelectionAdapter() { @Override - public void widgetSelected( SelectionEvent e ) { + public void widgetSelected(SelectionEvent e) { MenuItem item = (MenuItem) e.getSource(); boolean selection = item.getSelection(); - if ( !selection ) { + if (!selection) { return; } - if ( !communicator.isSensorDaemonStarted() ) { + if (!communicator.isSensorDaemonStarted()) { /* roll back a selection */ - item.setSelection( false ); + item.setSelection(false); - for ( MenuItem m : rotationList ) { + for (MenuItem m : rotationList) { short rotationId = (Short) m.getData(); if (currentState.getCurrentRotationId() == rotationId) { - m.setSelection( true ); + m.setSelection(true); break; } } @@ -1190,8 +1190,20 @@ public class EmulatorSkin { short rotationId = ((Short) item.getData()); + Point location = new Point(100, 100); + if (skinInfo.isPhoneShape()) { /* TODO: */ + location = shell.getLocation(); + shell.setVisible(false); + } + skinComposer.arrangeSkin(currentState.getCurrentScale(), rotationId); + if (skinInfo.isPhoneShape()) { /* TODO: */ + shell.setVisible(true); + shell.setLocation(location); + SkinUtil.setTopMost(shell, isOnTop); + } + LcdStateData lcdStateData = new LcdStateData(currentState.getCurrentScale(), rotationId); communicator.sendToQEMU(SendCommand.CHANGE_LCD_STATE, lcdStateData); @@ -1205,7 +1217,7 @@ public class EmulatorSkin { return menu; } - private Menu createScaleMenu(Shell shell) { + private Menu createScaleMenu(final Shell shell) { Menu menu = new Menu(shell, SWT.DROP_DOWN); @@ -1234,20 +1246,32 @@ public class EmulatorSkin { SelectionAdapter selectionAdapter = new SelectionAdapter() { @Override - public void widgetSelected( SelectionEvent e ) { + public void widgetSelected(SelectionEvent e) { MenuItem item = (MenuItem) e.getSource(); boolean selection = item.getSelection(); - if ( !selection ) { + if (!selection) { return; } int scale = ((Scale) item.getData()).value(); + Point location = new Point(100, 100); + if (skinInfo.isPhoneShape()) { /* TODO: */ + location = shell.getLocation(); + shell.setVisible(false); + } + skinComposer.arrangeSkin(scale, currentState.getCurrentRotationId()); + if (skinInfo.isPhoneShape()) { /* TODO: */ + shell.setVisible(true); + shell.setLocation(location); + SkinUtil.setTopMost(shell, isOnTop); + } + LcdStateData lcdStateData = new LcdStateData(scale, currentState.getCurrentRotationId()); communicator.sendToQEMU(SendCommand.CHANGE_LCD_STATE, lcdStateData); @@ -1255,19 +1279,17 @@ public class EmulatorSkin { } }; - for ( MenuItem menuItem : scaleList ) { + for (MenuItem menuItem : scaleList) { - int scale = ( (Scale) menuItem.getData() ).value(); + int scale = ((Scale) menuItem.getData()).value(); if (currentState.getCurrentScale() == scale) { - menuItem.setSelection( true ); + menuItem.setSelection(true); } - menuItem.addSelectionListener( selectionAdapter ); - + menuItem.addSelectionListener(selectionAdapter); } return menu; - } private Menu createDiagnosisMenu(Shell shell) { -- 2.34.1