+*1.3.49
+- add 'select skin path' menu.
+- modify console mode.
+- add 'Skin' class
+== 김지혜 <jihye1128.kim@samsung.com> 2012-10-31
+
*1.3.48
- change multi touch's max point 3->6
- update version
Source: emulator-manager
-Version: 1.3.48
+Version: 1.3.49
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
Package: emulator-manager
public final static String OP_RESOLUTION = "resolution";
public final static String OP_DPI = "dpi";
+ public final static String OP_SKIN = "skin";
public final static String OP_KEYTYPE = "key-type";
public final static String OP_RAM = "ram-size";
public final static String OP_FILESHARE = "file-sharing";
, RESOLUTION.HD.getType(), false, true));
commandList.add(new Command("d", Actions.OP_DPI,
"DPI. (100 ~ 480)", Integer.toString(property.dpi), false, true));
+
+ /** TODO : resolution and skin..***********************************************/
+ String skinType = "";
+ int i = 1;
+ skinType += Integer.toString(i++) + "(phone_shape_skin) | ";
+ skinType += Integer.toString(i++) + "(general_purpose_skin)";
+
+ commandList.add(new Command("k", Actions.OP_SKIN,
+ "Select skin style (" + skinType + ")", "1", false, true));
+ /*****************************************************************************/
+
/*
commandList.add(new Command("k", Actions.OP_KEYTYPE,
"Skin'front button type. (1 | 3)", Integer.toString(property.keyType), false, true));
commandList.add(new Command("d", Actions.OP_DPI,
"DPI. (100 ~ 480)", Integer.toString(property.dpi), false, true));
+ /** TODO : resolution and skin..***********************************************/
+ String skinType = "";
+ int i = 1;
+ skinType += Integer.toString(i++) + "(phone_shape_skin) | ";
+ skinType += Integer.toString(i++) + "(general_purpose_skin)";
+
+ commandList.add(new Command("k", Actions.OP_SKIN,
+ "Select skin style (" + skinType + ")", "1", false, true));
+ /*****************************************************************************/
+
/*
commandList.add(new Command("k", Actions.OP_KEYTYPE,
"Skin'front button type. (1 | 3)", Integer.toString(property.keyType), false, true));
import org.tizen.emulator.manager.image.Platform;
import org.tizen.emulator.manager.tool.CheckVirtualization;
import org.tizen.emulator.manager.tool.SelectSkin;
+import org.tizen.emulator.manager.tool.StringResource;
import org.tizen.emulator.manager.ui.detail.VMPropertyView;
import org.tizen.emulator.manager.vms.Creator;
import org.tizen.emulator.manager.vms.EmulatorVMs;
return true;
}
+ private Command skinCommand = null;
public void setOptions(Command c, VMPropertyValue prop) throws ConsoleException {
boolean check = false;
// Options
RESOLUTION r = checkResolution(c.getCurrentValue());
prop.resolution = r;
prop.dpi = r.getDPI();
+ if (skinCommand != null) {
+ selectSkin(skinCommand, prop);
+ skinCommand = null;
+ } else {
+ if (prop.skin != null &&
+ !prop.skin.getResolution().equals(StringResource.SKIN_GENERAL)) {
+ selectSkin(null, prop);
+ }
+ }
}
else if (c.getLongName() == Actions.OP_DPI) {
check = false;
throw new ConsoleException("DPI value (" + c.getCurrentValue() + ") is not avaliable.");
}
}
+ else if (c.getLongName() == Actions.OP_SKIN) {
+ skinCommand = c;
+ selectSkin(c, prop);
+ }
/*
else if (c.getLongName() == Actions.OP_KEYTYPE) {
check = false;
}
}
+ private void selectSkin(Command c, VMPropertyValue prop) throws ConsoleException {
+ // phone shape skin
+ if (c == null || c.getCurrentValue().equals("1")) {
+ prop.skin = prop.skinList.findSkin(prop.resolution.getValue());
+ if (prop.skin == null) {
+ System.out.println("There is not match skin to resolution(" + prop.resolution + ")");
+ prop.skin = prop.skinList.findGeneralSkin();
+ if (prop.skin == null) {
+ System.out.println("There is not general skin. Skin path may be null.");
+ }
+ }
+ if (prop.skin != null) {
+ prop.skinPath = prop.skin.getPath();
+ }
+ } else if (c.getCurrentValue().equals("2")) {
+ prop.skin = prop.skinList.findGeneralSkin();
+ if (prop.skin == null) {
+ System.out.println("There is not general skin. Skin path may be null.");
+ } else {
+ prop.skinPath = prop.skin.getPath();
+ }
+ } else {
+ throw new ConsoleException("Skin value (" + c.getCurrentValue() + ") is not avaliable.");
+ }
+ }
+
private boolean checkGLAcceleration(String currentValue) throws ConsoleException{
String value = currentValue.toLowerCase();
if (value.equals("true")) {
import org.tizen.emulator.manager.tool.StringResource;
public class Skins {
- private ArrayList<Skin> skins;
- private String path;
+ private ArrayList<Skin> skins = null;
+ private String path = null;
public Skins(File dir) throws Exception {
if (dir.exists()) {
return null;
}
+ public Skin findGeneralSkin() {
+ if (skins != null) {
+ for (Skin skin : skins) {
+ if (skin.getResolution().equals(StringResource.SKIN_GENERAL)) {
+ return skin;
+ }
+ }
+ }
+ return null;
+ }
+
public Skin findSkinUsePath(String path) {
if (skins != null) {
for (Skin skin : skins) {
}
public String getValue(VMPropertyValue value) {
- return value.skin.getName();
+ if (value.skin != null) {
+ return value.skin.getName();
+ } else {
+ return "";
+ }
}
public void setValue(VMPropertyValue value) {
value.skin = newSkin;
+ if (newSkin != null) {
+ value.skinPath = newSkin.getPath();
+ }
}
public boolean settingWidget(Table table, VMPropertyValue value) {
oldSkin = newSkin = value.skin;
skins = value.getSkin();
- ArrayList<Skin> skinList = skins.findSkinList(value.resolution.getValue());
+ ArrayList<Skin> skinList = null;
+ if (skins != null) {
+ skinList = skins.findSkinList(value.resolution.getValue());
+ } else {
+ skinList = new ArrayList<Skin>();
+ }
helper = new VMCreateHelper();
skinCombo = helper.makeCombo(table);
public void selectResolution(String resolution) {
skinCombo.removeAll();
- ArrayList<Skin> skinList = skins.findSkinList(resolution);
+ ArrayList<Skin> skinList = null;
+ if (skins != null) {
+ skinList = skins.findSkinList(resolution);
+ } else {
+ skinList = new ArrayList<Skin>();
+ }
helper.addComboItem(skinCombo, skinList.toArray(), 0);
newSkin = skinList.get(0);
}
ec.getDevice().getDisplay().getDensity().setValue(newVM.dpi);
ec.getDevice().getDisplay().setSkinPath(factory.createDisplayTypeSkinPath());
- ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skin.getPath());
+ if (newVM.skin != null) {
+ ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skin.getPath());
+ } else if (newVM.skinPath != null) {
+ ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
+ }
ec.getDevice().setRAM(factory.createRamType());
ec.getDevice().getRAM().setSize(factory.createRamTypeSize());
}
*/
if (newVM.skin != null) {
- //newVM.skinPath = newVM.getSkin().findSkin(newVM.resolution.getValue()).getPath();
- property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skin.getPath());
+ newVM.skinPath = newVM.skin.getPath();
+ property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
+ } else if (newVM.skinPath != null) {
+ property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
} else {
- //newVM.skinPath = null;
+ newVM.skinPath = null;
}
}
/* else {
public int dpi;
public int keyType;
public Skin skin;
- //public String skinPath;
+ public String skinPath;
public int ramSize;
if (skin == null && skinList != null) {
skin = skinList.findSkin(resolution.getValue());
}
+ if (skin != null) {
+ skinPath = skin.getPath();
+ }
}
}
dest.resolution = this.resolution;
dest.dpi = this.dpi;
dest.skin = this.skin;
- //dest.skinPath = this.skinPath;
+ dest.skinPath = this.skinPath;
dest.keyType = this.keyType;
dest.ramSize = this.ramSize;
keyType = 1;
if (SelectSkin.getInstance().getDefaultSkin() != null) {
if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) {
+ skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath();
skin = SelectSkin.getInstance().getDefaultSkin().findSkinUsePath
- (property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath());
+ (skinPath);
} else {
- skin = SelectSkin.getInstance().getDefaultSkin().findSkin(resolution.getValue());;
+ skin = SelectSkin.getInstance().getDefaultSkin().findSkin(resolution.getValue());
+ if (skin != null) {
+ skinPath = skin.getPath();
+ }
}
} else {
skin = null;
if (SelectSkin.getInstance().getDefaultSkin() != null) {
skin = SelectSkin.getInstance().getDefaultSkin().findSkin(resolution.getValue());
}
+ if (skin!= null) {
+ skinPath = skin.getPath();
+ }
+
keyType = 1;
//