import org.tizen.emulator.manager.ui.ResourceRegistry;
import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
import org.tizen.emulator.manager.vms.Creator;
-import org.tizen.emulator.manager.vms.EmulatorVMs;
import org.tizen.emulator.manager.vms.VMCreateHelper;
import org.tizen.emulator.manager.vms.VMPropertyValue;
import org.tizen.emulator.manager.vms.VMsProperty;
enum CItem{
ImageName("Name"), ImageNameInfo(""), BaseImage("BaseImage"),
- Resolution("Display Resolution"), Density("Display Density"), SkinPath("Skin Path"),
+ Resolution("Display Resolution"), Density("Display Density"), SkinType("Front Key Type"),
SDType("SDCard"), SDPath("SDCard Path"), RAMSize("RAM Size"),
- ShareType("File Sharing"), SharePath("File Sharing Path");
+ ShareType("File Sharing"), SharePath("File Sharing Path"), HWVirtual("HW Virtualization");
private String value;
CItem(String s) {
enum DItem{
ImageName("Name"), BaseImage("BaseImage"),
- Resolution("Display Resolution"), Density("Display Density"), SkinPath("Skin Path"),
+ Resolution("Display Resolution"), Density("Display Density"), SkinType("Front Key Type"),
SDType("SDCard"), SDPath("SDCard Path"), RAMSize("RAM Size"),
- ShareType("File Sharing"), SharePath("File Sharing Path"), Dummy("");
+ ShareType("File Sharing"), SharePath("File Sharing Path"), HWVirtual("HW Virtualization"), Dummy("");
private String value;
DItem(String s) {
widget.itemList.get(DItem.Resolution.ordinal()).setText(1, oldValue.resolution);
widget.itemList.get(DItem.Density.ordinal()).setText(1, String.valueOf(oldValue.dpi));
- widget.itemList.get(DItem.SkinPath.ordinal()).setText(1, oldValue.skinPathName);
+ // TODO : please !!
+ widget.itemList.get(DItem.SkinType.ordinal()).setText(1, oldValue.keyType == 1
+ ? "1Key type" : "3Keys type");
widget.itemList.get(DItem.SDType.ordinal()).setText(1, oldValue.isSDCardSupport
? SupportType.getInstance().get(0) : SupportType.getInstance().get(1));
widget.itemList.get(DItem.ShareType.ordinal()).setText(1,oldValue.isFileShareSupport
? SupportType.getInstance().get(0) : SupportType.getInstance().get(1));
widget.itemList.get(DItem.SharePath.ordinal()).setText(1, oldValue.fileSharePathName);
+
+ widget.itemList.get(DItem.HWVirtual.ordinal()).setText(1, oldValue.isHWVirtualization && helper.isSupportVirtualization()
+ ? SupportType.getInstance().get(0) : SupportType.getInstance().get(1));
}
public void createDetailView(boolean isDefaultImage) {
widget.itemList.get(CItem.Resolution.ordinal()).setText(1, oldValue.resolution);
widget.itemList.get(CItem.Density.ordinal()).setText(1, String.valueOf(oldValue.dpi));
- widget.itemList.get(CItem.SkinPath.ordinal()).setText(1, oldValue.skinPathName);
+ // TODO : please !!!
+ widget.itemList.get(CItem.SkinType.ordinal()).setText(1, "1Key type");
widget.itemList.get(CItem.SDType.ordinal()).setText(1,SupportType.getInstance().get(0));
widget.itemList.get(CItem.SDPath.ordinal()).setText(1, oldValue.SDCardPathName);
widget.itemList.get(CItem.ShareType.ordinal()).setText(1, SupportType.getInstance().get(0));
widget.itemList.get(CItem.SharePath.ordinal()).setText(1, oldValue.fileSharePathName);
+
+ widget.itemList.get(CItem.HWVirtual.ordinal()).setText(1, oldValue.isHWVirtualization && helper.isSupportVirtualization()
+ ? SupportType.getInstance().get(0) : SupportType.getInstance().get(1));
}
public void modifyView(Button confirm) {
createSDCardArea(table);
createRAMSizeArea(table);
createFileShareArea(table);
+ createHWVirtualArea(table);
settingModifyTableEditor();
}
createSDCardArea(table);
createRAMSizeArea(table);
createFileShareArea(table);
-
+ createHWVirtualArea(table);
+
settingCreateTableEditor();
}
editor = new TableEditor(table);
editor.grabHorizontal = true;
- editor.setEditor(widget.skinPathCombo, widget.itemList.get(DItem.SkinPath.ordinal()), 1);
+ editor.setEditor(widget.skinTypeCombo, widget.itemList.get(DItem.SkinType.ordinal()), 1);
editor = new TableEditor(table);
editor.grabHorizontal = true;
editor = new TableEditor(table);
editor.grabHorizontal = true;
editor.setEditor(widget.selectShareFolderButton, widget.itemList.get(DItem.SharePath.ordinal()), 1);
+
+ editor = new TableEditor(table);
+ editor.grabHorizontal = true;
+ editor.setEditor(widget.HWVirtualCombo, widget.itemList.get(DItem.HWVirtual.ordinal()), 1);
}
private void settingCreateTableEditor() {
editor = new TableEditor(table);
editor.grabHorizontal = true;
- editor.setEditor(widget.skinPathCombo, widget.itemList.get(CItem.SkinPath.ordinal()), 1);
+ editor.setEditor(widget.skinTypeCombo, widget.itemList.get(CItem.SkinType.ordinal()), 1);
editor = new TableEditor(table);
editor.grabHorizontal = true;
editor = new TableEditor(table);
editor.grabHorizontal = true;
editor.setEditor(widget.selectShareFolderButton, widget.itemList.get(CItem.SharePath.ordinal()), 1);
+
+ editor = new TableEditor(table);
+ editor.grabHorizontal = true;
+ editor.setEditor(widget.HWVirtualCombo, widget.itemList.get(CItem.HWVirtual.ordinal()), 1);
}
public static final int MAX_NAME_LEN = 20;
widget.DIPspinner = new Spinner(table, SWT.BORDER);
widget.DIPspinner.setValues(oldValue.dpi, 100, 480, 0, 1, 1);
- widget.skinPathCombo = helper.makeCombo(table);
- helper.addComboItem(widget.skinPathCombo, SkinPath.getInstance().getList());
- widget.skinPathCombo.add(oldValue.skinPathName, 0);
- widget.skinPathCombo.add("-----------------------------------------------------", 1);
- widget.skinPathCombo.add("--Select existing SkinFolder", SkinPath.getInstance().size() + 2);
- widget.skinPathCombo.select(0);
- widget.skinPathCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ widget.skinTypeCombo = helper.makeCombo(table);
+ widget.skinTypeCombo.add("1Key type");
+ widget.skinTypeCombo.add("3Keys type");
+ widget.skinTypeCombo.select(oldValue.keyType == 1 ? 0 : 1);
+ widget.skinTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
createDisplayListener();
}
}
}
- if (SkinPath.getInstance().size() == 0) {
- newValue.skinPath = "emul_" + newValue.resolution;
- newValue.skinPathName = "emul_" + newValue.resolution;
- } else {
- int i = SkinPath.getInstance().findIndex(newValue.resolution);
- newValue.skinPath = SkinPath.getInstance().get(i);
- newValue.skinPathName = SkinPath.getInstance().get(i);
- }
- widget.skinPathCombo.remove(0);
- widget.skinPathCombo.add(newValue.skinPath, 0);
- widget.skinPathCombo.select(0);
-
if (!isCreateMode) {
checkModifyState();
}
}
});
- widget.skinPathCombo.addSelectionListener(new SelectionListener() {
+ // TODO : modify please !!!!
+ widget.skinTypeCombo.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
- int i = widget.skinPathCombo.getSelectionIndex();
- if (i == SkinPath.getInstance().size() + 2) { // Select Exist Skin Folder
- if (widget.skinPathDD == null) {
- widget.skinPathDD = new DirectoryDialog(table.getShell(), SWT.OPEN);
- widget.skinPathDD.setText("Select a Direcory");
- }
- String path = widget.skinPathDD.open();
- if(path != null) {
- newValue.skinPath = path;
- newValue.skinPathName = path.substring(path.lastIndexOf(SEFARATOR) + 1, path.length());
- }
-
- } else if (i != 0 && i != 1) {
- newValue.skinPath = widget.skinPathCombo.getItem(i);
- newValue.skinPathName = widget.skinPathCombo.getItem(i);
+ int i = widget.skinTypeCombo.getSelectionIndex();
+ if (i == 0) {// 1key type
+ newValue.keyType = 1;
+ } else if (i == 1) { // 3key type
+ MessageBox msg = new MessageBox(table.getShell(), SWT.ICON_WARNING);
+ msg.setText("Warning");
+ msg.setMessage("Check platform of emulator support 3keys(Call/Home/End)\n"
+ +"If platform is not support, just change emulator skin.");
+ newValue.keyType = 3;
}
-
- widget.skinPathCombo.remove(0);
- widget.skinPathCombo.add(newValue.skinPathName, 0);
- widget.skinPathCombo.select(0);
-
if (!isCreateMode) {
checkModifyState();
}
});
}
+ private void createHWVirtualArea(final Table table) {
+ widget.HWVirtualCombo = helper.makeCombo(table);
+ helper.addComboItem(widget.HWVirtualCombo, SupportType.getInstance().getList());
+ widget.HWVirtualCombo.select(oldValue.isHWVirtualization && helper.isSupportVirtualization()
+ ? 0 : 1);
+
+ if (!helper.isSupportVirtualization()) {
+ widget.HWVirtualCombo.setEnabled(false);
+ }
+
+ createHWVirtualListener();
+ }
+
+ private void createHWVirtualListener() {
+ widget.HWVirtualCombo.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int i = widget.HWVirtualCombo.getSelectionIndex();
+ newValue.isHWVirtualization = i == 0 ? true : false;
+
+ if (!isCreateMode) {
+ checkModifyState();
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ });
+ }
+
private void checkModifyState() {
if (!newValue.equals(oldValue)) {
widget.confirmButton.setEnabled(true);
public Combo resolutionCombo;
public Spinner DIPspinner;
- public Combo skinPathCombo;
- public DirectoryDialog skinPathDD;
+ public Combo skinTypeCombo;
public Combo SDCardTypeCombo;
public Combo SDCardPathCombo;
public Button selectShareFolderButton;
public DirectoryDialog shareFileDD;
+ public Combo HWVirtualCombo;
+
public Button cancelButton;
public Button confirmButton;
selectBaseImageButton.dispose();
resolutionCombo.dispose();
DIPspinner.dispose();
- skinPathCombo.dispose();
+ skinTypeCombo.dispose();
SDCardTypeCombo.dispose();
SDCardPathCombo.dispose();
ramSizeCombo.dispose();
shareTypeCombo.dispose();
selectShareFolderButton.dispose();
+ HWVirtualCombo.dispose();
}
}
private Modifier() {}
static void modify(VMsProperty property, VMPropertyValue oldVM, VMPropertyValue newVM) throws VMsWorkerException {
- if(oldVM.equals(newVM)) // if nothing if modified...
+ if(oldVM.equals(newVM)) {// if nothing if modified...
return;
+ }
+
if (!newVM.resolution.equals(oldVM.resolution)) {
int i = newVM.resolution.indexOf('x');
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(oldVM.resolutionType);
+ // TODO : modify please !!
+ if (newVM.keyType == 1) { // 1key
+ newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
+ } else if (newVM.keyType == 3){ // 3 key
+ newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_3kyes_" + newVM.resolution;
+ }
+ property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
+ } else {
+ // TODO : modify please !!
+ if (newVM.keyType != oldVM.keyType) {
+ if (newVM.keyType == 1) { // 1key
+ newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + newVM.resolution;
+ } else if (newVM.keyType == 3){ // 3 key
+ newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_3kyes_" + newVM.resolution;
+ }
+ property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
+ }
}
if (newVM.dpi != oldVM.dpi) {
property.getConfiguration().getDevice().getDisplay().getDensity().setValue(newVM.dpi);
}
- if (newVM.skinPath != oldVM.skinPath) {
- if (newVM.skinPath == newVM.skinPathName) {
- newVM.skinPath = FileIO.getInstance().getSkinPath() + File.separator + newVM.skinPathName;
- }
- if (property.getConfiguration().getDevice().getDisplay().getSkinPath() == null) {
- property.getConfiguration().getDevice().getDisplay().setSkinPath
- (EmulatorVMs.getInstance().getObjectFactory().createDisplayTypeSkinPath());
- }
- property.getConfiguration().getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
- }
-
if (newVM.isSDCardSupport != oldVM.isSDCardSupport) {
if (newVM.isSDCardSupport) {
modifySDCard(newVM);
} else if (newVM.isFileShareSupport && !newVM.fileSharePath.equals(oldVM.fileSharePath)) {
property.getConfiguration().getUsability().getFileSharing().setPath(newVM.fileSharePath);
}
+
+ if (newVM.isHWVirtualization != oldVM.isHWVirtualization) {
+ property.getConfiguration().getUsability().setHwVirtualization(newVM.isHWVirtualization);
+ }
EmulatorVMs.getInstance().storeXML(property);
}
public Resolution resolutionType;
public String resolution;
public int dpi;
+ public int keyType;
public String skinPath;
- public String skinPathName;
public boolean isSDCardSupport;
public String SDCardPath;
public String fileSharePath;
public String fileSharePathName;
+ public boolean isHWVirtualization;
+
private VMPropertyValue() {} // for clone...
VMPropertyValue(VMsProperty property) {
resolution = String.valueOf(re.getWidth()) + "x" + String.valueOf(re.getHeight());
dpi = property.getConfiguration().getDevice().getDisplay().getDensity().getValue();
- // Skin Path
+ // TODO : Skin Type..
if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) {
skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath();
if (skinPath != null) {
- skinPathName = skinPath.substring(skinPath.lastIndexOf(File.separator) + 1, skinPath.length());
+ if (skinPath.contains("3kyes")) {
+ keyType = 3;
+ } else {
+ keyType = 1;
+ }
} else {
- skinPath = "";
- skinPathName = "( None )";
+ keyType = 1;
}
} else {
- skinPath = "";
- skinPathName = "( None )";
+ skinPath = null;
+ keyType = 1;
}
//
fileSharePathName = "( None )";
}
ramSize = property.getConfiguration().getDevice().getRAM().getSize().getValue();
+ isHWVirtualization = property.getConfiguration().getUsability().isHwVirtualization();
}
@Override
dest.resolution = this.resolution;
dest.dpi = this.dpi;
dest.skinPath = this.skinPath;
- dest.skinPathName = this.skinPathName;
+ dest.keyType = this.keyType;
dest.isSDCardSupport = this.isSDCardSupport;
dest.SDCardPath = this.SDCardPath;
dest.isFileShareSupport = this.isFileShareSupport;
dest.fileSharePath = this.fileSharePath;
dest.fileSharePathName = this.fileSharePathName;
+ dest.isHWVirtualization = this.isHWVirtualization;
return dest;
}
return false;
if(this.dpi != dest.dpi)
return false;
- if(this.skinPath != dest.skinPath)
+ if(this.keyType != dest.keyType)
return false;
if(this.isSDCardSupport != dest.isSDCardSupport)
return false;
return false;
if(this.isFileShareSupport != dest.isFileShareSupport)
return false;
+ if (this.isHWVirtualization != dest.isHWVirtualization)
+ return false;
return true;
}
value.dpi = 316; // this value be related to resolution
// TODO : Skin Path
value.skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + value.resolution;
- value.skinPathName = "emul_" + value.resolution;
+ value.keyType = 1;
//
value.isSDCardSupport = false;
value.isFileShareSupport = false;
value.fileSharePath = "";
value.fileSharePathName = "( None )";
-
+
+ value.isHWVirtualization = true;
return value;
}
}