[SPDSDKUX-1932] resolve issue at navigate menu
authorjaeyong lee <jae-yong.lee@samsung.com>
Fri, 26 Aug 2016 09:37:23 +0000 (18:37 +0900)
committerGihun Chang <gihun.chang@samsung.com>
Fri, 26 Aug 2016 09:39:55 +0000 (18:39 +0900)
Change-Id: If37b79bcd8a98c5e95862c25d91e6ef471de5714

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java

index 5d09e5e..b3683f5 100644 (file)
@@ -499,8 +499,8 @@ public class MenuBar {
                public void widgetSelected(SelectionEvent arg0) {
                        String menuName = null;
 
-                       if (Global.getProject() == null)
-                               return;
+//                     if (Global.getProject() == null)
+//                             return;
 
                        if (arg0.getSource() != null && arg0.getSource() instanceof MenuItem) {
                                menuName = ((MenuItem) arg0.getSource()).getText();
@@ -560,26 +560,22 @@ public class MenuBar {
                        // If zoom index(0~4)changed, changeScroll Time Interval changed
                        // too.
                        if (menuName.equals(MenuBarLabels.VIEW_ZOOM_IN)) {
-                               for (int i = 0; i < chartboards.size(); i++) {
-                                       scales.get(i).changeScale(true);
-                                       zoom_vals[i] = scales.get(i).getSelection();
-                                       boardMannagers.get(i).scaleChanged(zoom_vals[i]);
+                               if(Toolbar.INSTANCE.getScaleSelection() < 4) {
+                                       Toolbar.INSTANCE.setScaleSelection(Toolbar.INSTANCE.getScaleSelection()+1);
                                }
                        } else if (menuName.equals(MenuBarLabels.VIEW_ZOOM_OUT)) {
-                               for (int i = 0; i < chartboards.size(); i++) {
-                                       scales.get(i).changeScale(false);
-                                       zoom_vals[i] = scales.get(i).getSelection();
-                                       boardMannagers.get(i).scaleChanged(zoom_vals[i]);
+                               if(Toolbar.INSTANCE.getScaleSelection() > 0) {
+                                       Toolbar.INSTANCE.setScaleSelection(Toolbar.INSTANCE.getScaleSelection()-1);
                                }
                        } else if (menuName.equals(MenuBarLabels.VIEW_MOVE_LEFT)) {
                                for (int i = 0; i < chartboards.size(); i++) {
-                                       double changeScroll = (120 / Math.pow(2, zoom_vals[i]));
+                                       double changeScroll = (120 / Math.pow(2, Toolbar.INSTANCE.getScaleSelection()));
                                        double visibleStart = boardMannagers.get(i).getVisibleStartTime();
                                        boardMannagers.get(i).startTimeChanged(visibleStart - (changeScroll / chartDiv));
                                }
                        } else if (menuName.equals(MenuBarLabels.VIEW_MOVE_RIGHT)) {
                                for (int i = 0; i < chartboards.size(); i++) {
-                                       double changeScroll = (120 / Math.pow(2, zoom_vals[i]));
+                                       double changeScroll = (120 / Math.pow(2, Toolbar.INSTANCE.getScaleSelection()));
                                        double visibleStart = boardMannagers.get(i).getVisibleStartTime();
                                        boardMannagers.get(i).startTimeChanged(visibleStart + (changeScroll / chartDiv));
                                }