//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
* </simpleContent>
* </complexType>
* </element>
+ * <element name="skinPath">
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="path" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
* </sequence>
* </restriction>
* </complexContent>
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "displayType", propOrder = {
"resolution",
- "density"
+ "density",
+ "skinPath"
})
public class DisplayType {
protected DisplayType.Resolution resolution;
@XmlElement(required = true)
protected DisplayType.Density density;
+ @XmlElement(required = true)
+ protected DisplayType.SkinPath skinPath;
/**
* Gets the value of the resolution property.
this.density = value;
}
+ /**
+ * Gets the value of the skinPath property.
+ *
+ * @return
+ * possible object is
+ * {@link DisplayType.SkinPath }
+ *
+ */
+ public DisplayType.SkinPath getSkinPath() {
+ return skinPath;
+ }
+
+ /**
+ * Sets the value of the skinPath property.
+ *
+ * @param value
+ * allowed object is
+ * {@link DisplayType.SkinPath }
+ *
+ */
+ public void setSkinPath(DisplayType.SkinPath value) {
+ this.skinPath = value;
+ }
+
/**
* <p>Java class for anonymous complex type.
}
+
+ /**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="path" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "path"
+ })
+ public static class SkinPath {
+
+ protected String path;
+
+ /**
+ * Gets the value of the path property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * Sets the value of the path property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPath(String value) {
+ this.path = value;
+ }
+
+ }
+
}
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
}
/**
- * Create an instance of {@link DisplayType }
+ * Create an instance of {@link StorageType.SDCard }
*
*/
- public DisplayType createDisplayType() {
- return new DisplayType();
+ public StorageType.SDCard createStorageTypeSDCard() {
+ return new StorageType.SDCard();
}
/**
- * Create an instance of {@link UsabilityType }
+ * Create an instance of {@link BaseInformationType }
*
*/
- public UsabilityType createUsabilityType() {
- return new UsabilityType();
+ public BaseInformationType createBaseInformationType() {
+ return new BaseInformationType();
}
/**
- * Create an instance of {@link BaseInformationType }
+ * Create an instance of {@link StorageType }
*
*/
- public BaseInformationType createBaseInformationType() {
- return new BaseInformationType();
+ public StorageType createStorageType() {
+ return new StorageType();
}
/**
- * Create an instance of {@link RamType.Size }
+ * Create an instance of {@link DisplayType.Density }
*
*/
- public RamType.Size createRamTypeSize() {
- return new RamType.Size();
+ public DisplayType.Density createDisplayTypeDensity() {
+ return new DisplayType.Density();
}
/**
- * Create an instance of {@link StorageType.SDCard }
+ * Create an instance of {@link UsabilityType }
*
*/
- public StorageType.SDCard createStorageTypeSDCard() {
- return new StorageType.SDCard();
+ public UsabilityType createUsabilityType() {
+ return new UsabilityType();
}
/**
- * Create an instance of {@link EmulatorConfiguration }
+ * Create an instance of {@link DeviceType }
*
*/
- public EmulatorConfiguration createEmulatorConfiguration() {
- return new EmulatorConfiguration();
+ public DeviceType createDeviceType() {
+ return new DeviceType();
}
/**
- * Create an instance of {@link DisplayType.Density }
+ * Create an instance of {@link RamType.Size }
*
*/
- public DisplayType.Density createDisplayTypeDensity() {
- return new DisplayType.Density();
+ public RamType.Size createRamTypeSize() {
+ return new RamType.Size();
}
/**
- * Create an instance of {@link UsabilityType.Logging }
+ * Create an instance of {@link UsabilityType.FileSharing }
*
*/
- public UsabilityType.Logging createUsabilityTypeLogging() {
- return new UsabilityType.Logging();
+ public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
+ return new UsabilityType.FileSharing();
}
/**
}
/**
- * Create an instance of {@link RamType }
+ * Create an instance of {@link BaseInformationType.DiskImage }
*
*/
- public RamType createRamType() {
- return new RamType();
+ public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
+ return new BaseInformationType.DiskImage();
}
/**
- * Create an instance of {@link DeviceType }
+ * Create an instance of {@link UsabilityType.Logging }
*
*/
- public DeviceType createDeviceType() {
- return new DeviceType();
+ public UsabilityType.Logging createUsabilityTypeLogging() {
+ return new UsabilityType.Logging();
}
/**
}
/**
- * Create an instance of {@link BaseInformationType.DiskImage }
+ * Create an instance of {@link DisplayType }
*
*/
- public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
- return new BaseInformationType.DiskImage();
+ public DisplayType createDisplayType() {
+ return new DisplayType();
}
/**
- * Create an instance of {@link UsabilityType.FileSharing }
+ * Create an instance of {@link RamType }
*
*/
- public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
- return new UsabilityType.FileSharing();
+ public RamType createRamType() {
+ return new RamType();
+ }
+
+ /**
+ * Create an instance of {@link EmulatorConfiguration }
+ *
+ */
+ public EmulatorConfiguration createEmulatorConfiguration() {
+ return new EmulatorConfiguration();
}
/**
}
/**
- * Create an instance of {@link StorageType }
+ * Create an instance of {@link DisplayType.SkinPath }
*
*/
- public StorageType createStorageType() {
- return new StorageType();
+ public DisplayType.SkinPath createDisplayTypeSkinPath() {
+ return new DisplayType.SkinPath();
}
}
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2012.03.14 at 10:40:42 오후 KST
+// Generated on: 2012.03.24 at 01:54:52 PM KST
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/em", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Package: emulator-manager
-Version: 1.0.13
+Version: 1.0.14
OS: linux
Build-host-os: linux
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
Description: Tizen Emulator Manager
Package: emulator-manager
-Version: 1.0.13
+Version: 1.0.14
OS: windows
Build-host-os: windows
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
private final static String etc_suffix = File.separator +"etc";
private final static String log_suffix = File.separator +"logs";
private final static String x86_kernel_suffix = File.separator +"kernel-img";
+ private final static String skin_suffix = File.separator + "skins";
private static String currentPath;
private static String emulatorPath;
private static String etcPath;
private static String x86KernelPath;
private static String biosPath;
+ private static String skinPath;
private static String vmsPath;
private static String vmsArchPath;
arcPath = emulatorPath + arch_suffix;
etcPath = emulatorPath + etc_suffix;
iconPath = emulatorPath + icon_suffix;
+ skinPath = emulatorPath + skin_suffix;
dataPath = arcPath + data_suffix;
confPath = arcPath + conf_suffix;
instance = new FileIO();
}
}
+
public static FileIO getInstance() {
return instance;
}
return iconPath;
}
+ public String getSkinPath() {
+ return skinPath;
+ }
+
public String getDataPath(){
return dataPath;
}
List<String> cmd = new ArrayList<String>();
int width = property.getConfiguration().getDevice().getDisplay().getResolution().getWidth();
int height = property.getConfiguration().getDevice().getDisplay().getResolution().getHeight();
+ String skinPath = null;
+ if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) {
+ skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath();
+ if (skinPath.isEmpty()) {
+ skinPath = null;
+ }
+ }
String fileshare = property.getConfiguration().getUsability().getFileSharing().getPath();
String sdcard = property.getConfiguration().getDevice().getStorage().getSDCard().getDiskImage();
int isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux");
cmd.add("--skin-args");
cmd.add("width=" + width);
cmd.add("height=" + height);
+ if (skinPath != null) {
+ cmd.add("path=" + skinPath);
+ }
cmd.add("--qemu-args");
cmd.add("-drive");
cmd.add("file=" + EmulatorVMs.getInstance().getVMsBaseDirectory() + File.separator +property.getArch().toString() + File.separator + property.getName() + File.separator +"emulimg-" + property.getName() + ".x86,if=virtio");
}
public void closeDetailView() {
- if (vmsTree.getCountSelectionItem() > 1) {
+ if (vmsTree.getSelectionContentCount() > 1) {
deleteButton.setEnabled(true);
resetButton.setEnabled(true);
} else {
}
public void resetVirtualMachine() {
- if (listTable.getCountSelectionItem() == 1) {
+ if (listTable.getSelectionContentCount() == 1) {
if (!checkRunnigVM(listTable.getSelectionItem())) {
return;
}
int response = msg.open();
boolean success = false;
if (response == SWT.OK) {
- if (listTable.getCountSelectionItem() == 1) {
+ if (listTable.getSelectionContentCount() == 1) {
if (!resetProcess(listTable.getSelectionItem())) {
return;
}
// TOOD : error checking
public boolean deleteVirtualMachine() {
- if (listTable.getCountSelectionItem() == 1) {
+ if (listTable.getSelectionContentCount() == 1) {
if (!checkRunnigVM(listTable.getSelectionItem())) {
return false;
}
int response = msg.open();
if (response == SWT.OK) {
- if (listTable.getCountSelectionItem() == 1) {
+ if (listTable.getSelectionContentCount() == 1) {
if (!deleteProcess(listTable.getSelectionItem())) {
return false;
}
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.tizen.emulator.manager.vms.VMCreateHelper;
import org.tizen.emulator.manager.vms.VMProcess;
import org.tizen.emulator.manager.vms.VMPropertyValue;
-import org.tizen.emulator.manager.vms.VMViewWidget;
import org.tizen.emulator.manager.vms.VMsProperty;
enum CItem{
ImageName("Name"), ImageNameInfo(""), BaseImage("BaseImage"),
- Resolution("Display Resolution"), Density("Display Density"),
+ Resolution("Display Resolution"), Density("Display Density"), SkinPath("Skin Path"),
SDType("SDCard"), SDPath("SDCard Path"), RAMSize("RAM Size"),
ShareType("File Sharing"), SharePath("File Sharing Path");
enum DItem{
ImageName("Name"), BaseImage("BaseImage"),
- Resolution("Display Resolution"), Density("Display Density"),
+ Resolution("Display Resolution"), Density("Display Density"), SkinPath("Skin Path"),
SDType("SDCard"), SDPath("SDCard Path"), RAMSize("RAM Size"),
ShareType("File Sharing"), SharePath("File Sharing Path"), Dummy("");
public VMPropertyView(Table table) {
this.helper = new VMCreateHelper();
- this.process = new VMProcess();
+ this.process = new VMProcess();
this.widget = new VMViewWidget();
- this.table = table;
-
-// InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("res/folder.png");
-// if(resourceAsStream != null)
-// this.image = new Image(EmulatorManager.getInstance().getDisplay(), resourceAsStream);
-
+ this.table = table;
this.image = ResourceRegistry.getImage(ImageName.FOLDER);
makeItemList();
}
widget.itemList.get(DItem.ImageName.ordinal()).setText(1, oldValue.imageName);
widget.itemList.get(DItem.BaseImage.ordinal()).setText(1, oldValue.baseImagePathName);
-
+
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);
+
widget.itemList.get(DItem.SDType.ordinal()).setText(1, oldValue.isSDCardSupport
? SupportType.getInstance().get(0) : SupportType.getInstance().get(1));
widget.itemList.get(DItem.SDPath.ordinal()).setText(1, oldValue.SDCardPathName);
widget.itemList.get(CItem.ImageName.ordinal()).setText(1, oldValue.imageName);
widget.itemList.get(CItem.BaseImage.ordinal()).setText(1, oldValue.baseImagePathName);
-
+
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);
+
widget.itemList.get(CItem.SDType.ordinal()).setText(1,SupportType.getInstance().get(0));
widget.itemList.get(CItem.SDPath.ordinal()).setText(1, oldValue.SDCardPathName);
editor = new TableEditor(table);
editor.grabHorizontal = true;
editor.setEditor(widget.DIPspinner, widget.itemList.get(DItem.Density.ordinal()), 1);
+
+ editor = new TableEditor(table);
+ editor.grabHorizontal = true;
+ editor.setEditor(widget.skinPathCombo, widget.itemList.get(DItem.SkinPath.ordinal()), 1);
editor = new TableEditor(table);
editor.grabHorizontal = true;
editor = new TableEditor(table);
editor.grabHorizontal = true;
+ editor.setEditor(widget.skinPathCombo, widget.itemList.get(CItem.SkinPath.ordinal()), 1);
+
+ editor = new TableEditor(table);
+ editor.grabHorizontal = true;
editor.setEditor(widget.SDCardTypeCombo, widget.itemList.get(CItem.SDType.ordinal()), 1);
editor = new TableEditor(table);
DisplayResoultion.getInstance().findIndex(oldValue.resolution));
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));
createDisplayListener();
}
widget.DIPspinner.setSelection(newValue.dpi);
}
}
+
+ 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() {
+ @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);
+ }
+
+ widget.skinPathCombo.remove(0);
+ widget.skinPathCombo.add(newValue.skinPathName, 0);
+ widget.skinPathCombo.select(0);
+
+ if (!isCreateMode) {
+ checkModifyState();
+ }
+ }
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ });
}
private void createSDCardArea(final Table table) {
widget.SDCardPathCombo = helper.makeCombo(table);
helper.addComboItem(widget.SDCardPathCombo, SDCard.getInstance().getList());
widget.SDCardPathCombo.add(oldValue.SDCardPathName, 0);
- widget.SDCardPathCombo.add("--Select existing SDCard", SDCard.getInstance().size() + 1);
+ widget.SDCardPathCombo.add("-----------------------------------------------", 1);
+ widget.SDCardPathCombo.add("--Select existing SDCard", SDCard.getInstance().size() + 2);
widget.SDCardPathCombo.select(0);
widget.SDCardPathCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
widget.SDCardPathCombo.setEnabled(oldValue.isSDCardSupport);
@Override
public void widgetSelected(SelectionEvent e) {
int i = widget.SDCardPathCombo.getSelectionIndex();
- if (i == SDCard.getInstance().size() + 1) { // Select Exist SDCard
+ if (i == SDCard.getInstance().size() + 2) { // Select Exist SDCard
if (widget.SDImageFD == null) {
widget.SDImageFD = new FileDialog(table.getShell(), SWT.OPEN);
widget.SDImageFD.setText("Select an existing SD card");
if(path != null) {
newValue.SDCardPath = path;
newValue.SDCardPathName = path.substring(path.lastIndexOf(SEFARATOR) + 1, path.length());
- widget.SDCardPathCombo.remove(0);
- widget.SDCardPathCombo.add(newValue.SDCardPathName, 0);
- widget.SDCardPathCombo.select(0);
}
- } else if (i != 0) {
+ } else if (i != 0 && i != 1) {
newValue.SDCardPath = widget.SDCardPathCombo.getItem(i);
newValue.SDCardPathName = widget.SDCardPathCombo.getItem(i);
}
+ widget.SDCardPathCombo.remove(0);
+ widget.SDCardPathCombo.add(newValue.SDCardPathName, 0);
+ widget.SDCardPathCombo.select(0);
+
if (!isCreateMode) {
checkModifyState();
}
if (newValue.dpi != oldValue.dpi) {
isModify = true;
}
+ if (newValue.skinPath != oldValue.skinPath) {
+ isModify = true;
+ }
if (newValue.isSDCardSupport != oldValue.isSDCardSupport) {
isModify = true;
return p;
}
}
+
+class VMViewWidget {
+ public Table table;
+
+ public ArrayList<TableItem> itemList;
+ public Text imageNameText;
+ public Label nameinfoLabel;
+
+ public Button selectBaseImageButton;
+ public FileDialog baseImageFD;
+
+ public Combo resolutionCombo;
+ public Spinner DIPspinner;
+ public Combo skinPathCombo;
+ public DirectoryDialog skinPathDD;
+
+ public Combo SDCardTypeCombo;
+ public Combo SDCardPathCombo;
+ public FileDialog SDImageFD;
+
+ public Combo ramSizeCombo;
+
+ public Combo shareTypeCombo;
+ public Button selectShareFolderButton;
+ public DirectoryDialog shareFileDD;
+
+ public Button cancelButton;
+ public Button confirmButton;
+
+ public void close() {
+ //itemList.clear();
+ imageNameText.dispose();
+ if (nameinfoLabel != null)
+ nameinfoLabel.dispose();
+ selectBaseImageButton.dispose();
+ resolutionCombo.dispose();
+ DIPspinner.dispose();
+ skinPathCombo.dispose();
+ SDCardTypeCombo.dispose();
+ SDCardPathCombo.dispose();
+ ramSizeCombo.dispose();
+ shareTypeCombo.dispose();
+ selectShareFolderButton.dispose();
+ }
+}
import java.util.ArrayList;
+import org.tizen.emulator.manager.vms.VMCreateHelper;
+
class StringArrayResource
{
private ArrayList<String> list;
public String[] getList()
{
- return list.toArray(new String[size()]);
+ if (size() == 0) {
+ return null;
+ } else {
+ return list.toArray(new String[size()]);
+ }
}
public String get(int i) {
}
}
+class SkinPath extends StringArrayResource
+{
+ private static SkinPath skinPath = new SkinPath();
+ public static SkinPath getInstance() {
+ return skinPath;
+ }
+
+ private SkinPath() {
+ ArrayList<String> list = new VMCreateHelper().makeSkinfolderList();
+ int index = 0;
+ for (String s : list) {
+ add(index++, s);
+ }
+ }
+
+ public int findIndex(String r) {
+ String[] strArray = getList();
+ String s = null;
+ // TODO:
+ r = "emul_" + r;
+ for (int i = 0; i < strArray.length; i++) {
+ s = strArray[i];
+ if (s.equals(r)) {
+ return i;
+ }
+ }
+ return getDefaultIndex();
+ }
+}
+
class SDCard extends StringArrayResource
{
private static SDCard capacity = new SDCard();
return count;
}
- public int getCountSelectionItem() {
- int count = 0;
- Object data;
- for (int i = 0; i < vmsTree.getSelectionCount(); i++) {
- data = vmsTree.getSelection()[i].getData();
- if(!(data instanceof RowItem))
- continue;
-
- if (data instanceof CreateMarker || data instanceof TreeMarker) {
- return 0;
- }
-
- count++;
- }
- return count;
- }
-
public ArrayList<VMsProperty> getSelectionItems() {
ArrayList<VMsProperty> list = new ArrayList<VMsProperty>();
package org.tizen.emulator.manager.vms;
+import java.io.File;
+import java.util.ArrayList;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.tizen.emulator.manager.tool.FileIO;
import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
public class VMCreateHelper {
}
public void addComboItem(Combo combo, Object[] items) {
- addComboItem(combo, items, 0);
+ if (items == null) {
+ return;
+ } else {
+ addComboItem(combo, items, 0);
+ }
}
public void addComboItem(Combo combo, Object[] items, int defaultIndex) {
combo.select(defaultIndex);
}
+
+ public ArrayList<String> makeSkinfolderList() {
+ ArrayList<String> list = new ArrayList<String>();
+ File skins = new File(FileIO.getInstance().getSkinPath());
+
+ if (skins.exists()) {
+ //System.out.println(skins.getAbsolutePath());
+ for (File dir : skins.listFiles()) {
+ if (dir.isDirectory()) {
+ //System.out.println(dir.getName());
+ list.add(dir.getName());
+ }
+ }
+ }
+ return list;
+ }
}
property.getConfiguration().getDevice().getDisplay().getDensity().setValue(newVM.dpi);
}
+ if (newVM.skinPath != oldVM.skinPath) {
+ if (newVM.skinPath == newVM.skinPathName) {
+ newVM.skinPath = filePath.getSkinPath() + SEFARATOR + 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) {
isModify = true;
if (newVM.isSDCardSupport) {
ec.getDevice().getDisplay().getDensity().setUnit("dpi");
ec.getDevice().getDisplay().getDensity().setValue(newVM.dpi);
+ ec.getDevice().getDisplay().setSkinPath(factory.createDisplayTypeSkinPath());
+ ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
+
ec.getDevice().setRAM(factory.createRamType());
ec.getDevice().getRAM().setSize(factory.createRamTypeSize());
ec.getDevice().getRAM().getSize().setUnit("MiB");
newVM.resolutionType.setWidth(Integer.valueOf(newVM.resolution.substring(0,i)));
newVM.resolutionType.setHeight(Integer.valueOf(newVM.resolution.substring(i+1,newVM.resolution.length())));
+ if (newVM.skinPath == newVM.skinPathName) {
+ newVM.skinPath = filePath.getSkinPath() + SEFARATOR + newVM.skinPathName;
+ }
return true;
}
import java.io.File;
+import org.tizen.emulator.manager.tool.FileIO;
import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
public Resolution resolutionType;
public String resolution;
public int dpi;
+ public String skinPath;
+ public String skinPathName;
public boolean isSDCardSupport;
public String SDCardPath;
resolutionType = oldTarget.resolutionType;
resolution = oldTarget.resolution;
dpi = oldTarget.dpi;
+ skinPath = oldTarget.skinPath;
+ skinPathName = oldTarget.skinPathName;
isSDCardSupport = oldTarget.isSDCardSupport;
SDCardPath = oldTarget.SDCardPath;
resolutionType.setHeight(1280);
resolution = "720x1280";
dpi = 316; // this value be related to resolution
+ // TODO : Skin Path
+ skinPath = FileIO.getInstance().getSkinPath() + File.separator + "emul_" + resolution;
+ skinPathName = "emul_" + resolution;
+ //
isSDCardSupport = false;
SDCardPath = "";
resolutionType = re;
resolution = String.valueOf(re.getWidth()) + "x" + String.valueOf(re.getHeight());
dpi = property.getConfiguration().getDevice().getDisplay().getDensity().getValue();
+
+ // Skin Path
+ 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());
+ } else {
+ skinPath = "";
+ skinPathName = "( None )";
+ }
+ } else {
+ skinPath = "";
+ skinPathName = "( None )";
+ }
+ //
+
SDCardPath = property.getConfiguration().getDevice().getStorage().getSDCard().getDiskImage();
if (SDCardPath != null) {
isSDCardSupport = true;
SDCardPathName = SDCardPath.substring
(SDCardPath.lastIndexOf(File.separator) + 1, SDCardPath.length());
- } else if (SDCardPath == null) {
+ } else {
SDCardPath = "";
SDCardPathName = "( None )";
}
isFileShareSupport = true;
fileSharePathName = fileSharePath.substring
(fileSharePath.lastIndexOf(File.separator) + 1, fileSharePath.length());
- } else if (fileSharePath == null) {
+ } else {
fileSharePath = "";
fileSharePathName = "( None )";
}
+++ /dev/null
-package org.tizen.emulator.manager.vms;
-
-import java.util.ArrayList;
-
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TableItem;
-
-public class VMViewWidget {
- public Table table;
-
- public ArrayList<TableItem> itemList;
- public Text imageNameText;
- public Label nameinfoLabel;
-
- public Button selectBaseImageButton;
- public FileDialog baseImageFD;
-
- public Combo resolutionCombo;
- public Spinner DIPspinner;
-
- public Combo SDCardTypeCombo;
- public Combo SDCardPathCombo;
- public FileDialog SDImageFD;
-
- public Combo ramSizeCombo;
-
- public Combo shareTypeCombo;
- public Button selectShareFolderButton;
- public DirectoryDialog shareFileDD;
-
- public Button cancelButton;
- public Button confirmButton;
-
- public void close() {
- //itemList.clear();
- imageNameText.dispose();
- if (nameinfoLabel != null)
- nameinfoLabel.dispose();
- selectBaseImageButton.dispose();
- resolutionCombo.dispose();
- DIPspinner.dispose();
- SDCardTypeCombo.dispose();
- SDCardPathCombo.dispose();
- ramSizeCombo.dispose();
- shareTypeCombo.dispose();
- selectShareFolderButton.dispose();
- }
-}
<height>0</height>
</resolution>
<density unit="dpi">0</density>
+ <skinPath/>
</display>
<storage>
<SDCard/>
<element name="resolution" minOccurs="1" maxOccurs="1">
<complexType>
<sequence>
- <element name="width" type="int" minOccurs="1" maxOccurs="1" />
- <element name="height" type="int" minOccurs="1" maxOccurs="1" />
+ <element name="width" type="int" minOccurs="1"
+ maxOccurs="1" />
+ <element name="height" type="int" minOccurs="1"
+ maxOccurs="1" />
</sequence>
</complexType>
</element>
</simpleContent>
</complexType>
</element>
+ <element name="skinPath" minOccurs="1" maxOccurs="1">
+ <complexType>
+ <sequence>
+ <element name="path" type="string" minOccurs="0" />
+ </sequence>
+ </complexType>
+ </element>
</sequence>
</complexType>