Platform: remove total platform
authorjihye424.kim <jihye424.kim@samsung.com>
Tue, 12 May 2015 03:05:38 +0000 (12:05 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Tue, 12 May 2015 03:11:44 +0000 (12:11 +0900)
- remove TotalPlatform class
- change 'all' string to 'StringResources.TotalProfile'

Change-Id: I8e516a3d88acffa3df70bed569bad17d496299ce
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
common-project/src/org/tizen/emulator/manager/platform/PlatformList.java
common-project/src/org/tizen/emulator/manager/platform/ProfileList.java
common-project/src/org/tizen/emulator/manager/platform/TotalPlatform.java [deleted file]
common-project/src/org/tizen/emulator/manager/resources/StringResources.java
common-project/src/org/tizen/emulator/manager/ui/VMsListView.java
common-project/src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabFolder.java
common-project/src/org/tizen/emulator/manager/ui/tabfolder/ProfileTabFolder.java

index 5fe3171..a3dbc4a 100644 (file)
@@ -51,7 +51,6 @@ public class PlatformList {
        }
 
        private static ArrayList<CustomPlatform> customList = new ArrayList<CustomPlatform>();
-       private static TotalPlatform total = new TotalPlatform();
 
        private static ArrayList<String> profileList = new ArrayList<String>();
 
@@ -59,10 +58,6 @@ public class PlatformList {
                return customList;
        }
 
-       public static TotalPlatform getTotalPlatform() {
-               return total;
-       }
-
        private static void makeCustomPlatformList() {
                int profileCount = profileList.size();
                if (profileCount == 0) {
@@ -217,8 +212,6 @@ public class PlatformList {
                        // init vm worker
                        prop.initVMWorker();
                }
-
-               total.settingVMProperty();
        }
 
        private static void checkingBaseImageBinaryVersion() {
index 12ffe78..acfc2fc 100644 (file)
@@ -47,7 +47,7 @@ import org.tizen.emulator.manager.vms.helper.VMWorkerException;
 public class ProfileList {
        private static ArrayList<Profile> profileList = null;
        // TODO
-       private static Profile totalProfile = new Profile("all");
+       private static Profile totalProfile = new Profile(StringResources.TOTAL_PROFILE);
 
        public static ArrayList<Profile> getProfileList() {
                if (profileList == null) {
diff --git a/common-project/src/org/tizen/emulator/manager/platform/TotalPlatform.java b/common-project/src/org/tizen/emulator/manager/platform/TotalPlatform.java
deleted file mode 100644 (file)
index 43e2173..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Emulator Manager
- *
- * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * JiHye Kim <jihye1128.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * SeokYeon Hwang <syeon.hwang@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-package org.tizen.emulator.manager.platform;
-
-import java.io.IOException;
-
-import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.vms.VMProperty;
-
-public class TotalPlatform extends Platform {
-       private CustomBaseImage image = null;
-       public TotalPlatform() {
-               this.platformName = "all";
-               this.platformPath = "";
-               try {
-                       image = new CustomBaseImage(this, "allImage", "x86", PlatformStringResources.MobileProfile);
-               } catch (IOException e) {
-                       // TODO
-                       EMLogger.getLogger().warning("Error: " + e.getMessage());
-               }
-       }
-
-       public void settingVMProperty() {
-               if (image == null) {
-                       return;
-               }
-               image.getVmsList().clear();
-               for (Platform p : PlatformList.getPlatformList()) {
-                       for (BaseImage base : p.getImageList()) {
-                               for (VMProperty prop : base.getVmsList()) {
-                                       image.addVMsProperty(prop);
-                               }
-                       }
-               }
-
-               for (CustomPlatform p : PlatformList.getCustomPlatform()) {
-                       for (BaseImage base : p.getImageList()) {
-                               for (VMProperty prop : base.getVmsList()) {
-                                       image.addVMsProperty(prop);
-                               }
-                       }
-               }
-               this.getImageList().add(image);
-       }
-}
index 1f354a9..e128f99 100644 (file)
@@ -101,7 +101,8 @@ public class StringResources {
        public static final String SKIN_PRIORITY = "manager.priority";
        public static final String SKIN_GENERAL = "all";
        public static final String SKIN_PHONE_SHAPE = "shape";
-       public static final String SKIN_PROFILE="skin.profile";
+       public static final String SKIN_PROFILE = "skin.profile";
+       public static final String SKIN_SHAPE = "skin.shape";
        // SD card
        public static final String SD_CARD_DIR = "sdcard";
        public static final String[] SD_CARD = {"sdcard_ext4_4G.img", "sdcard_ext4_8G.img", "sdcard_ext4_16G.img","sdcard_ext4_32G.img"};
@@ -116,4 +117,6 @@ public class StringResources {
        public static final String NEW_LINE = System.getProperty("line.separator");
 
        public static final String EMULATOR_LOG = "emulator.log";
+
+       public static final String TOTAL_PROFILE = "all";
 }
index a79666b..706f475 100644 (file)
@@ -41,9 +41,9 @@ import org.eclipse.swt.widgets.Composite;
 import org.tizen.emulator.manager.platform.BaseImage;
 import org.tizen.emulator.manager.platform.Platform;
 import org.tizen.emulator.manager.platform.Profile;
-import org.tizen.emulator.manager.platform.TotalPlatform;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.list.AbstractListView;
 import org.tizen.emulator.manager.ui.list.ExtendTreeListView;
 import org.tizen.emulator.manager.ui.list.ItemListVew;
@@ -192,7 +192,7 @@ public class VMsListView {
                        treeButton.setSelection(true);
                        itemButton.setSelection(false);
                        // TODO
-                       if (VMsMainView.getInstance().getProfile().getName().equals("all")) {
+                       if (VMsMainView.getInstance().getProfile().getName().equals(StringResources.TOTAL_PROFILE)) {
                                itemButton.setEnabled(false);
                                TopListView = extendTreeListView;
                        } else {
@@ -234,41 +234,31 @@ public class VMsListView {
        }
 
        public void drawPlatform(Platform platform, int imageIndex, boolean isRefresh) {
-               if (platform instanceof TotalPlatform) {
-                       if (!isRefresh) {
-                               itemButton.setEnabled(false);
-                               selectRadioButton(true);
-                       }
+               if (!isRefresh) {
+                       itemButton.setEnabled(true);
+                       selectRadioButton(false);
+               }
+
+               if (!platform.getImageList().isEmpty()) {
                        imageCombo.removeAll();
-                       imageCombo.setEnabled(false);
-                       imageCombo.layout();
-               } else {
-                       if (!isRefresh) {
-                               itemButton.setEnabled(true);
-                               selectRadioButton(false);
+                       imageCombo.setEnabled(true);
+                       for (BaseImage image : platform.getImageList()) {
+                               imageCombo.add(image.getName());
                        }
-
-                       if (!platform.getImageList().isEmpty()) {
-                               imageCombo.removeAll();
-                               imageCombo.setEnabled(true);
-                               for (BaseImage image : platform.getImageList()) {
-                                       imageCombo.add(image.getName());
-                               }
-                               if (imageIndex >= imageCombo.getItemCount()) {
-                                       imageIndex = 0;
-                               }
-                               imageCombo.select(imageIndex);
-                       } else {
-                               // TODO
-                               return;
+                       if (imageIndex >= imageCombo.getItemCount()) {
+                               imageIndex = 0;
                        }
+                       imageCombo.select(imageIndex);
+               } else {
+                       // TODO
+                       return;
                }
 
                TopListView.drawPlatform(platform, imageIndex);
        }
 
        public void drawProfile(Profile profile, boolean isRefresh) {
-               if (profile.getName().equals("all")) { // TODO
+               if (profile.getName().equals(StringResources.TOTAL_PROFILE)) { // TODO
                        if (!isRefresh) {
                                itemButton.setEnabled(false);
                                selectRadioButton(true);
index 62dacef..b894fb2 100644 (file)
@@ -44,6 +44,7 @@ import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.SettingInfoFile;
 import org.tizen.emulator.manager.ui.VMsMainView;
 import org.tizen.emulator.manager.ui.widgets.ImageButton;
@@ -217,7 +218,7 @@ public class PlatformTabFolder {
                                        // draw main view using selected platform
                                        items.get(i).draw();
                                        // this is temp code..please fix me
-                                       if (items.get(i).getPlatform().getName().equals("all")) {
+                                       if (items.get(i).getPlatform().getName().equals(StringResources.TOTAL_PROFILE)) {
                                                items.get(i).draw();
                                        }
                                        contentsComposite.layout(true, false);
index 2a8d9a2..08be90e 100644 (file)
@@ -45,6 +45,7 @@ import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.SettingInfoFile;
 import org.tizen.emulator.manager.ui.VMsMainView;
 import org.tizen.emulator.manager.ui.widgets.ImageButton;
@@ -210,7 +211,7 @@ public class ProfileTabFolder {
                                        items.get(i).draw();
 
                                        // this is temp code..please fix me
-                                       if (items.get(i).getProfile().getName().equals("all")) {
+                                       if (items.get(i).getProfile().getName().equals(StringResources.TOTAL_PROFILE)) {
                                                items.get(i).draw();
                                        }