[Title] emulator-manager : add mouse wheel listener at scrollbar (only Linux)
authorjihye <jihye1128.kim@samsung.com>
Sat, 25 May 2013 08:38:48 +0000 (17:38 +0900)
committerjihye <jihye1128.kim@samsung.com>
Mon, 27 May 2013 05:33:23 +0000 (14:33 +0900)
[Desc.]  add mouse wheel listener at scrollbar (only linux)
[Issue]  N/A

Change-Id: Ia9dc427c6bca88e46bda7490495ce153de6ef30f
Signed-off-by: jihye <jihye1128.kim@samsung.com>
23 files changed:
resource/res/scrollbar_back.gif [new file with mode: 0644]
src/org/tizen/emulator/manager/resources/ImageResources.java
src/org/tizen/emulator/manager/resources/PatchImageResources.java
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/DetailViewItem.java
src/org/tizen/emulator/manager/ui/detail/DetailViewPage.java
src/org/tizen/emulator/manager/ui/detail/PEmptyViewPage.java
src/org/tizen/emulator/manager/ui/detail/PInfoViewPage.java
src/org/tizen/emulator/manager/ui/detail/PModifyViewPage.java
src/org/tizen/emulator/manager/ui/detail/TDisplayItem.java
src/org/tizen/emulator/manager/ui/detail/TFileShareItem.java
src/org/tizen/emulator/manager/ui/detail/THWSupportItem.java
src/org/tizen/emulator/manager/ui/detail/TNameTextItem.java
src/org/tizen/emulator/manager/ui/detail/TRAMItem.java
src/org/tizen/emulator/manager/ui/detail/TTouchPointItem.java
src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabFolder.java
src/org/tizen/emulator/manager/ui/widgets/CustomScrollBar.java
src/org/tizen/emulator/manager/ui/widgets/CustomScrolledComposite.java
src/org/tizen/emulator/manager/ui/widgets/VMButton.java

diff --git a/resource/res/scrollbar_back.gif b/resource/res/scrollbar_back.gif
new file mode 100644 (file)
index 0000000..c9c6a97
Binary files /dev/null and b/resource/res/scrollbar_back.gif differ
index 4b96ed7..52fa650 100644 (file)
@@ -88,6 +88,7 @@ public enum ImageResources {
        DETAIL_LIST_MIDDLE("detail_list_middle"),
        DETAIL_LIST_BOTTOM("detail_list_bottom"),
        DETAIL_LIST_ITEM("detail_list_item"),
+       SCROLLBAR_BACK("scrollbar_back"),
        
        CREATE_NEW_NOMAL("create_new_nml"),
        CREATE_NEW_PUSH("create_new_pushed"),
index 17185b2..021a4fd 100644 (file)
@@ -251,4 +251,14 @@ public class PatchImageResources {
 
                return image;
        }
+
+       public static Image getScrollbarBackground(int width, int height) {
+               Image image = new Image(Display.getCurrent(), width, height);
+               GC gc = new GC(image);
+               gc.fillRectangle(0, 0, width, height);
+               Image temp = ImageResources.SCROLLBAR_BACK.getImage();
+               gc.drawImage(temp, 0, 0, temp.getImageData().width, temp.getImageData().height,
+                               0, 0, width, height);
+               return image;
+       }
 }
index 98046bc..f3bcef2 100644 (file)
@@ -249,7 +249,7 @@ public class MainDialog {
                        @Override
                        public void handleClickEvent(DACustomButton button) {
                                // reload vm list
-                               refreshVMPropertyList(true);
+                               refreshVMPropertyList(false);
                        }
                });
        }
index d7d3ab1..153521a 100644 (file)
@@ -76,7 +76,7 @@ public class VMButtonFactory {
                        if (button == b) {
                                b.setSelected(true);
                                b.redraw();
-                               selectedIndex= i;
+                               selectedIndex = i;
                        } else {
                                b.setSelected(false);
                                b.redraw();
@@ -93,6 +93,8 @@ public class VMButtonFactory {
        }
 
        public static VMButton getSelectedButton() {
-               return buttons.get(selectedIndex);
+               return buttons.isEmpty()
+                               ? null
+                               : buttons.get(selectedIndex);
        }
 }
index fffd652..fba9a38 100644 (file)
@@ -73,12 +73,16 @@ public class VMsDetailView {
 
        public void drawDetailVM(VMProperty property) {
                detailView.drawPropertyView(property.getPropertyValue(), false);
+               //detailView.setDetailViewOrigin(modifyView.getDetailViewOrigin().x,
+               //              modifyView.getDetailViewOrigin().y);
                stackLayout.topControl = detailView.getComposite();
                mainView.layout();
        }
 
        public void drawModifyVM(VMProperty property) {
                modifyView.drawPropertyView(property.getPropertyValue(), false);
+               //modifyView.setDetailViewOrigin(detailView.getDetailViewOrigin().x,
+               //              detailView.getDetailViewOrigin().y);
                stackLayout.topControl = modifyView.getComposite();
                mainView.layout();
        }
@@ -97,6 +101,9 @@ public class VMsDetailView {
        }
 
        public void redraw() {
+               emptyView.reset();
+               detailView.reset();
+               modifyView.reset();
                stackLayout.topControl.redraw();
        }
 }
index 1c036f3..da9c32d 100644 (file)
@@ -27,12 +27,12 @@ enum VIEW_STATE {
 }
 public class VMsListView {
        private Composite parent        = null;
-       private Composite listView      = null;
+       private Composite listView      = null;
        private int WIDTH  = 510;
        private int HEIGHT = 430;
        // TODO
-       private int LIST_WIDTH  = WIDTH  - 10;
-       private int LIST_HEIGHT = HEIGHT - 55;
+       private int LIST_WIDTH  = WIDTH - 10;
+       private int LIST_HEIGHT = HEIGHT - 55;
 
        // for resize
        private VIEW_STATE state;
@@ -59,8 +59,8 @@ public class VMsListView {
                return listView;
        }
 
-       private DACustomCombo imageCombo = null;
-       private ScrolledComposite scrolledList = null;
+       private DACustomCombo imageCombo        = null;
+       private ScrolledComposite scrolledList  = null;
        private Composite vmList = null;
 
        public void init(int width, int height) {
@@ -94,8 +94,8 @@ public class VMsListView {
                FormData data = new FormData();
                data.left       = new FormAttachment(0, 10);
                data.top        = new FormAttachment(0, 10);
-               data.width      = COMBO_WIDTH;
-               data.height = COMBO_HEIGHT;
+               data.width      = COMBO_WIDTH;
+               data.height     = COMBO_HEIGHT;
                imageCombo.setLayoutData(data);
                imageCombo.select(0);
 
@@ -111,31 +111,26 @@ public class VMsListView {
        private Text dumyText = null;
        private void makeVMList() {
                scrolledList = new ScrolledComposite(listView, SWT.V_SCROLL |  SWT.BORDER);
-               FormData data = new FormData();
-               data.left       = new FormAttachment(0, 10);
-               data.top        = new FormAttachment(0, 40);
-               data.right      = new FormAttachment(100, 0);
-               data.bottom = new FormAttachment(100, -10);
-               scrolledList.setLayoutData(data);
                scrolledList.setBackground(ColorResources.LIST_BG_COLOR.getColor());
 
                vmList = new Composite(scrolledList, SWT.NONE);
                vmList.setBackground(ColorResources.LIST_BG_COLOR.getColor());
-               data = new FormData();
-               data.left       = new FormAttachment(0, 0);
-               data.top        = new FormAttachment(0, 0);
-               data.right      = new FormAttachment(100);
-               data.bottom = new FormAttachment(100);
-               vmList.setLayoutData(data);
                vmList.setLayout(new FormLayout());
 
                scrolledList.setContent(vmList);
                scrolledList.setExpandHorizontal(true);
 
-
                // for key event
                dumyText = new Text(listView, SWT.NONE);
                dumyText.setText("");
+
+               FormData data = new FormData();
+               data.left       = new FormAttachment(0, 10);
+               data.top        = new FormAttachment(0, 40);
+               data.right      = new FormAttachment(100, 0);
+               data.bottom = new FormAttachment(100, -10);
+               scrolledList.setLayoutData(data);
+
                data = new FormData();
                data.left       = new FormAttachment(0, -100);
                data.top        = new FormAttachment(0, 0);
@@ -301,60 +296,73 @@ public class VMsListView {
        }
 
        public void controlKeyEvent(KeyEvent event) {
-               switch (event.keyCode) {
-               case SWT.CR:
-               case SWT.KEYPAD_CR:
-                       if (VMButtonFactory.getSelectedButton() instanceof VMCreateButton) {
+               if (createButton != null) {
+                       switch(event.keyCode) {
+                       case SWT.CR:
+                       case SWT.KEYPAD_CR:
                                clickCreateButton();
-                       } else {
-                               VMButtonFactory.getSelectedButton().clickLaunchButton();
+                               break;
+                               default:
+                                       break;
                        }
-                       break;
-               case SWT.ARROW_UP:
-                       int size        = VMButtonFactory.getButtonList().size();
-                       int index       = VMButtonFactory.getSelectedButtonIndex() - W_COUNT;
-                       if (index >= 0) {
-                               VMButtonFactory.clickVMButton(index);
-                       }
-                       break;
-               case SWT.ARROW_DOWN:
-                       size    = VMButtonFactory.getButtonList().size();
-                       index   = VMButtonFactory.getSelectedButtonIndex() + W_COUNT;
-                       if (index < size) {
-                               VMButtonFactory.clickVMButton(index);
-                       } else {
-                               VMButtonFactory.clickVMButton(VMButtonFactory.getButtonList().size() - 1);
-                       }
-                       break;
-               case SWT.ARROW_LEFT:
-                       size    = VMButtonFactory.getButtonList().size();
-                       index   = VMButtonFactory.getSelectedButtonIndex() - 1;
-                       if (index >= 0) {
-                               VMButtonFactory.clickVMButton(index);
-                       }
-                       break;
-               case SWT.ARROW_RIGHT:
-                       size    = VMButtonFactory.getButtonList().size();
-                       index   = VMButtonFactory.getSelectedButtonIndex() + 1;
-                       if (index < size) {
-                               VMButtonFactory.clickVMButton(index);
-                       }
-                       break;
-               case SWT.DEL:
-                       if (VMButtonFactory.getSelectedButton() instanceof VMCreateButton) {
-                               // nothing
-                       } else {
-                               VMsMainView.getInstance().deleteEmulator();
-                               // TODO
-                               return;
+               } else {
+                       switch (event.keyCode) {
+                       case SWT.CR:
+                       case SWT.KEYPAD_CR:
+                               if (VMButtonFactory.getSelectedButton() instanceof VMCreateButton) {
+                                       clickCreateButton();
+                               } else {
+                                       VMButtonFactory.getSelectedButton().clickLaunchButton();
+                               }
+                               break;
+                       case SWT.ARROW_UP:
+                               int size = VMButtonFactory.getButtonList().size();
+                               int index = VMButtonFactory.getSelectedButtonIndex() - W_COUNT;
+                               if (index >= 0) {
+                                       VMButtonFactory.clickVMButton(index);
+                               }
+                               break;
+                       case SWT.ARROW_DOWN:
+                               size    = VMButtonFactory.getButtonList().size();
+                               index   = VMButtonFactory.getSelectedButtonIndex() + W_COUNT;
+                               if (index < size) {
+                                       VMButtonFactory.clickVMButton(index);
+                               } else {
+                                       VMButtonFactory.clickVMButton(VMButtonFactory.getButtonList().size() - 1);
+                               }
+                               break;
+                       case SWT.ARROW_LEFT:
+                               size    = VMButtonFactory.getButtonList().size();
+                               index   = VMButtonFactory.getSelectedButtonIndex() - 1;
+                               if (index >= 0) {
+                                       VMButtonFactory.clickVMButton(index);
+                               }
+                               break;
+                       case SWT.ARROW_RIGHT:
+                               size    = VMButtonFactory.getButtonList().size();
+                               index   = VMButtonFactory.getSelectedButtonIndex() + 1;
+                               if (index < size) {
+                                       VMButtonFactory.clickVMButton(index);
+                               }
+                               break;
+                       case SWT.DEL:
+                               if (!(VMButtonFactory.getSelectedButton() instanceof VMCreateButton)) {
+                                       VMsMainView.getInstance().deleteEmulator();
+                                       return;
+                               }
+                               break;
+                       case SWT.ESC:
+                               if (VMsMainView.getInstance().isCreateMode()) {
+                                       VMsMainView.getInstance().drawCancelCreaetVM();
+                               } else {
+                                       VMsMainView.getInstance().drawDetailVM();
+                               }
                        }
-                       break;
-               case SWT.ESC:
-                       if (!VMsMainView.getInstance().isCreateMode()) {
-                               VMsMainView.getInstance().drawDetailVM();
+
+                       if (VMButtonFactory.getSelectedButton() != null) {
+                               scrolledList.showControl(VMButtonFactory.getSelectedButton());
                        }
                }
-               scrolledList.showControl(VMButtonFactory.getSelectedButton());
        }
 
        public void cancelModify(int index) {
@@ -368,10 +376,6 @@ public class VMsListView {
                dumyText.setFocus();
        }
 
-       public void cancelModify() {
-               cancelModify(-1);
-       }
-
        public void draw() {
                vmList.layout(true, true);
                scrolledList.layout(true, true);
index 184b51a..ef5a6b1 100644 (file)
@@ -20,13 +20,13 @@ import org.tizen.emulator.manager.vms.VMPropertyValue;
 import org.tizen.emulator.manager.vms.VMWorkerException;
 
 public class VMsMainView {
-       private Composite mainView;
-       private VMsListView listView;
-       private VMsDetailView detailView;
+       private Composite       mainView;
+       private VMsListView     listView;
+       private VMsDetailView   detailView;
 
-       private boolean isInitialize = false;
-       private boolean isCreateMode = false;
-       private boolean setFocus = false;
+       private boolean isInitialize    = false;
+       private boolean isCreateMode    = false;
+       private boolean setFocus        = false;
 
        private static VMsMainView view = new VMsMainView();
        public static VMsMainView getInstance() {
@@ -43,7 +43,9 @@ public class VMsMainView {
                if (isInitialize) {
                        // TODO
                        // dispose
+                       return;
                }
+
                isInitialize = true;
 
                mainView = new Composite(parent, SWT.NONE);
@@ -69,24 +71,21 @@ public class VMsMainView {
                                listView.redraw();
                                detailView.redraw();
                        }
-                       
                });
 
-
-               listView        = new VMsListView(mainView);
-               detailView      = new VMsDetailView(mainView);
+               listView        = new VMsListView(mainView);
+               detailView      = new VMsDetailView(mainView);
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, 0);
                data.top        = new FormAttachment(0, 0);
-               data.bottom = new FormAttachment(100, 0);
+               data.bottom     = new FormAttachment(100, 0);
                data.right      = new FormAttachment(100, -detailView.getSize().x);
                listView.getComposite().setLayoutData(data);
 
                data = new FormData();
                data.left       = new FormAttachment(listView.getComposite(), 0);
                data.top        = new FormAttachment(0, 0);
-               //data.right = new FormAttachment(100, 0);
                data.bottom = new FormAttachment(100, 0);
                data.width      = detailView.getSize().x;
                detailView.getComposite().setLayoutData(data);
@@ -100,17 +99,33 @@ public class VMsMainView {
                mainView.dispose();
        }
 
+       public boolean isCreateMode() {
+               return isCreateMode;
+       }
+
+       public void setCreateMode(boolean isCreateMode) {
+               this.isCreateMode = isCreateMode;
+       }
+
+       public boolean isSetFocus() {
+               return setFocus;
+       }
+
+       public void setSetFocus(boolean setFocus) {
+               this.setFocus = setFocus;
+       }
+
        private Platform currentPlatform        = null;
        private BaseImage currentImage          = null;
-       private VMProperty currentProperty      = null;
+       private VMProperty currentProperty      = null;
 
        public void setPlatform(Platform platform, int index) {
-               this.currentPlatform = platform;
                if (platform == null) {
                        // TODO
                        return;
                }
 
+               this.currentPlatform = platform;
                if (platform.getImageList().isEmpty()) {
                        // TODO
                } else {
@@ -123,6 +138,7 @@ public class VMsMainView {
        }
 
        public void resetPlatform() {
+               detailView.redraw();
                setPlatform(currentPlatform,
                                currentPlatform.getImageList().indexOf(currentImage));
        }
@@ -130,14 +146,14 @@ public class VMsMainView {
        public void clearPlatform() {
                currentPlatform = null;
                currentImage    = null;
-               currentProperty = null;
+               currentProperty = null;
        }
 
        public Platform getPlatform() {
                return currentPlatform;
        }
 
-       public void setCurrentImage(BaseImage image) {
+       void setCurrentImage(BaseImage image) {
                this.currentImage = image;
        }
 
@@ -149,7 +165,7 @@ public class VMsMainView {
                return currentProperty;
        }
 
-       public void setCurrentProperty(VMProperty currentProperty) {
+       void setCurrentProperty(VMProperty currentProperty) {
                this.currentProperty = currentProperty;
        }
 
@@ -177,27 +193,32 @@ public class VMsMainView {
                detailView.drawEmptyVM();
        }
 
-       public void drawDetailVM(VMProperty property) {
+       public void drawDetailVM(VMProperty property, int index) {
+               assert property == null;
+
                currentProperty = property;
                isCreateMode = false;
-               listView.cancelModify();
+               listView.cancelModify(index);
                detailView.drawDetailVM(property);
        }
 
        public void drawDetailVM() {
-               drawDetailVM(currentProperty);
+               drawDetailVM(currentProperty, -1);
        }
 
        // for launch emulator
        public void drawDetailVM(int index) {
-               currentProperty = currentImage.getVmsList().get(index);
-               isCreateMode = false;
-               // select vm button
-               listView.cancelModify(index);
-               detailView.drawDetailVM(currentProperty);
+               if (index < 0
+               || index > currentImage.getVmsList().size()) {
+                       return;
+               }
+
+               drawDetailVM(currentImage.getVmsList().get(index), index);
        }
 
        public void drawModifyVM(VMProperty property) {
+               assert property == null;
+
                currentProperty = property;
 
                MessageDialog msg = new MessageDialog();
@@ -209,6 +230,7 @@ public class VMsMainView {
                }
 
                isCreateMode = false;
+               setSetFocus(true);
                detailView.drawModifyVM(property);
        }
 
@@ -224,7 +246,8 @@ public class VMsMainView {
                        listView.drawVMList(currentImage, -1, true);
                }
 
-               BaseImage image = (currentPlatform.getName().equals("custom")) ? null : currentImage;
+               BaseImage image = (currentPlatform.getName().equals("custom"))
+                                                       ? null : currentImage;
                detailView.drawCreateVM(
                                new VMPropertyValue(image, SelectTemplate.getInstance().getDefaultTemplate()));
        }
@@ -233,6 +256,7 @@ public class VMsMainView {
                isCreateMode = false;
 
                if (currentImage.getVmsList().isEmpty()) {
+                       listView.cancelModify(-1);
                        drawEmptyVMList();
                } else {
                        int i = currentImage.getVmsList().indexOf(currentProperty);
@@ -241,6 +265,10 @@ public class VMsMainView {
                }
        }
 
+       //
+       // handling vm
+       // launch, create, delete, modify, reset, create base image
+       //
        public void launchEmulator(VMProperty property) {
                if (property == null) {
                        property = getCurrentProperty();
@@ -314,20 +342,4 @@ public class VMsMainView {
                handling.resetVirtualMachine(currentProperty);
                return true;
        }
-
-       public boolean isCreateMode() {
-               return isCreateMode;
-       }
-
-       public void setCreateMode(boolean isCreateMode) {
-               this.isCreateMode = isCreateMode;
-       }
-
-       public boolean isSetFocus() {
-               return setFocus;
-       }
-
-       public void setSetFocus(boolean setFocus) {
-               this.setFocus = setFocus;
-       }
 }
index e2e4faf..d36dfaa 100644 (file)
@@ -55,9 +55,9 @@ public abstract class DetailViewItem {
        protected Label titleLabel;
        protected String title;
        private boolean isCreateMode;
-       private boolean isMinMode = false;
+       protected boolean isMinMode = false;
 
-       private DACustomToggleButton arrowButton;
+       protected DACustomToggleButton arrowButton;
        protected int count;
 
        protected DetailViewItem item;
@@ -88,7 +88,7 @@ public abstract class DetailViewItem {
        protected ArrayList<Composite> compList = new ArrayList<Composite>();
        protected static int ITEM_HEIGHT  = 20;
        protected static int ITEM_WIDTH  = 20;
-       protected static int TiTLE_HEIGHT = 20;
+       protected static int TITLE_HEIGHT = 20;
        protected static int TITLE_WIDTH = 100;
 
        protected static int FILE_SELECT_BUTTON_WIDTH   = 38;
@@ -98,7 +98,7 @@ public abstract class DetailViewItem {
 
        protected static int INPUTBOX_OFFSET    = 118;
        protected static int INPUTBOX_TOP_GAP   = 3;
-       protected static int INPUTOBX_RIGHT_GAP = 10;
+       protected static int INPUTBOX_RIGHT_GAP = 10;
 
        protected static int TITLE_TOP_GAP      = 4;
        protected static int TITLE_LEFT_GAP = 15;
@@ -198,7 +198,7 @@ public abstract class DetailViewItem {
                FormData data = new FormData();
                data.left       = new FormAttachment(0, TITLE_LEFT_GAP);
                data.top        = new FormAttachment(0, TITLE_TOP_GAP);
-               data.height = TiTLE_HEIGHT;
+               data.height = TITLE_HEIGHT;
                data.width  = TITLE_WIDTH;
                titleLabel.setLayoutData(data);
                titleLabel.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
@@ -233,7 +233,7 @@ public abstract class DetailViewItem {
 
        }
 
-       private void changeArrowState() {
+       protected void changeArrowState() {
                if (arrowButton.isToggled()) {
                        /*
                        FormData data = new FormData();
@@ -244,6 +244,7 @@ public abstract class DetailViewItem {
                        compList.get(0).setLayoutData(data);
                        compList.get(0).getParent().layout(true, true);
                        */
+                       isMinMode = true;
                        for (int i = 1; i < count; i++) {
                                FormData data = new FormData();
                                data.height = 0;
@@ -266,6 +267,7 @@ public abstract class DetailViewItem {
                        compList.get(0).setLayoutData(data);
                        compList.get(0).getParent().layout(true, true);
                        */
+                       isMinMode = false;
                        for (int i = 1; i < count; i++) {
                                FormData data = new FormData();
                                data.left       = new FormAttachment(0, ITEM_LEFT_GAP);
@@ -340,14 +342,6 @@ public abstract class DetailViewItem {
                this.isCreateMode = isCreateMode;
        }
 
-       public boolean isMinMode() {
-               return isMinMode;
-       }
-
-       public void setMinMode(boolean isMinMode) {
-               this.isMinMode = isMinMode;
-       }
-
        public int getCount() {
                if (isMinMode) {
                        return 1;
@@ -366,6 +360,8 @@ public abstract class DetailViewItem {
        public abstract void setValue(VMPropertyValue value);
        public abstract void drawDetail();
        public abstract void drawModify();
+       // for min mode
+       public abstract void settingStatus(boolean isRefresh);
        public abstract boolean settingDetailItem(VMPropertyValue value);
        public abstract boolean settingModifyItem(VMPropertyValue value);
        public abstract void closeItem();
index dbd3c67..8511c6d 100644 (file)
@@ -3,6 +3,7 @@ package org.tizen.emulator.manager.ui.detail;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
@@ -58,7 +59,7 @@ public abstract class DetailViewPage {
 
                itemListBack = new Composite(view, SWT.NONE);
                scrolledList = new CustomScrolledComposite(itemListBack, SWT.V_SCROLL);
-               itemList = new Composite(scrolledList, SWT.NONE);
+               itemList = new Composite(scrolledList, SWT.DOUBLE_BUFFERED);
 
                itemListBack.setBackground(ColorResources.DETAIL_VIEW_PAGE_COLOR.getColor());
                scrolledList.setBackground(ColorResources.DETAIL_VIEW_PAGE_COLOR.getColor());
@@ -152,15 +153,27 @@ public abstract class DetailViewPage {
                data.left       = new FormAttachment(0, 0);
                data.top        = new FormAttachment(0, 0);
                data.bottom = new FormAttachment(100, -4);
-               scrolledList.setSize(image2.getImageData().width, image2.getImageData().height);
+               data.height = image2.getImageData().height;
+               data.width = image2.getImageData().width;
+               scrolledList.setSize(data.width, data.height);
                scrolledList.setLayoutData(data);
                itemList.setSize(image3.getImageData().width, image3.getImageData().height);
+               //scrolledList.layout();
        }
 
        public void resize(int height) {
                settingItemList();
        }
 
+       public Point getDetailViewOrigin() {
+               return scrolledList.getOrigin();
+       }
+
+       public void setDetailViewOrigin(int x, int y) {
+               scrolledList.setOrigin(x, y);
+       }
+
        protected abstract void drawInitView();
+       public abstract void reset();
        public abstract void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate);
 }
index f4d1bb4..69c4d03 100644 (file)
@@ -42,4 +42,9 @@ public class PEmptyViewPage extends DetailViewPage {
        public int checkItemCount() {
                return checkItemCountwithSize();
        }
+
+       @Override
+       public void reset() {
+               // TODO Auto-generated method stub
+       }
 }
index 6ca32d7..0b8dce2 100644 (file)
@@ -143,6 +143,7 @@ public class PInfoViewPage extends DetailViewPage {
                assert propertyValue == null;
 
                for (DetailViewItem item : list) {
+                       item.settingStatus(false);
                        item.settingDetailItem(propertyValue);
                }
        }
@@ -177,4 +178,14 @@ public class PInfoViewPage extends DetailViewPage {
                }
                return count;
        }
+
+       @Override
+       public void reset() {
+               /*
+               scrolledList.setOrigin(0, 0);
+               for (int i = 0; i < list.size(); i++) {
+                       list.get(i).settingStatus(true);
+               }
+               */
+       }
 }
index 62a46c0..9d75d78 100644 (file)
@@ -143,6 +143,10 @@ public class PModifyViewPage extends DetailViewPage
        public void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate) {
                assert propertyValue == null;
 
+               if (isCreate) {
+                       scrolledList.setOrigin(0, 0);
+               }
+
                confirmButton.setEnabled(false);
                buttonComp.layout(true, true);
 
@@ -151,6 +155,7 @@ public class PModifyViewPage extends DetailViewPage
                newValue = oldValue.clone();
                for (DetailViewItem item : list) {
                        item.setCreateMode(isCreate);
+                       item.settingStatus(false);
                        item.settingModifyItem(propertyValue);
                }
        }
@@ -195,4 +200,9 @@ public class PModifyViewPage extends DetailViewPage
                }
                return count;
        }
+
+       @Override
+       public void reset() {
+               // TODO Auto-generated method stub
+       }
 }
index 8f18c18..ed577bd 100644 (file)
@@ -409,4 +409,27 @@ public class TDisplayItem extends DetailViewItem {
                // SKIN
                settingSkinList(re);
        }
+
+       private static boolean isShareMinMode = false;
+
+       @Override
+       protected void changeArrowState() {
+               super.changeArrowState();
+               isShareMinMode = isMinMode;
+       }
+
+       @Override
+       public void settingStatus(boolean isRefresh) {
+               if (isRefresh) {
+                       if (isMinMode) {
+                               arrowButton.setToggled(false);
+                               changeArrowState();
+                       }
+               } else {
+                       if (isShareMinMode != isMinMode) {
+                               arrowButton.setToggled(isShareMinMode);
+                               changeArrowState();
+                       }
+               }
+       }
 }
index a9fad3e..fd24931 100644 (file)
@@ -276,4 +276,27 @@ public class TFileShareItem extends DetailViewItem {
                }
        }
 
+       private static boolean isShareMinMode = false;
+
+       @Override
+       protected void changeArrowState() {
+               super.changeArrowState();
+               isShareMinMode = isMinMode;
+       }
+
+       @Override
+       public void settingStatus(boolean isRefresh) {
+               if (isRefresh) {
+                       if (isMinMode) {
+                               arrowButton.setToggled(false);
+                               changeArrowState();
+                       }
+               } else {
+                       if (isShareMinMode != isMinMode) {
+                               arrowButton.setToggled(isShareMinMode);
+                               changeArrowState();
+                       }
+               }
+       }
+
 }
index 1734f6e..d18358b 100644 (file)
@@ -128,7 +128,7 @@ public class THWSupportItem extends DetailViewItem {
                data = new FormData();
                data.left = new FormAttachment(virtualButton, 10);
                data.top = new FormAttachment(0, INPUTBOX_TOP_GAP + 1);
-               data.width = INPUTBOX_WIDTH - TOGGLE_BUTTON_WIDTH - INPUTOBX_RIGHT_GAP;
+               data.width = INPUTBOX_WIDTH - TOGGLE_BUTTON_WIDTH - INPUTBOX_RIGHT_GAP;
                virtualState.setLayoutData(data);
 
                data = new FormData();
@@ -141,7 +141,7 @@ public class THWSupportItem extends DetailViewItem {
                data = new FormData();
                data.left = new FormAttachment(GPUButton, 10);
                data.top = new FormAttachment(0, INPUTBOX_TOP_GAP + 1);
-               data.width = INPUTBOX_WIDTH - TOGGLE_BUTTON_WIDTH - INPUTOBX_RIGHT_GAP;
+               data.width = INPUTBOX_WIDTH - TOGGLE_BUTTON_WIDTH - INPUTBOX_RIGHT_GAP;
                GPUState.setLayoutData(data);
        }
 
@@ -319,4 +319,25 @@ public class THWSupportItem extends DetailViewItem {
                }
        }
 
+       private static boolean isShareMinMode = false;
+       @Override
+       protected void changeArrowState() {
+               super.changeArrowState();
+               isShareMinMode = isMinMode;
+       }
+
+       @Override
+       public void settingStatus(boolean isRefresh) {
+               if (isRefresh) {
+                       if (isMinMode) {
+                               arrowButton.setToggled(false);
+                               changeArrowState();
+                       }
+               } else {
+                       if (isShareMinMode != isMinMode) {
+                               arrowButton.setToggled(isShareMinMode);
+                               changeArrowState();
+                       }
+               }
+       }
 }
index 5d5bae9..95c57dd 100644 (file)
@@ -76,7 +76,7 @@ public class TNameTextItem extends DetailViewItem {
                FormData data = new FormData();
                data.left       = new FormAttachment(0, TITLE_LEFT_GAP);
                data.top        = new FormAttachment(0, TITLE_TOP_GAP);
-               data.height = TiTLE_HEIGHT;
+               data.height = TITLE_HEIGHT;
                data.width      = TITLE_WIDTH;
                subTitleLabel.setLayoutData(data);
                subTitleLabel.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
@@ -363,4 +363,9 @@ public class TNameTextItem extends DetailViewItem {
                nameLabel.setFocus();
                nameText.setFocus();
        }
+
+       @Override
+       public void settingStatus(boolean isRefresh) {
+               // TODO Auto-generated method stub
+       }
 }
index 98d2871..229b1f0 100644 (file)
@@ -132,4 +132,9 @@ public class TRAMItem extends DetailViewItem {
                        ramSizeCombo.dispose();
                }
        }
+
+       @Override
+       public void settingStatus(boolean isRefresh) {
+               // TODO Auto-generated method stub
+       }
 }
index 139aff8..b93c3e0 100644 (file)
@@ -70,4 +70,9 @@ public class TTouchPointItem extends DetailViewItem {
        public void closeItem() {
                touchPoint.dispose();
        }
+
+       @Override
+       public void settingStatus(boolean isRefresh) {
+               // TODO Auto-generated method stub
+       }
 }
index b3ef432..c3c1e03 100644 (file)
@@ -60,6 +60,13 @@ public class PlatformTabFolder {
                tabComposite = new Composite(mainComposite, SWT.DOUBLE_BUFFERED);
                tabComposite.setLayout(new FormLayout());
 
+               contentsComposite = new Composite(mainComposite, SWT.DOUBLE_BUFFERED);
+               contentsComposite.setLayout(new FillLayout());
+
+               // initialize main view
+               view = VMsMainView.getInstance();
+               view.setInit(contentsComposite);
+
                FormData data = new FormData();
                data.top = new FormAttachment(0, 0);
                data.left = new FormAttachment(0, 2);
@@ -68,9 +75,6 @@ public class PlatformTabFolder {
                tabComposite.setLayoutData(data);
                tabComposite.setBackground(ColorResources.TAB_BG_COLOR.getColor());
 
-               contentsComposite = new Composite(mainComposite, SWT.DOUBLE_BUFFERED);
-               contentsComposite.setLayout(new FillLayout());
-
                data = new FormData();
                data.top = new FormAttachment(tabComposite, 0);
                data.left = new FormAttachment(0, 2);
@@ -78,13 +82,9 @@ public class PlatformTabFolder {
                data.bottom = new FormAttachment(100, 0);
                contentsComposite.setLayoutData(data);
                contentsComposite.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
-
-               // initialize main view
-               view = VMsMainView.getInstance();
-               view.setInit(contentsComposite);
        }
 
-       public void draw() {            
+       public void draw() {
                if(!items.isEmpty()) {
                        // clear
                        if (!buttons.isEmpty()) {
index 438eaf2..28461e9 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
+import org.tizen.emulator.manager.resources.PatchImageResources;
 
 enum MouseActionUsage {
     UPBTN_HOVER, UPBTN_CLICK, DNBTN_HOVER, DNBTN_CLICK, UPPAGEINCREMENT, DNPAGEINCREMENT, THUMB_HOVER, DRAGGING, NOTHING
@@ -379,6 +380,11 @@ public class CustomScrollBar extends Canvas implements PaintListener, MouseWheel
                GC g = e.gc;
         Point size = getSize();
 
+        if (screenSizeY != size.y) {
+               // draw background
+            this.setBackgroundImage(PatchImageResources.getScrollbarBackground(SCROLLBAR_WIDTH, size.y));
+        }
+
         if (data.max > 0 && data.thumb > 0 && data.thumb <= data.max) {
 
             // calculate the position of thumb and draw thumb
index b076f71..fe188e7 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.*;
+import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.resources.ColorResources;
 /**
  * A ScrolledComposite provides scrollbars and will scroll its content when the user
@@ -69,7 +70,7 @@ public class CustomScrolledComposite extends Composite {
        public CustomScrolledComposite(Composite parent, int style) {
                super(parent, SWT.DOUBLE_BUFFERED);
                super.setLayout(new FormLayout());
-       
+
                verticalBar = new CustomScrollBar(this);
                if (verticalBar != null) {
                        verticalBar.setVisible(false);
@@ -80,7 +81,7 @@ public class CustomScrolledComposite extends Composite {
                                }
                        });
                }
-       
+
                FormData data = new FormData();
                data.top                = new FormAttachment(0, 2);
                data.bottom     = new FormAttachment(100, -2);
@@ -88,14 +89,14 @@ public class CustomScrolledComposite extends Composite {
                data.width      = 5;
                verticalBar.setLayoutData(data);
                verticalBar.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
-       
+
                contentListener = new Listener() {
                        public void handleEvent(Event e) {
                                if (e.type != SWT.Resize) return;
                                settingScrollLayout(e);
                        }
                };
-       
+
                filter = new Listener() {
                        public void handleEvent(Event event) {
                                if (event.widget instanceof Control) {
@@ -104,15 +105,31 @@ public class CustomScrolledComposite extends Composite {
                                }
                        }
                };
-       
+
                addDisposeListener(new DisposeListener() {
                        public void widgetDisposed(DisposeEvent e) {
                                getDisplay().removeFilter(SWT.FocusIn, filter);
                        }
                });
+
+               this.addListener(SWT.Resize, contentListener);
+
+               this.addMouseWheelListener(new MouseWheelListener() {
+                       @Override
+                       public void mouseScrolled(MouseEvent e) {
+                               if (verticalBar != null && verticalBar.isVisible()) {
+                                       verticalBar.mouseScrolled(e);
+                               }
+                       }
+               });
+
        }
-       
+
        void settingScrollLayout(Event e) {
+               if (content == null) {
+                       return;
+               }
+
                layout(true, true);
                if (needVScroll(content.getBounds(), false)) {
                        verticalBar.setVisible(true);
@@ -122,26 +139,26 @@ public class CustomScrolledComposite extends Composite {
                        verticalBar.setVisible(false);
                }
        }
-       
+
        static int checkStyle (int style) {
                int mask =  SWT.V_SCROLL | SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; //SWT.H_SCROLL
                return style & mask;
        }
-       
+
        boolean contains(Control control) {
                if (control == null || control.isDisposed()) {
                        return false;
                }
-       
+
                Composite parent = control.getParent();
                while (parent != null && !(parent instanceof Shell)) {
                        if (this == parent) return true;
                        parent = parent.getParent();
                }
-       
+
                return false;
        }
-       
+
        /**
         * Returns the Always Show Scrollbars flag.  True if the scrollbars are 
         * always shown even if they are not required.  False if the scrollbars are only 
@@ -165,7 +182,7 @@ public class CustomScrolledComposite extends Composite {
                //checkWidget();
                return content;
        }
-       
+
        /**
         * Returns <code>true</code> if the receiver automatically scrolls to a focused child control 
         * to make it visible. Otherwise, returns <code>false</code>.
@@ -183,33 +200,33 @@ public class CustomScrolledComposite extends Composite {
                checkWidget();
                return showFocusedControl;
        }
-       
+
        public CustomScrollBar getVScrollBar() {
                return verticalBar;
        }
-       
+
        boolean needVScroll(Rectangle contentRect, boolean hVisible) {
                if (verticalBar == null) {
                        return false;
                }
-       
+
                Rectangle hostRect = getBounds();
                int border = getBorderWidth();
                hostRect.height -= 2*border;
-       
+
                /*
                if (hVisible && verticalBar != null) {
                        hostRect.height -= verticalBar.getSize().y;
                }
                */
-       
+
                if (contentRect.height > hostRect.height) {
                        return true;
                }
 
                return false;
        }
-       
+
        /**
         * Return the point in the content that currently appears in the top left 
         * corner of the scrolled composite.
@@ -284,7 +301,7 @@ public class CustomScrolledComposite extends Composite {
                }
                content.setLocation(x, y);
        }
-       
+
        /**
         * Set the Always Show Scrollbars flag.  True if the scrollbars are 
         * always shown even if they are not required.  False if the scrollbars are only 
@@ -320,7 +337,7 @@ public class CustomScrolledComposite extends Composite {
         *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
         * </ul>
         */
-       public void setContent(Control content) {
+       public void setContent(Composite content) {
                checkWidget();
                if (this.content != null && !this.content.isDisposed()) {
                        this.content.removeListener(SWT.Resize, contentListener);
@@ -382,7 +399,7 @@ public class CustomScrolledComposite extends Composite {
                        showControl(control);
                }
        }
-       
+
        /**
         * Scrolls the content of the receiver so that the control is visible.
         *
@@ -410,7 +427,7 @@ public class CustomScrolledComposite extends Composite {
                if (!contains(control)) {
                        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
                }
-               
+
                Rectangle itemRect = getDisplay().map(control.getParent(), this, control.getBounds());
                Rectangle area = getClientArea();
                Point origin = getOrigin();
@@ -426,11 +443,14 @@ public class CustomScrolledComposite extends Composite {
                }
                setOrigin(origin);
        }
-       
+
        void vScroll() {
                if (content == null) return;
                Point location = content.getLocation ();
                int vSelection = verticalBar.getScrollPos();
                content.setLocation (location.x, -vSelection);
+               if (EmulatorManager.isWin()) {
+                       ((Composite)content).layout();
+               }
        }
 }
index 6498b3c..d311982 100644 (file)
@@ -107,7 +107,7 @@ public class VMButton extends DACustomButton {
        public void setSelected(boolean selected) {
                ((VMButtonAttribute)attr).setSelected(selected);
                if (selected && property != null) {
-                       VMsMainView.getInstance().drawDetailVM(property);
+                       VMsMainView.getInstance().drawDetailVM(property, -1);
                }
        }