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();
// 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));
}