[SRADA-410] Change mouse cursor at Screenshot chart's point
authorjaeyong lee <jae-yong.lee@samsung.com>
Tue, 24 May 2016 02:50:08 +0000 (11:50 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Tue, 24 May 2016 07:27:53 +0000 (16:27 +0900)
Change-Id: I7e002a617a1896a262d4f197f5db32916148339d

org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseEventListener.java

index cac7344..fe99ff6 100644 (file)
@@ -63,7 +63,7 @@ public class DAChartRenderer {
        private static final int SCREENSHOT_SELECTED_LINE_WIDTH = 2;
        private static final int SCREENSHOT_BORDER_LINE_WIDTH = 1;
        
-       private static final int SCREENSHOT_DOT_WIDTH = 8;
+       private static final int SCREENSHOT_DOT_WIDTH = 12;
 
        private static final int MULTI_CHECK_BAR_WIDTH = 2;
 
@@ -1771,7 +1771,7 @@ public class DAChartRenderer {
                
                for(DAChartSeriesItem seriesItem : seriesItems) {
                        int pixelX = plot.getXPixelFromX(seriesItem.getX()) - SCREENSHOT_DOT_WIDTH;
-                       int pixelY = DAChartBoard.DEFAULT_ITEM_HEIGHT / 2 - SCREENSHOT_DOT_WIDTH;
+                       int pixelY = (DAChartBoard.DEFAULT_ITEM_HEIGHT - SCREENSHOT_DOT_WIDTH) / 2;
                        
                        gc.setForeground(ColorResources.SCREENSHOT_CHART_DOT);
                        gc.setBackground(ColorResources.SCREENSHOT_CHART_DOT);
index a1a7568..68e9baa 100644 (file)
@@ -34,8 +34,10 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseAdapter;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.graphics.Cursor;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
@@ -70,7 +72,7 @@ public class TimelineChartMouseEventListener extends MouseAdapter implements Mou
        
        protected static final int SELECTION_MARKER_INDEX = 0;
        
-       private static final int SCREENSHOT_DOT_WIDTH = 8;
+       private static final int SCREENSHOT_DOT_WIDTH = 12;
 
        public TimelineChartMouseEventListener(DAPopupMenu menu, DATimeline timeline, String pageID) {
                this.menu = menu;
@@ -283,8 +285,11 @@ public class TimelineChartMouseEventListener extends MouseAdapter implements Mou
                }
 
                if (plot instanceof DAScreenshotChartPlot) {
-//                     ((DAScreenshotChartPlot) plot).setHighlightedImageIndex(getHighlightedImageIndex(e));
-//                     chart.redraw();
+                       if(getPointedScreenshotImage(e) != null) {
+                               Display.getCurrent().getCursorControl().setCursor(new Cursor(Display.getCurrent(), SWT.CURSOR_HAND));
+                       } else {
+                               Display.getCurrent().getCursorControl().setCursor(null);
+                       }
                } else if (plot instanceof DAUIEventChartPlot) {
                        DAUIEventChartPlot uiEventChartPlot = (DAUIEventChartPlot) plot;
                        int seriesIndex = (int) (newYPosRatio * chart.getSeriesList().size());
@@ -385,8 +390,8 @@ public class TimelineChartMouseEventListener extends MouseAdapter implements Mou
                int index = -1;
                
                for(DAChartSeriesItem item : series.getSeriesItemList()) {
-                       if(e.x >= plot.getXPixelFromX(item.getX()) - SCREENSHOT_DOT_WIDTH / 2 && 
-                                       e.x <= plot.getXPixelFromX(item.getX()) + SCREENSHOT_DOT_WIDTH / 2 &&
+                       if(e.x >= plot.getXPixelFromX(item.getX()) - SCREENSHOT_DOT_WIDTH && 
+                                       e.x <= plot.getXPixelFromX(item.getX()) &&
                                        e.y >= (DAChartBoard.DEFAULT_ITEM_HEIGHT - SCREENSHOT_DOT_WIDTH) / 2 &&
                                        e.y <= (DAChartBoard.DEFAULT_ITEM_HEIGHT + SCREENSHOT_DOT_WIDTH) / 2) {
                                index = series.getSeriesItemList().indexOf(item);
@@ -408,8 +413,8 @@ public class TimelineChartMouseEventListener extends MouseAdapter implements Mou
                int index = -1;
                
                for(DAChartSeriesItem item : series.getSeriesItemList()) {
-                       if(e.x >= plot.getXPixelFromX(item.getX()) - SCREENSHOT_DOT_WIDTH / 2 && 
-                                       e.x <= plot.getXPixelFromX(item.getX()) + SCREENSHOT_DOT_WIDTH / 2 &&
+                       if(e.x >= plot.getXPixelFromX(item.getX()) - SCREENSHOT_DOT_WIDTH && 
+                                       e.x <= plot.getXPixelFromX(item.getX()) &&
                                        e.y >= (DAChartBoard.DEFAULT_ITEM_HEIGHT - SCREENSHOT_DOT_WIDTH) / 2 &&
                                        e.y <= (DAChartBoard.DEFAULT_ITEM_HEIGHT + SCREENSHOT_DOT_WIDTH) / 2) {
                                index = series.getSeriesItemList().indexOf(item);