[Title] bug fix. windowing table
authorHyunjong,park <phjwithyou.park@samsung.com>
Thu, 7 Nov 2013 05:19:01 +0000 (14:19 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Thu, 7 Nov 2013 05:19:01 +0000 (14:19 +0900)
[Desc.] expands call trace table
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java

index 6a53730..84938c7 100644 (file)
@@ -133,12 +133,13 @@ public class FileApiListTable extends DAApiListTableComposite {
                        boolean isExistStartTimeLog = false;
                        if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_START
                                        || fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_START) {
-                               findStartAPITableIndexHashMap.put(contentTemp.getArgs(), i);
+                               String keString = contentTemp.getApiName()+contentTemp.getPid()+contentTemp.getTid();
+                               findStartAPITableIndexHashMap.put(keString, i);
 
                        } else if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_END
                                        || fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_END) {
-                               startLogIndex = findStartAPITableIndexHashMap.get(contentTemp
-                                               .getArgs());
+                               String keString = contentTemp.getApiName()+contentTemp.getPid()+contentTemp.getTid();
+                               startLogIndex = findStartAPITableIndexHashMap.get(keString);
                                if (null != startLogIndex) {
                                        contentText.add(input.get(startLogIndex.intValue())
                                                        .getText().get(1)); // start time
@@ -207,7 +208,6 @@ public class FileApiListTable extends DAApiListTableComposite {
                                tableInput.setInRange(true);
                        }
                }
-
                int removeCount = 0;
                for (int index : removeTableIndex) {
                        input.remove(index - removeCount);
index 283a7e3..30b2970 100644 (file)
@@ -71,7 +71,7 @@ public class FileChartData {
        protected DAChart chart;
        protected boolean hasUpdate = false;
 
-       private int lastAccessIndexForParent = 0;
+//     private int lastAccessIndexForParent = 0;
 
        public FileChartData(String filePath, long Fd, boolean isRoot) {
                setFilePath(filePath);
@@ -479,15 +479,15 @@ public class FileChartData {
                if (lastIndex < 0) {
                        return;
                }
-               if (isParent()) {
-                       for (int i = lastAccessIndexForParent; i < lastIndex; i++) {
-                               accessSeries.getSeriesItemList().get(i).setY(endTime);
-
-                       }
-                       lastAccessIndexForParent = lastIndex;
-               } else {
+//             if (isParent()) {
+//                     for (int i = lastAccessIndexForParent; i < lastIndex; i++) {
+//                             accessSeries.getSeriesItemList().get(i).setY(endTime);
+//
+//                     }
+//                     lastAccessIndexForParent = lastIndex;
+//             } else {
                        accessSeries.getSeriesItemList().get(lastIndex).setY(endTime);
-               }
+//             }
        }
 
        public void setFileOpendTime(double data) {
index 72240b9..7f3923c 100644 (file)
@@ -184,8 +184,6 @@ public class FileDataMaker {
                        } else if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_END
                                        || fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_END) {
                                long fileSize = input.getFileSize();
-                               System.out.println(input.getApiName() + " : fileSize : "
-                                               + fileSize);
                                if (fileSize < 0) {
                                        fileSize = 0;
                                }
@@ -199,15 +197,8 @@ public class FileDataMaker {
                                        event.setApiType(LogCenterConstants.FD_API_TYPE_WRITE_END);
                                        FileChart.getInstance().setWriteByte((int) fileSize, time);
                                }
-                       } else if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_END) {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_READ_END);
-
-                       } else if (fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_END) {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_WRITE_END);
-
-                       } else {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_OTHERS);
                        }
+                       event.setApiType(fdApiType);
                        fileEventQueue.add(event);
                        fileEventWarningQueue.add(event);
                        if (fdApiType == LogCenterConstants.FD_API_TYPE_CLOSE) {
index af8a356..1504181 100644 (file)
@@ -55,8 +55,6 @@ import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
-import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUChart;
-import org.tizen.dynamicanalyzer.ui.timeline.chart.NetworkIOChart;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
@@ -80,9 +78,9 @@ public class NetworkDataMaker {
        private HashMap<String, String> addressByFdHashMap = new HashMap<String, String>();
        private HashMap<String, String> parentFDByFdHashMap = new HashMap<String, String>();
 
-       private DAChartBoardItem networkTrafficItem;
-       private DAChartBoardItem networkIOItem;
-       private DAChartBoardItem cpuItem;
+//     private DAChartBoardItem networkTrafficItem;
+//     private DAChartBoardItem networkIOItem;
+//     private DAChartBoardItem cpuItem;
 
        private WarningChecker warningChecker = null;
        private FailedChecker failedChecker = null;
@@ -103,9 +101,9 @@ public class NetworkDataMaker {
                networkEventQueue.clear();
                addressByFdHashMap.clear();
                parentFDByFdHashMap.clear();
-               networkTrafficItem = null;
-               networkIOItem = null;
-               cpuItem = null;
+//             networkTrafficItem = null;
+//             networkIOItem = null;
+//             cpuItem = null;
                NetworkTrafficChart.getInstance().clear();
 
        }
@@ -537,134 +535,134 @@ public class NetworkDataMaker {
                return true;
        }
 
-       private boolean createTransmissionSizeBoardItem() {
-               if (null == networkTrafficItem) {
-                       if (null == board) {
-                               return false;
-                       }
-                       DAChart chart;
-                       networkTrafficItem = NetworkTrafficChart.getInstance()
-                                       .createBoardItem(board);
-
-                       chart = networkTrafficItem.getChart();
-                       initNetworkChart(chart, true);
-               }
-               return true;
-       }
-
-       private boolean createNetworkIOBoardItem() {
-               if (null == networkIOItem) {
-                       if (null == board) {
-                               return false;
-                       }
-                       DAChart chart;
-                       networkIOItem = NetworkIOChart.getInstance().createBoardItem(board);
-                       chart = networkIOItem.getChart();
-
-                       DAChartPlot plot = chart.getPlot();
-                       DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
-                       tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
-                       plot.setTooltip(tooltip);
-
-                       DAPopupMenu popupMenu = new DAPopupMenu(chart);
-                       popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
-                       DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-                       startItem.addListener(new PopupStartMenuItemClickListener(
-                                       startItem, board));
-
-                       DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-                       endItem.addListener(new PopupEndMenuItemClickListener(endItem,
-                                       board));
-
-                       DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       fromSelectionItem
-                                       .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
-                       fromSelectionItem
-                                       .addListener(new PopupFromSelectionMenuItemClickListener(
-                                                       fromSelectionItem, board));
-
-                       DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-                       analysisItem.addListener(new PopupAnalysisMenuItemClickListener());
-
-                       DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-                       clearItem.addListener(new PopupClearMenuItemClickListener());
-
-                       TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
-                                       popupMenu, board.getTimeline());
-                       chart.addMouseListener(timelineChartMouseEventListener);
-                       chart.addMouseMoveListener(timelineChartMouseEventListener);
-                       chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(
-                                       board.getTimeline()));
-                       plot.setMarkers(board.getMarkers());
-               }
-               return true;
-       }
-
-       private boolean createCPUBoardItem() {
-               if (null == cpuItem) {
-                       if (null == board) {
-                               return false;
-                       }
-                       DAChart chart;
-                       cpuItem = CPUChart.getInstance().createBoardItem(board);
-                       chart = cpuItem.getChart();
-
-                       DAChartPlot plot = chart.getPlot();
-                       DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
-                       tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
-                       plot.setTooltip(tooltip);
-
-                       DAPopupMenu popupMenu = new DAPopupMenu(chart);
-                       popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
-                       DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-                       startItem.addListener(new PopupStartMenuItemClickListener(
-                                       startItem, board));
-
-                       DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-                       endItem.addListener(new PopupEndMenuItemClickListener(endItem,
-                                       board));
-
-                       DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       fromSelectionItem
-                                       .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
-                       fromSelectionItem
-                                       .addListener(new PopupFromSelectionMenuItemClickListener(
-                                                       fromSelectionItem, board));
-
-                       DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-                       analysisItem.addListener(new PopupAnalysisMenuItemClickListener());
-
-                       DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu,
-                                       DAPopupMenuItem.NONE);
-                       clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-                       clearItem.addListener(new PopupClearMenuItemClickListener());
-
-                       TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
-                                       popupMenu, board.getTimeline());
-                       chart.addMouseListener(timelineChartMouseEventListener);
-                       chart.addMouseMoveListener(timelineChartMouseEventListener);
-                       chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(
-                                       board.getTimeline()));
-                       plot.setMarkers(board.getMarkers());
-               }
-               return true;
-       }
+//     private boolean createTransmissionSizeBoardItem() {
+//             if (null == networkTrafficItem) {
+//                     if (null == board) {
+//                             return false;
+//                     }
+//                     DAChart chart;
+//                     networkTrafficItem = NetworkTrafficChart.getInstance()
+//                                     .createBoardItem(board);
+//
+//                     chart = networkTrafficItem.getChart();
+//                     initNetworkChart(chart, true);
+//             }
+//             return true;
+//     }
+//
+//     private boolean createNetworkIOBoardItem() {
+//             if (null == networkIOItem) {
+//                     if (null == board) {
+//                             return false;
+//                     }
+//                     DAChart chart;
+//                     networkIOItem = NetworkIOChart.getInstance().createBoardItem(board);
+//                     chart = networkIOItem.getChart();
+//
+//                     DAChartPlot plot = chart.getPlot();
+//                     DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+//                     tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+//                     plot.setTooltip(tooltip);
+//
+//                     DAPopupMenu popupMenu = new DAPopupMenu(chart);
+//                     popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+//                     DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+//                     startItem.addListener(new PopupStartMenuItemClickListener(
+//                                     startItem, board));
+//
+//                     DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+//                     endItem.addListener(new PopupEndMenuItemClickListener(endItem,
+//                                     board));
+//
+//                     DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     fromSelectionItem
+//                                     .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+//                     fromSelectionItem
+//                                     .addListener(new PopupFromSelectionMenuItemClickListener(
+//                                                     fromSelectionItem, board));
+//
+//                     DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+//                     analysisItem.addListener(new PopupAnalysisMenuItemClickListener());
+//
+//                     DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+//                     clearItem.addListener(new PopupClearMenuItemClickListener());
+//
+//                     TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+//                                     popupMenu, board.getTimeline());
+//                     chart.addMouseListener(timelineChartMouseEventListener);
+//                     chart.addMouseMoveListener(timelineChartMouseEventListener);
+//                     chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(
+//                                     board.getTimeline()));
+//                     plot.setMarkers(board.getMarkers());
+//             }
+//             return true;
+//     }
+//
+//     private boolean createCPUBoardItem() {
+//             if (null == cpuItem) {
+//                     if (null == board) {
+//                             return false;
+//                     }
+//                     DAChart chart;
+//                     cpuItem = CPUChart.getInstance().createBoardItem(board);
+//                     chart = cpuItem.getChart();
+//
+//                     DAChartPlot plot = chart.getPlot();
+//                     DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+//                     tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+//                     plot.setTooltip(tooltip);
+//
+//                     DAPopupMenu popupMenu = new DAPopupMenu(chart);
+//                     popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+//                     DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+//                     startItem.addListener(new PopupStartMenuItemClickListener(
+//                                     startItem, board));
+//
+//                     DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+//                     endItem.addListener(new PopupEndMenuItemClickListener(endItem,
+//                                     board));
+//
+//                     DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     fromSelectionItem
+//                                     .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+//                     fromSelectionItem
+//                                     .addListener(new PopupFromSelectionMenuItemClickListener(
+//                                                     fromSelectionItem, board));
+//
+//                     DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+//                     analysisItem.addListener(new PopupAnalysisMenuItemClickListener());
+//
+//                     DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu,
+//                                     DAPopupMenuItem.NONE);
+//                     clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+//                     clearItem.addListener(new PopupClearMenuItemClickListener());
+//
+//                     TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+//                                     popupMenu, board.getTimeline());
+//                     chart.addMouseListener(timelineChartMouseEventListener);
+//                     chart.addMouseMoveListener(timelineChartMouseEventListener);
+//                     chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(
+//                                     board.getTimeline()));
+//                     plot.setMarkers(board.getMarkers());
+//             }
+//             return true;
+//     }
 
        private NetworkChartData findAddressChart(NetworkChartDataEvent data) {
 
index c4d1d47..5190c9c 100644 (file)
@@ -222,12 +222,14 @@ public abstract class DAWindowingTableComposite extends Composite {
                setTableToolTipListener(new TableTooltipListener(table));
        }
 
-       protected abstract List<TableInput> makeTableInput(
-                       List<LogData> userLog);
+       protected abstract List<TableInput> makeTableInput(List<LogData> userLog);
+
        protected abstract int getItemCount();
+
        protected abstract int getTableLogId();
+
        protected abstract String getSelectQueryOption();
-       
+
        public void clean() {
                getTable().removeAll();
                scrollbar.setMaximum(0);
@@ -313,13 +315,12 @@ public abstract class DAWindowingTableComposite extends Composite {
                } else {
                        scrollEndSelection = scrollSelection + additionalSelectCount;
                }
-               List<LogData> outputList = SqlManager.getInstance()
-                               .selectTableData(getTableLogId(), scrollStartSelection,
-                                               scrollEndSelection+1, getSelectQueryOption());
+               List<LogData> outputList = SqlManager.getInstance().selectTableData(
+                               getTableLogId(), scrollStartSelection, scrollEndSelection + 1,
+                               getSelectQueryOption());
                return outputList;
        }
 
-       
        private List<TableInput> makeTableInputFromDB() {
                int scrollSelection = scrollbar.getSelection();
                boolean isQueryDB = false;
@@ -331,16 +332,22 @@ public abstract class DAWindowingTableComposite extends Composite {
                if (preLogCount != getItemCount()) {
                        isQueryDB = true;
                }
+
+               if (null != savedLogDataList
+                               && savedLogDataList.size() != getTableLenght()) {
+                       isQueryDB = true;
+               }
+
                preLogCount = getItemCount();
 
                if (isQueryDB) {
                        savedLogDataList = getItemListFromDB();
                }
-               
+
                if (null == savedLogDataList) {
                        return null;
                }
-               
+
                return makeTableInput(savedLogDataList);
        }
 
@@ -350,9 +357,9 @@ public abstract class DAWindowingTableComposite extends Composite {
                if (getItemCount() <= selectedEndIndex) {
                        selectedEndIndex = getItemCount();
                }
-               List<LogData> outputList = SqlManager.getInstance()
-                               .selectTableData(getTableLogId(), scrollSelection,
-                                               selectedEndIndex + 1, getSelectQueryOption());
+               List<LogData> outputList = SqlManager.getInstance().selectTableData(
+                               getTableLogId(), scrollSelection, selectedEndIndex + 1,
+                               getSelectQueryOption());
                return outputList;
        }
 
@@ -396,7 +403,7 @@ public abstract class DAWindowingTableComposite extends Composite {
                boolean isSelectionItem = false;
                int focusIndex = -1;
                int size = output.size();
-               
+
                for (int i = 0; i < size; i++) {
                        GridItem gridItem = new GridItem(table, SWT.NONE);
                        DATableDataFormat gridData = (DATableDataFormat) output.get(i)
@@ -407,7 +414,7 @@ public abstract class DAWindowingTableComposite extends Composite {
                        int columnCount = text.size();
                        for (int index = 0; index < columnCount; index++) {
                                String textData = text.get(index);
-                               if(null != textData){
+                               if (null != textData) {
                                        gridItem.setText(index, text.get(index));
                                }
                        }
@@ -434,7 +441,6 @@ public abstract class DAWindowingTableComposite extends Composite {
                        }
 
                }
-               
 
                int[] sels = new int[selectionList.size()];
                for (int i = 0; i < selectionList.size(); i++) {