From: jihye kim Date: Mon, 3 Dec 2012 07:01:23 +0000 (+0900) Subject: [Title] emulator-manager : change default resolution (WVGA, HD) X-Git-Tag: 2.2.1_release^2~72^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37601f0941fb493de3176998f52067062684fadf;p=sdk%2Femulator%2Femulator-manager.git [Title] emulator-manager : change default resolution (WVGA, HD) [Desc.] change default resolution (WVGA, HD) and set x86 image id 0, arm image start 1. [Issue] N/A --- diff --git a/package/changelog b/package/changelog index e1e22eb..e21ecf3 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,8 @@ +* 1.3.64 +- change set of resolution (WVGA, HD) +- set x86 image id 0 (arm image start 1) +== jihye kim 2012-12-03 + * 1.3.63 - change emulator-manager.app for mac == jihye kim 2012-11-29 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index f2c3a2a..0ec6fc9 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Source: emulator-manager -Version: 1.3.63 +Version: 1.3.64 Maintainer: Yeong-Kyoon Lee Package: emulator-manager diff --git a/src/org/tizen/emulator/manager/EmulatorManager.java b/src/org/tizen/emulator/manager/EmulatorManager.java index 9d5a54b..aafebbc 100755 --- a/src/org/tizen/emulator/manager/EmulatorManager.java +++ b/src/org/tizen/emulator/manager/EmulatorManager.java @@ -63,7 +63,7 @@ public class EmulatorManager { private static CommandLineParser processor = null; private static boolean isConsoleMode = true; // for multi touch - private static boolean isInhoseMode = true; + private static boolean isInhoseMode = false; private static RandomAccessFile randomAccessFile; private static boolean isMac = false; diff --git a/src/org/tizen/emulator/manager/image/BaseImage.java b/src/org/tizen/emulator/manager/image/BaseImage.java index 18b1b35..475831a 100644 --- a/src/org/tizen/emulator/manager/image/BaseImage.java +++ b/src/org/tizen/emulator/manager/image/BaseImage.java @@ -40,7 +40,7 @@ import org.tizen.emulator.manager.tool.StringResource; public class BaseImage { private Platform platform; - private String id; + private String id = "x"; private String platformName; private String type; private String name; @@ -53,23 +53,13 @@ public class BaseImage { private String path; private String information; - public BaseImage(Platform platform, File path, int id) throws IOException { + public BaseImage(Platform platform, File path) throws IOException { this.platform = platform; - loadProperty(id, path); + loadProperty(path); settingImagePath(path); - information = getName() + "\n" + - " ID : " + getID() + "\n" + - " Platform : " + getPlatformName() + "\n" + - " Type : " + getType() + "\n" + - " Version : " + getVersion() + "\n" + - " Release Version : " + getRelease() + "\n" + - " Target CPU : " + getCpu().toUpperCase() + "\n" + - " Product Domain : " + getDomain() + "\n" + - " Base Disk Image Path : " + getPath() + "\n"; } - private void loadProperty(int id, File path) throws IOException { - this.id = Integer.toString(id); + private void loadProperty(File path) throws IOException { File f = new File(path + File.separator + StringResource.IMAGE_INFO_FILENAME); FileInputStream inputStream = null; try { @@ -114,6 +104,22 @@ public class BaseImage { throw new IOException("Failed getting image file path."); } } + + void setID(int id) { + this.id = Integer.toString(id); + // + information = getName() + "\n" + + " ID : " + getID() + "\n" + + " Platform : " + getPlatformName() + "\n" + + " Type : " + getType() + "\n" + + " Version : " + getVersion() + "\n" + + " Release Version : " + getRelease() + "\n" + + " Target CPU : " + getCpu().toUpperCase() + "\n" + + " Product Domain : " + getDomain() + "\n" + + " Base Disk Image Path : " + getPath() + "\n"; + // + } + public String getID() { return id; } diff --git a/src/org/tizen/emulator/manager/image/Platform.java b/src/org/tizen/emulator/manager/image/Platform.java index ae5e83a..01dfc94 100644 --- a/src/org/tizen/emulator/manager/image/Platform.java +++ b/src/org/tizen/emulator/manager/image/Platform.java @@ -159,12 +159,11 @@ public class Platform { for (File f : defaultImages.listFiles()) { if (f.isDirectory()) { try { - image = new BaseImage(this, f, ++id); + image = new BaseImage(this, f); for (BaseImage i : imageList) { if (i.getName().equals(image.getName())){ // TODO: duplicate name EMLogger.getLogger().warning("The same name of the base disk image already exist.(name : " + image.getName() + " )"); - --id; throw new IOException(); } } @@ -181,12 +180,11 @@ public class Platform { for (File f : addonsImages.listFiles()) { if (f.isDirectory()) { try { - image = new BaseImage(this, f, ++id); + image = new BaseImage(this, f); for (BaseImage i : imageList) { if (i.getName().equals(image.getName())){ // TODO: duplicate name EMLogger.getLogger().warning("The same name of the base disk image already exist.(name : " + image.getName() + " )"); - --id; throw new IOException(); } } @@ -197,6 +195,19 @@ public class Platform { } } } + + // set image id + for (BaseImage i : imageList) { + if (i.getCpu().equals("x86")) { + i.setID(id++); + break; + } + } + for (BaseImage i : imageList) { + if (!i.getID().equals("0")) { + i.setID(id++); + } + } } diff --git a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java index bae26ce..df28dc6 100644 --- a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java +++ b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java @@ -392,8 +392,11 @@ class ResolutionCombo extends TableWidget { VMCreateHelper helper = new VMCreateHelper(); resolutionCombo = helper.makeCombo(table); - helper.addComboItem(resolutionCombo, DisplayResoultion.getInstance().getList(), - DisplayResoultion.getInstance().findIndex(oldResolution.toString())); + DisplayResolution.getInstance().initialize(oldResolution); + + helper.addComboItem(resolutionCombo, DisplayResolution.getInstance().getList(), + DisplayResolution.getInstance().findIndex(oldResolution.toString())); + resolutionCombo.setToolTipText(resolutionCombo.getItem(resolutionCombo.getSelectionIndex())); return true; } @@ -404,15 +407,14 @@ class ResolutionCombo extends TableWidget { public void widgetSelected(SelectionEvent e) { String re = resolutionCombo.getItem(resolutionCombo.getSelectionIndex()); resolutionCombo.setToolTipText(re); - for (RESOLUTION d : RESOLUTION.values()) { - if (re.equals(d.toString())) { - newResolution = d; - Spinner dpi = (Spinner)(TableWidgetList.getInstance() - .findVMWidget("dpi", isCreateMode()).getWidget()); - dpi.setSelection(d.getDPI()); - SkinCombo skin = (SkinCombo)TableWidgetList.getInstance().findVMWidget("skin", isCreateMode()); - skin.selectResolution(d.getValue()); - } + RESOLUTION d = DisplayResolution.getInstance().findResolution(re); + if (d != null) { + newResolution = d; + Spinner dpi = (Spinner)(TableWidgetList.getInstance() + .findVMWidget("dpi", isCreateMode()).getWidget()); + dpi.setSelection(d.getDPI()); + SkinCombo skin = (SkinCombo)TableWidgetList.getInstance().findVMWidget("skin", isCreateMode()); + skin.selectResolution(d.getValue()); } if (!isCreateMode()) { diff --git a/src/org/tizen/emulator/manager/ui/detail/VMResource.java b/src/org/tizen/emulator/manager/ui/detail/VMResource.java index 5cb5f09..f31e23f 100644 --- a/src/org/tizen/emulator/manager/ui/detail/VMResource.java +++ b/src/org/tizen/emulator/manager/ui/detail/VMResource.java @@ -32,6 +32,8 @@ package org.tizen.emulator.manager.ui.detail; import java.util.ArrayList; +import org.tizen.emulator.manager.EmulatorManager; +import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; import org.tizen.emulator.manager.tool.StringResource; import org.tizen.emulator.manager.vms.RAM_SIZE; import org.tizen.emulator.manager.vms.RESOLUTION; @@ -108,25 +110,64 @@ class SupportType extends StringArrayResource } } -class DisplayResoultion extends StringArrayResource +class DisplayResolution extends StringArrayResource { - private static DisplayResoultion resolution = new DisplayResoultion(); - public static DisplayResoultion getInstance() + private static RESOLUTION[] minResoultion = {RESOLUTION.WVGA, RESOLUTION.HD}; + + private static DisplayResolution resolution = new DisplayResolution(); + public static DisplayResolution getInstance() { return resolution; } - private DisplayResoultion() + private DisplayResolution() { int i = 0; - for (RESOLUTION r : RESOLUTION.values()) { - if (r == RESOLUTION.HD) { - setDefaultIndex(i); + if (EmulatorManager.getInstance().getManagerMode() == ManagerModeType.INHOUSE_MODE) { + for (RESOLUTION r : RESOLUTION.values()) { + if (r == RESOLUTION.HD) { + setDefaultIndex(i); + } + add(i++, r.toString()); + } + } else { + for (RESOLUTION r : minResoultion) { + if (r == RESOLUTION.HD) { + setDefaultIndex(i); + } + add(i++, r.toString()); + } + } + } + + public void initialize(RESOLUTION re) { + if (!(EmulatorManager.getInstance().getManagerMode() == ManagerModeType.INHOUSE_MODE)) { + for (String s : getList()) { + if (s.equals(re.toString())) { + return; + } } - add(i++, r.toString()); + add(0, re.toString()); } } + public RESOLUTION findResolution(String resolution) { + if (EmulatorManager.getInstance().getManagerMode() == ManagerModeType.INHOUSE_MODE) { + for (RESOLUTION r : RESOLUTION.values()) { + if (resolution.equals(r.toString())) { + return r; + } + } + } else { + for (RESOLUTION r : minResoultion) { + if (resolution.equals(r.toString())) { + return r; + } + } + } + return null; + } + public int findIndex(String r) { String[] strArray = getList(); String s = null; @@ -136,6 +177,7 @@ class DisplayResoultion extends StringArrayResource return i; } } + return getDefaultIndex(); } }