From 6daca4bd38a5e54e17e17f2183c9dc0248347db6 Mon Sep 17 00:00:00 2001 From: "minkee.lee" Date: Mon, 23 Nov 2015 16:32:24 +0900 Subject: [PATCH] vm-modify: add camera item Change-Id: I48565d120a3444a172ffea0d6c5425fb191818d9 Signed-off-by: minkee.lee --- resource/renewal/res/icon_title_camera.png | Bin 0 -> 2979 bytes resource/renewal/res/icon_title_connectivity.png | Bin 0 -> 3129 bytes .../manager/devices/DeviceTemplateValue.java | 14 ++ .../tizen/emulator/manager/platform/BaseImage.java | 2 +- .../manager/renewal/resources/ImageResources.java | 2 + .../manager/template/renewal/VMTemplateUtil.java | 44 ++-- .../manager/ui/renewal/dialog/ItemListComp.java | 5 + .../manager/ui/renewal/dialog/VMModifyDialog.java | 4 +- .../ui/renewal/item/CommonItemListFactory.java | 53 +++-- .../ui/renewal/item/CommonOptionFactory.java | 8 +- .../emulator/manager/ui/renewal/item/ItemName.java | 10 +- .../manager/ui/renewal/item/OptionName.java | 11 + .../renewal/item/modify/common/CheckBoxItem.java | 5 +- .../ui/renewal/item/modify/common/ComboItem.java | 1 - .../item/modify/common/ConnectivityItem.java | 11 +- .../renewal/item/modify/common/FileDialogItem.java | 23 +- .../item/modify/common/ModifyDialogItem.java | 12 +- .../ui/renewal/item/modify/common/SensorItem.java | 9 + .../item/modify/comp/AdvancedPropertyViewer.java | 15 ++ .../ui/renewal/item/modify/comp/ItemTitle.java | 4 +- .../ui/renewal/item/modify/comp/PropertyValue.java | 22 ++ .../renewal/item/modify/template/CameraItem.java | 12 +- .../ui/renewal/item/modify/vm/CameraImageItem.java | 171 +++++++++++++++ .../ui/renewal/item/modify/vm/CameraItem.java | 222 +++++++++++++++++++ .../renewal/item/modify/vm/CameraLegacyItem.java | 84 +++++++ .../ui/renewal/item/modify/vm/CameraTypeItem.java | 243 +++++++++++++++++++++ .../ui/renewal/item/modify/vm/CategoryItem.java | 22 ++ .../renewal/item/modify/vm/DeviceTemplateItem.java | 17 +- .../ui/renewal/item/modify/vm/FileSharingItem.java | 3 + .../renewal/item/modify/vm/NetConnectTypeItem.java | 1 - .../ui/renewal/item/modify/vm/NetworkItem.java | 28 +-- .../renewal/tableviewer/CreateVMTableViewer.java | 41 +++- .../manager/ui/renewal/widgets/ComboBox.java | 14 ++ .../emulator/manager/vms/VMPropertyValue.java | 2 +- .../manager/vms/option/CameraLegacyOption.java | 50 +++++ xsd/x86-standard-template-v2.xml | 22 +- 36 files changed, 1101 insertions(+), 86 deletions(-) create mode 100644 resource/renewal/res/icon_title_camera.png create mode 100644 resource/renewal/res/icon_title_connectivity.png create mode 100644 src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java create mode 100644 src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraItem.java create mode 100644 src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraLegacyItem.java create mode 100644 src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraTypeItem.java create mode 100644 src/org/tizen/emulator/manager/vms/option/CameraLegacyOption.java diff --git a/resource/renewal/res/icon_title_camera.png b/resource/renewal/res/icon_title_camera.png new file mode 100644 index 0000000000000000000000000000000000000000..f5026b35eec33f1018119ff50ae1dabcbcb72c9f GIT binary patch literal 2979 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 Z4gm5-LA^na)=mHb002ovPDHLkV1j`*gVF#1 literal 0 HcmV?d00001 diff --git a/resource/renewal/res/icon_title_connectivity.png b/resource/renewal/res/icon_title_connectivity.png new file mode 100644 index 0000000000000000000000000000000000000000..f0448cfb0fca403e44d9704791f59e95ab11445a GIT binary patch literal 3129 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 osList = Arrays.asList(opt.getValue().trim(). split(StringResources.REG_EXP_SPLIT_COMMA)); - if (EmulatorManager.isWin() && !osList.contains(OptionType.WIN)) { + if (EmulatorManager.isWin() && !osList.contains(OptionName.WIN)) { isSupportOS = false; } - if (EmulatorManager.isLinux() && !osList.contains(OptionType.LINUX)) { + if (EmulatorManager.isLinux() && !osList.contains(OptionName.LINUX)) { isSupportOS = false; } - if (EmulatorManager.isMac() && !osList.contains(OptionType.MAC)) { + if (EmulatorManager.isMac() && !osList.contains(OptionName.MAC)) { isSupportOS = false; } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/dialog/ItemListComp.java b/src/org/tizen/emulator/manager/ui/renewal/dialog/ItemListComp.java index ad10be7..ab63cbe 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/dialog/ItemListComp.java +++ b/src/org/tizen/emulator/manager/ui/renewal/dialog/ItemListComp.java @@ -191,6 +191,9 @@ public class ItemListComp { boolean isOKButtonEnable = true; for (ModifyDialogItem dialogItem : itemList) { + if (!dialogItem.isUse()) { + continue; + } if (!dialogItem.isValid()) { isOKButtonEnable = false; } @@ -293,6 +296,8 @@ public class ItemListComp { item.setInitialValue(propertyValue); } changeItemList(itemList, imageItems); + checkValid(); + layoutScrolledComposite(); diff --git a/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java b/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java index f7f8c86..6ffe6ff 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java +++ b/src/org/tizen/emulator/manager/ui/renewal/dialog/VMModifyDialog.java @@ -42,8 +42,8 @@ import org.tizen.emulator.manager.vms.VMPropertyValue; public class VMModifyDialog extends ModifyDialog { private final static String TITLE = "VM Modify"; - public final static int WIDTH = 484; -// private final static int WIDTH = 500; +// public final static int WIDTH = 484; + public final static int WIDTH = 494; // private final static int HEIGHT = 496; private final static int HEIGHT = 497; diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/CommonItemListFactory.java b/src/org/tizen/emulator/manager/ui/renewal/item/CommonItemListFactory.java index 462d936..1c3333f 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/CommonItemListFactory.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/CommonItemListFactory.java @@ -48,6 +48,10 @@ import org.tizen.emulator.manager.ui.renewal.item.modify.common.ProfileItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.RamSizeItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.SensorItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.TreeModifyItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraImageItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraLegacyItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraTypeItem; import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CategoryItem; import org.tizen.emulator.manager.ui.renewal.item.modify.vm.DeviceTemplateItem; import org.tizen.emulator.manager.ui.renewal.item.modify.vm.FileSharingItem; @@ -98,43 +102,55 @@ public class CommonItemListFactory implements IItemListFactory{ } - public void addSubItems(List items, CategoryItem dialogItem) { + public void addSubItems(List items, CategoryItem categoryItem) { for (VMItem item : items) { if (!VMTemplateUtil.checkItemAvailable(item)) { continue; } - addSubItem(item, dialogItem); + addSubItem(item, categoryItem); } } - public void addSubItem(VMItem item, CategoryItem dialogItem) { + public void addSubItem(VMItem item, CategoryItem categoryItem) { String name = item.getName(); String title = item.getTitle(); if (name.equals(ItemName.NET_PROXY)) { - dialogItem.addSubItems(new NetProxyItem(VMTemplateUtil.getProxyItemMap(item.getOptions()))); + categoryItem.addSubItems(new NetProxyItem(VMTemplateUtil.getProxyItemMap(item.getOptions()))); } else if (name.equals(ItemName.NET_CONNECT_TYPE)) { - dialogItem.addSubItems(new NetConnectTypeItem(title, + categoryItem.addSubItems(new NetConnectTypeItem(title, VMTemplateUtil.getOptionList(item.getOptions()))); } else if (name.equals(ItemName.NET_TAP_DEVICE)) { if (EmulatorManager.isWin()) { - dialogItem.addSubItems(new NetTapDeviceItemForWin(title)); + categoryItem.addSubItems(new NetTapDeviceItemForWin(title)); } else { - dialogItem.addSubItems(new NetTapDeviceItem(title)); + categoryItem.addSubItems(new NetTapDeviceItem(title)); } } else if (name.equals(ItemName.NET_IP_INFO)) { - dialogItem.addSubItems(new NetIPInfoItem(title)); + categoryItem.addSubItems(new NetIPInfoItem(title)); } else if (name.equals(ItemName.NET_DNS)) { - dialogItem.addSubItems(new NetDnsItem(title)); + categoryItem.addSubItems(new NetDnsItem(title)); } else if (name.equals(ItemName.NET_MAC)) { - dialogItem.addSubItems(new NetMacItem(title)); + categoryItem.addSubItems(new NetMacItem(title)); + + } else if (name.equals(ItemName.CAMERA_TYPE_FRONT)) { + categoryItem.addSubItems(new CameraTypeItem(name, title)); + + } else if (name.equals(ItemName.CAMERA_TYPE_REAR)) { + categoryItem.addSubItems(new CameraTypeItem(name, title)); + + } else if (name.equals(ItemName.CAMERA_IMAGE_FRONT)) { + categoryItem.addSubItems(new CameraImageItem(name, title)); + + } else if (name.equals(ItemName.CAMERA_IMAGE_REAR)) { + categoryItem.addSubItems(new CameraImageItem(name, title)); } } @@ -152,6 +168,7 @@ public class CommonItemListFactory implements IItemListFactory{ String name = item.getName(); String title = item.getTitle(); + String type = item.getType(); if (name.equals(ItemName.NAME)) { @@ -192,11 +209,19 @@ public class CommonItemListFactory implements IItemListFactory{ itemList.add(new HWSupportItem()); } else if (name.equals(ItemName.NETWORK)) { - CategoryItem categoryItem = new NetworkItem(); - itemList.add(categoryItem); - addSubItems(item.getSubItems(), categoryItem); + CategoryItem networkItem = new NetworkItem(); + itemList.add(networkItem); + addSubItems(item.getSubItems(), networkItem); + + } else if (name.equals(ItemName.CAMERA)) { + CategoryItem cameraItem = new CameraItem(null, title); + itemList.add(cameraItem); + addSubItems(item.getSubItems(), cameraItem); + + } else if (name.equals(ItemName.CAMERA_LEGACY)) { + itemList.add(new CameraLegacyItem(name, title, VMTemplateUtil.getNumColomnOption(item), + treeRoot, VMTemplateUtil.getCheckBoxDataList(item))); } - } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/CommonOptionFactory.java b/src/org/tizen/emulator/manager/ui/renewal/item/CommonOptionFactory.java index 233ee5a..965b380 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/CommonOptionFactory.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/CommonOptionFactory.java @@ -37,6 +37,7 @@ import java.util.List; import org.tizen.emulator.manager.template.renewal.VMItem; import org.tizen.emulator.manager.vms.option.BaseImageOption; import org.tizen.emulator.manager.vms.option.CPUSupportOption; +import org.tizen.emulator.manager.vms.option.CameraLegacyOption; import org.tizen.emulator.manager.vms.option.CommonOption; import org.tizen.emulator.manager.vms.option.ConnectivityOption; import org.tizen.emulator.manager.vms.option.DisplayModeOption; @@ -132,16 +133,19 @@ public class CommonOptionFactory implements IOptionFactory { } else if (name.equals(ItemName.NET_PROXY)) { optionList.add(Option.getInstance(NetProxyOption.class)); + } else if (name.equals(ItemName.CAMERA_LEGACY)) { + optionList.add(Option.getInstance(CameraLegacyOption.class)); + } else if (name.equals(ItemName.CAMERA)) { // add sub options (rear camera, front camera) if (item.getSubItems() != null) { makeCommonOptionList(optionList, item.getSubItems()); } - } else if (name.equals(ItemName.CAMERA_REAR)) { + } else if (name.equals(ItemName.CAMERA_TYPE_REAR)) { optionList.add(Option.getInstance(RearCameraOption.class)); - } else if (name.equals(ItemName.CAMERA_FRONT)) { + } else if (name.equals(ItemName.CAMERA_TYPE_FRONT)) { optionList.add(Option.getInstance(FrontCameraOption.class)); } else if (name.equals(ItemName.SENSOR)) { diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/ItemName.java b/src/org/tizen/emulator/manager/ui/renewal/item/ItemName.java index 8bc0a51..c1e92d9 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/ItemName.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/ItemName.java @@ -50,11 +50,15 @@ public class ItemName { public static final String CONNECTIVITY = "connectivity"; public static final String SENSOR = "sensor"; //$NON-NLS-1$ - public static final String DEVICE = "device"; //$NON-NLS-1$ + public static final String DEVICES = "devices"; //$NON-NLS-1$ public static final String JACK = "jack"; //$NON-NLS-1$ + public static final String CAMERA_LEGACY = "cameraLegacy"; + public static final String CAMERA_REAR = "rear"; public static final String CAMERA = "camera"; //$NON-NLS-1$ - public static final String CAMERA_REAR = "rearType"; - public static final String CAMERA_FRONT = "frontType"; + public static final String CAMERA_TYPE_REAR = "rearType"; + public static final String CAMERA_TYPE_FRONT = "frontType"; + public static final String CAMERA_IMAGE_REAR = "rearImage"; //$NON-NLS-1$ + public static final String CAMERA_IMAGE_FRONT = "frontImage"; //$NON-NLS-1$ public static final String NET_CONFIG = "netConfig"; //$NON-NLS-1$ public static final String NET_PROXY = "proxy"; //$NON-NLS-1$ diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/OptionName.java b/src/org/tizen/emulator/manager/ui/renewal/item/OptionName.java index 4459be7..2acaf65 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/OptionName.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/OptionName.java @@ -36,5 +36,16 @@ public class OptionName { public static final String NUM_COLUMN = "numColumn"; public static final String EXPERIMENTAL = "experimental"; public static final String LIST = "list"; + public static final String SUPPORT_OS = "supportOS"; + + public static final String VALUE_TRUE = "true"; + public static final String VALUE_FALSE = "false"; + + public static final String VALUE_ON = "on"; //$NON-NLS-1$ + public static final String VALUE_OFF = "off"; //$NON-NLS-1$ + + public static final String LINUX = "linux"; //$NON-NLS-1$ + public static final String WIN = "win"; //$NON-NLS-1$ + public static final String MAC = "mac"; //$NON-NLS-1$ } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/CheckBoxItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/CheckBoxItem.java index 79837f1..25e66ae 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/CheckBoxItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/CheckBoxItem.java @@ -162,7 +162,7 @@ public class CheckBoxItem extends ModifyDialogItem { } - private void updateCheckBoxSubItems() { + protected void updateCheckBoxSubItems() { for (CheckBoxSubItem subItem : subItemList) { boolean isDataExist = false; for (CheckItemData data : dataList) { @@ -186,7 +186,7 @@ public class CheckBoxItem extends ModifyDialogItem { } - private void layoutCheckBoxSubItems() { + protected void layoutCheckBoxSubItems() { // layout subitems int top = 0; @@ -310,7 +310,6 @@ public class CheckBoxItem extends ModifyDialogItem { valueMap.put(subItem.getName(), subItem.isChecked()); } value.setCheckBoxOptions(getName(), valueMap); - } @Override diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java index f5c0d31..66092bc 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java @@ -87,7 +87,6 @@ public abstract class ComboItem extends ModifyDialogItem { } - protected String getSelectedItem() { return comboBox.getSelectedItem(); } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ConnectivityItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ConnectivityItem.java index 16c3f5d..4ea2507 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ConnectivityItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ConnectivityItem.java @@ -30,9 +30,11 @@ package org.tizen.emulator.manager.ui.renewal.item.modify.common; +import java.util.ArrayList; import java.util.List; import org.eclipse.swt.widgets.Composite; +import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.TreeModifyItem; public class ConnectivityItem extends CheckBoxItem { @@ -58,11 +60,18 @@ public class ConnectivityItem extends CheckBoxItem { @Override public void create(Composite parent) { item.init(parent); - item.setItemTitle(createIconTitle(item, null)); + item.setItemTitle(createIconTitle(item, ImageResources.ICON_TITLE_CONNECTIVITY)); item.create(); createCheckBoxItems(item); } + @Override + public ModifyDialogItem cloneItem() { + List dataList = new ArrayList(); + dataList.addAll(this.dataList); + return new ConnectivityItem(null, dataList); + } + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java index d2bcdfd..32768d5 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java @@ -72,6 +72,11 @@ public abstract class FileDialogItem extends ModifyDialogItem { lastPath = path; } + + public int getContentRight(int boxWidth) { + return boxWidth + BUTTON_SPACE + BUTTON_WIDTH; + } + public static String getLastDirectoryPath() { return lastPath; } @@ -91,7 +96,7 @@ public abstract class FileDialogItem extends ModifyDialogItem { makeBody(textBoxWidth); } - private void makeBody(int textBoxWidth) { + protected void makeBody(int textBoxWidth) { item.setBodyLayoutForm(); @@ -178,4 +183,20 @@ public abstract class FileDialogItem extends ModifyDialogItem { } public abstract void fileSelected(); + + + public void setItemEnable(boolean enable) { + textBox.setEnabled(enable); + fileDialogButton.setShowImage(enable); + item.setTitleEnable(enable); + } + + + + @Override + public void changeWidgetState(boolean isError) { + if (!getItemListComp().isDetailMode()) { + textBox.setError(isError); + } + } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java index 76728f2..89afef2 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java @@ -67,7 +67,7 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { public static final int ERROR_ICON_SPACING_INNER = 3; // decide item's visibility in dialog - private final boolean isUse = true; + private boolean isUse = true; // This decide whether draw bottom line or not. private boolean isDrawBottomLine = true; @@ -79,6 +79,14 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { } } + public boolean isUse() { + return isUse; + } + + public void setUse(boolean isUse) { + this.isUse = isUse; + } + public void redrawBottomLine() { item.getBody().redraw(); item.getItemTitle().redrawBottomLine(isDrawBottomLine); @@ -181,6 +189,8 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { } else { data.heightHint = 0; } + + setUse(isVisible); } public void setVisible() { diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java index dc049e7..2288766 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/SensorItem.java @@ -31,6 +31,7 @@ package org.tizen.emulator.manager.ui.renewal.item.modify.common; +import java.util.ArrayList; import java.util.List; import org.eclipse.swt.widgets.Composite; @@ -75,4 +76,12 @@ public class SensorItem extends CheckBoxItem { } + @Override + public ModifyDialogItem cloneItem() { + List dataList = new ArrayList(); + dataList.addAll(this.dataList); + return new SensorItem(null, dataList); + } + + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/AdvancedPropertyViewer.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/AdvancedPropertyViewer.java index 0abd21a..259c06a 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/AdvancedPropertyViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/AdvancedPropertyViewer.java @@ -53,7 +53,9 @@ import org.tizen.emulator.manager.ui.renewal.MainDialog; import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE; import org.tizen.emulator.manager.ui.renewal.dialog.ItemListComp; import org.tizen.emulator.manager.ui.renewal.dialog.ValidationListener; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraItem; import org.tizen.emulator.manager.ui.renewal.tableviewer.CreateVMTableViewer; @@ -227,4 +229,17 @@ public class AdvancedPropertyViewer { public void saveDataInto(Object value) { itemListComp.saveDataInto(value); } + + // return if item is showing in advanced option. + public CameraItem getCameraItem() { + for (ModifyDialogItem item :itemListComp.getItemList()) { + if (item.getName().equals(ItemName.CAMERA)) { + if (item.isUse()) { + return (CameraItem)item; + } + break; + } + } + return null; + } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java index 2c7f9f4..b3506ac 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java @@ -45,8 +45,8 @@ import org.tizen.emulator.manager.renewal.resources.FontResources; public class ItemTitle extends Canvas{ public static final int TITLE_SPACING = 8; -// private final int TITLE_CANVAS_WIDTH = 144; - public static final int TITLE_CANVAS_WIDTH = 130; + public static final int TITLE_CANVAS_WIDTH = 140; +// public static final int TITLE_CANVAS_WIDTH = 130; private final int LINE_INDENT = 5; protected int ICON_WIDTH = 18; diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/PropertyValue.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/PropertyValue.java index c502eed..9bda608 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/PropertyValue.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/PropertyValue.java @@ -44,6 +44,7 @@ import org.tizen.emulator.manager.devices.SubDeviceItem; import org.tizen.emulator.manager.platform.Platform; import org.tizen.emulator.manager.platform.Skin; import org.tizen.emulator.manager.platform.baseimage.CustomBaseImageValue; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; import org.tizen.emulator.manager.vms.RESOLUTION; import org.tizen.emulator.manager.vms.SKIN_SHAPE; import org.tizen.emulator.manager.vms.VMOption; @@ -417,6 +418,15 @@ public class PropertyValue { return valueMap; } + public Map getCameraCheckOptions() { + if (isVMValue()) { + return getCheckBoxOptions(ItemName.CAMERA_LEGACY); + + } else { + return getCheckBoxOptions(ItemName.CAMERA); + } + } + public void setCPUVirtualization(boolean isOn) { if (isVMValue()) { @@ -525,6 +535,18 @@ public class PropertyValue { public boolean getCheckBoxValue(String name, String subName) { if (isVMValue()) { return checkOn(getSubOptionValue(name, subName)); + + } else if (isTemplateValue()) { + for (SubDevice subDevice : templateValue.getAdditionalDevices()) { + if (subDevice.getName().equals(name)) { + for (SubDeviceItem subDeviceItem : subDevice.getItems()) { + if (subDeviceItem.getId().equals(subName)) { + return subDeviceItem.isSupport(); + } + } + } + } + return false; } return true; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/template/CameraItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/template/CameraItem.java index 15a6b41..274aefc 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/template/CameraItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/template/CameraItem.java @@ -30,11 +30,14 @@ package org.tizen.emulator.manager.ui.renewal.item.modify.template; +import java.util.ArrayList; import java.util.List; import org.eclipse.swt.widgets.Composite; +import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.ui.renewal.item.modify.common.CheckBoxItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.CheckItemData; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; public class CameraItem extends CheckBoxItem { @@ -59,7 +62,7 @@ public class CameraItem extends CheckBoxItem { @Override public void create(Composite parent) { item.init(parent); - item.setItemTitle(createIconTitle(item, null)); + item.setItemTitle(createIconTitle(item, ImageResources.ICON_TITLE_CAMERA)); item.create(); createCheckBoxItems(item); @@ -67,4 +70,11 @@ public class CameraItem extends CheckBoxItem { } + @Override + public ModifyDialogItem cloneItem() { + List dataList = new ArrayList(); + dataList.addAll(this.dataList); + return new CameraItem(dataList); + } + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java new file mode 100644 index 0000000..3ee8e5a --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java @@ -0,0 +1,171 @@ +/* + * Emulator Manager + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Minkee Lee + * JiHye Kim + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui.renewal.item.modify.vm; + +import java.io.File; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.emulator.manager.renewal.resources.ColorResources; +import org.tizen.emulator.manager.resources.FilePathResources; +import org.tizen.emulator.manager.ui.Messages; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.FileDialogItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubModifyItem; + +public class CameraImageItem extends FileDialogItem { + + private String imagePath; // directory + private CameraItem cameraItem; + + private static final String DEFAULT_FRONT_IMG = "default-image1.gif"; + private static final String DEFAULT_REAR_IMG = "default-image2.gif"; + + + public CameraImageItem(String name, String title) { + super(name, title); + } + + @Override + public void create(Composite parent) { + item = new SubModifyItem(this); + item.setItemHeight(SubModifyItem.ITEM_HEIGHT); + item.init(parent); + item.setItemTitle(new SubItemTitle(item.getItemComp(), getTitle(), + ColorResources.WHITE)); + item.create(); + + makeBody(SubModifyItem.BOX_WIDTH); + + setTextBox(imagePath); + } + + + @Override + public void setParentItem(ModifyDialogItem parentItem) { + super.setParentItem(parentItem); + cameraItem = (CameraItem)parentItem; + } + + private void updateUI() { + if (imagePath == null || imagePath.isEmpty()) { + setTextBox("(select sharing path...)"); + + } else { + setTextBox(imagePath); + } + + } + @Override + public void setInitialValue(PropertyValue value) { + imagePath = value.getSubOptionValue(getParentItem().getName(), getName()); + settingImagePath(); +// setTextBox(imagePath); + + } + + @Override + public void setValue(PropertyValue value) { + value.setSubOptionValue(getParentItem().getName(), getName(), imagePath); + + } + + @Override + public ModifyDialogItem cloneItem() { + return new CameraImageItem(getName(), getTitle()); + } + + + @Override + public void fileSelected() { + imagePath = filePath; + getItemListComp().checkValid(); + } + + + public void reset(String cameraType) { + if (CameraItem.TYPE_VIRTUAL.equals(cameraType)) { + activate(); + } else { + deactivate(); + } + } + + private void settingImagePath() { + if (imagePath == null || imagePath.isEmpty()) { + imagePath = FilePathResources.getToolEmulatorImagesPath() + + File.separator + + (ItemName.CAMERA_IMAGE_FRONT.equals(getName()) ? DEFAULT_FRONT_IMG + : DEFAULT_REAR_IMG); + } + } + + public void activate() { + setItemEnable(true); + settingImagePath(); + setTextBox(imagePath); + } + + public void deactivate() { + imagePath = ""; //$NON-NLS-1$ + setTextBox(imagePath); + setItemEnable(false); + } + + @Override + public boolean isValid() { + boolean isValid = true; + String msg = ""; + CameraTypeItem cameraType = cameraItem.getCameraTypeItem(getName()); + if (cameraType.isVirtualSelected()) { + if (imagePath == null || imagePath.isEmpty()) { + msg = Messages.getString("CameraImageSubViewItem.ImageFileError.0"); //$NON-NLS-1$ + + } else { + File f = new File(imagePath); + if (!f.exists()) { + msg = Messages.getString("CameraImageSubViewItem.ImageFileError.1"); //$NON-NLS-1$ + } + } + } + + if (!msg.isEmpty()) { + isValid = false; + } + + changeItemState(!isValid, getContentRight(SubModifyItem.BOX_WIDTH), msg); + + return isValid; + } + +} diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraItem.java new file mode 100644 index 0000000..e0863a2 --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraItem.java @@ -0,0 +1,222 @@ +/* + * Emulator Manager + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Minkee Lee + * JiHye Kim + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui.renewal.item.modify.vm; + +import java.util.Arrays; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.emulator.manager.renewal.resources.ImageResources; +import org.tizen.emulator.manager.resources.FilePathResources; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubTreeModifyItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.TreeModifyItem; +import org.tizen.emulator.manager.vms.helper.HelperClass; +import org.tizen.emulator.manager.vms.helper.ProcessResult; + +public class CameraItem extends CategoryItem { + + public static final String NAME = "camera"; + + public static final String TYPE_NONE = "(none)"; //$NON-NLS-1$ + public static final String TYPE_WEBCAM = "Webcam"; //$NON-NLS-1$ + public static final String TYPE_VIRTUAL = "Virtual"; //$NON-NLS-1$ + + public static Boolean webcamSupport = null; + + public CameraItem(TreeModifyItem treeRoot, String title) { + super(NAME, title); + if (treeRoot == null) { + item = new ModifyItem(this); + + } else { + item = new SubTreeModifyItem(this,treeRoot); + treeRoot.addSubItem((SubTreeModifyItem)item); + } + } + + + @Override + public void create(Composite parent) { + int itemHeight = 0; + if (subItems.size() == 0) { + itemHeight = ModifyItem.ITEM_HEIGHT; + + } else { + for (ModifyDialogItem subItem : subItems) { + subItem.setDrawBottomLine(false); + } + itemHeight = getItemHeight(); + } + +// item = new ModifyItem(this); + item.setItemHeight(itemHeight); + item.init(parent); + + // TODO set camera icon + item.setItemTitle(createIconTitle(item, ImageResources.ICON_TITLE_CAMERA)); + item.create(); + + makeBody(); + } + + + private void makeBody() { + item.setBodyLayoutGrid(1, 0); + createSubItems(); + } + + + private void createSubItems() { + for (ModifyDialogItem item : subItems) { + item.setParentItem(this); + item.setItemListComp(this.getItemListComp()); + item.setInitialValue(this.getItemListComp().getPropertyValue()); + item.create(this.item.getBody()); + item.setVisible(); + } + + CameraTypeItem rearTypeItem = getRearTypeItem(); + CameraTypeItem frontTypeItem = getFrontTypeItem(); + String rearType = rearTypeItem == null ? TYPE_NONE : rearTypeItem.getCameraType(); + String frontType = frontTypeItem == null ? TYPE_NONE : frontTypeItem.getCameraType(); + if (rearTypeItem != null) { + rearTypeItem.reset(frontType); + getRearImageItem().reset(rearType); + } + if (frontTypeItem != null) { + frontTypeItem.reset(rearType); + getFrontImageItem().reset(frontType); + } + } + + + public void setRearCameraCheck(boolean isCheck) { + CameraTypeItem rearTypeItem = getRearTypeItem(); + if (rearTypeItem == null) { + return; + } + + String cameraType = isCheck ? "" : TYPE_NONE; + rearTypeItem.setCameraTypeAndSelect(cameraType); + } + + + @Override + public ModifyDialogItem cloneItem() { + CameraItem item = new CameraItem(null, getTitle()); + for (ModifyDialogItem subItem : subItems) { + item.addSubItems(subItem.cloneItem()); + } + + return item; + } + + + private static boolean checkWebcam() { + ProcessResult res = HelperClass.runProcess(Arrays + .asList(FilePathResources.getCheckCamPath())); + int result = res.getExitValue(); + if (result == 1) { + return true; + } else { + return false; + } + } + + public static boolean isWebcamSupport() { + if (webcamSupport == null) { + webcamSupport = checkWebcam(); + } + return webcamSupport; + } + + + private CameraTypeItem getRearTypeItem() { + return (CameraTypeItem)getSubItemByName(ItemName.CAMERA_TYPE_REAR); + } + + private CameraTypeItem getFrontTypeItem() { + return (CameraTypeItem)getSubItemByName(ItemName.CAMERA_TYPE_FRONT); + } + + private CameraImageItem getRearImageItem() { + return (CameraImageItem)getSubItemByName(ItemName.CAMERA_IMAGE_REAR); + } + + private CameraImageItem getFrontImageItem() { + return (CameraImageItem)getSubItemByName(ItemName.CAMERA_IMAGE_FRONT); + } + + + public CameraImageItem getCameraImageItem(String typeItemName) { + if (typeItemName.equals(ItemName.CAMERA_TYPE_FRONT)) { + return getFrontImageItem(); + } else { + return getRearImageItem(); + } + } + + public CameraTypeItem getCameraTypeItem(String imageItemName) { + if (imageItemName.equals(ItemName.CAMERA_IMAGE_FRONT)) { + return getFrontTypeItem(); + } else { + return getRearTypeItem(); + } + } + + public CameraTypeItem getAnotherCameraTypeItem(String typeItemName) { + if (typeItemName.equals(ItemName.CAMERA_TYPE_FRONT)) { + return getRearTypeItem(); + } else { + return getFrontTypeItem(); + } + } + + @Override + public boolean isValid() { + boolean isValid = true; + for (ModifyDialogItem item : subItems) { + if(!item.isValid()) { + isValid = false; + } + } + return isValid; + } + + @Override + public void changeItemValue(PropertyValue value) { + boolean useRear = value.getCheckBoxValue(ItemName.CAMERA, ItemName.CAMERA_REAR); + setRearCameraCheck(useRear); + } +} diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraLegacyItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraLegacyItem.java new file mode 100644 index 0000000..face322 --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraLegacyItem.java @@ -0,0 +1,84 @@ +/* + * Emulator Manager + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Minkee Lee + * JiHye Kim + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui.renewal.item.modify.vm; + +import java.util.List; +import java.util.Map; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.emulator.manager.renewal.resources.ImageResources; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.CheckBoxItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.CheckBoxSubItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.CheckItemData; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.TreeModifyItem; + +public class CameraLegacyItem extends CheckBoxItem { + + public CameraLegacyItem(String name, String title, int numColomn, + TreeModifyItem treeRoot, List dataList) { + super(name, title, numColomn, treeRoot, dataList); + } + + @Override + public void create(Composite parent) { + item.init(parent); + item.setItemTitle(createIconTitle(item, ImageResources.ICON_TITLE_CAMERA)); + item.create(); + + createCheckBoxItems(item); + } + + @Override + public void changeItemValue(PropertyValue value) { + setInitialValue(value); + updateCheckBoxSubItems(); + layoutCheckBoxSubItems(); + } + + + @Override + public void setInitialValue(PropertyValue value) { + Map valueMap = value.getCameraCheckOptions(); + this.valueMap = valueMap; + } + + + @Override + public void setValue(PropertyValue value) { + valueMap.clear(); + for (CheckBoxSubItem subItem : getSubItemList()) { + valueMap.put(subItem.getName(), subItem.isChecked()); + } + value.setCheckBoxOptions(getName(), valueMap); + } + +} diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraTypeItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraTypeItem.java new file mode 100644 index 0000000..20e0f35 --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraTypeItem.java @@ -0,0 +1,243 @@ +/* + * Emulator Manager + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Minkee Lee + * JiHye Kim + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui.renewal.item.modify.vm; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.emulator.manager.renewal.resources.ColorResources; +import org.tizen.emulator.manager.ui.detail.item.property.CameraViewItem; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.ComboItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubModifyItem; +import org.tizen.emulator.manager.ui.renewal.widgets.ComboBox; + +public class CameraTypeItem extends ComboItem { + + String cameraType = ""; + + private CameraItem cameraItem; + + public CameraTypeItem(String name, String title) { + super(name, title); + } + + @Override + public void create(Composite parent) { + item = new SubModifyItem(this); + item.setItemHeight(SubModifyItem.ITEM_HEIGHT); + item.init(parent); + item.setItemTitle(new SubItemTitle(item.getItemComp(), getTitle(), + ColorResources.WHITE)); + item.create(); + + makeBody(); + } + + protected void makeBody() { + // create combo + createCombo(item, SubModifyItem.BOX_WIDTH); + + // init combo list + addItem(CameraItem.TYPE_WEBCAM); + addItem(CameraItem.TYPE_VIRTUAL); + addItem(CameraItem.TYPE_NONE); + + // select combo + selectItem(false); + } + + @Override + public void setParentItem(ModifyDialogItem parentItem) { + super.setParentItem(parentItem); + cameraItem = (CameraItem)parentItem; + } + + private boolean addItem(String type) { + if (CameraItem.TYPE_WEBCAM.equals(type) + && !CameraViewItem.isWebcamSupport()) { + return false; + } + addComboItem(type); + return true; + } + + + private void selectItem(boolean notifySelect) { + if (comboBox == null || comboBox.isDisposed()) { + return; + } + + // Set default if first create. + if (getItemListComp().isCreateMode()) { + if (!isInComboOptions(cameraType)) { + // Rear : webcam (if webcam available) + if (isRear() && CameraItem.isWebcamSupport()) { + cameraType = CameraItem.TYPE_WEBCAM; + + // Front : virtual + } else { + cameraType = CameraItem.TYPE_VIRTUAL; + } + } + } + + + // select item + int index = -1; + for (int i=0 ; i < getComboItemList().size() ; i++) { + if (getComboItemList().get(i).equals(cameraType)) { + index = i; + break; + } + } + + if (index == -1) { + index = 0; + cameraType = getComboItem(index); + } + + selectComboItem(index, notifySelect); + + if (notifySelect) { + comboSelected(); + } + } + + private void comboSelected() { + // reset image item + CameraImageItem imageItem = cameraItem.getCameraImageItem(getName()); + if (imageItem != null) { + imageItem.reset(cameraType); + } + + // reset another camera type item + CameraTypeItem anotherCameraItem = cameraItem.getAnotherCameraTypeItem(getName()); + if (anotherCameraItem != null) { + anotherCameraItem.reset(cameraType); + } + + getItemListComp().checkValid(); + } + + + @Override + public void itemSelected(ComboBox comboBox) { + // This is called when combo item is selected + cameraType = comboBox.getSelectedItem(); + comboSelected(); + } + + + @Override + public void setInitialValue(PropertyValue value) { + cameraType = value.getSubOptionValue(ItemName.CAMERA, getName()); + } + + @Override + public void setValue(PropertyValue value) { + value.setSubOptionValue(ItemName.CAMERA, getName(), cameraType); + + } + + public String getCameraType() { + return cameraType; + } + + + public void setCameraTypeAndSelect(String cameraType) { + this.cameraType = cameraType; + selectItem(true); + } + + + @Override + public ModifyDialogItem cloneItem() { + return new CameraTypeItem(getName(), getTitle()); + } + + public void reset(String anotherCameraType) { + if (CameraItem.TYPE_WEBCAM.equals(anotherCameraType)) { + // remove webcam if exist. + int index = -1; + for (int i = 0; i < comboBox.getItemCount(); i++) { + if (comboBox.getItem(i).equals(CameraItem.TYPE_WEBCAM)) { + index = i; + } + } + if (index > -1) { + comboBox.remove(index); + selectItem(false); // false ? + } + + } else { + // Add webcam if not exist. + if (CameraItem.isWebcamSupport()) { + boolean addWebcam = true; + for (int i = 0; i < comboBox.getItemCount(); i++) { + if (comboBox.getItem(i).equals(CameraItem.TYPE_WEBCAM)) { + addWebcam = false; + break; + } + } + if (addWebcam) { + comboBox.addItem(CameraItem.TYPE_WEBCAM, 0); + selectItem(false); // false ? + } + } + } + } + + + private boolean isInComboOptions(String value) { + for (String str : comboBox.getItemList()) { + if (str.equals(value)) { + return true; + } + } + return false; + } + + private boolean isRear() { + return ItemName.CAMERA_TYPE_REAR.equals(getName()); + } + + + + public boolean isVirtualSelected() { + if (CameraViewItem.VALUE_VIRTUAL.equals(cameraType)) { + return true; + } else { + return false; + } + } +} diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CategoryItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CategoryItem.java index e9da702..a14b717 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CategoryItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CategoryItem.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.List; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; +import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; public abstract class CategoryItem extends ModifyDialogItem { @@ -61,5 +62,26 @@ public abstract class CategoryItem extends ModifyDialogItem { return height; } + @Override + public void setValue(PropertyValue value) { + for (ModifyDialogItem item : subItems) { + item.setValue(value); + } + } + + @Override + public void setInitialValue(PropertyValue value) { + // override this if you want. + } + + protected ModifyDialogItem getSubItemByName(String itemName) { + for (ModifyDialogItem subItem : subItems) { + if (subItem.getName().equals(itemName)) { + return subItem; + } + } + return null; + } + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java index 92b18f4..faebfed 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java @@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.devices.DeviceTemplate; import org.tizen.emulator.manager.platform.Profile; import org.tizen.emulator.manager.platform.ProfileList; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ComboItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; @@ -108,12 +109,26 @@ public class DeviceTemplateItem extends ComboItem { public void itemSelected(ComboBox comboBox) { template = (DeviceTemplate)comboBox.getSelectedData(); + PropertyValue propertyValue = new PropertyValue(template.getValue()); // - change item list value for (SubTreeModifyItem subTree : treeModifyItem.getSubItemList()) { ModifyDialogItem dialogItem = subTree.getDialogItem(); - dialogItem.changeItemValue(new PropertyValue(template.getValue())); + dialogItem.changeItemValue(propertyValue); } + + // change new camera item value + changeCameraItemValue(propertyValue); + } + + + private void changeCameraItemValue(PropertyValue value) { + CameraItem cameraItem = (CameraItem)getItemListComp().getItem(ItemName.CAMERA); + if (cameraItem == null) { + return; + } + + cameraItem.changeItemValue(value); } @Override diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/FileSharingItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/FileSharingItem.java index 0e194d2..b6576d2 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/FileSharingItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/FileSharingItem.java @@ -88,6 +88,7 @@ public class FileSharingItem extends FileDialogItem { return new FileSharingItem(); } + @Override public void fileSelected() { sharingPath = filePath; @@ -98,4 +99,6 @@ public class FileSharingItem extends FileDialogItem { setFilePath(sharingPath); updateUI(); } + + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetConnectTypeItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetConnectTypeItem.java index 92869a1..2bc2770 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetConnectTypeItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetConnectTypeItem.java @@ -85,7 +85,6 @@ public class NetConnectTypeItem extends ComboItem{ } else if (str.equals(TYPE_BRIDGE)) { addComboItem(TYPE_BRIDGE); } - } // select combo diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetworkItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetworkItem.java index 4e327ba..f742077 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetworkItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetworkItem.java @@ -49,11 +49,18 @@ public class NetworkItem extends CategoryItem { @Override public void create(Composite parent) { - subItems.get(subItems.size()-1).setDrawBottomLine(false); + int itemHeight = 0; + if (subItems.size() == 0) { + itemHeight = ModifyItem.ITEM_HEIGHT; + + } else { + subItems.get(subItems.size()-1).setDrawBottomLine(false); + itemHeight = getItemHeight(); + } item = new ModifyItem(this); // item.setItemHeight(ModifyItem.ITEM_HEIGHT * subItems.size()); - item.setItemHeight(getItemHeight()); + item.setItemHeight(itemHeight); item.init(parent); item.setItemTitle(createIconTitle(item, ImageResources.ICON_TITLE_NETWORK)); item.create(); @@ -85,13 +92,6 @@ public class NetworkItem extends CategoryItem { } - @Override - public void setValue(PropertyValue value) { - for (ModifyDialogItem item : subItems) { - item.setValue(value); - } - } - @Override public boolean isValid() { @@ -162,16 +162,6 @@ public class NetworkItem extends CategoryItem { item.resetItem(); } - - private ModifyDialogItem getSubItemByName(String itemName) { - for (ModifyDialogItem subItem : subItems) { - if (subItem.getName().equals(itemName)) { - return subItem; - } - } - return null; - } - public void setSubnet(String subnet) { NetIPInfoItem item = (NetIPInfoItem)getSubItemByName(ItemName.NET_IP_INFO); item.setSubnet(subnet); diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java index 9c8eb75..be658fb 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/CreateVMTableViewer.java @@ -55,8 +55,11 @@ import org.tizen.emulator.manager.renewal.resources.PatchImageResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.ui.Messages; import org.tizen.emulator.manager.ui.renewal.MainDialog; +import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.OptionName; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.AdvancedPropertyViewer; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue; +import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraItem; import org.tizen.emulator.manager.ui.renewal.widgets.GrayButton; import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton; import org.tizen.emulator.manager.ui.renewal.widgets.NinePatchResourceInfo; @@ -241,16 +244,18 @@ public class CreateVMTableViewer extends AbstractTableViewer { } this.baseImage = baseImage; - if (needRedrawingTable) { - System.out.println("need redrawing"); - table.showTable(); - } // change advanced item-list settingVMPropertyValue(); PropertyValue value = new PropertyValue(newValue.clone()); advancedViewer.changeItemList(baseImage, value); + if (needRedrawingTable) { + System.out.println("need redrawing"); + table.showTable(); + } + + checkValid(); } @@ -259,11 +264,39 @@ public class CreateVMTableViewer extends AbstractTableViewer { return template; } + public void setTemplate(DeviceTemplate template) { this.template = template; + + // check camera + resetCameraOption(); + + // TODO check skin list + checkValid(); } + + private void resetCameraOption() { + if (newValue == null) { + settingVMPropertyValue(); + } + + boolean isRearCameraSupport = template.getValue().isRearCameraSupport(); + + CameraItem advancedCameraItem = advancedViewer.getCameraItem(); + if (advancedCameraItem == null) { + // setting legacy camera option + newValue.setAdvancedOptionSub(ItemName.CAMERA_LEGACY, ItemName.CAMERA_REAR, + isRearCameraSupport ? OptionName.VALUE_ON : OptionName.VALUE_OFF); + + } else { + // change camera value in advanced option + advancedCameraItem.setRearCameraCheck(isRearCameraSupport); + } + } + + public VMPropertyValue getNewValue() { return newValue; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/widgets/ComboBox.java b/src/org/tizen/emulator/manager/ui/renewal/widgets/ComboBox.java index f34739c..93a638d 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/widgets/ComboBox.java +++ b/src/org/tizen/emulator/manager/ui/renewal/widgets/ComboBox.java @@ -96,6 +96,20 @@ public class ComboBox extends NinePatchBox { } } + public int getItemCount() { + return items.size(); + } + + public String getItem(int index) { + return items.get(index); + } + + public void remove(int index) { + items.remove(index); + datas.remove(index); + } + + public Shell getParentShell() { return parentShell; } diff --git a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java index 844c82e..0a8112f 100644 --- a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java +++ b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java @@ -485,7 +485,7 @@ public class VMPropertyValue implements Cloneable { VMOption option = getVMAdvancedOption(name); if (option == null) { option = new VMOption(name); - option.setValue(value); + option.setValue(null); advancedVMOptionList.add(option); } diff --git a/src/org/tizen/emulator/manager/vms/option/CameraLegacyOption.java b/src/org/tizen/emulator/manager/vms/option/CameraLegacyOption.java new file mode 100644 index 0000000..585ebb0 --- /dev/null +++ b/src/org/tizen/emulator/manager/vms/option/CameraLegacyOption.java @@ -0,0 +1,50 @@ +/* + * Emulator Manager + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Minkee Lee + * JiHye Kim + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + + +package org.tizen.emulator.manager.vms.option; + +import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.vms.VMProperty; +import org.tizen.emulator.manager.vms.helper.VMWorkerException; + +public class CameraLegacyOption extends Option { + + @Override + public void getLaunchArgument(LaunchConfig config, VMProperty property) + throws VMWorkerException { + + if (checkOn(property.getPropertyValue().getAdvancedOptionSubValue( + ItemName.CAMERA_LEGACY, ItemName.CAMERA_REAR))) { + config.addQemuOption("-device", "maru-camera"); + } + } + +} diff --git a/xsd/x86-standard-template-v2.xml b/xsd/x86-standard-template-v2.xml index a1b4c41..8706987 100644 --- a/xsd/x86-standard-template-v2.xml +++ b/xsd/x86-standard-template-v2.xml @@ -45,24 +45,16 @@ + + + + - - - - - - - - - - - - @@ -72,6 +64,12 @@ + + + + + + -- 2.7.4