import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.About;
import org.tizen.emulator.manager.vms.VMProperty;
+import org.tizen.emulator.manager.vms.VMPropertyConfiguration;
import org.tizen.emulator.manager.vms.helper.HelperClass;
import org.tizen.emulator.manager.vms.helper.VMWorkerException;
import org.tizen.emulator.manager.vms.option.LaunchConfig;
public String getDetailInfoOfVM(VMProperty prop) {
String str = new String();
try {
+ VMPropertyConfiguration conf = prop.getVMConfiguration();
str += String.format("%s" + StringResources.NEW_LINE, prop.getName()); //$NON-NLS-1$
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "ImageType",prop.getImageType()); //$NON-NLS-1$ //$NON-NLS-2$
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Platform", prop.getImagePlatform()); //$NON-NLS-1$ //$NON-NLS-2$
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Profile", prop.getImageProfile()); //$NON-NLS-1$ //$NON-NLS-2$
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Version", prop.getImageVersion()); //$NON-NLS-1$ //$NON-NLS-2$
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Image Name" , //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getBaseInformation().getDiskImage().getBase());
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Base Disk Image", //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue());
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Child Disk Image", //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue());
-
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Resolution", //$NON-NLS-1$ //$NON-NLS-2$
- (prop.getConfiguration().getDevice().getDisplay().getResolution().getWidth()
- + "x" + prop.getConfiguration().getDevice().getDisplay().getResolution().getHeight())); //$NON-NLS-1$
-
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "DPI", //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getDevice().getDisplay().getDensity().getValue());
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Skin Path", //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getDevice().getDisplay().getSkinPath().getPath());
-
- if (prop.getConfiguration().getDevice().getTouch() != null) {
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Max Touch Point", //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getDevice().getTouch().getMaxTouchPoint());
- }
-
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "RAM Size", //$NON-NLS-1$ //$NON-NLS-2$
- prop.getConfiguration().getDevice().getRAM().getSize().getValue());
-
- if (prop.getConfiguration().getUsability().getFileSharing() != null) {
- String filePath = prop.getConfiguration().getUsability().getFileSharing().getPath();
- if (filePath != null && !filePath.isEmpty()) {
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "File Sharing Path", filePath); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "ImageType", conf.getBaseImageType()); //$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Platform", conf.getPlatformName()); //$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Profile", conf.getBaseImageProfile()); //$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Version", conf.getBaseImageVersion()); //$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Image Name", conf.getBaseImageName()); //$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Base Disk Image", conf.getBaseImagePath());//$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Child Disk Image", conf.getChildImagePath());//$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Resolution", (conf.getDisplayWidth() + "x" + conf.getDisplayHeight()));
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "DPI", conf.getDisplayDPI());//$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Skin Path", conf.getSkinPath() == null ? "" : conf.getSkinPath());//$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Max Touch Point", conf.getMaxTouchPoint());//$NON-NLS-1$ //$NON-NLS-2$
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "RAM Size", conf.getRamSize());//$NON-NLS-1$ //$NON-NLS-2$
+ String filePath = conf.getFileSharingPath();
+ if (filePath != null && !filePath.isEmpty()) {
+ str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "File Sharing Path", filePath); //$NON-NLS-1$ //$NON-NLS-2$
}
str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "HW Virtualization", //$NON-NLS-1$ //$NON-NLS-2$
- (prop.getConfiguration().getUsability().isHwVirtualization() ? "TRUE" : "FALSE")); //$NON-NLS-1$ //$NON-NLS-2$
+ (conf.supportHWVirtualization() ? "TRUE" : "FALSE")); //$NON-NLS-1$ //$NON-NLS-2$
str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "HW GL Acceleration", //$NON-NLS-1$ //$NON-NLS-2$
- (prop.getConfiguration().getUsability().isHwGLAcceleration() ? "TRUE" : "FALSE")); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (prop.getConfiguration().getUsability().getAdvancedOptions() != null) {
- str+= String.format("\t%-17s : %s" + StringResources.NEW_LINE, "Advanced Options: ", prop.getConfiguration().getUsability().getAdvancedOptions()); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ (conf.supporGLAcceleration() ? "TRUE" : "FALSE")); //$NON-NLS-1$ //$NON-NLS-2$
} catch (NullPointerException e) {
System.out.println(e.getMessage());
return null;
prop.initVMWorker();
- binaryVersion = prop.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getVersion();
- path = prop.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue();
+ binaryVersion = prop.getBaseImageBinaryVersion();
+ path = prop.getBaseImagePath();
base = prop.getPropertyValue().baseImage;
if (base.getPath().equals(path)
&& (binaryVersion == null || !binaryVersion.equals(base.getBinaryVersion()))) {
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.VMPropertyValue;
-import org.tizen.emulator.manager.vms.xml.DeviceType;
-import org.tizen.emulator.manager.vms.xml.DisplayType;
public abstract class ColumnContentHelper {
static final int numberOfColumns = 4;
@Override
public String getContent(VMProperty property) {
- DisplayType displayType = property.getConfiguration().getDevice().getDisplay();
- return displayType.getResolution().getWidth()
- + " x " + displayType.getResolution().getHeight(); //$NON-NLS-1$
+ return property.getVMConfiguration().getDisplayWidth()
+ + " x " + property.getVMConfiguration().getDisplayHeight(); //$NON-NLS-1$
}
}
@Override
public String getContent(VMProperty property) {
- DeviceType deviceType = property.getConfiguration().getDevice();
- return deviceType.getRAM().getSize().getValue() + ""; //$NON-NLS-1$
+ return property.getVMConfiguration().getRamSize() + ""; //$NON-NLS-1$
}
}
import org.tizen.emulator.manager.platform.baseimage.CustomBaseImageValue;
import org.tizen.emulator.manager.vms.RESOLUTION;
import org.tizen.emulator.manager.vms.SKIN_SHAPE;
+import org.tizen.emulator.manager.vms.VMOption;
import org.tizen.emulator.manager.vms.VMProperty.Architecture;
import org.tizen.emulator.manager.vms.VMPropertyValue;
+import org.tizen.emulator.manager.vms.VMSubOption;
import org.tizen.emulator.manager.vms.helper.HelperClass;
-import org.tizen.emulator.manager.vms.xml.OptionType;
-import org.tizen.emulator.manager.vms.xml.SubOptionType;
public class PropertyValue {
public Map<String, Boolean> getCheckBoxOptions(String name) {
Map<String, Boolean> valueMap = new HashMap<String, Boolean>();
if (isVMValue()) {
- OptionType options = vmValue.getAdvancedOption(name);
+ VMOption options = vmValue.getVMAdvancedOption(name);
if (options == null) {
return valueMap;
}
- for (SubOptionType subOption : options.getSubOption()) {
+ for (VMSubOption subOption : options.getSubOptionList()) {
valueMap.put(subOption.getName(), checkOn(subOption.getValue()));
}
baseImagePath = dest;
baseImagePartPath = dest + ".part"; //$NON-NLS-1$
- File childImage = new File(property.getConfiguration()
- .getBaseInformation().getDiskImage().getCurrentDiskImage()
- .getValue());
- File baseImage = new File(property.getConfiguration()
- .getBaseInformation().getDiskImage().getBaseDiskImage()
- .getValue());
+ File childImage = new File(property.getChildImagePath());
+ File baseImage = new File(property.getBaseImagePath());
if (!childImage.exists()) {
throw new VMWorkerException(Messages.getString("VMWorkerCommon.Error.0") //$NON-NLS-1$
+ childImage.getAbsolutePath());
checkPropertyModification();
isRunningNow();
- String basePath = property.getConfiguration().getBaseInformation()
- .getDiskImage().getBaseDiskImage().getValue();
- String targetPath = property.getConfiguration()
- .getBaseInformation().getDiskImage().getCurrentDiskImage()
- .getValue();
+ String basePath = property.getBaseImagePath();
+ String targetPath = property.getChildImagePath();
if (basePath == null || basePath.isEmpty()) {
throw new VMWorkerException(Messages.getString("VMWorkerCommon.PathError.1")); //$NON-NLS-1$
}
Creator.createInitialVMImage(basePath, targetPath);
-
- if (property.getConfiguration().getBaseInformation().getDiskImage()
- .getSwapDiskImage() != null) {
+ String swapTargetPath = property.getSwapImagePath();
+ if (swapTargetPath != null) {
String swapBasePath = FilePathResources.getSwapPath()
+ File.separator + StringResources.SWAP_IMAGE;
- String swapTargetPath = property.getConfiguration()
- .getBaseInformation().getDiskImage().getSwapDiskImage()
- .getValue();
if (!new File(swapBasePath).exists()) {
return;
}
public void cloneVM(String newVMName) throws VMWorkerException {
VMPropertyValue newValue = property.getPropertyValue();
newValue.vmsName = newVMName;
- // TODO
- newValue.isHWVirtualization = property.getConfiguration()
- .getUsability().isHwVirtualization();
// create lock acquire and release
Creator.create(newValue);
private static String isRunning(String line, VMProperty prop) {
if (EmulatorManager.isLinux()) {
- String imagePath = prop.getConfiguration().getBaseInformation()
- .getDiskImage().getCurrentDiskImage().getValue();
+ String imagePath = prop.getChildImagePath();
if (line.contains("emulator-x86") && line.contains(imagePath)) { //$NON-NLS-1$
return imagePath;
}
return titleName[titleName.length - 1];
}
} else if (EmulatorManager.isMac()) {
- String imagePath = prop.getConfiguration().getBaseInformation()
- .getDiskImage().getCurrentDiskImage().getValue();
+ String imagePath = prop.getChildImagePath();
if (line.contains("emulator-x86") && line.contains(imagePath)) { //$NON-NLS-1$
return imagePath;
}
public void getLaunchArgument(LaunchConfig config, VMProperty property)
throws VMLauncherException {
String hwVirtualization = ""; //$NON-NLS-1$
- if (property.getConfiguration().getUsability().isHwVirtualization()) {
+ if (property.getVMConfiguration().supportHWVirtualization()) {
hwVirtualization = CheckVT.getVTEnablingCommand();
} else {
// do nothing...
String rendering = null;
if (!EmulatorManager.isMac()
- && property.getConfiguration().getUsability().isHwGLAcceleration()) {
+ && property.getVMConfiguration().supporGLAcceleration()) {
rendering = "onscreen"; //$NON-NLS-1$
} else {
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- String skinPath = null;
- if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) {
- skinPath = property.getConfiguration().getDevice().getDisplay()
- .getSkinPath().getPath();
- if (skinPath != null && skinPath.isEmpty()) {
- skinPath = null;
- }
+ String skinPath = property.getVMConfiguration().getSkinPath();
+ if (skinPath != null && skinPath.isEmpty()) {
+ skinPath = null;
}
- int width = property.getConfiguration().getDevice().getDisplay()
- .getResolution().getWidth();
- int height = property.getConfiguration().getDevice().getDisplay()
- .getResolution().getHeight();
- int dpi = property.getConfiguration().getDevice().getDisplay()
- .getDensity().getValue();
+
+ int width = property.getVMConfiguration().getDisplayWidth();
+ int height = property.getVMConfiguration().getDisplayHeight();
+ int dpi = property.getVMConfiguration().getDisplayDPI();
if (skinPath != null) {
config.addVariableWithSpace(OPTION_KEY.VAR_SKIN_PATH, skinPath);
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- String fileshare = property.getConfiguration().getUsability()
- .getFileSharing().getPath();
+ String fileshare = property.getVMConfiguration().getFileSharingPath();
if (fileshare != null) {
config.addVariableWithSpace(OPTION_KEY.VAR_SHARING_PATH, fileshare);
config.addKernelOption("virtio-9p"); //$NON-NLS-1$
@Override
public void checkArgument(VMProperty property) throws VMLauncherException {
// Check File sharing
- String fileshare = property.getConfiguration().getUsability()
- .getFileSharing().getPath();
+ String fileshare = property.getVMConfiguration().getFileSharingPath();
if (fileshare != null) {
File f = new File(fileshare);
if (!f.exists()) {
String glVersion = property.getPropertyValue().
getAdvancedOptionValue(ItemName.GL_VERSION);
- if (property.getConfiguration().getUsability().isHwGLAcceleration()) {
+ if (property.getVMConfiguration().supporGLAcceleration()) {
if (glVersion.equals(GLVersionViewItem.VER1_VER2)) {
config.appendQemuOptions("-device", "vigs", "gl_version=2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
config.appendQemuOptions("-device", "yagl", "gl_version=2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property)
throws VMLauncherException {
- if (property.getConfiguration().getUsability().isHwGLAcceleration()) {
+ if (property.getVMConfiguration().supporGLAcceleration()) {
config.addVariable(OPTION_KEY.VAR_WSI, "vigs_wsi");
config.appendQemuOptions("-device", "vigs", "backend=gl,wsi=" + varForm(OPTION_KEY.VAR_WSI)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
config.appendQemuOptions("-device", "yagl", "wsi=" + varForm(OPTION_KEY.VAR_WSI)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
import org.tizen.emulator.manager.vms.CPU;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.helper.VMLauncherException;
-import org.tizen.emulator.manager.vms.xml.CpuType;
public class ProcessorOption extends Option {
}
private int getCpuNum(VMProperty property) {
- CpuType cpuType = property.getConfiguration().getDevice().getCPU();
- if (cpuType != null) {
- return cpuType.getValue().getValue();
+ int cpuCount = property.getVMConfiguration().getCPUCount();
+ if (cpuCount != 0) {
+ return cpuCount;
} else {
if (CheckVT.isNonUG()) {
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- int ramSize = property.getConfiguration().getDevice().getRAM()
- .getSize().getValue();
+ int ramSize = property.getVMConfiguration().getRamSize();
config.addVariable(OPTION_KEY.VAR_RAM, String.valueOf(ramSize));
config.addQemuOption("-m", varForm(OPTION_KEY.VAR_RAM)); //$NON-NLS-1$
}
package org.tizen.emulator.manager.vms.option;
import org.tizen.emulator.manager.ui.renewal.item.ItemName;
+import org.tizen.emulator.manager.vms.VMOption;
import org.tizen.emulator.manager.vms.VMProperty;
-import org.tizen.emulator.manager.vms.xml.OptionType;
public class SensorOption extends Option {
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- OptionType sensor = property.getPropertyValue().getAdvancedOption(
- ItemName.SENSOR);
+ VMOption sensor = property.getPropertyValue().getVMAdvancedOption(ItemName.SENSOR);
StringBuilder sb = new StringBuilder();
if (sensor != null) {
if (checkOnOff(property.getPropertyValue()
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- if (property.getConfiguration().getUsability().isSupportSuspend()) {
+ if (property.getVMConfiguration().supportSuspend()) {
config.addQemuOption("-enable-suspend"); //$NON-NLS-1$
}
}
package org.tizen.emulator.manager.vms.option;
import org.tizen.emulator.manager.vms.VMProperty;
-import org.tizen.emulator.manager.vms.xml.TouchType;
public class TouchPointOption extends Option {
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- TouchType touchType = property.getConfiguration().getDevice()
- .getTouch();
- if (touchType != null && touchType.getMaxTouchPoint() > 0) {
+ int touchPoint = property.getVMConfiguration().getMaxTouchPoint();
+ if (touchPoint > 0) {
config.addVariable(OPTION_KEY.VAR_MAX_POINT,
- String.valueOf(touchType.getMaxTouchPoint()));
+ String.valueOf(touchPoint));
config.addQemuOption("-device", "virtio-touchscreen-pci,max_point=" //$NON-NLS-1$ //$NON-NLS-2$
+ varForm(OPTION_KEY.VAR_MAX_POINT));
} else {