vm property: delete Resolution class
authorjihye424.kim <jihye424.kim@samsung.com>
Sat, 7 Nov 2015 02:50:41 +0000 (11:50 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 20 Jan 2016 05:05:28 +0000 (14:05 +0900)
- delete Resolution class <- auto generate class from xml (xsd) file

Conflicts:
        src/org/tizen/emulator/manager/devices/DeviceTemplateValue.java
        src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ResolutionSubItem.java

Change-Id: Ia549ff475529366b4dc99f4a4c75d80ed0583b77
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
(cherry picked from commit 51588e743f19ef1b3193f3f07aa56f2fd316314a)

src/org/tizen/emulator/manager/vms/Creator.java
src/org/tizen/emulator/manager/vms/Modifier.java
src/org/tizen/emulator/manager/vms/RESOLUTION.java
src/org/tizen/emulator/manager/vms/VMPropertyValue.java

index e06c2ca..a3f9d88 100644 (file)
@@ -333,8 +333,8 @@ public class Creator {
 
                ec.getDevice().setDisplay(factory.createDisplayType());
                ec.getDevice().getDisplay().setResolution(factory.createDisplayTypeResolution());
-               ec.getDevice().getDisplay().getResolution().setWidth(newVM.resolution.getResolution().getWidth());
-               ec.getDevice().getDisplay().getResolution().setHeight(newVM.resolution.getResolution().getHeight());
+               ec.getDevice().getDisplay().getResolution().setWidth(newVM.resolution.getWidth());
+               ec.getDevice().getDisplay().getResolution().setHeight(newVM.resolution.getHeight());
 
                ec.getDevice().getDisplay().setDensity(factory.createDisplayTypeDensity());
                ec.getDevice().getDisplay().getDensity().setUnit("dpi"); //$NON-NLS-1$
index bc0997b..fea7e77 100644 (file)
@@ -51,7 +51,8 @@ public class Modifier {
                        oldVM.resolutionType.setWidth(Integer.valueOf(newVM.resolution.substring(0,i)));
                        oldVM.resolutionType.setHeight(Integer.valueOf(newVM.resolution.substring(i+1,newVM.resolution.length())));
                        */
-                       property.getConfiguration().getDevice().getDisplay().setResolution(newVM.resolution.getResolution());
+                       property.getConfiguration().getDevice().getDisplay().getResolution().setWidth(newVM.resolution.getWidth());
+                       property.getConfiguration().getDevice().getDisplay().getResolution().setHeight(newVM.resolution.getHeight());
                        /*
                        if (newVM.keyType == 1) { // 1key
                                newVM.skinPath = FilePath.getInstance().getDefaultSkinPath() + File.separator + "emul_" + newVM.resolution;
index 122702b..7e63e88 100644 (file)
@@ -31,8 +31,6 @@ package org.tizen.emulator.manager.vms;
 
 import java.util.ArrayList;
 
-import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
-
 public class RESOLUTION {
        public static RESOLUTION MINI = new RESOLUTION(320, 320, "", 316); //$NON-NLS-1$
        public static RESOLUTION HVGA = new RESOLUTION(320, 480,"HVGA", 160); //$NON-NLS-1$
@@ -45,7 +43,8 @@ public class RESOLUTION {
        public static RESOLUTION WQXGA = new RESOLUTION(2560, 1600, "WQXGA", 301); //$NON-NLS-1$
        public static RESOLUTION R_360_480 = new RESOLUTION(360, 480, "", 316); //$NON-NLS-1$
 
-       private Resolution resolution;
+       private int width = 0;
+       private int height = 0;
        private String type;
        private int dpi;
        private String strValue;
@@ -54,9 +53,8 @@ public class RESOLUTION {
        private static ArrayList<RESOLUTION> values;
 
        public RESOLUTION(int width, int height, String type, int dpi) {
-               this.resolution = new Resolution();
-               resolution.setWidth(width);
-               resolution.setHeight(height);
+               setWidth(width);
+               setHeight(height);
                this.type = type;
                this.dpi = dpi;
 
@@ -74,6 +72,22 @@ public class RESOLUTION {
                values.add(this);
        }
 
+       public int getWidth() {
+               return width;
+       }
+
+       public void setWidth(int width) {
+               this.width = width;
+       }
+
+       public int getHeight() {
+               return height;
+       }
+
+       public void setHeight(int height) {
+               this.height = height;
+       }
+
        public int getDPI() {
                return dpi;
        }
@@ -82,10 +96,6 @@ public class RESOLUTION {
                return type;
        }
 
-       public Resolution getResolution() {
-               return resolution;
-       }
-
        public String getStrValue() {
                return strValue;
        }
@@ -94,6 +104,7 @@ public class RESOLUTION {
                return strTypeValue;
        }
 
+       @Override
        public String toString() {
                return strTypeValue;
        }
index 2c4fbb6..2c6ec03 100644 (file)
@@ -336,8 +336,8 @@ public class VMPropertyValue implements Cloneable {
                Resolution re = null;
                for (RESOLUTION d : RESOLUTION.values()) {
                        re = property.getConfiguration().getDevice().getDisplay().getResolution();
-                       if (d.getResolution().getWidth() == re.getWidth()
-                                       && d.getResolution().getHeight() == re.getHeight()) {
+                       if (d.getWidth() == re.getWidth()
+                                       && d.getHeight() == re.getHeight()) {
                                resolution = d;
                                break;
                        }