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;
}
public void setResolution(RESOLUTION resolution) {
this.resolution = resolution;
- displayWidth = resolution.getResolution().getWidth();
- displayHeight = resolution.getResolution().getHeight();
+ displayWidth = resolution.getWidth();
+ displayHeight = resolution.getHeight();
displayDPI = calculatorDPI();
}
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);
}
}
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);
// 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;
}
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$
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;
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$
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;
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;
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;
}
return type;
}
- public Resolution getResolution() {
- return resolution;
- }
-
public String getStrValue() {
return strValue;
}
return strTypeValue;
}
+ @Override
public String toString() {
return strTypeValue;
}
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;
}