[Title] rollback windowing table
authorHyunjong,park <phjwithyou.park@samsung.com>
Mon, 28 Oct 2013 08:04:40 +0000 (17:04 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Mon, 28 Oct 2013 08:04:40 +0000 (17:04 +0900)
[Desc.] -
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceView.java

index 39dbf90..f0f89ac 100644 (file)
@@ -45,13 +45,13 @@ import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
 import org.tizen.dynamicanalyzer.utils.Formatter;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 
-public class CallTraceTable extends DAWindowingTableComposite {
+public class CallTraceTable extends DATableComposite {
        private DAChartBoard chartBoard = null;
 
        public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
index 3e2b45a..b8ad527 100644 (file)
@@ -26,7 +26,8 @@
 
 package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
 
-import org.eclipse.nebula.widgets.grid.Grid;
+import java.util.List;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -36,20 +37,25 @@ import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.model.DAView;
 import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.swap.logparser.Logs;
+import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
+import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
 import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class CallTraceView extends DAView {
        public static final String ID = CallTraceView.class.getName();
-       private DAWindowingTableComposite tableComp;
+       private DATableComposite tableComp;
 
        private String[] columnNames = { TimelinePageLabels.CALL_TRACE_VIEW_TIME,
                        TimelinePageLabels.CALL_TRACE_VIEW_TID,
@@ -86,58 +92,13 @@ public class CallTraceView extends DAView {
                setMaxWeight(innerMaxWeight, outerMaxWeight);
        }
 
-       // @Override
-       // public void updateView(DASelectionData selData) {
-       // long start = selData.getStartTime();
-       // long end = selData.getEndTime();
-       // updateView();
-       // ((CallTraceTable) tableComp).setSelectionByTime(start, end);
-       // updateView();
-       // /* only callstack update */
-       // // timeline view and tabcomp top view : callstack
-       // if (selData.getViewId().equals(TimelineView.ID)) {
-       // DATabComposite tabView = (DATabComposite) AnalyzerUtil.getView(
-       // TimelinePage.ID, DATabComposite.ID);
-       // Composite comp = tabView.getTopComposite();
-       // if (comp instanceof CallstackView) {
-       // ((CallstackView) comp).updateView();
-       // }
-       // }
-       // }
-
        @Override
        public void updateView(DASelectionData selData) {
                long start = selData.getStartTime();
                long end = selData.getEndTime();
-
-               int selectionIndex = SqlManager.getInstance().getSelectionIndex(
-                               tableComp, start);
-               int selectionCount = SqlManager.getInstance().getSelectionItemCount(
-                               tableComp, start, end);
-
-               selectionIndex = ((selectionIndex < 0) && (selectionCount > 0)) ? 0
-                               : selectionIndex;
-               tableComp.getTable().getVerticalBar().setSelection(selectionIndex);
                updateView();
-
-               Grid table = tableComp.getTable();
-               if (selectionIndex >= 0) {
-                       if (selectionCount > 0) {
-                               int selections[] = new int[selectionCount];
-                               for (int i = 0; i < selectionCount; i++) {
-                                       selections[i] = selectionIndex + i;
-                               }
-                               table.setSelection(selections);
-                       } else {
-                               int selections[] = new int[0];
-                               table.setSelection(selections);
-                               int itemCount = table.getItemCount();
-                               if (selectionIndex >= itemCount) {
-                                       selectionIndex = itemCount - 1;
-                               }
-                               table.setSelection(selectionIndex);
-                       }
-               }
+               ((CallTraceTable) tableComp).setSelectionByTime(start, end);
+               updateView();
                /* only callstack update */
                // timeline view and tabcomp top view : callstack
                if (selData.getViewId().equals(TimelineView.ID)) {
@@ -150,6 +111,51 @@ public class CallTraceView extends DAView {
                }
        }
 
+//     @Override
+//     public void updateView(DASelectionData selData) {
+//             long start = selData.getStartTime();
+//             long end = selData.getEndTime();
+//
+//             int selectionIndex = SqlManager.getInstance().getSelectionIndex(
+//                             tableComp, start);
+//             int selectionCount = SqlManager.getInstance().getSelectionItemCount(
+//                             tableComp, start, end);
+//
+//             selectionIndex = ((selectionIndex < 0) && (selectionCount > 0)) ? 0
+//                             : selectionIndex;
+//             tableComp.getTable().getVerticalBar().setSelection(selectionIndex);
+//             updateView();
+//
+//             Grid table = tableComp.getTable();
+//             if (selectionIndex >= 0) {
+//                     if (selectionCount > 0) {
+//                             int selections[] = new int[selectionCount];
+//                             for (int i = 0; i < selectionCount; i++) {
+//                                     selections[i] = selectionIndex + i;
+//                             }
+//                             table.setSelection(selections);
+//                     } else {
+//                             int selections[] = new int[0];
+//                             table.setSelection(selections);
+//                             int itemCount = table.getItemCount();
+//                             if (selectionIndex >= itemCount) {
+//                                     selectionIndex = itemCount - 1;
+//                             }
+//                             table.setSelection(selectionIndex);
+//                     }
+//             }
+//             /* only callstack update */
+//             // timeline view and tabcomp top view : callstack
+//             if (selData.getViewId().equals(TimelineView.ID)) {
+//                     DATabComposite tabView = (DATabComposite) AnalyzerUtil.getView(
+//                                     TimelinePage.ID, DATabComposite.ID);
+//                     Composite comp = tabView.getTopComposite();
+//                     if (comp instanceof CallstackView) {
+//                             ((CallstackView) comp).updateView();
+//                     }
+//             }
+//     }
+
        @Override
        public void updateView() {
                tableComp.updateTable();
@@ -158,7 +164,6 @@ public class CallTraceView extends DAView {
        @Override
        public void clear() {
                tableComp.getTable().removeAll();
-               tableComp.clean();
        }
 
        @Override
@@ -168,30 +173,29 @@ public class CallTraceView extends DAView {
 
        @Override
        public void updateLog(LogPackage logPack) {
-               // Logs logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
-               // if (null == logs) {
-               // logs = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
-               // }
-               // if (null == logs || null == logs.getLogs() ||
-               // logs.getLogs().isEmpty()) {
-               // return;
-               // }
-               // List<LogData> inputs = logs.getLogs();
-               //
-               // int size = inputs.size();
-               // for (int i = 0; i < size; i++) {
-               // if (logs.getId() == DataChannelConstants.MSG_FUNCTION_ENTRY) {
-               // ProfileData pData = (ProfileData) inputs.get(i);
-               // UserFunctionManager.getInstance().addLog(pData);
-               // } else if (logs.getId() == LogCenterConstants.LOG_USER_FUNCTION) {
-               // UserFunctionData input = (UserFunctionData) inputs.get(i);
-               // int type = input.getType();
-               // if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
-               // UserFunctionManager.getInstance().addLog(input);
-               // }
-               // }
-               //
-               // }
+               Logs logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
+               if (null == logs) {
+                       logs = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
+               }
+               if (null == logs || null == logs.getLogs() || logs.getLogs().isEmpty()) {
+                       return;
+               }
+               List<LogData> inputs = logs.getLogs();
+
+               int size = inputs.size();
+               for (int i = 0; i < size; i++) {
+                       if (logs.getId() == DataChannelConstants.MSG_FUNCTION_ENTRY) {
+                               ProfileData pData = (ProfileData) inputs.get(i);
+                               UserFunctionManager.getInstance().addLog(pData);
+                       } else if (logs.getId() == LogCenterConstants.LOG_USER_FUNCTION) {
+                               UserFunctionData input = (UserFunctionData) inputs.get(i);
+                               int type = input.getType();
+                               if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
+                                       UserFunctionManager.getInstance().addLog(input);
+                               }
+                       }
+
+               }
        }
 
 }