[Title] emulator-manager : change action when select 'add new' button
authorjihye1128.kim <jihye1128.kim@samsung.com>
Fri, 19 Apr 2013 02:41:27 +0000 (11:41 +0900)
committerjihye1128.kim <jihye1128.kim@samsung.com>
Fri, 19 Apr 2013 02:41:27 +0000 (11:41 +0900)
[Desc.] change action when select 'add new' button
[Issue] N/A

package/changelog
package/pkginfo.manifest
src/org/tizen/emulator/manager/ui/MainDialog.java
src/org/tizen/emulator/manager/ui/VMButtonFactory.java
src/org/tizen/emulator/manager/ui/VMsDetailView.java
src/org/tizen/emulator/manager/ui/VMsListView.java
src/org/tizen/emulator/manager/ui/VMsMainView.java
src/org/tizen/emulator/manager/ui/detail/TNameTextItem.java

index 351a4d4..9c86716 100644 (file)
@@ -1,3 +1,7 @@
+* 2.1.4
+- change emulator manager main ux
+== jihye kim <jihye1128.kim@samsung.com> 2013-04-19
+
 * 2.1.3
 - modify module of open browser (tizendevelop site)
 == jihye kim <jihye1128.kim@samsung.com> 2013-03-21
index 0eb1f7a..3be9bcf 100644 (file)
@@ -1,5 +1,5 @@
 Source: emulator-manager
-Version: 2.1.3
+Version: 2.1.4
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 
 Package: emulator-manager
index f6d4eec..9cf724d 100644 (file)
@@ -62,7 +62,7 @@ public class MainDialog {
 
        public static final int DEFALUT_WIDTH  = 840;
        public static final int DEFAULT_HEIGHT = 482;
-       public static final int MIN_HEIGHT      = 483;
+       public static final int MIN_HEIGHT      = 480;
        public static final int MIN_WIDTH       = 500;
        public static int WIDTH  = DEFALUT_WIDTH;
        public static int HEIGHT = DEFAULT_HEIGHT;
index 12cdc3f..d7d3ab1 100644 (file)
@@ -7,6 +7,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.ui.widgets.VMButton;
+import org.tizen.emulator.manager.ui.widgets.VMButtonAttribute;
 import org.tizen.emulator.manager.ui.widgets.VMButtonClickEventListener;
 
 class VMCreateButton extends VMButton {
@@ -21,6 +22,17 @@ class VMCreateButton extends VMButton {
                                ImageResources.ADD_NEW_HOVER.getImage(),
                                ImageResources.VM_IMAGE_CREATE.getImage());
        }
+
+       @Override
+       public void setSelected(boolean selected) {
+               ((VMButtonAttribute)attr).setSelected(selected);
+               if (selected) {
+                       setEnabled(false);
+                       VMsMainView.getInstance().drawCreateVM(false);
+               } else {
+                       setEnabled(true);
+               }
+       }
 }
 
 public class VMButtonFactory {
index 2740957..fffd652 100644 (file)
@@ -77,7 +77,7 @@ public class VMsDetailView {
                mainView.layout();
        }
 
-       public void drawModifyVM(VMProperty property, boolean isCreate) {
+       public void drawModifyVM(VMProperty property) {
                modifyView.drawPropertyView(property.getPropertyValue(), false);
                stackLayout.topControl = modifyView.getComposite();
                mainView.layout();
index c340c9b..da6da0e 100644 (file)
@@ -202,7 +202,7 @@ public class VMsListView {
                createButton.addClickListener(new DACustomButtonClickEventListener(){
                        @Override
                        public void handleClickEvent(DACustomButton button) {
-                               VMsMainView.getInstance().drawCreateVM();
+                               VMsMainView.getInstance().drawCreateVM(true);
                        }
                });
 
@@ -259,8 +259,8 @@ public class VMsListView {
                int hIndex = 0;
                int size = VMButtonFactory.getButtonList().size();
                if (size != 0) {
-                       H_COUNT = (size + 1) / W_COUNT;
-                       if ((size + 1) % W_COUNT != 0) {
+                       H_COUNT = size / W_COUNT;
+                       if (size % W_COUNT != 0) {
                                H_COUNT++;
                        }
 
@@ -297,8 +297,7 @@ public class VMsListView {
 
        private void clickCreateButton() {
                VMButtonFactory.clickVMButton(addNewButton);
-               addNewButton.setEnabled(false);
-               VMsMainView.getInstance().drawCreateVM();
+               VMsMainView.getInstance().drawCreateVM(true);
        }
 
        public void controlKeyEvent(KeyEvent event) {
index 307957c..935bcde 100644 (file)
@@ -26,6 +26,7 @@ public class VMsMainView {
 
        private boolean isInitialize = false;
        private boolean isCreateMode = false;
+       private boolean setFocus = false;
 
        private static VMsMainView view = new VMsMainView();
        public static VMsMainView getInstance() {
@@ -186,9 +187,11 @@ public class VMsMainView {
                drawDetailVM(currentProperty);
        }
 
+       // for launch emulator
        public void drawDetailVM(int index) {
                currentProperty = currentImage.getVmsList().get(index);
                isCreateMode = false;
+               // select vm button
                listView.cancelModify(index);
                detailView.drawDetailVM(currentProperty);
        }
@@ -205,15 +208,16 @@ public class VMsMainView {
                }
 
                isCreateMode = false;
-               detailView.drawModifyVM(property, false);
+               detailView.drawModifyVM(property);
        }
 
        public void drawModifyVM() {
                drawModifyVM(currentProperty);
        }
 
-       public void drawCreateVM() {
+       public void drawCreateVM(boolean setfocus) {
                isCreateMode = true;
+               setSetFocus(setfocus);
 
                if (currentImage.getVmsList().isEmpty()) {
                        listView.drawVMList(currentImage, -1, true);
@@ -253,6 +257,7 @@ public class VMsMainView {
                                new MessageDialog().openWarningDialog(msg);
                        }
                }
+               // set focus vm button
                drawDetailVM(currentImage.getVmsList().indexOf(property));
        }
 
@@ -314,4 +319,12 @@ public class VMsMainView {
        public void setCreateMode(boolean isCreateMode) {
                this.isCreateMode = isCreateMode;
        }
+
+       public boolean isSetFocus() {
+               return setFocus;
+       }
+
+       public void setSetFocus(boolean setFocus) {
+               this.setFocus = setFocus;
+       }
 }
index d48a67d..ac78c4e 100644 (file)
@@ -26,6 +26,7 @@ import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.ui.MainDialog;
 import org.tizen.emulator.manager.ui.MenuHandling;
+import org.tizen.emulator.manager.ui.VMsMainView;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.EmulatorVMList;
@@ -352,7 +353,9 @@ public class TNameTextItem extends DetailViewItem {
                        selectImageButton.setEnabled(false);
                }
 
-               setFocus();
+               if (VMsMainView.getInstance().isSetFocus()) {
+                       setFocus();
+               }
                return false;
        }