[Title] apply windowing table
authorHyunjong,park <phjwithyou.park@samsung.com>
Wed, 6 Nov 2013 01:40:35 +0000 (10:40 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Wed, 6 Nov 2013 01:40:35 +0000 (10:40 +0900)
[Desc.] only apply opentrace table
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/UserFunctionManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogValues.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java

index 85c8da4..b73498b 100755 (executable)
@@ -41,6 +41,7 @@ import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;
 import org.tizen.dynamicanalyzer.swap.callstack.SWAPCallStackManager;
+import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
 import org.tizen.dynamicanalyzer.theme.DATheme;
 import org.tizen.dynamicanalyzer.theme.DAThemeWhite;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
@@ -51,7 +52,6 @@ import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
 import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
-import org.tizen.dynamicanalyzer.ui.timeline.calltrace.UserFunctionManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.utils.ImageListSortComparator;
@@ -186,8 +186,8 @@ public class AnalyzerManager {
                isHaveSampleThread = false;
                isLogParsingComplete = false;
                StopProcessManager.clear();
-               UserFunctionManager.getInstance().clear();
-               //LogDataFactory.clean();
+       //      UserFunctionManager.getInstance().clear();
+               LogDataFactory.clean();
                FunctionUsageProfiler.clear();
                FunctionUsageProfiler.stopProfiler();
                RangeDataManager.getInstance().initRange();
index f86f8b2..6ec4505 100644 (file)
@@ -70,6 +70,7 @@ public class DBTableManager {
        public static final String EMPTY = CommonConstants.EMPTY;
        public static final String TEXT = "VARCHAR(256)";//$NON-NLS-1$
        public static final String INTEGER = "INTEGER";//$NON-NLS-1$
+       public static final String LONG = "bigint";//$NON-NLS-1$
        public static final String NOT_NULL = "not null";//$NON-NLS-1$
 
        public static final String COMMON_COLUMN_RID = "Rid";//$NON-NLS-1$
index 27d5f2a..e2ef6e3 100755 (executable)
@@ -247,7 +247,7 @@ public class SqlManager {
                        if (dbTypes.get(i) == LogFormat.I) {
                                type = DBTableManager.INTEGER;
                        } else if (dbTypes.get(i) == LogFormat.L) {
-                               type = DBTableManager.TEXT;
+                               type = DBTableManager.LONG;
                        }
                        query.append(type);
                        if (i + 1 == size) {
@@ -909,7 +909,6 @@ public class SqlManager {
                        }
                        query = String.format("select %s from %s %s;",//$NON-NLS-1$
                                        columns.toString(), tableName, queryOption);
-
                        stat = conn.createStatement();
                        rs = stat.executeQuery(query);
                        if (null == rs) {
@@ -1038,7 +1037,7 @@ public class SqlManager {
                        while (rs.next()) {
                                List<String> rowData = new ArrayList<String>();
                                for (int i = 1; i < nRsMetaDataCount + 1; i++) {
-                                       if (rsMetaData.getColumnTypeName(i).contains("INTEGER")) {//$NON-NLS-1$
+                                       if (rsMetaData.getColumnTypeName(i).contains("INTEGER") || rsMetaData.getColumnTypeName(i).contains("BIGINT")) {//$NON-NLS-1$
                                                rowData.add(Integer.toString(rs.getInt(i)));
                                        } else if (rsMetaData.getColumnTypeName(i).contains(
                                                        "VARCHAR")) {//$NON-NLS-1$
@@ -1204,14 +1203,14 @@ public class SqlManager {
                return dbInfo.get(0);
        }
 
-       public int executeSelectIndexOperation(long time) {
+       public long executeSelectIndexOperation(long time) {
                String queryOptin = " where time < " + time + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER; //$NON-NLS-1$ //$NON-NLS-2$
                List<List<String>> dbInfo = selectQuery(null,
                                new String[] { "count(time)" }, "user_function", queryOptin);
                if (null == dbInfo || null == dbInfo.get(0).get(0)) {
                        return 0;
                }
-               return Integer.parseInt(dbInfo.get(0).get(0));
+               return Long.parseLong(dbInfo.get(0).get(0));
        }
 
        public int executeSelectCountOperation(long StartTime, long endTime) {
@@ -1239,7 +1238,6 @@ public class SqlManager {
        }
 
        public long getLastSnapshotTime(long time) {
-
                String queryOption = "where time >=" + time;//$NON-NLS-1$
                List<List<String>> dbInfo = selectQuery(null,
                                new String[] { "min(time)" }, "screenshot", queryOption); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1298,7 +1296,7 @@ public class SqlManager {
 
                return dbInfo;
        }
-       
+
        public synchronized List<LogData> selectTableData(int logId, int from,
                        int to, String option) {
                String tableName = LogDataFactory.getLogFormatById(logId).getName();
@@ -1314,8 +1312,7 @@ public class SqlManager {
                return dbInfo;
        }
 
-       
-       public synchronized int getSelectionTime(String tableName, long startTime,
+       public synchronized long getSelectionTime(String tableName, long startTime,
                        String option) {
                String query = null;
                Statement stat = null;
@@ -1335,7 +1332,7 @@ public class SqlManager {
                        query = String.format("select max(time) from %s where time <= %s",//$NON-NLS-1$
                                        tableName, Long.toString(startTime));
                        if (!option.equals(CommonConstants.EMPTY)) {
-                               query += "and " + option;
+                               query += " and " + option;
                        }
                        stat = conn.createStatement();
 
index cd80ac1..cc740f2 100644 (file)
@@ -681,9 +681,9 @@ public class NetworkDataMaker {
 
        public void checkUpdate() {
 
-               createCPUBoardItem();
-               createNetworkIOBoardItem();
-               createTransmissionSizeBoardItem();
+//             createCPUBoardItem();
+//             createNetworkIOBoardItem();
+//             createTransmissionSizeBoardItem();
 
                if (!AnalyzerManager.isRunning()) {
                        int size = unConnectedDataList.size();
index 959c628..fb9f34c 100644 (file)
@@ -29,6 +29,222 @@ package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
 
 
 
+//import java.util.ArrayList;
+//import java.util.List;
+//
+//import org.eclipse.nebula.widgets.grid.Grid;
+//import org.eclipse.nebula.widgets.grid.GridItem;
+//import org.eclipse.swt.events.SelectionEvent;
+//import org.eclipse.swt.events.SelectionListener;
+//import org.eclipse.swt.widgets.Composite;
+//import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+//import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+//import org.tizen.dynamicanalyzer.common.DASelectionData;
+//import org.tizen.dynamicanalyzer.model.TableInput;
+//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.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.utils.Formatter;
+//import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+//import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+//
+//public class CallTraceTable extends DATableComposite {
+//     private DAChartBoard chartBoard = null;
+//
+//     public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
+//             super(parent, compStyle, tableStyle);
+//             setRangePopup();
+//
+//             table.addSelectionListener(new SelectionListener() {
+//
+//                     @Override
+//                     public void widgetSelected(SelectionEvent e) {
+//                             GridItem[] ti = ((Grid) e.widget).getSelection();
+//                             if (null == ti || ti.length == 0) {
+//                                     return;
+//                             }
+//                             int size = ti.length;
+//                             LogData startData = ((DATableDataFormat) ti[0].getData())
+//                                             .getLogData();
+//                             LogData endData = ((DATableDataFormat) ti[size - 1].getData())
+//                                             .getLogData();
+//                             long startTime = startData.getTime();
+//                             long endTime = endData.getTime();
+//
+//                             DASelectionData data = new DASelectionData(CallTraceView.ID,
+//                                             startTime, endTime, ti, table);
+//                             AnalyzerManager.getCurrentPage().updatePage(data);
+//                     }
+//
+//                     @Override
+//                     public void widgetDefaultSelected(SelectionEvent e) {
+//                     }
+//             });
+//
+//     }
+//
+//     protected List<TableInput> makeTableInput() {
+//             List<LogData> userLog = UserFunctionManager.getInstance().getLog();
+//             List<TableInput> input = new ArrayList<TableInput>();
+//             int size = userLog.size();
+//             for (int i = 0; i < size; i++) {
+//                     LogData logData = userLog.get(i);
+//                     List<String> text = new ArrayList<String>();
+//                     if (logData instanceof UserFunctionData) {
+//                             // create text
+//                             UserFunctionData data = (UserFunctionData) logData;
+//                             String time = Formatter.toTimeFormat(data.getTime());
+//                             text.add(time);
+//                             text.add(Integer.toString(data.getTid()));
+//                             text.add(Integer.toString(data.getPid()));
+//                             text.add(data.getApiName());
+//                             text.add(data.getArgs());
+//                             text.add(data.getReturn());
+//                             text.add(data.getLibName());
+//                     } else if (logData instanceof ProfileData) {
+//                             ProfileData data = (ProfileData) logData;
+//                             String time = Formatter.toTimeFormat(data.getTime());
+//                             text.add(time);
+//                             text.add(Integer.toString(data.getTid()));
+//                             text.add(Integer.toString(data.getPid()));
+//                             text.add(data.getApiName());
+//                             text.add(data.getArgs());
+//                             text.add(data.getHexReturn());
+//                             text.add(data.getLibName());
+//                     } else {
+//                             System.out.println("wrong log data in calltrace view");
+//                             continue;
+//                     }
+//                     // create images
+//
+//                     // create DATableDataFormat
+//                     DATableDataFormat tableData = new DATableDataFormat(
+//                                     logData.getSeq());
+//                     tableData.setLogData(logData);
+//                     tableData.setType(AnalyzerConstants.TYPE_TABLE_CALLTRACE);
+//
+//                     TableInput tableInput = new TableInput();
+//                     tableInput.setText(text);
+//                     tableInput.setData(tableData);
+//                     input.add(tableInput);
+//
+//                     if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+//                             long logTime = logData.getTime();
+//                             long analysisStartTime = RangeDataManager.getInstance()
+//                                             .getAnalysisStartTime();
+//                             long analysisEndTime = RangeDataManager.getInstance()
+//                                             .getAnalysisEndTime();
+//                             if (logTime >= analysisStartTime && logTime <= analysisEndTime) {
+//                                     tableInput.setInRange(true);
+//                             }
+//                     }
+//             }
+//             return input;
+//     }
+//
+//     private DAChartBoard getChartBoard() {
+//             if (chartBoard == null) {
+//                     return (DAChartBoard) (AnalyzerManager.getCurrentPage().getView(
+//                                     TimelineView.ID).getControl());
+//             }
+//             return chartBoard;
+//     }
+//
+//     protected void actionSetStartEnd(int type) {
+//             GridItem item = table.getItem(mousePoint);
+//             if (null != item) {
+//                     LogData data = ((DATableDataFormat) item.getData()).getLogData();
+//                     long inputTime = data.getTime();
+//                     double startTime = -1;
+//                     double endTime = -1;
+//                     DAChartBoard board = getChartBoard();
+//
+//                     if (type == START_TIME) {
+//                             rangeDataManager.setMarkerStartTime(inputTime);
+//                             startTime = inputTime / TimelineConstants.MEGA_DOUBLE;
+//                             endTime = rangeDataManager.getMarkerEndTime()
+//                                             / TimelineConstants.MEGA_DOUBLE;
+//
+//                     } else if (type == END_TIME) {
+//                             rangeDataManager.setMarkerEndTime(inputTime);
+//                             endTime = inputTime / TimelineConstants.MEGA_DOUBLE;
+//                             startTime = rangeDataManager.getMarkerStartTime()
+//                                             / TimelineConstants.MEGA_DOUBLE;
+//                     }
+//
+//                     board.setTimelineMarkerStartTime(startTime);
+//                     board.setTimelineMarkerEndTime(endTime);
+//
+//                     ((DAChartPlotIntervalMarker) board.getMarkers().get(
+//                                     UICommonConstants.RANGE_MARKER_INDEX))
+//                                     .setStartVal(startTime);
+//                     ((DAChartPlotIntervalMarker) board.getMarkers().get(
+//                                     UICommonConstants.RANGE_MARKER_INDEX)).setEndVal(endTime);
+//                     //
+//                     //
+//                     //
+//                     //
+//                     // if (type == START_TIME) {
+//                     // rangeDataManager.setMarkerStartTime(inputTime);
+//                     // getChartBoard().setTimelineMarkerStartTime(
+//                     // inputTime / TimelineConstants.MEGA);
+//                     // } else if (type == END_TIME) {
+//                     // rangeDataManager.setMarkerEndTime(inputTime);
+//                     // getChartBoard().setTimelineMarkerEndTime(
+//                     // inputTime / TimelineConstants.MEGA);
+//                     // }
+//             }
+//     }
+//
+//     public void setSelectionByTime(long startTime, long endTime) {
+//             GridItem[] items = table.getItems();
+//             int size = items.length;
+//             List<Integer> selectionArray = new ArrayList<Integer>();
+//             int topIndex = 0;
+//             long topIndexTime = 0;
+//
+//             for (int i = 0; i < size; i++) {
+//                     DATableDataFormat dataFormat = (DATableDataFormat) items[i]
+//                                     .getData();
+//                     long time = dataFormat.getLogData().getTime();
+//
+//                     if (time < startTime) {
+//                             if (time > topIndexTime) {
+//                                     topIndexTime = time;
+//                                     topIndex = i;
+//                             }
+//                     } else if (time <= endTime) {
+//                             if (topIndexTime < startTime) {
+//                                     topIndexTime = time;
+//                                     topIndex = i;
+//                             } else {
+//                                     if (topIndexTime > time) {
+//                                             topIndexTime = time;
+//                                             topIndex = i;
+//                                     }
+//                             }
+//                             selectionArray.add(i);
+//                     } else {
+//                             break;
+//                     }
+//             }
+//
+//             int[] sel = new int[selectionArray.size()];
+//             for (int i = 0; i < sel.length; i++) {
+//                     sel[i] = selectionArray.get(i).intValue();
+//             }
+//             table.setSelection(sel);
+//             table.setTopIndex(topIndex);
+//     }
+//}
+
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -41,21 +257,19 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
 import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
 import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
-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 DATableComposite {
-       private DAChartBoard chartBoard = null;
+public class CallTraceTable extends DAWindowingTableComposite {
+       private String dbOptionQuery = "messageid = "+DataChannelConstants.MSG_FUNCTION_ENTRY;//$NON-NLS-1$
 
        public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
@@ -89,8 +303,7 @@ public class CallTraceTable extends DATableComposite {
 
        }
 
-       protected List<TableInput> makeTableInput() {
-               List<LogData> userLog = UserFunctionManager.getInstance().getLog();
+       protected List<TableInput> makeTableInput(List<LogData> userLog) {
                List<TableInput> input = new ArrayList<TableInput>();
                int size = userLog.size();
                for (int i = 0; i < size; i++) {
@@ -144,245 +357,33 @@ public class CallTraceTable extends DATableComposite {
                                        tableInput.setInRange(true);
                                }
                        }
+
                }
                return input;
        }
-
-       private DAChartBoard getChartBoard() {
-               if (chartBoard == null) {
-                       return (DAChartBoard) (AnalyzerManager.getCurrentPage().getView(
-                                       TimelineView.ID).getControl());
-               }
-               return chartBoard;
+       protected int getTableLogId(){
+               return DataChannelConstants.MSG_FUNCTION_ENTRY;
        }
-
-       protected void actionSetStartEnd(int type) {
-               GridItem item = table.getItem(mousePoint);
-               if (null != item) {
-                       LogData data = ((DATableDataFormat) item.getData()).getLogData();
-                       long inputTime = data.getTime();
-                       double startTime = -1;
-                       double endTime = -1;
-                       DAChartBoard board = getChartBoard();
-
-                       if (type == START_TIME) {
-                               rangeDataManager.setMarkerStartTime(inputTime);
-                               startTime = inputTime / TimelineConstants.MEGA_DOUBLE;
-                               endTime = rangeDataManager.getMarkerEndTime()
-                                               / TimelineConstants.MEGA_DOUBLE;
-
-                       } else if (type == END_TIME) {
-                               rangeDataManager.setMarkerEndTime(inputTime);
-                               endTime = inputTime / TimelineConstants.MEGA_DOUBLE;
-                               startTime = rangeDataManager.getMarkerStartTime()
-                                               / TimelineConstants.MEGA_DOUBLE;
-                       }
-
-                       board.setTimelineMarkerStartTime(startTime);
-                       board.setTimelineMarkerEndTime(endTime);
-
-                       ((DAChartPlotIntervalMarker) board.getMarkers().get(
-                                       UICommonConstants.RANGE_MARKER_INDEX))
-                                       .setStartVal(startTime);
-                       ((DAChartPlotIntervalMarker) board.getMarkers().get(
-                                       UICommonConstants.RANGE_MARKER_INDEX)).setEndVal(endTime);
-                       //
-                       //
-                       //
-                       //
-                       // if (type == START_TIME) {
-                       // rangeDataManager.setMarkerStartTime(inputTime);
-                       // getChartBoard().setTimelineMarkerStartTime(
-                       // inputTime / TimelineConstants.MEGA);
-                       // } else if (type == END_TIME) {
-                       // rangeDataManager.setMarkerEndTime(inputTime);
-                       // getChartBoard().setTimelineMarkerEndTime(
-                       // inputTime / TimelineConstants.MEGA);
-                       // }
-               }
+       
+       protected int getItemCount() {
+               return LogDataFactory.getProfilingLogNum();
        }
 
        public void setSelectionByTime(long startTime, long endTime) {
-               GridItem[] items = table.getItems();
-               int size = items.length;
-               List<Integer> selectionArray = new ArrayList<Integer>();
-               int topIndex = 0;
-               long topIndexTime = 0;
-
-               for (int i = 0; i < size; i++) {
-                       DATableDataFormat dataFormat = (DATableDataFormat) items[i]
-                                       .getData();
-                       long time = dataFormat.getLogData().getTime();
-
-                       if (time < startTime) {
-                               if (time > topIndexTime) {
-                                       topIndexTime = time;
-                                       topIndex = i;
-                               }
-                       } else if (time <= endTime) {
-                               if (topIndexTime < startTime) {
-                                       topIndexTime = time;
-                                       topIndex = i;
-                               } else {
-                                       if (topIndexTime > time) {
-                                               topIndexTime = time;
-                                               topIndex = i;
-                                       }
-                               }
-                               selectionArray.add(i);
-                       } else {
-                               break;
-                       }
-               }
-
-               int[] sel = new int[selectionArray.size()];
-               for (int i = 0; i < sel.length; i++) {
-                       sel[i] = selectionArray.get(i).intValue();
+               selectionStartTime = SqlManager.getInstance().getSelectionTime(
+                               getDBTableName(), startTime, dbOptionQuery);
+               selectionEndTime = selectionStartTime;
+               if (startTime != endTime) {
+                       selectionEndTime = SqlManager.getInstance().getSelectionTime(
+                                       getDBTableName(), endTime, dbOptionQuery);
                }
-               table.setSelection(sel);
-               table.setTopIndex(topIndex);
+               
+               int selectionRid = SqlManager.getInstance().getSelectionRid(
+                               getDBTableName(), selectionStartTime, dbOptionQuery);
+               getScrollBar().setSelection(selectionRid);
        }
-}
-
-
-//import java.util.ArrayList;
-//import java.util.List;
-//
-//import org.eclipse.nebula.widgets.grid.Grid;
-//import org.eclipse.nebula.widgets.grid.GridItem;
-//import org.eclipse.swt.events.SelectionEvent;
-//import org.eclipse.swt.events.SelectionListener;
-//import org.eclipse.swt.widgets.Composite;
-//import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-//import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-//import org.tizen.dynamicanalyzer.common.DASelectionData;
-//import org.tizen.dynamicanalyzer.model.TableInput;
-//import org.tizen.dynamicanalyzer.sql.SqlManager;
-//import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
-//import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-//import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
-//import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
-//import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
-//import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-//import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-//import org.tizen.dynamicanalyzer.ui.widgets.table.DAWindowingTableComposite;
-//import org.tizen.dynamicanalyzer.utils.Formatter;
-//
-//public class CallTraceTable extends DAWindowingTableComposite {
-//     private String dbOptionQuery = "messageid = 8";//$NON-NLS-1$
-//
-//     public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
-//             super(parent, compStyle, tableStyle);
-//             setRangePopup();
-//
-//             table.addSelectionListener(new SelectionListener() {
-//
-//                     @Override
-//                     public void widgetSelected(SelectionEvent e) {
-//                             GridItem[] ti = ((Grid) e.widget).getSelection();
-//                             if (null == ti || ti.length == 0) {
-//                                     return;
-//                             }
-//                             int size = ti.length;
-//                             LogData startData = ((DATableDataFormat) ti[0].getData())
-//                                             .getLogData();
-//                             LogData endData = ((DATableDataFormat) ti[size - 1].getData())
-//                                             .getLogData();
-//                             long startTime = startData.getTime();
-//                             long endTime = endData.getTime();
-//
-//                             DASelectionData data = new DASelectionData(CallTraceView.ID,
-//                                             startTime, endTime, ti, table);
-//                             AnalyzerManager.getCurrentPage().updatePage(data);
-//                     }
-//
-//                     @Override
-//                     public void widgetDefaultSelected(SelectionEvent e) {
-//                     }
-//             });
-//
-//     }
-//
-//     protected List<TableInput> makeTableInput(List<LogData> userLog) {
-//             List<TableInput> input = new ArrayList<TableInput>();
-//             int size = userLog.size();
-//             for (int i = 0; i < size; i++) {
-//                     LogData logData = userLog.get(i);
-//                     List<String> text = new ArrayList<String>();
-//                     if (logData instanceof UserFunctionData) {
-//                             // create text
-//                             UserFunctionData data = (UserFunctionData) logData;
-//                             String time = Formatter.toTimeFormat(data.getTime());
-//                             text.add(time);
-//                             text.add(Integer.toString(data.getTid()));
-//                             text.add(Integer.toString(data.getPid()));
-//                             text.add(data.getApiName());
-//                             text.add(data.getArgs());
-//     //                      text.add(data.getHexReturn());
-//                             text.add(data.getLibName());
-//                     } else if (logData instanceof ProfileData) {
-//                             ProfileData data = (ProfileData) logData;
-//                             String time = Formatter.toTimeFormat(data.getTime());
-//                             text.add(time);
-//                             text.add(Integer.toString(data.getTid()));
-//                             text.add(Integer.toString(data.getPid()));
-//                             text.add(data.getApiName());
-//                             text.add(data.getArgs());
-//                             text.add(data.getHexReturn());
-//                             text.add(data.getLibName());
-//                     } else {
-//                             System.out.println("wrong log data in calltrace view");
-//                             continue;
-//                     }
-//                     // create images
-//
-//                     // create DATableDataFormat
-//                     DATableDataFormat tableData = new DATableDataFormat(
-//                                     logData.getSeq());
-//                     tableData.setLogData(logData);
-//                     tableData.setType(AnalyzerConstants.TYPE_TABLE_CALLTRACE);
-//
-//                     TableInput tableInput = new TableInput();
-//                     tableInput.setText(text);
-//                     tableInput.setData(tableData);
-//                     input.add(tableInput);
-//
-//                     if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-//                             long logTime = logData.getTime();
-//                             long analysisStartTime = RangeDataManager.getInstance()
-//                                             .getAnalysisStartTime();
-//                             long analysisEndTime = RangeDataManager.getInstance()
-//                                             .getAnalysisEndTime();
-//                             if (logTime >= analysisStartTime && logTime <= analysisEndTime) {
-//                                     tableInput.setInRange(true);
-//                             }
-//                     }
-//
-//             }
-//             return input;
-//     }
-//     protected int getTableLogId(){
-//             return DataChannelConstants.MSG_FUNCTION_ENTRY;
-//     }
-//     
-//     protected int getItemCount() {
-//             return LogDataFactory.getProfilingLogNum();
-//     }
-//
-//     public void setSelectionByTime(long startTime, long endTime) {
-//             selectionStartTime = SqlManager.getInstance().getSelectionTime(
-//                             getDBTableName(), startTime, dbOptionQuery);
-//             selectionEndTime = selectionStartTime;
-//             if (startTime != endTime) {
-//                     selectionEndTime = SqlManager.getInstance().getSelectionTime(
-//                                     getDBTableName(), endTime, dbOptionQuery);
-//             }
-//             int selectionRid = SqlManager.getInstance().getSelectionRid(
-//                             getDBTableName(), selectionStartTime, dbOptionQuery);
-//             getScrollBar().setSelection(selectionRid);
-//     }
-//     
-//     protected String getSelectQueryOption(){
-//             return dbOptionQuery;
-//     }
-//}
\ No newline at end of file
+       
+       protected String getSelectQueryOption(){
+               return dbOptionQuery;
+       }
+}
\ No newline at end of file
index 24abcd6..1ee947a 100644 (file)
@@ -28,196 +28,7 @@ package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
 
 
 
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.model.DAView;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-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.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 DATableComposite tableComp;
-
-       private String[] columnNames = { TimelinePageLabels.CALL_TRACE_VIEW_TIME,
-                       TimelinePageLabels.CALL_TRACE_VIEW_TID,
-                       TimelinePageLabels.CALL_TRACE_VIEW_PID,
-                       TimelinePageLabels.CALL_TRACE_VIEW_NAME,
-                       AnalyzerLabels.TABLE_COLUMN_PARAMETERS,
-                       AnalyzerLabels.TABLE_COLUMN_RETURN,
-                       AnalyzerLabels.TABLE_COLUMN_LIBNAME };
-       private int[] columnSizes = { 60, 35, 35, 350, 150, 80, 200 };
-       private boolean[] columnVisibility = { true, true, true, true, true, true,
-                       true };
-       int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING };
-
-       int[] innerMaxWeight = { 0, 100 };
-       int[] outerMaxWeight = { 0, 100 };
-
-       public CallTraceView(Composite parent, int style) {
-               super(parent, style);
-               this.setLayout(new FillLayout());
-
-               ViewContainer viewContainer = new ViewContainer(this, true);
-               viewContainer.setTitleText(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
-
-               Composite contents = viewContainer.getContentArea();
-               contents.setBackground(ColorResources.WINDOW_BG_COLOR);
-               contents.setLayout(new FillLayout());
-               tableComp = new CallTraceTable(contents, SWT.NONE, SWT.MULTI
-                               | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
-               tableComp.setTableName(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
-               tableComp.setSortTypes(sortTypes);
-               tableComp.setColumns(columnNames);
-               tableComp.setColumnSize(columnSizes);
-               tableComp.setColumnVisibility(columnVisibility);
-               contents.addControlListener(new TableColumnSizePackListener(tableComp,
-                               columnSizes));
-
-               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);
-       // }
-       // }
-       // /* 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();
-       }
-
-       @Override
-       public void clear() {
-               tableComp.getTable().removeAll();
-       }
-
-       @Override
-       public Control getControl() {
-               return tableComp;
-       }
-
-       @Override
-       public void updateLog(LogPackage logPack) {
-               Logs logs = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
-               if (null == logs) {
-                       logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
-               }
-               if (null != logs && null != logs.getLogs() && !logs.getLogs().isEmpty()) {
-                       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 = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_EXIT);
-               if (null != logs && null != logs.getLogs() && !logs.getLogs().isEmpty()) {
-                       List<LogData> inputs = logs.getLogs();
-
-                       int size = inputs.size();
-                       for (int i = 0; i < size; i++) {
-                               UserFunctionManager.getInstance().setReturnValue(inputs.get(i));
-                       }
-               }
-       }
-
-}
-//
+//import java.util.List;
 //
 //import org.eclipse.swt.SWT;
 //import org.eclipse.swt.layout.FillLayout;
@@ -225,23 +36,29 @@ public class CallTraceView extends DAView {
 //import org.eclipse.swt.widgets.Control;
 //import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 //import org.tizen.dynamicanalyzer.common.DASelectionData;
+//import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 //import org.tizen.dynamicanalyzer.model.DAView;
 //import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 //import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
 //import org.tizen.dynamicanalyzer.resources.ColorResources;
+//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.WindowingTableColumnSizePackListener;
+//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,
@@ -250,7 +67,7 @@ public class CallTraceView extends DAView {
 //                     AnalyzerLabels.TABLE_COLUMN_PARAMETERS,
 //                     AnalyzerLabels.TABLE_COLUMN_RETURN,
 //                     AnalyzerLabels.TABLE_COLUMN_LIBNAME };
-//     private int[] columnSizes = { 65, 45, 45, 400, 150, 80, 200 };
+//     private int[] columnSizes = { 60, 35, 35, 350, 150, 80, 200 };
 //     private boolean[] columnVisibility = { true, true, true, true, true, true,
 //                     true };
 //     int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
@@ -273,13 +90,13 @@ public class CallTraceView extends DAView {
 //             contents.setBackground(ColorResources.WINDOW_BG_COLOR);
 //             contents.setLayout(new FillLayout());
 //             tableComp = new CallTraceTable(contents, SWT.NONE, SWT.MULTI
-//                             | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL);
+//                             | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
 //             tableComp.setTableName(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
 //             tableComp.setSortTypes(sortTypes);
 //             tableComp.setColumns(columnNames);
 //             tableComp.setColumnSize(columnSizes);
 //             tableComp.setColumnVisibility(columnVisibility);
-//             contents.addControlListener(new WindowingTableColumnSizePackListener(tableComp,
+//             contents.addControlListener(new TableColumnSizePackListener(tableComp,
 //                             columnSizes));
 //
 //             setMaxWeight(innerMaxWeight, outerMaxWeight);
@@ -312,7 +129,6 @@ public class CallTraceView extends DAView {
 //     @Override
 //     public void clear() {
 //             tableComp.getTable().removeAll();
-//             tableComp.clean();
 //     }
 //
 //     @Override
@@ -322,6 +138,146 @@ public class CallTraceView extends DAView {
 //
 //     @Override
 //     public void updateLog(LogPackage logPack) {
-//             
+//             Logs logs = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
+//             if (null == logs) {
+//                     logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
+//             }
+//             if (null != logs && null != logs.getLogs() && !logs.getLogs().isEmpty()) {
+//                     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 = logPack.getLogs(DataChannelConstants.MSG_FUNCTION_EXIT);
+//             if (null != logs && null != logs.getLogs() && !logs.getLogs().isEmpty()) {
+//                     List<LogData> inputs = logs.getLogs();
+//
+//                     int size = inputs.size();
+//                     for (int i = 0; i < size; i++) {
+//                             UserFunctionManager.getInstance().setReturnValue(inputs.get(i));
+//                     }
+//             }
 //     }
+//
 //}
+
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
+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.WindowingTableColumnSizePackListener;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class CallTraceView extends DAView {
+       public static final String ID = CallTraceView.class.getName();
+       private DAWindowingTableComposite tableComp;
+
+       private String[] columnNames = { TimelinePageLabels.CALL_TRACE_VIEW_TIME,
+                       TimelinePageLabels.CALL_TRACE_VIEW_TID,
+                       TimelinePageLabels.CALL_TRACE_VIEW_PID,
+                       TimelinePageLabels.CALL_TRACE_VIEW_NAME,
+                       AnalyzerLabels.TABLE_COLUMN_PARAMETERS,
+                       AnalyzerLabels.TABLE_COLUMN_RETURN,
+                       AnalyzerLabels.TABLE_COLUMN_LIBNAME };
+       private int[] columnSizes = { 65, 45, 45, 400, 150, 80, 200 };
+       private boolean[] columnVisibility = { true, true, true, true, true, true,
+                       true };
+       int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+                       AnalyzerConstants.SORT_TYPE_STRING,
+                       AnalyzerConstants.SORT_TYPE_STRING,
+                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING };
+
+       int[] innerMaxWeight = { 0, 100 };
+       int[] outerMaxWeight = { 0, 100 };
+
+       public CallTraceView(Composite parent, int style) {
+               super(parent, style);
+               this.setLayout(new FillLayout());
+
+               ViewContainer viewContainer = new ViewContainer(this, true);
+               viewContainer.setTitleText(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
+
+               Composite contents = viewContainer.getContentArea();
+               contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+               contents.setLayout(new FillLayout());
+               tableComp = new CallTraceTable(contents, SWT.NONE, SWT.MULTI
+                               | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL);
+               tableComp.setTableName(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
+               tableComp.setSortTypes(sortTypes);
+               tableComp.setColumns(columnNames);
+               tableComp.setColumnSize(columnSizes);
+               tableComp.setColumnVisibility(columnVisibility);
+               contents.addControlListener(new WindowingTableColumnSizePackListener(tableComp,
+                               columnSizes));
+
+               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() {
+               tableComp.updateTable();
+       }
+
+       @Override
+       public void clear() {
+               tableComp.getTable().removeAll();
+               tableComp.clean();
+       }
+
+       @Override
+       public Control getControl() {
+               return tableComp;
+       }
+
+       @Override
+       public void updateLog(LogPackage logPack) {
+               
+       }
+}
index 0da8bab..fa7ec96 100644 (file)
@@ -35,58 +35,58 @@ import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
 
 public class UserFunctionManager {
-       private List<LogData> log = null;
-       private static UserFunctionManager instance = null;
-       private int count = 0;
-       public static boolean stop = false;
-       private HashMap<Long, LogData> entryMap = new HashMap<Long, LogData>();
-
-       public static UserFunctionManager getInstance() {
-               if (null == instance) {
-                       instance = new UserFunctionManager();
-               }
-               return instance;
-       }
-
-       public void clear() {
-               instance = null;
-               stop = false;
-       }
-
-       public List<LogData> getLog() {
-               if (null == log) {
-                       log = new ArrayList<LogData>();
-               }
-               return log;
-       }
-
-       public void setReturnValue(LogData input) {
-               ProfileData exitData = (ProfileData) input;
-               long addr = exitData.getPcAddr();
-//             System.out.println(input.getId() + " exit addr : "
-//                             + AnalyzerUtil.toHexdecimal(addr) + " api : " + exitData.getApiName());
-               ProfileData entryData = (ProfileData) entryMap.get(addr);
-               if (null != entryData) {
-//                     System.out.println("SET RETURN! " + AnalyzerUtil.toHexdecimal(addr)
-//                                     + " value : " + exitData.getRet());
-                       entryData.setRet(exitData.getRet());
-                       entryMap.remove(addr);
-               }
-
-       }
-
-       public void addLog(LogData input) {
-               // TODO:UserFunction case
-               if (!stop) {
-                       ProfileData entryData = (ProfileData) input;
-                       getLog().add(entryData);
-                       entryMap.put(entryData.getPcAddr(), entryData);
-//                     System.out.println("PUT : "
-//                                     + AnalyzerUtil.toHexdecimal(entryData.getPcAddr())+ "  api : " + entryData.getApiName());
-                       count++;
-                       if (count >= 1000) {
-                               stop = true;
-                       }
-               }
-       }
+//     private List<LogData> log = null;
+//     private static UserFunctionManager instance = null;
+//     private int count = 0;
+//     public static boolean stop = false;
+//     private HashMap<Long, LogData> entryMap = new HashMap<Long, LogData>();
+//
+//     public static UserFunctionManager getInstance() {
+//             if (null == instance) {
+//                     instance = new UserFunctionManager();
+//             }
+//             return instance;
+//     }
+//
+//     public void clear() {
+//             instance = null;
+//             stop = false;
+//     }
+//
+//     public List<LogData> getLog() {
+//             if (null == log) {
+//                     log = new ArrayList<LogData>();
+//             }
+//             return log;
+//     }
+//
+//     public void setReturnValue(LogData input) {
+//             ProfileData exitData = (ProfileData) input;
+//             long addr = exitData.getPcAddr();
+////           System.out.println(input.getId() + " exit addr : "
+////                           + AnalyzerUtil.toHexdecimal(addr) + " api : " + exitData.getApiName());
+//             ProfileData entryData = (ProfileData) entryMap.get(addr);
+//             if (null != entryData) {
+////                   System.out.println("SET RETURN! " + AnalyzerUtil.toHexdecimal(addr)
+////                                   + " value : " + exitData.getRet());
+//                     entryData.setRet(exitData.getRet());
+//                     entryMap.remove(addr);
+//             }
+//
+//     }
+//
+//     public void addLog(LogData input) {
+//             // TODO:UserFunction case
+//             if (!stop) {
+//                     ProfileData entryData = (ProfileData) input;
+//                     getLog().add(entryData);
+//                     entryMap.put(entryData.getPcAddr(), entryData);
+////                   System.out.println("PUT : "
+////                                   + AnalyzerUtil.toHexdecimal(entryData.getPcAddr())+ "  api : " + entryData.getApiName());
+//                     count++;
+//                     if (count >= 1000) {
+//                             stop = true;
+//                     }
+//             }
+//     }
 }
index dba3b2c..5e75da9 100644 (file)
@@ -90,7 +90,7 @@ public class ConfigurationDialogValues {
                        featuresName = new String[] {
                                        ConfigureLabels.FEATURE_SYSTEM,
                                        ConfigureLabels.FEATURE_FUNCTION_PROFILING,
-                                       //ConfigureLabels.FEATURE_FUNCTION_SAMPLING,
+                                       // ConfigureLabels.FEATURE_FUNCTION_SAMPLING,
                                        ConfigureLabels.FEATURE_MEMORY_ALLOCATION,
                                        ConfigureLabels.FEATURE_FILE,
                                        ConfigureLabels.FEATURE_THREAD,
@@ -589,12 +589,12 @@ public class ConfigurationDialogValues {
                                        System.out.println("change values open GL");
                                }
                        }
-                       else if (featueName
-                                       .equals(ConfigureLabels.FEATURE_FUNCTION_SAMPLING)) {
-                               if (isChangeFeatuesValues(getSampling(), featueName)) {
-                                       System.out.println("change values sampling");
-                               }
-                       }
+                       // else if (featueName
+                       // .equals(ConfigureLabels.FEATURE_FUNCTION_SAMPLING)) {
+                       // if (isChangeFeatuesValues(getSampling(), featueName)) {
+                       // System.out.println("change values sampling");
+                       // }
+                       // }
                        else if (featueName.equals(ConfigureLabels.FEATURE_SYSTEM)) {
                                if (isChangeFeatuesValues(getSystem(), featueName)) {
                                        System.out.println("change values system");
index 3e3d5c9..f44a20e 100644 (file)
@@ -177,8 +177,7 @@ public class UIControlListDataChecker {
                                        splitProfilingList[0].trim());
                        String strProfilingAPIName = new String(
                                        splitProfilingList[splitProfilingList.length - 1].trim());
-                       int dataSize = getDataList().size();
-                       for (int j = 0; j < dataSize; j++) {
+                       for (int j = 0; j < getDataList().size(); j++) {
                                if (getDataList().get(j).getChildClassName().trim()
                                                .contains(strProfilingClassName)) {
                                        if (i < controlList.size()) {
index 97f7622..c4d1d47 100644 (file)
@@ -315,7 +315,7 @@ public abstract class DAWindowingTableComposite extends Composite {
                }
                List<LogData> outputList = SqlManager.getInstance()
                                .selectTableData(getTableLogId(), scrollStartSelection,
-                                               scrollEndSelection, "messageid = 8");
+                                               scrollEndSelection+1, getSelectQueryOption());
                return outputList;
        }