thread : to move the chat to the selected time 56/29756/1
authorHyunjong.park <phjwithyou.park@samsung.com>
Tue, 4 Nov 2014 04:37:13 +0000 (13:37 +0900)
committerHyunjong.park <phjwithyou.park@samsung.com>
Tue, 4 Nov 2014 04:37:13 +0000 (13:37 +0900)
Signed-off-by: Hyunjong.park <phjwithyou.park@samsung.com>
Change-Id: I12626d577627b11a9fbf4dab61d845461146121c

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/chart/ThreadChartView.java

index 0b7d428..906b4fb 100644 (file)
@@ -217,7 +217,7 @@ public class ThreadChartView extends DAViewComposite {
 
        private void changeComboThreadToSync() {
                stackLayout.topControl = syncChartBoard;
-               threadCombo.setText(ThreadPageLabels.THREAD_CHART_SYNC);
+               syncCombo.setText(ThreadPageLabels.THREAD_CHART_SYNC);
                syncChartBoard.setScaleVal(threadChartBoard.getScaleVal());
                syncChartBoard.setVisibleStart(threadChartBoard.getVisibleStart());
                syncChartBoard.setItemsHeightMode(threadChartBoard.isItemMinimized());
@@ -289,7 +289,7 @@ public class ThreadChartView extends DAViewComposite {
        private void selectionFromSummary(DASelectionData selData) {
                Object odata = selData.getData();
                String category = LogDataFactory.getLogFormatName(((ProbeCommonData) odata).getId());
-               if(null == category){
+               if (null == category) {
                        return;
                }
                String selectTid = Integer.toString(((ProbeCommonData) odata).getTid());
@@ -308,6 +308,7 @@ public class ThreadChartView extends DAViewComposite {
                double startTime = (double) start / TimelineConstants.MEGA_DOUBLE;
                double endTime = (double) end / TimelineConstants.MEGA_DOUBLE;
                intervalMarker.setInterval(startTime, endTime);
+               moveSelectTime(startTime);
        }
 
        private void selectionFromAPITable(DASelectionData selData) {
@@ -319,6 +320,17 @@ public class ThreadChartView extends DAViewComposite {
                double startTime = (double) start / TimelineConstants.MEGA_DOUBLE;
                double endTime = (double) end / TimelineConstants.MEGA_DOUBLE;
                intervalMarker.setInterval(startTime, endTime);
+               moveSelectTime(startTime);
+       }
+
+       private void moveSelectTime(double time) {
+               if (stackLayout.topControl == syncChartBoard) {
+                       syncChartBoard.setVisibleMiddleTime(time);
+                       syncChartBoard.updateChart();
+               } else {
+                       threadChartBoard.setVisibleMiddleTime(time);
+                       threadChartBoard.updateChart();
+               }
        }
 
        private int getThreadChartIndexOfSelected(String tID) {
@@ -335,7 +347,7 @@ public class ThreadChartView extends DAViewComposite {
                }
                return 0;
        }
-       
+
        private int getSyncChartIndexOfSelected(String tID) {
                int itemSize = syncChartBoard.getItemList().getItemSize();
                if (null == tID || 0 == itemSize) {