vm property: delete Resolution class
authorjihye424.kim <jihye424.kim@samsung.com>
Sat, 7 Nov 2015 02:50:41 +0000 (11:50 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Sat, 7 Nov 2015 02:50:41 +0000 (11:50 +0900)
- delete Resolution class <- auto generate class from xml (xsd) file

Change-Id: Ia549ff475529366b4dc99f4a4c75d80ed0583b77
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/devices/DeviceTemplateValue.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ResolutionSubItem.java
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 3ed51d5..c2e4cce 100644 (file)
@@ -154,8 +154,8 @@ public class DeviceTemplateValue implements Cloneable {
                        displayDPI = calculatorDPI();
 
                        for (RESOLUTION r : RESOLUTION.values()) {
-                               if (r.getResolution().getWidth() == displayWidth
-                                               && r.getResolution().getHeight() == displayHeight) {
+                               if (r.getWidth() == displayWidth
+                                               && r.getHeight() == displayHeight) {
                                        resolution = r;
                                        break;
                                }
@@ -320,8 +320,8 @@ public class DeviceTemplateValue implements Cloneable {
 
        public void setResolution(RESOLUTION resolution) {
                this.resolution = resolution;
-               displayWidth = resolution.getResolution().getWidth();
-               displayHeight = resolution.getResolution().getHeight();
+               displayWidth = resolution.getWidth();
+               displayHeight = resolution.getHeight();
                displayDPI = calculatorDPI();
        }
 
index a979667..0160331 100644 (file)
@@ -236,8 +236,8 @@ public class ResolutionSubItem {
 
        private void setResolutionTextBox() {
                if (resolution != null) {
-                       displayWidth = String.valueOf(resolution.getResolution().getWidth());
-                       displayHeight = String.valueOf(resolution.getResolution().getHeight());
+                       displayWidth = String.valueOf(resolution.getWidth());
+                       displayHeight = String.valueOf(resolution.getHeight());
                        widthTextBox.setText(displayWidth);
                        heightTextBox.setText(displayHeight);
                }
@@ -310,8 +310,8 @@ public class ResolutionSubItem {
                }
                int width = Integer.parseInt(displayWidth);
                int height = Integer.parseInt(displayHeight);
-               if (width == resolution.getResolution().getWidth()
-                               && height == resolution.getResolution().getHeight()) {
+               if (width == resolution.getWidth()
+                               && height == resolution.getHeight()) {
                        if (isCustomResolution) {
                                isCustomResolution = false;
                                selectResolutionCombo(true);
@@ -321,8 +321,8 @@ public class ResolutionSubItem {
 
                // is in res list ?
                for (RESOLUTION res : resList) {
-                       if (width == res.getResolution().getWidth()
-                                       && height == res.getResolution().getHeight()) {
+                       if (width == res.getWidth()
+                                       && height == res.getHeight()) {
                                if (!isCustomResolution) {
                                        return;
                                }
index beaac16..26e12ce 100644 (file)
@@ -342,8 +342,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 78dbaf1..b60be0f 100644 (file)
@@ -61,7 +61,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 e321f76..d7ee76f 100644 (file)
@@ -358,8 +358,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;
                        }