skin: delete unused code
authorGiWoong Kim <giwoong.kim@samsung.com>
Thu, 26 Sep 2013 03:19:28 +0000 (12:19 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Thu, 26 Sep 2013 03:19:58 +0000 (12:19 +0900)
Change-Id: Ice43b09a9dcb7da146cd103e4caa85ccfbf7df59
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinState.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/ProfileSpecificSkinComposer.java

index 4a7e86c364bb69e9ff35ca981db2551999dbe2ba..54242ae9964f8c02e13ff079cdf5ada8c59bf47d 100755 (executable)
@@ -107,25 +107,6 @@ import org.tizen.emulator.skin.util.SwtUtil;
  *
  */
 public class EmulatorSkin {
-
-       public class SkinReopenPolicy {
-               private EmulatorSkin reopenSkin;
-               private boolean reopen;
-
-               private SkinReopenPolicy(EmulatorSkin reopenSkin, boolean reopen) {
-                       this.reopenSkin = reopenSkin;
-                       this.reopen = reopen;
-               }
-
-               public EmulatorSkin getReopenSkin() {
-                       return reopenSkin;
-               }
-
-               public boolean isReopen() {
-                       return reopen;
-               }
-       }
-
        public enum SkinBasicColor {
                BLUE(0, 174, 239),
                YELLOW(246, 226, 0),
@@ -153,8 +134,8 @@ public class EmulatorSkin {
                }
        }
 
-       private static Logger logger = SkinLogger.getSkinLogger(EmulatorSkin.class)
-                       .getLogger();
+       private static Logger logger =
+                       SkinLogger.getSkinLogger(EmulatorSkin.class).getLogger();
 
        protected EmulatorConfig config;
        protected Shell shell;
@@ -168,7 +149,6 @@ public class EmulatorSkin {
 
        protected boolean isDisplayDragging;
        protected boolean isShutdownRequested;
-       private boolean isAboutToReopen;
        public boolean isOnTop;
        public boolean isKeyWindow;
        public boolean isOnKbd;
@@ -195,8 +175,6 @@ public class EmulatorSkin {
        private FocusListener canvasFocusListener;
        private LinkedList<KeyEventData> pressedKeyEventList;
 
-       private EmulatorSkin reopenSkin;
-
        /**
         * @brief constructor
         * @param config : configuration of emulator skin
@@ -308,43 +286,6 @@ public class EmulatorSkin {
                return 0;
        }
 
-       // private void readyToReopen( EmulatorSkin sourceSkin, boolean isOnTop ) {
-       //
-       // logger.info( "Start Changing AlwaysOnTop status" );
-       //
-       // sourceSkin.reopenSkin = new EmulatorSkin( sourceSkin.config, isOnTop );
-       //
-       // sourceSkin.reopenSkin.lcdCanvas = sourceSkin.lcdCanvas;
-       // Point previousLocation = sourceSkin.shell.getLocation();
-       //
-       // sourceSkin.reopenSkin.composeInternal( sourceSkin.lcdCanvas,
-       // previousLocation.x, previousLocation.y,
-       // sourceSkin.currentLcdWidth, sourceSkin.currentLcdHeight,
-       // sourceSkin.currentScale,
-       // sourceSkin.currentRotationId, sourceSkin.isOnKbd );
-       //
-       // sourceSkin.reopenSkin.windowHandleId = sourceSkin.windowHandleId;
-       //
-       // sourceSkin.reopenSkin.communicator = sourceSkin.communicator;
-       // sourceSkin.reopenSkin.communicator.resetSkin( reopenSkin );
-       //
-       // sourceSkin.isAboutToReopen = true;
-       // sourceSkin.isShutdownRequested = true;
-       //
-       // if ( sourceSkin.isScreenShotOpened && ( null !=
-       // sourceSkin.screenShotDialog ) ) {
-       // sourceSkin.screenShotDialog.setReserveImage( true );
-       // sourceSkin.screenShotDialog.setEmulatorSkin( reopenSkin );
-       // reopenSkin.isScreenShotOpened = true;
-       // reopenSkin.screenShotDialog = sourceSkin.screenShotDialog;
-       // // see open() method to know next logic for screenshot dialog.
-       // }
-       //
-       // sourceSkin.lcdCanvas.setParent( reopenSkin.shell );
-       // sourceSkin.shell.close();
-       //
-       // }
-
        private Color loadHoverColor() {
                HoverType hover = config.getDbiContents().getHover();
 
@@ -393,34 +334,21 @@ public class EmulatorSkin {
                return keyWindowKeeper;
        }
 
-       public SkinReopenPolicy open() {
+       public void open() {
                if (null == this.communicator) {
                        logger.severe("communicator is null.");
-                       return null;
+                       return;
                }
 
                Display display = this.shell.getDisplay();
 
                this.shell.open();
 
-               // logic only for reopen case ///////
-               // if ( isScreenShotOpened && ( null != screenShotDialog ) ) {
-               // try {
-               // screenShotDialog.setReserveImage( false );
-               // screenShotDialog.open();
-               // } finally {
-               // isScreenShotOpened = false;
-               // }
-               // }
-               // ///////////////////////////////////
-
                while (!shell.isDisposed()) {
                        if (!display.readAndDispatch()) {
                                display.sleep();
                        }
                }
-
-               return new SkinReopenPolicy(reopenSkin, isAboutToReopen);
        }
 
        protected void skinFinalize() {
@@ -439,62 +367,62 @@ public class EmulatorSkin {
                                        removeShellListeners();
                                        removeCanvasListeners();
 
-                                       if (!isAboutToReopen) {
-                                               /* close the screen shot window */
-                                               if (null != screenShotDialog) {
-                                                       Shell scShell = screenShotDialog.getShell();
-                                                       if (!scShell.isDisposed()) {
-                                                               scShell.close();
-                                                       }
-                                                       screenShotDialog = null;
+                                       /* close the screen shot window */
+                                       if (null != screenShotDialog) {
+                                               Shell scShell = screenShotDialog.getShell();
+                                               if (!scShell.isDisposed()) {
+                                                       scShell.close();
                                                }
+                                               screenShotDialog = null;
+                                       }
 
-                                               /* save config only for emulator close */
-                                               config.setSkinProperty(
-                                                               SkinPropertiesConstants.WINDOW_X,
-                                                               shell.getLocation().x);
-                                               config.setSkinProperty(
-                                                               SkinPropertiesConstants.WINDOW_Y,
-                                                               shell.getLocation().y);
-                                               config.setSkinProperty(
-                                                               SkinPropertiesConstants.WINDOW_SCALE,
-                                                               currentState.getCurrentScale());
-                                               config.setSkinProperty(
-                                                               SkinPropertiesConstants.WINDOW_ROTATION,
-                                                               currentState.getCurrentRotationId());
-                                               config.setSkinProperty(
-                                                               SkinPropertiesConstants.WINDOW_ONTOP,
-                                                               Boolean.toString(isOnTop));
-
-                                               int dockValue = 0;
-                                               SkinWindow keyWindow = getKeyWindowKeeper()
-                                                               .getKeyWindow();
-                                               if (keyWindow != null
-                                                               && keyWindow.getShell().isVisible() == true) {
-                                                       dockValue = getKeyWindowKeeper().getDockPosition();
-                                               }
-                                               config.setSkinProperty(
-                                                               SkinPropertiesConstants.KEYWINDOW_POSITION,
-                                                               dockValue);
-
-                                               config.saveSkinProperties();
+                                       /* save config only for emulator close */
+                                       config.setSkinProperty(
+                                                       SkinPropertiesConstants.WINDOW_X,
+                                                       shell.getLocation().x);
+                                       config.setSkinProperty(
+                                                       SkinPropertiesConstants.WINDOW_Y,
+                                                       shell.getLocation().y);
+                                       config.setSkinProperty(
+                                                       SkinPropertiesConstants.WINDOW_SCALE,
+                                                       currentState.getCurrentScale());
+                                       config.setSkinProperty(
+                                                       SkinPropertiesConstants.WINDOW_ROTATION,
+                                                       currentState.getCurrentRotationId());
+                                       config.setSkinProperty(
+                                                       SkinPropertiesConstants.WINDOW_ONTOP,
+                                                       Boolean.toString(isOnTop));
+
+                                       int dockValue = 0;
+                                       SkinWindow keyWindow = getKeyWindowKeeper().getKeyWindow();
+                                       if (keyWindow != null
+                                                       && keyWindow.getShell().isVisible() == true) {
+                                               dockValue = getKeyWindowKeeper().getDockPosition();
+                                       }
+                                       config.setSkinProperty(
+                                                       SkinPropertiesConstants.KEYWINDOW_POSITION,
+                                                       dockValue);
 
-                                               /* close the Key Window */
-                                               if (getKeyWindowKeeper() != null) {
-                                                       getKeyWindowKeeper().closeKeyWindow();
-                                               }
+                                       config.saveSkinProperties();
 
-                                               /* dispose the color */
-                                               if (colorVM != null) {
-                                                       colorVM.dispose();
-                                               }
+                                       /* close the Key Window */
+                                       if (getKeyWindowKeeper() != null) {
+                                               getKeyWindowKeeper().closeKeyWindow();
                                        }
 
+                                       /* dispose the images */
                                        if (currentState.getCurrentImage() != null) {
                                                currentState.getCurrentImage().dispose();
+                                               currentState.setCurrentImage(null);
                                        }
                                        if (currentState.getCurrentKeyPressedImage() != null) {
                                                currentState.getCurrentKeyPressedImage().dispose();
+                                               currentState.setCurrentKeyPressedImage(null);
+                                       }
+
+                                       /* dispose the color */
+                                       if (colorVM != null) {
+                                               colorVM.dispose();
                                        }
 
                                        if (currentState.getHoverColor() != null) {
@@ -1376,7 +1304,6 @@ public class EmulatorSkin {
                                isOnTop = popupMenu.onTopItem.getSelection();
 
                                logger.info("Select Always On Top : " + isOnTop);
-                               // readyToReopen(EmulatorSkin.this, isOnTop);
 
                                if (SkinUtil.setTopMost(shell, isOnTop) == false) {
                                        logger.info("failed to Always On Top");
@@ -1399,11 +1326,10 @@ public class EmulatorSkin {
 
                final List<MenuItem> rotationList = new ArrayList<MenuItem>();
 
-               Iterator<Entry<Short, RotationType>> iterator = SkinRotation
-                               .getRotationIterator();
+               Iterator<Entry<Short, RotationType>> iterator =
+                               SkinRotation.getRotationIterator();
 
                while (iterator.hasNext()) {
-
                        Entry<Short, RotationType> entry = iterator.next();
                        Short rotationId = entry.getKey();
                        RotationType section = entry.getValue();
@@ -1417,7 +1343,6 @@ public class EmulatorSkin {
                        }
 
                        rotationList.add(menuItem);
-
                }
 
                /* temp : swap rotation menu names */
@@ -1462,7 +1387,6 @@ public class EmulatorSkin {
                                }
 
                                if (!communicator.isSensorDaemonStarted()) {
-
                                        /* roll back a selection */
                                        item.setSelection(false);
 
@@ -1492,8 +1416,7 @@ public class EmulatorSkin {
                                                                currentState.getCurrentScale(), rotationId);
 
                                                /* location correction */
-                                               Rectangle monitorBounds = Display.getDefault()
-                                                               .getBounds();
+                                               Rectangle monitorBounds = Display.getDefault().getBounds();
                                                Rectangle emulatorBounds = shell.getBounds();
                                                shell.setLocation(
                                                                Math.max(emulatorBounds.x, monitorBounds.x),
@@ -1543,7 +1466,6 @@ public class EmulatorSkin {
                SelectionAdapter selectionAdapter = new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
-
                                MenuItem item = (MenuItem) e.getSource();
 
                                boolean selection = item.getSelection();
@@ -1561,8 +1483,7 @@ public class EmulatorSkin {
                                                                currentState.getCurrentRotationId());
 
                                                /* location correction */
-                                               Rectangle monitorBounds = Display.getDefault()
-                                                               .getBounds();
+                                               Rectangle monitorBounds = Display.getDefault().getBounds();
                                                Rectangle emulatorBounds = shell.getBounds();
                                                shell.setLocation(
                                                                Math.max(emulatorBounds.x, monitorBounds.x),
@@ -1579,7 +1500,6 @@ public class EmulatorSkin {
                };
 
                for (MenuItem menuItem : scaleList) {
-
                        int scale = ((Scale) menuItem.getData()).value();
                        if (currentState.getCurrentScale() == scale) {
                                menuItem.setSelection(true);
@@ -1695,9 +1615,7 @@ public class EmulatorSkin {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                if (!communicator.isSensorDaemonStarted()) {
-                                       SkinUtil.openMessage(
-                                                       shell,
-                                                       null,
+                                       SkinUtil.openMessage(shell, null,
                                                        "Host Keyboard is not ready.\n"
                                                                        + "Please wait until the emulator is completely boot up.",
                                                        SWT.ICON_WARNING, config);
@@ -1773,9 +1691,7 @@ public class EmulatorSkin {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                if (!communicator.isSdbDaemonStarted()) {
-                                       SkinUtil.openMessage(
-                                                       shell,
-                                                       null,
+                                       SkinUtil.openMessage(shell, null,
                                                        "SDB is not ready.\n"
                                                                        + "Please wait until the emulator is completely boot up.",
                                                        SWT.ICON_WARNING, config);
@@ -1786,13 +1702,10 @@ public class EmulatorSkin {
 
                                File sdbFile = new File(sdbPath);
                                if (!sdbFile.exists()) {
-                                       logger.log(
-                                                       Level.INFO,
-                                                       "SDB file is not exist : "
-                                                                       + sdbFile.getAbsolutePath());
+                                       logger.info("SDB file does not exist : " + sdbFile.getAbsolutePath());
                                        try {
                                                SkinUtil.openMessage(shell, null,
-                                                               "SDB file is not exist in the following path.\n"
+                                                               "SDB file does not exist in the following path.\n"
                                                                                + sdbFile.getCanonicalPath(),
                                                                SWT.ICON_ERROR, config);
                                        } catch (IOException ee) {
index 4a83ea612f38452377c4198bea31d59f2cde6066..d9d46ac4ee7f9b12e5bdb5368068fbf407ff8d53 100644 (file)
@@ -154,7 +154,7 @@ public class EmulatorSkinState {
                return currentKeyPressedImage;
        }
 
-       public synchronized void setCurrentKeyPressedImag(Image keyPressedImage) {
+       public synchronized void setCurrentKeyPressedImage(Image keyPressedImage) {
                this.currentKeyPressedImage = keyPressedImage;
        }
 
index 04629f4d77052fb2b0d976d94bb7a40553d03e83..0465d3846fc9e98ad2156f251a1640c7a2f54051 100644 (file)
@@ -214,7 +214,7 @@ public class ProfileSpecificSkinComposer implements ISkinComposer {
 
                currentState.setCurrentImage(SkinUtil.createScaledImage(
                                imageRegistry, shell, rotationId, scale, ImageType.IMG_TYPE_MAIN));
-               currentState.setCurrentKeyPressedImag(SkinUtil.createScaledImage(
+               currentState.setCurrentKeyPressedImage(SkinUtil.createScaledImage(
                                imageRegistry, shell, rotationId, scale, ImageType.IMG_TYPE_PRESSED));
 
                if (tempImage != null) {