[SRADA-786] modified Dlog range selection, Calltrace view set drag time by ToolBar...
authorggh1933.go <ggh1933.go@samsung.com>
Mon, 20 Jun 2016 01:01:28 +0000 (10:01 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Mon, 20 Jun 2016 05:19:28 +0000 (14:19 +0900)
 - FIX : change view from calltrace to dlog, Dlog table selection is not changed.
 - if changed drag time by calltrace or chart, reset all selection and redraw from new start to new end drag time.
 - calltrace set drag start, end time for sending changed time to dlog.
 - FIX : if calltrace update table by DAWindowingTableComposite, don't apply drag start and end time,
 - so, Add getter drag time from ToolBar in updateTable.

Change-Id: I094969b4f63880f01a51751c19fe012e0c652a4d

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/dlog/DlogTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java

index d3e3c20..94ae73e 100644 (file)
@@ -104,7 +104,10 @@ public class CallTraceTable extends DAWindowingTableComposite {
                                List<Object> endData = ((DATableDataFormat) ti[size - 1].getData()).getData();
                                long startTime = (Long) startData.get(FunctionEntryDBTable.COLUMN.START_TIME.index);
                                long endTime = (Long) endData.get(FunctionEntryDBTable.COLUMN.START_TIME.index);
-
+                               
+                               Toolbar.INSTANCE.setChartDragStartTime(startTime);
+                               Toolbar.INSTANCE.setChartDragEndTime(endTime);
+                               
                                DASelectionData data = new DASelectionData(TimelinePage.calltraceViewID, startTime,
                                                endTime, ti, table);
                                AnalyzerManager.getCurrentPage().updateView(data);
index 1ed19f7..b99e7ce 100644 (file)
@@ -43,6 +43,8 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;\r
 import org.eclipse.swt.widgets.Shell;\r
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+import org.tizen.dynamicanalyzer.common.DASelectionData;\r
 import org.tizen.dynamicanalyzer.common.Global;\r
 import org.tizen.dynamicanalyzer.model.TableInput;\r
 import org.tizen.dynamicanalyzer.resources.ColorResources;\r
@@ -79,8 +81,8 @@ public class DlogTable extends DATableComposite {
        private int[] columnSizes = { 70, 50, 60, 60, 80, 600};\r
        private int[] columnAlignment = { SWT.CENTER, SWT.CENTER, SWT.CENTER, SWT.CENTER, SWT.LEFT, SWT.LEFT };\r
        private boolean[] columnVisibility = { true, true, true, true, true, true };\r
-       private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_NUM,\r
-                       AnalyzerConstants.SORT_TYPE_NUM,AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_STRING };\r
+       private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE,\r
+                       AnalyzerConstants.SORT_TYPE_NONE,AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE };\r
        \r
        private List<TableInput> tableClone = new ArrayList<TableInput>();\r
        private List<DADlogData> dlogClone = new ArrayList<DADlogData>();\r
@@ -385,12 +387,20 @@ public class DlogTable extends DATableComposite {
                double endMarkerTime = endTime\r
                                / (TimelineConstants.MEGA_DOUBLE);\r
                \r
+               clearAllselection();\r
+               \r
                TimelineChartView TLchartView = (TimelineChartView) AnalyzerUtil.getView(TimelinePage.pageID, TimelineChartView.class.getName());\r
                \r
                DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) TLchartView.getChartBoard()\r
                                .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);\r
                intervalMarker.setInterval(startMarkerTime, endMarkerTime);\r
                \r
+               Toolbar.INSTANCE.setChartDragStartTime(startTime);\r
+               Toolbar.INSTANCE.setChartDragEndTime(endTime);\r
+               \r
+               /// send selection time to callTrace too selected in range\r
+               AnalyzerManager.getCurrentPage().updateView(\r
+                               new DASelectionData(TimelinePage.timelineViewID, startTime, endTime, null, null));\r
        }\r
        private long convertTimeStringToLong(String timestring) {\r
                long timelong = 0;\r
@@ -420,6 +430,12 @@ public class DlogTable extends DATableComposite {
        }\r
        \r
        private void selectTablefromChartDrag(long start, long end){\r
+                               \r
+               if(start == end) return;\r
+               \r
+               // clear selection made by dragging mouse on table.\r
+               table.deselectAll();\r
+\r
                for(int i = 0 ; i <  table.getItems().length ; i++){\r
                        \r
                        long diffTime = Long.parseLong(dlogClone.get(i).getTime());\r
@@ -434,4 +450,13 @@ public class DlogTable extends DATableComposite {
 \r
                }\r
        }\r
+       \r
+       // clear selection made by selectTablefromChartDrag.\r
+       private void clearAllselection(){\r
+               \r
+               for(int i = 0 ; i <  table.getItems().length ; i++){\r
+                       table.getItem(i).setBackground(ColorResources.TABLE_CONTENTS_NORMAL);\r
+                       table.getItem(i).setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);\r
+               }\r
+       }\r
 }\r
index 103818f..688ef55 100644 (file)
@@ -50,6 +50,7 @@ import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
 import org.tizen.dynamicanalyzer.model.FindProperty;
 import org.tizen.dynamicanalyzer.model.TableInput;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
 import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
 import org.tizen.dynamicanalyzer.ui.widgets.SearchDialog;
 import org.tizen.dynamicanalyzer.util.CommonUtil;
@@ -277,7 +278,16 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                if (itemCount <= 0) {
                        return;
                }
-
+               
+               /// when updateTable, selectionTime updated by ToolBar INSTANCE dragtime.
+               if(selectionStartTime == selectionEndTime || selectionStartTime < 0 || selectionEndTime < 0 ){
+                       if( !(Toolbar.INSTANCE.getChartDragStartTime() < 0) && !(Toolbar.INSTANCE.getChartDragEndTime() < 0) )
+                       {
+                               selectionStartTime = Toolbar.INSTANCE.getChartDragStartTime();
+                               selectionEndTime = Toolbar.INSTANCE.getChartDragEndTime();
+                       }
+               }
+               
                List<TableInput> output = null;
                output = makeTableInputFromDB(itemCount);
                if (null == output) {