File : apply new chart design 92/23992/1
authorhyeran74.kim <hyeran74.kim@samsung.com>
Mon, 7 Jul 2014 08:41:18 +0000 (17:41 +0900)
committerhyeran74.kim <hyeran74.kim@samsung.com>
Mon, 7 Jul 2014 09:39:26 +0000 (18:39 +0900)
Change-Id: I53de35344917404f3e51801a2d4e9effd0de75c0
Signed-off-by: hyeran74.kim <hyeran74.kim@samsung.com>
166 files changed:
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/ColorResources.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/FontResources.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/resources/ImageResources.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/theme/DAThemeWhite.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabButton.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabComposite.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DAViewComposite.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/TabButtonRenderer.java
org.tizen.dynamicanalyzer.appearance/theme/white/context_menu_child_arrow.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_touchevent_position.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_disable.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_hover.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_normal.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_push.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_push.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_drag.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_hover.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_normal.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_push.png
org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_selected.png
org.tizen.dynamicanalyzer.widgets/Images/context_menu_child_arrow.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButtonAttribute.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButtonRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/toggle/DACustomToggleButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/toggle/DACustomToggleButtonRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItemCell.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomCombo.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomComboDefaultRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomComboPopupDefaultRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomComboRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ColorResources.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/FontResources.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ImageResources.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/popupMenu/DAPopupMenu.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/popupMenu/DAPopupMenuItemButtonRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/DBConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/database/SqlConnectionManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/Streamable.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/FilePageLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/FilePageLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/NetworkPageLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/data/DataChannelConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/channel/data/ProcessInfoPackage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/LogPackage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/PageDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/FileData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/GLES20LogData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataFactory.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataSeqNoComparator.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/ProfileData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/SystemData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/LogFormat.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/format/SystemLogFormat.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChart.java [moved from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileChart.java with 88% similarity]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartBoard.java [moved from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileChartBoard.java with 73% similarity]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartManager.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDetailInfoView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileChartDataMaker.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileChartManager.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileDataMaker.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileDataManager.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/model/FileAccess.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/model/FileEvent.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/model/FileSelectedData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/model/FileStatus.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileApiListTable.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileApiListView.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileChartView.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileDetailInfoView.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/screenshot/ScreenshotDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/data/KernelDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartBoard.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDetailView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkAPIDBManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkSeriesDBManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/StatusSeriesListSortComparator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/type/NetworkAPIType.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/type/NetworkSeriesType.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLDetailsView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/chart/GLChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLAPIDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameRateDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLFrameTimeDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateHistoryDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateSharingDBTableManager.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateTextureDBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/ContextValueType.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/FrameCountInfoType.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLAPINameDefine.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLContextDefaultValueHashMap.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLSharingContextType.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateProgramType.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLStateShaderType.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/api/GLAPIListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLContextTableView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLProgramTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/table/state/GLTextureTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/FunctionUsageProfiler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfileDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadChartManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/CPUDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/CustomDataDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/EnergyDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/ProcessLoadDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/ScreenShotDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/SystemDataDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/UIEventDBTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUCoreChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUFrequencyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/AboutDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/LicenseDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceProgressManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDBManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/RepalyEditSaveDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditPopupMenu.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableItemListSortComparator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/UIDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TitleComboPopupRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TitleComboRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/DownloadContentfileManager.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/Formatter.java

index c58e719..aeeac0a 100755 (executable)
@@ -73,6 +73,9 @@ public class ColorResources {
        public static Color EDIT_CHART_DIALOG_LOWER = getColor("edit_chart_dialog_lower");//$NON-NLS-1$\r
 \r
        public static Color VIEW_BORDER = getColor("view_border"); //$NON-NLS-1$\r
+       public static Color VIEW_BORDER_1 = getColor("view_border_1"); //$NON-NLS-1$\r
+       public static Color VIEW_BORDER_2 = getColor("view_border_2"); //$NON-NLS-1$\r
+       public static Color VIEW_BORDER_3 = getColor("view_border_3"); //$NON-NLS-1$\r
        public static Color VIEW_BG_COLOR = getColor("view_bg_color"); //$NON-NLS-1$\r
        public static Color VIEW_TITLE_FONT_COLOR = getColor("view_title_font_color");//$NON-NLS-1$\r
 \r
@@ -90,7 +93,7 @@ public class ColorResources {
 \r
        /** device and application combo specific colors start **/\r
        public static Color DEVICE_APPLICATION_ENABLE = getColor("device_application_enable_font"); //$NON-NLS-1$\r
-       public static Color DEVICE_APPLICATION_DISABLE = getColor("device_application_disable"); //$NON-NLS-1$\r
+       public static Color DEVICE_APPLICATION_DISABLE = getColor("device_application_disable_font"); //$NON-NLS-1$\r
        public static Color DEVICE_APPLICATION_POPUP_OUTER_1 = getColor("device_application_popup_outer_1"); //$NON-NLS-1$\r
        public static Color DEVICE_APPLICATION_POPUP_OUTER_2 = getColor("device_application_popup_outer_2"); //$NON-NLS-1$\r
        public static Color DEVICE_APPLICATION_DROPDOWN_TEXT = getColor("device_application_enable_font"); //$NON-NLS-1$\r
@@ -242,6 +245,7 @@ public class ColorResources {
        public static Color TAB_HOVER_FONT_COLOR = getColor("tab_hover_font_color"); //$NON-NLS-1$\r
        public static Color TAB_PUSH_FONT_COLOR = getColor("tab_push_font_color"); //$NON-NLS-1$\r
 \r
+       public static Color TAB_BG_COLOR = getColor("tab_bg_color"); //$NON-NLS-1$\r
        public static Color TAB_BG_COLOR_START = getColor("tab_bg_color_start"); //$NON-NLS-1$\r
        public static Color TAB_BG_COLOR_END = getColor("tab_bg_color_end"); //$NON-NLS-1$\r
        public static Color TAB_BG_OUTLINE_COLOR = getColor("tab_bg_outline_color"); //$NON-NLS-1$\r
@@ -370,7 +374,6 @@ public class ColorResources {
        public static Color SERIES_COLOR_CPU_SYSTEM = getColor("seriesColorCPUSystem"); //$NON-NLS-1$\r
        public static Color SERIES_COLOR_CPU_APP = getColor("seriesColorCPUApp"); //$NON-NLS-1$\r
 \r
-       public final static int MAX_SERIES_COLOR_COUNT = 4;\r
        public static Color SERIES_COLOR_CPUCORE_CORE0 = getColor("seriesColorCPUCoreCore0"); //$NON-NLS-1$\r
        public static Color SERIES_COLOR_CPUCORE_CORE1 = getColor("seriesColorCPUCoreCore1"); //$NON-NLS-1$\r
        public static Color SERIES_COLOR_CPUCORE_CORE2 = getColor("seriesColorCPUCoreCore2"); //$NON-NLS-1$\r
index fd21425..3784c92 100644 (file)
@@ -55,7 +55,10 @@ public class FontResources {
        public static final Font TAB_BUTTON_FONT = getFont(\r
                        "tab_button_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
        // mac 11\r
-\r
+       \r
+       public static final Font TAB_BUTTON_LARGE_FONT = getFont(\r
+                       "tab_button_large_font", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+       \r
        // * Time-Line Layout\r
        // Edit Chart Dlg.\r
        public static final Font ADDITEM_BUTTON_FONT = getFont(\r
@@ -112,6 +115,11 @@ public class FontResources {
        // * About Dlg.\r
        public static final Font ABOUT_TEXT = getFont(\r
                        "about_text", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+       \r
+       // * License Dlg.\r
+       public static final Font LICENSE_TEXT = getFont(\r
+                       "license_text", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+       \r
        // mac 11\r
        public static final Font DIALOG_BUTTON_FONT = getFont(\r
                        "dialog_button_font", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
index f55b9b1..65f9017 100644 (file)
@@ -81,12 +81,12 @@ public class ImageResources {
        public static final Image OPEN_PUSH = getPngImage("toolbar_open_push"); //$NON-NLS-1$\r
        public static final Image OPEN_HOVER = getPngImage("toolbar_open_hover"); //$NON-NLS-1$\r
        public static final Image OPEN_DISABLE = getPngImage("toolbar_open_disable"); //$NON-NLS-1$\r
-       \r
+\r
        public static final Image REPLAY = getPngImage("toolbar_replay_nor"); //$NON-NLS-1$\r
        public static final Image REPLAY_PUSH = getPngImage("toolbar_replay_push"); //$NON-NLS-1$\r
        public static final Image REPLAY_HOVER = getPngImage("toolbar_replay_hover"); //$NON-NLS-1$\r
        public static final Image REPLAY_DISABLE = getPngImage("toolbar_replay_disable"); //$NON-NLS-1$\r
-       \r
+\r
        public static final Image REPLAY_EDIT = getPngImage("toolbar_replayedit_nor"); //$NON-NLS-1$\r
        public static final Image REPLAY_EDIT_PUSH = getPngImage("toolbar_replayedit_push"); //$NON-NLS-1$\r
        public static final Image REPLAY_EDIT_HOVER = getPngImage("toolbar_replayedit_hover"); //$NON-NLS-1$\r
@@ -123,9 +123,11 @@ public class ImageResources {
 \r
        // Tab\r
        public static final Image TAB = getPngImage("tab_unselected"); //$NON-NLS-1$\r
+       public static final Image TAB_NORMAL = getPngImage("tab_normal"); //$NON-NLS-1$\r
        public static final Image TAB_PUSH = getPngImage("tab_push"); //$NON-NLS-1$\r
        public static final Image TAB_HOVER = getPngImage("tab_hover"); //$NON-NLS-1$\r
-       public static final Image TAB_DISABLE = getPngImage("tab_selected"); //$NON-NLS-1$\r
+       public static final Image TAB_SELECTED = getPngImage("tab_selected"); //$NON-NLS-1$\r
+       public static final Image TAB_DRAG = getPngImage("tab_dag"); //$NON-NLS-1$\r
 \r
        // Trim\r
        public static final Image WINDOW_TOP = getPngImage("window_top_pattern_01"); //$NON-NLS-1$\r
@@ -185,6 +187,10 @@ public class ImageResources {
        // Dialog icon\r
        public static final Image DIALOG_WARNING_ICON = getPngImage("dialog_warning"); //$NON-NLS-1$\r
 \r
+       // OpenGL\r
+       public static final Image OPENGL_SHOW_ONLY_CHANGED_SELECTED = getPngImage("show_only_changed_push"); //$NON-NLS-1$\r
+       public static final Image OPENGL_SHOW_ONLY_CHANGED_UNSELECTED = getPngImage("show_only_changed_normal"); //$NON-NLS-1$\r
+\r
        // Diglog trim\r
        public static final Image DIALOG_TOP = getPngImage("dialog_top_pattern"); //$NON-NLS-1$\r
        public static final Image DIALOG_BOTTOM = getPngImage("dialog_bottom_pattern"); //$NON-NLS-1$\r
@@ -199,7 +205,7 @@ public class ImageResources {
        public static final Image COMBO_DROPDOWN_UP = getPngImage("dropdown_up"); //$NON-NLS-1$\r
        public static final Image COMBO_DROPDOWN_DOWN = getPngImage("dropdown_down"); //$NON-NLS-1$\r
        public static final Image REPLAY_EDIT_DROPDOWN_DOWN = getPngImage("toolbar_dropdown_normal_a"); //$NON-NLS-1$\r
-       public static final Image REPLAY_EDIT_SNAPSHOT_DOWN = getPngImage("replay_edit_snapshot"); //$NON-NLS-1$\r
+       public static final Image REPLAY_EDIT_SNAPSHOT_DOWN = getPngImage("btn_touchevent_position"); //$NON-NLS-1$\r
 \r
        // On, Off button\r
        public static final Image ON_HOVER = getPngImage("onoff_on_hover"); //$NON-NLS-1$\r
@@ -228,7 +234,7 @@ public class ImageResources {
        public static final Image DYNANMIC_ANALYZER_ICON = getPngImage("64_DA_icon"); //$NON-NLS-1$ \r
        public static final Image ABOUT_TIZEN_SDK = getPngImage("about_Tizen_SDK");//$NON-NLS-1$\r
        public static final Image LICENSE_TIZEN_SDK = getPngImage("license_banner");//$NON-NLS-1$\r
-       \r
+\r
        /* OpenGL */\r
        public static final Image OPEN_GL_PRE_NAVI_HOVER = getPngImage("btn_nav_r_hover"); //$NON-NLS-1$ \r
        public static final Image OPEN_GL_PRE_NAVI_NORMAL = getPngImage("btn_nav_r_normal"); //$NON-NLS-1$\r
@@ -236,7 +242,7 @@ public class ImageResources {
        public static final Image OPEN_GL_NEXT_NAVI_HOVER = getPngImage("btn_nav_f_hover"); //$NON-NLS-1$ \r
        public static final Image OPEN_GL_NEXT_NAVI_NORMAL = getPngImage("btn_nav_f_normal"); //$NON-NLS-1$\r
        public static final Image OPEN_GL_NEXT_NAVI_PUSH = getPngImage("btn_nav_f_push"); //$NON-NLS-1$\r
-       \r
+\r
        /* configuration */\r
        public static final Image WELCONE_BANNER_IMAGE = getPngImage("welcome_banner"); //$NON-NLS-1$\r
        public static final Image CONFIGURATION_BANNER_IMAGE = getPngImage("settings_banner"); //$NON-NLS-1$\r
@@ -275,10 +281,10 @@ public class ImageResources {
        public static final Image UI_EVENT = getPngImage("time_line_icon_UI_events"); //$NON-NLS-1$\r
        public static final Image CHART_CUSTOM = getPngImage("time_line_icon_custom"); //$NON-NLS-1$\r
        public static final Image CHART_NETWORK = getPngImage("time_line_icon_traffic"); //$NON-NLS-1$\r
-       \r
+\r
        /* graphics */\r
        public static final Image CHART_FPS = getPngImage("time_line_icon_fps"); //$NON-NLS-1$\r
-       public static final Image CHART_FRAME_TIME= getPngImage("time_line_icon_frame_time"); //$NON-NLS-1$\r
+       public static final Image CHART_FRAME_TIME = getPngImage("time_line_icon_frame_time"); //$NON-NLS-1$\r
        public static final Image CHART_FRAME_RATE = getPngImage("time_line_icon_frame_rate"); //$NON-NLS-1$\r
 \r
        /* Resource */\r
@@ -322,6 +328,9 @@ public class ImageResources {
        public static final Image TREE_FOLD = getPngImage("tree_fold"); //$NON-NLS-1$\r
        public static final Image NO_IMAGE = getPngImage("empty_snapshot"); //$NON-NLS-1$\r
        public static final Image NO_IMAGE_SMALL = getPngImage("empty_snapshot_small"); //$NON-NLS-1$\r
+       \r
+       /*** context child arrow ***/\r
+       public static final Image CONTEXT_OPEN = getPngImage("context_menu_child_arrow"); //$NON-NLS-1$\r
 \r
        /* score */\r
        public static final Image SCORE_0 = getPngImage("score_0"); //$NON-NLS-1$\r
@@ -391,18 +400,17 @@ public class ImageResources {
        public static final Image ICON_DEVICE = getGifImage("device"); //$NON-NLS-1$\r
        public static final Image ICON_OTHER = getGifImage("file"); //$NON-NLS-1$\r
 \r
-       \r
        /** Binary Settings page desing images */\r
        public static final Image DELETE_BUTTON_NORMAL = getPngImage("btn_delete_normal"); //$NON-NLS-1$\r
        public static final Image DELETE_BUTTON_PUSH = getPngImage("btn_delete_push"); //$NON-NLS-1$\r
        public static final Image DELETE_BUTTON_HOVER = getPngImage("btn_delete_hover"); //$NON-NLS-1$\r
        public static final Image DELETE_BUTTON_DISABLE = getPngImage("btn_delete_disable"); //$NON-NLS-1$\r
-       \r
+\r
        public static final Image FIND_BUTTON_NORMAL = getPngImage("btn_finder_normal"); //$NON-NLS-1$\r
        public static final Image FIND_BUTTON_PUSH = getPngImage("btn_finder_push"); //$NON-NLS-1$\r
        public static final Image FIND_BUTTON_HOVER = getPngImage("btn_finder_hover"); //$NON-NLS-1$\r
        public static final Image FIND_BUTTON_DISABLE = getPngImage("btn_finder_disable"); //$NON-NLS-1$\r
-       \r
+\r
        public static final Image FILE_TYPE_DEVICE = getPngImage("file_type_device_phone"); //$NON-NLS-1$\r
        public static final Image FILE_TYPE_DIR = getPngImage("file_type_dir"); //$NON-NLS-1$\r
        public static final Image FILE_TYPE_DIR_LINK = getPngImage("file_type_dir_link"); //$NON-NLS-1$\r
@@ -410,12 +418,12 @@ public class ImageResources {
        public static final Image FILE_TYPE_ETC = getPngImage("file_type_etc"); //$NON-NLS-1$\r
        public static final Image FILE_TYPE_FILE = getPngImage("file_type_file"); //$NON-NLS-1$\r
        public static final Image FILE_TYPE_FILE_LINK = getPngImage("file_type_file_link"); //$NON-NLS-1$\r
-       \r
+\r
        public static final Image SCREEN_SHOT_NORMAL = getPngImage("toolbar_screen_shot_nor"); //$NON-NLS-1$\r
        public static final Image SCREEN_SHOT_PUSH = getPngImage("toolbar_screen_shot_push"); //$NON-NLS-1$\r
        public static final Image SCREEN_SHOT_HOVER = getPngImage("toolbar_screen_shot_hover"); //$NON-NLS-1$\r
        public static final Image SCREEN_SHOT_DISABLE = getPngImage("toolbar_screen_shot_disable"); //$NON-NLS-1$\r
-       \r
+\r
        private static Image getImage(String pluginId, String folderName,\r
                        String imageName, String extension) {\r
                if (null == imageRegistry.get(imageName)\r
@@ -437,9 +445,9 @@ public class ImageResources {
        }\r
 \r
        private static Image getImageFromWorkbench(String imageName) {\r
-               return getImage(WORKBENCH_ID,\r
-                               ICON_WORKBENCH_FOLDER_NAME + File.separator,\r
-                               imageName, CommonConstants.EXTENSION_PNG_IMAGE);\r
+               return getImage(WORKBENCH_ID, ICON_WORKBENCH_FOLDER_NAME\r
+                               + File.separator, imageName,\r
+                               CommonConstants.EXTENSION_PNG_IMAGE);\r
        }\r
 \r
        private static Image getPngImage(String imageName) {\r
index 1cf46c3..67efc57 100644 (file)
@@ -70,7 +70,7 @@ public class DAThemeWhite extends DATheme {
 
                // shell window background color
                setColor("window_bg_color", new RGB(160, 160, 160)); //$NON-NLS-1$
-               setColor("dialg_bg_upper", new RGB(206, 206, 206));
+               setColor("dialg_bg_upper", new RGB(232, 234, 235));
                setColor("dialg_bg_lower", new RGB(240, 240, 240));
                setColor("dialg_sunken_1", new RGB(160, 160, 160));
                setColor("dialg_sunken_2", new RGB(255, 255, 255));
@@ -78,8 +78,11 @@ public class DAThemeWhite extends DATheme {
                setColor("edit_chart_dialog_lower", new RGB(240, 240, 240));
 
                setColor("view_border", new RGB(206, 206, 206)); //$NON-NLS-1$
+               setColor("view_border_1", new RGB(160, 160, 160)); //$NON-NLS-1$
+               setColor("view_border_2", new RGB(232, 234, 235)); //$NON-NLS-1$
+               setColor("view_border_3", new RGB(186, 186, 186)); //$NON-NLS-1$
                setColor("view_bg_color", new RGB(230, 230, 230)); //$NON-NLS-1$
-               getColor("view_title_font_color", new RGB(0, 0, 0));
+               getColor("view_title_font_color", new RGB(255, 255, 255));
 
                setColor("coolbar_bg_color", new RGB(228, 228, 228)); //$NON-NLS-1$
                setColor("default_font_color", new RGB(0, 0, 0));//$NON-NLS-1$
@@ -87,24 +90,22 @@ public class DAThemeWhite extends DATheme {
                /** title bar colors **/
                setColor("titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$
                setColor("titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$
-               setColor("titlebar_start_color", new RGB(240, 240, 240)); //$NON-NLS-1$
-               setColor("titlebar_end_color", new RGB(165, 165, 165)); //$NON-NLS-1$
+               setColor("titlebar_start_color", new RGB(104, 156, 166)); //$NON-NLS-1$
+               setColor("titlebar_end_color", new RGB(55, 105, 114)); //$NON-NLS-1$
                setColor("titlebar_bottom_stroke_1", new RGB(115, 115, 115));
                setColor("titlebar_bottom_stroke_2", new RGB(160, 160, 160));
 
                /** device and application combo specific colors start **/
                setColor("device_application_enable_font", new RGB(0, 0, 0)); //$NON-NLS-1$
-               setColor("device_application_disable_font", new RGB(160, 160, 160)); //$NON-NLS-1$
-               setColor("device_application_popup_outer_1", new RGB(120, 120, 120)); //$NON-NLS-1$
-               setColor("device_application_popup_outer_2", new RGB(50, 185, 231)); //$NON-NLS-1$
+               setColor("device_application_disable_font", new RGB(119, 223, 238)); //$NON-NLS-1$
+               setColor("device_application_popup_outer_1", new RGB(45, 180, 200)); //$NON-NLS-1$
+               setColor("device_application_popup_outer_2", new RGB(47, 85, 92)); //$NON-NLS-1$
                setColor("device_application_item_normal_top", new RGB(255, 255, 255)); //$NON-NLS-1$
-               setColor("device_application_item_normal_inner", new RGB(230, 230, 230)); //$NON-NLS-1$
-               setColor(
-                               "device_application_item_normal_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$
+               setColor("device_application_item_normal_inner", new RGB(232, 234, 235)); //$NON-NLS-1$
+               setColor("device_application_item_normal_bottom", new RGB(180, 180, 180)); //$NON-NLS-1$
                setColor("device_application_item_select_top", new RGB(255, 255, 255)); //$NON-NLS-1$
-               setColor("device_application_item_select_inner", new RGB(50, 185, 231)); //$NON-NLS-1$
-               setColor(
-                               "device_application_item_select_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$
+               setColor("device_application_item_select_inner", new RGB(45, 180, 200)); //$NON-NLS-1$
+               setColor("device_application_item_select_bottom", new RGB(180, 180, 180)); //$NON-NLS-1$
                /** device and application combo specific colors end **/
 
                /*** combo button gradation ***/
@@ -118,7 +119,13 @@ public class DAThemeWhite extends DATheme {
                setColor(
                                "device_application_button_disable_start", new RGB(157, 157, 157)); //$NON-NLS-1$
                setColor("device_application_button_disable_end", new RGB(78, 79, 81)); //$NON-NLS-1$
-               setColor("device_application_button_outline", new RGB(31, 31, 31));
+               
+               /*** combo arrow button color ***/
+               setColor("device_application_button_normal", new RGB(206, 206, 206)); //$NON-NLS-1$
+               setColor("device_application_button_push", new RGB(24, 147, 189)); //$NON-NLS-1$
+               setColor("device_application_button_hover", new RGB(45, 180, 200)); //$NON-NLS-1$
+               setColor("device_application_button_disable", new RGB(206, 206, 206)); //$NON-NLS-1$
+               setColor("device_application_button_outline", new RGB(47, 85, 92));
 
                /*** common button colors ***/
                setColor("button_normal_color_start", new RGB(240, 240, 240));
@@ -229,25 +236,26 @@ public class DAThemeWhite extends DATheme {
                setColor("open_trace_table2_font_color", new RGB(255, 85, 57)); //$NON-NLS-1$
 
                /** tab widget colors **/
-               setColor("tab_selected_color_start", new RGB(255, 255, 255));
-               setColor("tab_selected_color_end", new RGB(178, 178, 178));
-               setColor("tab_normal_color_start", new RGB(206, 206, 206));
-               setColor("tab_normal_color_end", new RGB(163, 163, 163));
-               setColor("tab_hover_color_start", new RGB(206, 206, 206));
-               setColor("tab_hover_color_end", new RGB(163, 163, 163));
-               setColor("tab_push_color_start", new RGB(163, 163, 163));
-               setColor("tab_push_color_end", new RGB(206, 206, 206));
-
-               setColor("tab_outline_normal_color", new RGB(115, 115, 115));
-               setColor("tab_outline_push_color", new RGB(10, 113, 178));
-               setColor("tab_outline_hover_color", new RGB(10, 113, 178));
-               setColor("tab_outline_selected_color", new RGB(160, 160, 160));
+               setColor("tab_selected_color_start", new RGB(148, 194, 201));
+               setColor("tab_selected_color_end", new RGB(88, 167, 179));
+               setColor("tab_normal_color_start", new RGB(39, 81, 89));
+               setColor("tab_normal_color_end", new RGB(15, 45, 50));
+               setColor("tab_hover_color_start", new RGB(39, 81, 89));
+               setColor("tab_hover_color_end", new RGB(15, 45, 50));
+               setColor("tab_push_color_start", new RGB(15, 45, 50));
+               setColor("tab_push_color_end", new RGB(39, 81, 89));
+
+               setColor("tab_outline_normal_color", new RGB(0, 0, 0));
+               setColor("tab_outline_push_color", new RGB(106, 154, 163));
+               setColor("tab_outline_hover_color", new RGB(106, 154, 163));
+               setColor("tab_outline_selected_color", new RGB(232, 234, 235));
 
                setColor("tab_selected_font_color", new RGB(0, 0, 0));
-               setColor("tab_normal_font_color", new RGB(91, 91, 91));
-               setColor("tab_hover_font_color", new RGB(91, 91, 91));
-               setColor("tab_push_font_color", new RGB(91, 91, 91));
+               setColor("tab_normal_font_color", new RGB(184, 184, 184));
+               setColor("tab_hover_font_color", new RGB(184, 184, 184));
+               setColor("tab_push_font_color", new RGB(184, 184, 184));
 
+               setColor("tab_bg_color", new RGB(47, 85, 92));
                setColor("tab_bg_color_start", new RGB(205, 205, 205));
                setColor("tab_bg_color_end", new RGB(216, 216, 216));
                setColor("tab_bg_outline_color", new RGB(160, 160, 160));
index 58ecbfd..cc8bf6a 100644 (file)
@@ -49,7 +49,7 @@ public class DATabButton extends DACustomButton {
        private Rectangle closeButtonRect = null;
        private DACustomButtonClickEventListener closeButtonListener = null;
 
-       public DATabButton(Composite parent, int style) {
+       public DATabButton(Composite parent, int style, boolean isImageTab) {
                super(parent, ColorResources.TAB_NORMAL_COLOR_START,
                                ColorResources.TAB_NORMAL_COLOR_END,
                                ColorResources.TAB_PUSH_COLOR_START,
@@ -58,7 +58,12 @@ public class DATabButton extends DACustomButton {
                                ColorResources.TAB_HOVER_COLOR_END,
                                ColorResources.TAB_SELECTED_COLOR_START,
                                ColorResources.TAB_SELECTED_COLOR_END);
-               this.setLayout(new FormLayout());
+               if(isImageTab) {
+                       this.setImages(ImageResources.TAB_NORMAL,
+                               ImageResources.TAB_PUSH,
+                               ImageResources.TAB_HOVER,
+                               ImageResources.TAB_SELECTED);
+               }
 
                this.addListener(SWT.MouseMove, tbMouseEventListener);
                this.addListener(SWT.MouseDown, tbMouseEventListener);
@@ -78,8 +83,8 @@ public class DATabButton extends DACustomButton {
                        if (null == closeButtonRect) {
                                Rectangle imgRect = button.getCloseButtonImage().getBounds();
                                Rectangle rect = button.getBounds();
-                               closeButtonRect = new Rectangle(rect.width - imgRect.width - 2,
-                                               (rect.height - imgRect.height) / 2, imgRect.width,
+                               closeButtonRect = new Rectangle(rect.width - imgRect.width - 6,
+                                               rect.y + 1, imgRect.width,
                                                imgRect.height);
                        }
 
index d616485..acf0274 100644 (file)
@@ -74,7 +74,8 @@ public class DATabComposite extends DABaseComposite {
        private int targetButtonIndex = -1;
        private int sourceButtonIndex = -1;
        private boolean drag = false;
-
+       
+       private boolean isImageTab = false;
        private int tabWidth = LONG_TAB_WIDTH;
 
        {
@@ -125,11 +126,9 @@ public class DATabComposite extends DABaseComposite {
                public void paintControl(PaintEvent e) {
                        Composite comp = (Composite) e.widget;
                        Rectangle rect = comp.getClientArea();
-                       e.gc.setForeground(ColorResources.TAB_BG_COLOR_START);
-                       e.gc.setBackground(ColorResources.TAB_BG_COLOR_END);
+                       e.gc.setBackground(ColorResources.TAB_BG_COLOR);
                        e.gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height,
                                        true);
-                       e.gc.setForeground(ColorResources.TAB_BG_OUTLINE_COLOR);
                        e.gc.drawRectangle(rect);
                }
        };
@@ -163,7 +162,14 @@ public class DATabComposite extends DABaseComposite {
 
                String title = child.getTitle();
 
-               final DATabButton tabButton = new DATabButton(tabComposite, SWT.NONE);
+               final DATabButton tabButton;
+               if(isImageTab) {
+                       tabButton = new DATabButton(tabComposite, SWT.NONE, true);
+                       tabButton.setButtonFont(FontResources.TAB_BUTTON_FONT);
+               } else {
+                       tabButton = new DATabButton(tabComposite, SWT.NONE, false);
+                       tabButton.setButtonFont(FontResources.TAB_BUTTON_LARGE_FONT);
+               }
                tabButton.setFontColors(ColorResources.TAB_NORMAL_FONT_COLOR,
                                ColorResources.TAB_PUSH_FONT_COLOR,
                                ColorResources.TAB_HOVER_FONT_COLOR,
@@ -174,15 +180,15 @@ public class DATabComposite extends DABaseComposite {
                                ColorResources.TAB_OUTLINE_SELECTED_COLOR);
                tabButton.setRenderer(new TabButtonRenderer());
                tabButton.setButtonEnabled(true);
-               tabButton.setButtonFont(FontResources.TAB_BUTTON_FONT);
+               tabButton.setBackground(ColorResources.TAB_BG_COLOR);
                tabButton.setText(title);
                tabButton.setToolTipText((String) child.getData("tooltip"));
                tabButton.setClosable(closeable);
 
                FormData data = new FormData();
-               data.top = new FormAttachment(0, 0);
+               data.top = new FormAttachment(0, 1);
                data.bottom = new FormAttachment(100, 0);
-
+               
                if (buttons.size() > 0) {
                        DATabButton lastbutton = buttons.get(buttons.size() - 1);
                        data.left = new FormAttachment(lastbutton, 0);
@@ -274,7 +280,7 @@ public class DATabComposite extends DABaseComposite {
                                                                contentsComposite.layout();
                                                        } else {
                                                                if (r.contains(curPosition.x, 0)
-                                                                               && (event.y > r.y && event.y < r.y
+                                                                                && (event.y > r.y && event.y < r.y
                                                                                                + r.height)) {
                                                                        btn.changeButtonState(DACustomButton.STATE_HOVER);
                                                                } else {
@@ -378,7 +384,7 @@ public class DATabComposite extends DABaseComposite {
        // positioning of the tab button
        private void setLayoutTabs(int leftTabIndex, int tabIndex) {
                FormData data = new FormData();
-               data.top = new FormAttachment(0, 0);
+               data.top = new FormAttachment(0, 1);
                data.bottom = new FormAttachment(100, 0);
                data.width = tabWidth;
                if (leftTabIndex != -1) {
@@ -513,6 +519,10 @@ public class DATabComposite extends DABaseComposite {
        public void setTabWidth(int size) {
                tabWidth = size;
        }
+       
+       public void isImageTab(boolean isImageTab) {
+               this.isImageTab = isImageTab;
+       }
 
        @Override
        public DABaseComposite getView(String ID) {
index 1eebfe1..62bb73e 100755 (executable)
@@ -41,44 +41,66 @@ public abstract class DAViewComposite extends DABaseComposite {
                final Composite composite = new Composite(this, SWT.NONE);\r
                composite.setLayout(new FormLayout());\r
                // Creates title bar.\r
-               titleBar = new Canvas(composite, SWT.DOUBLE_BUFFERED);\r
-               titleBar.addPaintListener(titlePaintListener);\r
-               titleBar.addListener(SWT.MouseDoubleClick, titleMouseListener);\r
-\r
-               // Creates border area.\r
-               Composite borderArea = new Composite(composite, SWT.NONE);\r
-               borderArea.setLayout(new FormLayout());\r
-               borderArea.setBackground(ColorResources.VIEW_BORDER);\r
-\r
-               // Creates content area.\r
-               contentArea = new Composite(borderArea, SWT.NONE);\r
-               contentArea.setLayout(new FormLayout());\r
-               contentArea.setBackground(ColorResources.VIEW_BG_COLOR);\r
-\r
-               // Sets layout data.\r
-               FormData data = new FormData();\r
-               data.left = new FormAttachment(0, 0);\r
-               data.right = new FormAttachment(100, 0);\r
-               if (titleVisibility) {\r
-                       data.height = DesignConstants.VIEW_TITLEBAR_HEIGHT;\r
-               } else {\r
-                       data.height = 0;\r
-               }\r
-               titleBar.setLayoutData(data);\r
-\r
-               data = new FormData();\r
-               data.top = new FormAttachment(titleBar, 0);\r
-               data.left = new FormAttachment(0, 0);\r
-               data.right = new FormAttachment(100, 0);\r
-               data.bottom = new FormAttachment(100, 0);\r
-               borderArea.setLayoutData(data);\r
-\r
-               data = new FormData();\r
-               data.top = new FormAttachment(0, 3);\r
-               data.left = new FormAttachment(0, 2);\r
-               data.right = new FormAttachment(100, -2);\r
-               data.bottom = new FormAttachment(100, -2);\r
-               contentArea.setLayoutData(data);\r
+                               titleBar = new Canvas(composite, SWT.DOUBLE_BUFFERED);\r
+                               titleBar.addPaintListener(titlePaintListener);\r
+                               titleBar.addListener(SWT.MouseDoubleClick, titleMouseListener);\r
+\r
+                               // Creates border area.\r
+                               Composite borderArea1 = new Composite(composite, SWT.NONE);\r
+                               borderArea1.setLayout(new FormLayout());\r
+                               borderArea1.setBackground(ColorResources.VIEW_BORDER_1);\r
+                               \r
+                               Composite borderArea2 = new Composite(borderArea1, SWT.NONE);\r
+                               borderArea2.setLayout(new FormLayout());\r
+                               borderArea2.setBackground(ColorResources.VIEW_BORDER_2);\r
+                               \r
+                               Composite borderArea3 = new Composite(borderArea2, SWT.NONE);\r
+                               borderArea3.setLayout(new FormLayout());\r
+                               borderArea3.setBackground(ColorResources.VIEW_BORDER_3);\r
+                               \r
+                               // Creates content area.\r
+                               contentArea = new Composite(borderArea3, SWT.NONE);\r
+                               contentArea.setLayout(new FormLayout());\r
+                               contentArea.setBackground(ColorResources.VIEW_BG_COLOR);\r
+\r
+                               // Sets layout data.\r
+                               FormData data = new FormData();\r
+                               data.left = new FormAttachment(0, 0);\r
+                               data.right = new FormAttachment(100, 0);\r
+                               if (titleVisibility) {\r
+                                       data.height = DesignConstants.VIEW_TITLEBAR_HEIGHT;\r
+                               } else {\r
+                                       data.height = 0;\r
+                               }\r
+                               titleBar.setLayoutData(data);\r
+\r
+                               data = new FormData();\r
+                               data.top = new FormAttachment(titleBar, 0);\r
+                               data.left = new FormAttachment(0, 0);\r
+                               data.right = new FormAttachment(100, 0);\r
+                               data.bottom = new FormAttachment(100, 0);\r
+                               borderArea1.setLayoutData(data);\r
+                               \r
+                               data = new FormData();\r
+                               data.top = new FormAttachment(0, 1);\r
+                               data.left = new FormAttachment(0, 1);\r
+                               data.right = new FormAttachment(100, -1);\r
+                               data.bottom = new FormAttachment(100, -1);\r
+                               borderArea2.setLayoutData(data);\r
+                               \r
+                               data = new FormData();\r
+                               data.top = new FormAttachment(0, 4);\r
+                               data.left = new FormAttachment(0, 3);\r
+                               data.right = new FormAttachment(100, -3);\r
+                               data.bottom = new FormAttachment(100, -3);\r
+                               borderArea3.setLayoutData(data);\r
+\r
+                               data = new FormData();\r
+                               data.top = new FormAttachment(0, 0);\r
+                               data.left = new FormAttachment(0, 0);\r
+                               data.right = new FormAttachment(100, 0);\r
+                               data.bottom = new FormAttachment(100, 0);\r
+                               contentArea.setLayoutData(data);\r
        }\r
 \r
        public Canvas getTitleArea(){\r
@@ -107,18 +129,12 @@ public abstract class DAViewComposite extends DABaseComposite {
 \r
                        Rectangle bounds = titleBar.getBounds();\r
                        int width = bounds.width;\r
-                       int height = bounds.height - 2;\r
+                       int height = bounds.height;\r
 \r
                        // Draws background.\r
                        gc.setForeground(ColorResources.TITLEBAR_START_COLOR);\r
                        gc.setBackground(ColorResources.TITLEBAR_END_COLOR);\r
                        gc.fillGradientRectangle(bounds.x, bounds.y, width, height, true);\r
-                       gc.setForeground(ColorResources.TITLEBAR_BOTTOM_STROKE_1);\r
-                       gc.drawLine(bounds.x, bounds.y + height + 1, bounds.x + width,\r
-                                       bounds.y + height + 1);\r
-                       gc.setForeground(ColorResources.TITLEBAR_BOTTOM_STROKE_2);\r
-                       gc.drawLine(bounds.x, bounds.y + height + 2, bounds.x + width,\r
-                                       bounds.y + height + 2);\r
 \r
                        // Draws text.\r
                        gc.setFont(FontResources.VIEW_TITLE);\r
index a351eab..50a8439 100644 (file)
@@ -63,7 +63,7 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
                if (button.isClosable()) {
                        Image img = button.getCloseButtonImage();
                        Rectangle imgRect = img.getBounds();
-                       gc.drawImage(img, rect.width - imgRect.width, rect.y + 1);
+                       gc.drawImage(img, rect.width - imgRect.width - 6, rect.y + 1);
                }
        }
 
@@ -81,7 +81,7 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
                }
 
                Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
-               if (attr.getButtonImage() == null) {
+               if (attr.getButtonImage(state) == null) {
                        drawButtonText(gc, r, state, attr);
                }
                Color c = gc.getForeground();
@@ -98,9 +98,9 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
        }
 
        protected void drawButtonImage(GC gc, Rectangle rect,
-                       DACustomButtonAttribute attr) {
-               if (attr != null && attr.getButtonImage() != null) {
-                       Image img = attr.getButtonImage();
+                       DACustomButtonAttribute attr, int state) {
+               Image img = attr.getButtonImage(state);
+               if (attr != null && img != null) {
                        Rectangle imgRect = img.getBounds();
                        int width = rect.width - imgRect.width;
                        int height = rect.height - imgRect.height;
diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/context_menu_child_arrow.png b/org.tizen.dynamicanalyzer.appearance/theme/white/context_menu_child_arrow.png
new file mode 100644 (file)
index 0000000..ebb09d4
Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/context_menu_child_arrow.png differ
diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_touchevent_position.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_touchevent_position.png
new file mode 100644 (file)
index 0000000..609e3d4
Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/btn_touchevent_position.png differ
index 297e4e6..cb9d208 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_disable.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_disable.png differ
index 8344353..b28ca58 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_hover.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_hover.png differ
index 577896a..7f9572b 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_normal.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_normal.png differ
index 96795d1..c884054 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_push.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/close_box_push.png differ
diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_hover.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_hover.png
new file mode 100644 (file)
index 0000000..46d3f99
Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_hover.png differ
diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_normal.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_normal.png
new file mode 100644 (file)
index 0000000..87ebe9b
Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_normal.png differ
diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_push.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_push.png
new file mode 100644 (file)
index 0000000..98f2388
Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/show_only_changed_push.png differ
diff --git a/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_drag.png b/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_drag.png
new file mode 100644 (file)
index 0000000..58b74a1
Binary files /dev/null and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_drag.png differ
index 9ee228a..75ba5d4 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_hover.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_hover.png differ
index 5e3df0c..2e08e6e 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_normal.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_normal.png differ
index 0303d7b..2a49f77 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_push.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_push.png differ
index 2984f8b..f759a88 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_selected.png and b/org.tizen.dynamicanalyzer.appearance/theme/white/img/tab_selected.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/context_menu_child_arrow.png b/org.tizen.dynamicanalyzer.widgets/Images/context_menu_child_arrow.png
new file mode 100644 (file)
index 0000000..ebb09d4
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/context_menu_child_arrow.png differ
index 2904e4a..5c5dab9 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * Jooyoul Lee <jy.exe.lee@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -282,13 +283,17 @@ public class DACustomButton extends Canvas {
         * image button means background is image. <br>
         * icon button means image draws on text field or front of text
         * 
-        * @param img
-        *            the icon of icon button
+        * 
+        * @param state
+        *            The state of the button you want to set.
+        * @param image
+        *            The image of the button you want to set.
         */
-       public void setButtonImage(Image img) {
-               attr.setButtonImage(img);
+       
+       public void setButtonImage(int state, Image image) {
+               attr.setButtonImage(state, image);
        }
-
+       
        /**
         * Sets the user render of button. <br>
         * this class has default renderer : DACustomButtonRenderer
@@ -428,6 +433,25 @@ public class DACustomButton extends Canvas {
        }
 
        /**
+        * Sets the icon images of button
+        * 
+        * @param normal
+        *            The image of normal state
+        * @param push
+        *            The image of push state
+        * @param hover
+        *            The image of hover state
+        * @param disable
+        *            The image of disable state
+        */
+       public void setButtonImages(Image normal, Image push, Image hover, Image disable) {
+               attr.setButtonImage(STATE_NORMAL, normal);
+               attr.setButtonImage(STATE_PUSH, push);
+               attr.setButtonImage(STATE_HOVER, hover);
+               attr.setButtonImage(STATE_DISABLE, disable);
+       }
+       
+       /**
         * Sets the outside outline color of button.
         * 
         * @param normal
index e9fee67..6c88081 100644 (file)
@@ -37,13 +37,14 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
 
 public class DACustomButtonAttribute {
-       public static final int MAX_SIZE = 12;
+       public static final int MAX_SIZE = 14;
        private String text;
-       private Image buttonImage = null;
        private Font font;
        private Point fontPoint;
        private int drawType = DACustomButton.TYPE_COLOR;
-
+       private List<Image> buttonImages = new ArrayList<Image>();
+       private Point buttonImagePoint;
+       
        private int align = SWT.CENTER;
        private Image iconImage = null;
 
@@ -55,6 +56,7 @@ public class DACustomButtonAttribute {
 
        public DACustomButtonAttribute() {
                for (int i = 0; i < MAX_SIZE; i++) {
+                       buttonImages.add(null);
                        images.add(null);
                        colors.add(null);
                        fontColors.add(null);
@@ -71,14 +73,25 @@ public class DACustomButtonAttribute {
                this.text = text;
        }
 
-       public Image getButtonImage() {
-               return buttonImage;
+       public Image getButtonImage(int state) {
+               if (!buttonImages.isEmpty()) {
+                       return buttonImages.get(state);
+               }
+               return null;
        }
 
-       public void setButtonImage(Image img) {
-               buttonImage = img;
+       public void setButtonImage(int state, Image buttonImage) {
+               buttonImages.set(state, buttonImage);
        }
 
+       public Point getButtonImagePoint() {
+               return buttonImagePoint;
+       }
+       
+       public void setButtonImagePoint(Point buttonImagePoint) {
+               this.buttonImagePoint = buttonImagePoint;
+       }
+       
        public Font getFont() {
                return font;
        }
index 4274d65..025b4cc 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * Jooyoul Lee <jy.exe.lee@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -50,7 +51,7 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
                                || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
                        drawButton(gc, rect, state, attr);
                }
-               drawButtonImage(gc, rect, attr);
+               drawButtonImage(gc, rect, attr, state);
                drawIcon(gc, rect, attr);
        }
 
@@ -97,9 +98,9 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
                }
 
                Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
-               if (attr.getButtonImage() == null) {
+//             if (attr.getButtonImage() == null) {
                        drawButtonText(gc, r, attr, state);
-               }
+//             }
                Color c = gc.getForeground();
                if (null != attr.getOutlineColor(state)) {
                        gc.setForeground(attr.getOutlineColor(state));
@@ -120,20 +121,29 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
        }
 
        protected void drawButtonImage(GC gc, Rectangle rect,
-                       DACustomButtonAttribute attr) {
-               if (attr != null && attr.getButtonImage() != null) {
-                       Image img = attr.getButtonImage();
+                       DACustomButtonAttribute attr, int state) {
+               
+               Image img = attr.getButtonImage(state);
+               if (attr != null && img != null) {
+                       Point p = null;
                        Rectangle imgRect = img.getBounds();
-                       int width = rect.width - imgRect.width;
-                       int height = rect.height - imgRect.height;
+                       
                        int x = 0, y = 0;
-                       if (width > 0) {
-                               x = width / 2;
-                       }
+                       if (null == (p = attr.getButtonImagePoint())) {
+                               int width = rect.width - imgRect.width;
+                               int height = rect.height - imgRect.height;
+                               if (width > 0) {
+                                       x = width / 2;
+                               }
 
-                       if (height > 0) {
-                               y = height / 2;
+                               if (height > 0) {
+                                       y = height / 2;
+                               }
+                       } else {
+                               x = p.x;
+                               y = p.y;
                        }
+                       
                        gc.drawImage(img, x, y);
                }
        }
index 658fb5e..3be9a69 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
  *\r
  * Contact: \r
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>\r
  * Jooyoul Lee <jy.exe.lee@samsung.com>\r
  * Juyoung Kim <j0.kim@samsung.com>\r
  *\r
@@ -122,7 +123,7 @@ public class DACustomToggleButton extends DACustomButton {
                        Color normalEnd, Color pushStart, Color pushEnd, Color hoverStart,\r
                        Color hoverEnd, Color disableStart, Color disableEnd,\r
                        Color toggleStart, Color toggleEnd, Color toggleHoverStart,\r
-                       Color toggleHoverEnd) {\r
+                       Color toggleHoverEnd, Color togglePushStart, Color togglePushEnd) {\r
                this(parent, SWT.NONE);\r
                attr.setColor(0, normalStart);\r
                attr.setColor(1, normalEnd);\r
@@ -136,8 +137,26 @@ public class DACustomToggleButton extends DACustomButton {
                attr.setColor(9, toggleEnd);\r
                attr.setColor(10, toggleHoverStart);\r
                attr.setColor(11, toggleHoverEnd);\r
+               attr.setColor(12, togglePushStart);\r
+               attr.setColor(13, togglePushEnd);\r
                attr.setDrawType(TYPE_GRADATION);\r
        }\r
+       \r
+       public void setOutlineColors(Color normal, Color push, Color hover,\r
+                       Color disable, Color toggle, Color toggleHover, Color togglePush) {\r
+               setOutlineColors(normal, togglePush, toggleHover, disable);\r
+               attr.setOutlineColor(STATE_TOGGLE, toggle);\r
+               attr.setOutlineColor(STATE_TOGGLE_HOVER, toggleHover);\r
+               attr.setOutlineColor(STATE_TOGGLE_PUSH, togglePush);\r
+       }\r
+\r
+       public void setOutlineInColors(Color normal, Color push, Color hover,\r
+                       Color disable, Color toggle, Color toggleHover, Color togglePush) {     \r
+               setOutlineInColors(normal, togglePush, toggleHover, disable);\r
+               attr.setOutlineInColor(STATE_TOGGLE, toggle);\r
+               attr.setOutlineInColor(STATE_TOGGLE_HOVER, toggleHover);\r
+               attr.setOutlineInColor(STATE_TOGGLE_PUSH, togglePush);\r
+       }\r
 \r
        protected void addToggleListeners() {\r
                if (null != toggleButtonMouseListener) {\r
index a9e0074..13f22ae 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * Jooyoul Lee <jy.exe.lee@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -28,13 +29,16 @@ package org.tizen.dynamicanalyzer.widgets.button.toggle;
 
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.util.DALogger;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonAttribute;
 
 public class DACustomToggleButtonRenderer extends DACustomButtonRenderer {
+       private static final DALogger DA_LOG = DALogger.getInstance();
 
        @Override
        public void draw(GC gc, Canvas canvas, int state,
@@ -51,7 +55,47 @@ public class DACustomToggleButtonRenderer extends DACustomButtonRenderer {
                } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
                                || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
                        drawButton(gc, rect, state, attr);
+                       drawButtonToggleImage(gc, rect, state, attr);
                }
        }
 
+       private void drawButtonToggleImage(GC gc, Rectangle rect,
+                       int state, DACustomButtonAttribute attr) {
+               Point p = null;
+               Image img = null;
+               Rectangle imgRect = null;
+               
+               if (state < DACustomToggleButton.STATE_TOGGLE) {
+                       // draw normal image
+                       img = attr.getButtonImage(DACustomToggleButton.STATE_NORMAL);
+               } else {        // state >= DACustomToggleButton.STATE_TOGGLE
+                       // draw toggle image
+                       img = attr.getButtonImage(DACustomToggleButton.STATE_TOGGLE);
+               }
+               
+               if (null != img) {
+                       imgRect = img.getBounds();
+                       int x = 0, y = 0;
+                       if (null == (p = attr.getButtonImagePoint())) {
+                               int width = rect.width - imgRect.width;
+                               int height = rect.height - imgRect.height;
+                               if (width > 0) {
+                                       x = width / 2;
+                               } else {
+                                       DA_LOG.debug("width size : " + width); //$NON-NLS-1$
+                               }
+
+                               if (height > 0) {
+                                       y = height / 2;
+                               } else {
+                                       DA_LOG.debug("height size : " + height); //$NON-NLS-1$
+                               }
+                       } else {
+                               x = p.x;
+                               y = p.y;
+                       }                               
+                       gc.drawImage(img, x, y);
+               }
+               
+       }
 }
index b53fc66..ee49b8a 100644 (file)
@@ -1027,6 +1027,11 @@ public class DAChartRenderer {
                gc.setAlpha(255);
        }
        
+       /*
+        * This method is one of Chart renderer. Real chart using this method is File Analysis chart.
+        * This renderer draws Rectangle and bar in multi line and need specific seriesItem type.
+        * Type is possible SERIES_AREA_START, SERIES_AREA_END, SERIES_AREA_BAR.
+        */
        private void drawStateAreaSeries(GC gc, DAChartSeries series, int seriesIndex, 
                        int seriesSize) {
                List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
@@ -1092,9 +1097,12 @@ public class DAChartRenderer {
                                        pixcelWidth = plot.getXPixcelFromX(endSeriesItem.getX(), r) - pixcelStartX;
                                } else {
                                        /*
-                                        * endSeriesItem is null when end series is not exist. this case, draw it as much as visibleEndX.
+                                        * endSeriesItem is null when end series is not exist. this case, draw it as much as validEndX.
                                         */
-                                       pixcelWidth = plot.getXPixcelFromX(plot.getVisibleEndX(), r) - pixcelStartX;
+                                       pixcelWidth = plot.getXPixcelFromX(plot.getValidEndX(), r) - pixcelStartX;
+                               }
+                               if(pixcelWidth ==0) {
+                                       pixcelWidth = 1;
                                }
                                gc.fillRectangle(pixcelStartX, pixcelStartY, pixcelWidth, areaHeight);
                                
index cfba807..a5906b6 100644 (file)
@@ -140,11 +140,12 @@ public class DAChartBoardItemCell extends Composite {
                chartCell.addMouseListener(new MouseListener() {
                        @Override
                        public void mouseUp(MouseEvent e) {
+                               parent.callbackSelect(true);
                        }
 
                        @Override
                        public void mouseDown(MouseEvent e) {
-                               parent.callbackSelect(true);
+//                             parent.callbackSelect(true);
                        }
 
                        @Override
index 0737653..87d0121 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * Jooyoul Lee <jy.exe.lee@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -72,6 +73,10 @@ public class DACustomCombo extends Canvas {
 
        private static final int pageSize = 5;
 
+       public static final int TYPE_IMAGE = 0;
+       public static final int TYPE_COLOR = 1;
+       public static final int TYPE_GRADATION = 2;
+       
        Composite parent;
        private Canvas combo = null;
        private Canvas popup = null;
@@ -87,6 +92,13 @@ public class DACustomCombo extends Canvas {
        private List<String> items;
        private List<Rectangle> rects = null;
 
+       private int arrowButtonHeight = 15;
+       private Point comboImagePoint;
+       private List<Image> comboImages = null;
+       private List<Color> colors = null;
+       private List<Color> outlineColors = null;
+       private int drawType = DACustomCombo.TYPE_COLOR;        // color, gradation, image
+       
        private List<Image> images = null;
        private Image buttonUp = null;
        private Image buttonDown = null;
@@ -95,17 +107,18 @@ public class DACustomCombo extends Canvas {
        private int selection = 0;
        private int tmpSelection = 0;
        private String text = DAWidgetConstants.EMPTY_STRING;
-       private boolean imgCombo = false;
        private int state = STATE_NORMAL; // 0 normal 1 hover 2 push 3 disable
        private DACustomComboRenderer comboRenderer = new DACustomComboDefaultRenderer();;
        private DACustomComboPopupRenderer popupRenderer = new DACustomComboPopupDefaultRenderer();
        private IDACustomButtonRenderer buttonRenderer = null;
 
        private List<Color> arrowColors = null;
+       private List<Color> arrowOutlineColors = null;
        private List<Image> arrowImages = null;
        private int titleAlign = TEXT_ALIGN_LEFT;
        private Font font;
-
+       private Point fontPoint;
+       
        public DACustomCombo(Composite parent, int style) {
                super(parent, style);
                combo = this;
@@ -126,6 +139,14 @@ public class DACustomCombo extends Canvas {
                addListener(SWT.MouseUp, comboMouseListener);
        }
 
+       public Point getFontPoint() {
+               return fontPoint;
+       }
+
+       public void setFontPoint(Point fontPoint) {
+               this.fontPoint = fontPoint;
+       }
+       
        public String getText() {
                if (selection < 0) {
                        return text;
@@ -250,6 +271,14 @@ public class DACustomCombo extends Canvas {
                return max;
        }
 
+       public int getArrowButtonHeight() {
+               return arrowButtonHeight;
+       }
+
+       public void setArrowButtonHeight(int arrowButtonHeight) {
+               this.arrowButtonHeight = arrowButtonHeight;
+       }
+
        public int getItemHeight() {
                return itemHeight;
        }
@@ -314,20 +343,21 @@ public class DACustomCombo extends Canvas {
                        if (buttonUp == null) {
                                upArrowButton.setText(Messages.DACustomCombo_1);
                        } else {
-                               upArrowButton.setButtonImage(buttonUp);
+                               upArrowButton.setButtonImages(buttonUp,
+                                               buttonUp, buttonUp, buttonUp);
                        }
                        FormData data = new FormData();
                        data.top = new FormAttachment(0, 0);
                        data.left = new FormAttachment(0, 0);
                        data.right = new FormAttachment(100, 0);
-                       data.height = height;
+                       data.height = arrowButtonHeight;
                        upArrowButton.setLayoutData(data);
                        upArrowButton.addListener(SWT.MouseExit, upButtonMouseListener);
                        upArrowButton.addListener(SWT.MouseEnter, upButtonMouseListener);
                        upArrowButton.addListener(SWT.MouseUp, upButtonMouseListener);
                        upArrowButton.addListener(SWT.FocusIn, upButtonMouseListener);
                        upArrowButton.addListener(SWT.FocusOut, upButtonMouseListener);
-                       shellHeight += height;
+                       shellHeight += arrowButtonHeight;
                        if (tmpItemIndex > 0) {
                                upArrowButton.setButtonEnabled(true);
                        } else {
@@ -345,13 +375,14 @@ public class DACustomCombo extends Canvas {
                        if (null == buttonDown) {
                                downArrowButton.setText(Messages.DACustomCombo_2);
                        } else {
-                               downArrowButton.setButtonImage(buttonDown);
+                               downArrowButton.setButtonImages(buttonDown,
+                                               buttonDown, buttonDown, buttonDown);
                        }
                        data = new FormData();
                        data.top = new FormAttachment(popup, 0);
                        data.left = new FormAttachment(0, 0);
                        data.right = new FormAttachment(100, 0);
-                       data.height = height;
+                       data.height = arrowButtonHeight;
                        downArrowButton.setLayoutData(data);
                        downArrowButton.addListener(SWT.MouseExit, downButtonMouseListener);
                        downArrowButton
@@ -359,7 +390,7 @@ public class DACustomCombo extends Canvas {
                        downArrowButton.addListener(SWT.MouseUp, downButtonMouseListener);
                        downArrowButton.addListener(SWT.FocusIn, downButtonMouseListener);
                        downArrowButton.addListener(SWT.FocusOut, downButtonMouseListener);
-                       shellHeight += height;
+                       shellHeight += arrowButtonHeight;
                        if (tmpItemIndex + MAX_SIZE < size - 1) {
                                downArrowButton.setButtonEnabled(true);
                        } else {
@@ -532,14 +563,10 @@ public class DACustomCombo extends Canvas {
                this.enabled = enabled;
                if (enabled) {
                        changeComboState(STATE_NORMAL);
-                       if (isImageCombo()) {
-                               setBackgroundImage(images.get(STATE_NORMAL));
-                       }
+                       setBackgroundImageAndColor(STATE_NORMAL);
                } else {
                        changeComboState(STATE_DISABLE);
-                       if (isImageCombo()) {
-                               setBackgroundImage(images.get(STATE_DISABLE));
-                       }
+                       setBackgroundImageAndColor(STATE_DISABLE);
 
                        Display.getDefault().syncExec(new Runnable() {
                                @Override
@@ -553,16 +580,34 @@ public class DACustomCombo extends Canvas {
                }
        }
 
+       private void setBackgroundImageAndColor(int state) {
+               if (drawType == TYPE_IMAGE) {
+                       setBackgroundImage(images.get(state));
+               } else if (drawType == TYPE_COLOR) {
+                       setBackground(colors.get(state));
+               } else if (drawType == TYPE_GRADATION) {
+                       int index = state * 2;
+                       setForeground(colors.get(index));
+                       setBackground(colors.get(index + 1));
+               } else {
+                       DA_LOG.debug("DACustomCombo drawType : " + state);
+               }
+       }
+       
        private PaintListener comboPaintListener = new PaintListener() {
 
                @Override
-               public void paintControl(PaintEvent e) {
-                       if (!isImageCombo()) {
-                               comboRenderer.draw(e.gc, combo, text, titleAlign, font, state);
-                       } else {
+               public void paintControl(PaintEvent e) {                        
+                       if (drawType == TYPE_IMAGE) {
                                comboRenderer.drawImage(e.gc, combo, images.get(state), text,
-                                               titleAlign, font, state);
-                       }
+                                               titleAlign, font, state);                               
+                       } else if (drawType == TYPE_COLOR || drawType == TYPE_GRADATION) {
+                               comboRenderer.draw(e.gc, combo, drawType, colors, 
+                                               outlineColors, comboImagePoint, comboImages,
+                                               text, titleAlign, font, fontPoint, state);
+                       } else {
+                               DA_LOG.debug("DACustomCombo drawType : " + state);
+                       } 
                }
        };
 
@@ -596,9 +641,41 @@ public class DACustomCombo extends Canvas {
                }
                return DAWidgetConstants.EMPTY_STRING;
        }
-
+       
+       private List<Color> getColors() {
+               if (null == colors) {
+                       colors = new ArrayList<Color>();
+               }
+               return colors;
+       }
+       
+       public void setComboColors(Color normal, Color push, Color hover, Color disable) {
+               List<Color> comboColors = getColors();
+               comboColors.add(normal);
+               comboColors.add(hover);
+               comboColors.add(push);
+               comboColors.add(disable);
+               drawType = TYPE_COLOR;
+       }
+               
+       public void setComboGradation(Color normalStart, Color normalEnd,
+                       Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
+                       Color disableStart, Color disableEnd) {
+               List<Color> comboColors = getColors();
+               comboColors.add(normalStart);
+               comboColors.add(normalEnd);
+               comboColors.add(hoverStart);
+               comboColors.add(hoverEnd);
+               comboColors.add(pushStart);
+               comboColors.add(pushEnd);
+               comboColors.add(disableStart);
+               comboColors.add(disableEnd);
+               drawType = TYPE_GRADATION;
+       }
+       
        public void setImages(Image normal, Image hover, Image push, Image disable) {
                if (null == normal || null == hover || null == push || null == disable) {
+                       DA_LOG.debug("DACustomCombo setImages parameter is null");
                        return;
                }
                List<Image> imgs = getImages();
@@ -607,7 +684,7 @@ public class DACustomCombo extends Canvas {
                imgs.add(hover);
                imgs.add(push);
                imgs.add(disable);
-               setImageCombo(true);
+               drawType = TYPE_IMAGE;
        }
 
        private List<Image> getImages() {
@@ -617,14 +694,45 @@ public class DACustomCombo extends Canvas {
                return images;
        }
 
-       private void setImageCombo(boolean b) {
-               this.imgCombo = b;
+       private List<Color> getOutlineColors() {
+               if (null == outlineColors) {
+                       outlineColors = new ArrayList<Color>();
+               }
+               return outlineColors;
        }
-
-       public boolean isImageCombo() {
-               return imgCombo;
+       
+       public void setOutlineColors(Color normal, Color push, Color hover,
+                       Color disable) {
+               List<Color> comboOutlineColors = getOutlineColors();
+               comboOutlineColors.add(normal);
+               comboOutlineColors.add(hover);
+               comboOutlineColors.add(push);
+               comboOutlineColors.add(disable);
+       }
+       
+       private List<Image> getComboImages() {
+               if (null == comboImages) {
+                       comboImages = new ArrayList<Image>();
+               }
+               return comboImages;
        }
 
+       public void setComboImages(Image normal, Image push, Image hover, Image disable) {
+               List<Image> imgs = getComboImages();
+               imgs.add(normal);
+               imgs.add(hover);
+               imgs.add(push);
+               imgs.add(disable);
+       }
+       
+       public Point getComboImagePoint() {
+               return comboImagePoint;
+       }
+       
+       public void setComboImagePoint(Point comboImagePoint) {
+               this.comboImagePoint = comboImagePoint;
+       }
+       
        private Listener upButtonMouseListener = new Listener() {
 
                @Override
@@ -756,8 +864,8 @@ public class DACustomCombo extends Canvas {
                        Color disable) {
                arrowColors = new ArrayList<Color>();
                arrowColors.add(normal);
-               arrowColors.add(push);
                arrowColors.add(hover);
+               arrowColors.add(push);
                arrowColors.add(disable);
        }
 
@@ -776,17 +884,34 @@ public class DACustomCombo extends Canvas {
                arrowColors = new ArrayList<Color>();
                arrowColors.add(normalStart);
                arrowColors.add(normalEnd);
-               arrowColors.add(pushStart);
-               arrowColors.add(pushEnd);
                arrowColors.add(hoverStart);
                arrowColors.add(hoverEnd);
+               arrowColors.add(pushStart);
+               arrowColors.add(pushEnd);
                arrowColors.add(disableStart);
                arrowColors.add(disableEnd);
        }
 
+       private List<Color> getArrowOutlineColors() {
+               if (null == arrowOutlineColors) {
+                       arrowOutlineColors = new ArrayList<Color>();
+               }
+               return arrowOutlineColors;
+       }
+       
+       public void setArrowOutlineColors(Color normal, Color push, Color hover,
+                       Color disable) {
+               List<Color> comboArrowOutlineColors = getArrowOutlineColors();
+               comboArrowOutlineColors.add(normal);
+               comboArrowOutlineColors.add(hover);
+               comboArrowOutlineColors.add(push);
+               comboArrowOutlineColors.add(disable);
+       }
+       
        private DACustomButton makeButton() {
                DACustomButton button = null;
                if (arrowImages != null) {
+                       // image
                        button = new DACustomButton(childShell,
                                        arrowImages.get(STATE_NORMAL), arrowImages.get(STATE_PUSH),
                                        arrowImages.get(STATE_HOVER),
@@ -804,12 +929,20 @@ public class DACustomCombo extends Canvas {
                                                arrowColors.get(STATE_DISABLE * 2),
                                                arrowColors.get(STATE_DISABLE * 2 + 1));
                        } else {
+                               // color
                                button = new DACustomButton(childShell, SWT.NONE);
                                button.setColors(arrowColors.get(STATE_NORMAL),
                                                arrowColors.get(STATE_PUSH),
                                                arrowColors.get(STATE_HOVER),
                                                arrowColors.get(STATE_DISABLE));
                        }
+                       
+                       if (arrowOutlineColors != null) {
+                               button.setOutlineColors(arrowOutlineColors.get(STATE_NORMAL),
+                                               arrowOutlineColors.get(STATE_PUSH), 
+                                               arrowOutlineColors.get(STATE_HOVER), 
+                                               arrowOutlineColors.get(STATE_DISABLE));
+                       }
                } else {
                        button = new DACustomButton(childShell, SWT.NONE);
                }
index d777255..54f2f3e 100644 (file)
 
 package org.tizen.dynamicanalyzer.widgets.combo;
 
+import java.util.List;
+
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
@@ -71,13 +74,16 @@ public class DACustomComboDefaultRenderer extends DACustomComboRenderer {
        }
 
        @Override
-       public void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       String text, int state) {
+       public void drawImage(GC gc, Canvas canvas, Image image, String text,
+                       int textAlign, Font font, int state) {
+
        }
 
        @Override
-       public void drawImage(GC gc, Canvas canvas, Image image, String text,
-                       int textAlign, Font font, int state) {
+       public void draw(GC gc, Canvas canvas, int drawType, List<Color> colors,
+                       List<Color> outlineColors, Point comboImagePoint,
+                       List<Image> comboImages, String text, int textAlign, Font font,
+                       Point fontPoint, int state) {
 
        }
 
index 1bb42a2..a22e616 100644 (file)
@@ -62,14 +62,12 @@ public class DACustomComboPopupDefaultRenderer extends DACustomComboPopupRendere
        @Override
        public void drawPattern(GC gc, Canvas canvas, Image patternImage,
                        int state, List<Rectangle> rects, int selection, List<String> items) {
-               // TODO Auto-generated method stub
 
        }
 
        @Override
        public void drawImage(GC gc, Canvas canvas, Image image, int state,
                        List<Rectangle> rects, int selection, List<String> items) {
-               // TODO Auto-generated method stub
 
        }
 
index 45f1fbd..6af2964 100644 (file)
 
 package org.tizen.dynamicanalyzer.widgets.combo;
 
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.widgets.Canvas;
 
 public abstract class DACustomComboRenderer {
        public abstract void draw(GC gc, Canvas canvas, String text, int textAlign,
                        Font font, int state);
 
-       public abstract void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       String text, int state);
-
        public abstract void drawImage(GC gc, Canvas canvas, Image image,
                        String text, int textAlign, Font font, int state);
+       
+       public abstract void draw(GC gc, Canvas canvas, int drawType, List<Color> colors, 
+                       List<Color> outlineColors, Point comboImagePoint, List<Image> comboImages, 
+                       String text, int textAlign, Font font, Point fontPoint, int state);
 }
index 1cea4fa..945e26b 100644 (file)
@@ -174,15 +174,15 @@ public class ColorResources {
                        "checkbox_disabled_font_color", new RGB(135, 135, 135)); //$NON-NLS-1$\r
        \r
        /*** stop progress dialog ***/\r
-       public static final Color STOP_PROGRESS_LINE1_COLOR = getColor("stop_progress_line1_color", new RGB(2, 171, 208)); //$NON-NLS-1$\r
-       public static final Color STOP_PROGRESS_LINE2_COLOR = getColor("stop_progress_line2_color", new RGB(86, 86, 86)); //$NON-NLS-1$\r
-       public static final Color STOP_PROGRESS_BACKGROUND_COLOR = getColor("stop_progress_background_color", new RGB(230, 230, 230)); //$NON-NLS-1$\r
+       public static final Color STOP_PROGRESS_LINE1_COLOR = getColor("stop_progress_line1_color", new RGB(45, 180, 200)); //$NON-NLS-1$\r
+       public static final Color STOP_PROGRESS_LINE2_COLOR = getColor("stop_progress_line2_color", new RGB(0, 0, 0)); //$NON-NLS-1$\r
+       public static final Color STOP_PROGRESS_BACKGROUND_COLOR = getColor("stop_progress_background_color", new RGB(232, 234, 235)); //$NON-NLS-1$\r
        public static final Color STOP_PROGRESS_INFO_FONT_COLOR = getColor("stop_progress_info_font_color", new RGB(70, 70, 70)); //$NON-NLS-1$\r
-       public static final Color STOP_PROGRESS_BAR_START_COLOR = getColor("stop_progress_bar_start_color", new RGB(0, 181, 222)); //$NON-NLS-1$\r
-       public static final Color STOP_PROGRESS_BAR_END_COLOR = getColor("stop_progress_bar_end_color", new RGB(4, 108, 143)); //$NON-NLS-1$\r
+       public static final Color STOP_PROGRESS_BAR_START_COLOR = getColor("stop_progress_bar_start_color", new RGB(45, 180, 222)); //$NON-NLS-1$\r
+       public static final Color STOP_PROGRESS_BAR_END_COLOR = getColor("stop_progress_bar_end_color", new RGB(19, 161, 183)); //$NON-NLS-1$\r
        public static final Color STOP_PROGRESS_BAR_BG_START_COLOR = getColor("stop_progress_bar_bg_start_color", new RGB(204, 204, 204)); //$NON-NLS-1$\r
        public static final Color STOP_PROGRESS_BAR_BG_END_COLOR = getColor("stop_progress_bar_bg_end_color", new RGB(212, 212, 212)); //$NON-NLS-1$\r
-       public static final Color STOP_PROGRESS_BAR_OUTLINE_COLOR = getColor("stop_progress_bar_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$\r
+       public static final Color STOP_PROGRESS_BAR_OUTLINE_COLOR = getColor("stop_progress_bar_outline_color", new RGB(95, 95, 95)); //$NON-NLS-1$\r
        \r
        \r
        \r
@@ -208,7 +208,7 @@ public class ColorResources {
        public static Color POPUP_MENU_TEXT_DISABLED = getColor("popup_menu_text_disabled", new RGB(189, 189, 189)); //$NON-NLS-1$\r
        \r
        public static Color POPUP_MENU_ITEM_NORMAL = getColor("popup_menu_item_normal", new RGB(230, 230, 230)); //$NON-NLS-1$);\r
-       public static Color POPUP_MENU_ITEM_SELECTED = getColor("popup_menu_item_selected", new RGB(50, 185, 231)); //$NON-NLS-1$\r
+       public static Color POPUP_MENU_ITEM_SELECTED = getColor("popup_menu_item_selected", new RGB(45, 180, 200)); //$NON-NLS-1$\r
 \r
        public static Color POPUP_MENU_SEPARATOR1 = getColor("popup_menu_separator1", new RGB(189, 189, 189)); //$NON-NLS-1$\r
        public static Color POPUP_MENU_SEPARATOR2 = getColor("popup_menu_separator2", new RGB(255, 255, 255)); //$NON-NLS-1$\r
index 53b27c8..dd19a04 100644 (file)
@@ -75,6 +75,9 @@ public class FontResources {
        public static final Font TEST_TEXT = getFont(\r
                        "about_text", resizeSystemFont(28));//$NON-NLS-1$\r
 \r
+       public static final Font LICENSE_TEXT = getFont(\r
+                       "license_text", resizeSystemFont(8));//$NON-NLS-1$\r
+       \r
        /** detail info font **/\r
        public static final Font DETAIL_INFO_FONT = getFont(\r
                        "detail_info_font", resizeSystemFont(9));//$NON-NLS-1$\r
@@ -114,6 +117,8 @@ public class FontResources {
                        "additem_button_font", resizeSystemFont(8));//$NON-NLS-1$\r
        public static final Font TAB_BUTTON_FONT = getFont(\r
                        "tab_button_font", resizeSystemFont(10));//$NON-NLS-1$\r
+       public static final Font TAB_BUTTON__LARGE_FONT = getFont(\r
+                       "tab_button_large_font", resizeSystemFont(10));//$NON-NLS-1$\r
 \r
        public static final Font CURRENT_TABLE_HEADER_FONT = getFont(\r
                        "current_table_header_font", resizeSystemFont(8));//$NON-NLS-1$\r
@@ -142,7 +147,7 @@ public class FontResources {
        public static final Font STOP_PROGRESS_FONT = getFont(\r
                        "stop_progress_font", resizeSystemFont(8));//$NON-NLS-1$\r
        public static final Font PROGRESS_FONT = getFont(\r
-                       "progress_font", resizeSystemFont(9));//$NON-NLS-1$\r
+                       "progress_font", resizeSystemFont(8));//$NON-NLS-1$\r
 \r
        public static final Font CONTEXT_MENU_ITEM_FONT = getFont(\r
                        "context_menu_item_font", resizeSystemFont(9));//$NON-NLS-1$\r
index 5a12dde..2560f0c 100644 (file)
@@ -108,6 +108,9 @@ public class ImageResources {
        /*** tree fold ***/
        public static final Image TREE_FOLD = getPngImage("tree_fold"); //$NON-NLS-1$
        public static final Image TREE_OPEN = getPngImage("tree_open"); //$NON-NLS-1$
+       
+       /*** context child arrow ***/
+       public static final Image CONTEXT_OPEN = getPngImage("context_menu_child_arrow"); //$NON-NLS-1$
 
        // check box
        public static final Image CHECKBOX_SELECTED = getPngImage("checkbox_selected"); //$NON-NLS-1$
index b51df96..82911cf 100644 (file)
@@ -135,7 +135,6 @@ public class DAPopupMenu {
 
                        @Override
                        public void mouseDown(MouseEvent event) {
-                               // TODO Auto-generated method stub
                                switch (event.button) {
                                case MOUSE_LEFT: {
                                        closeParent();
@@ -304,7 +303,10 @@ public class DAPopupMenu {
                                                newItem.setButtonEnabled(false);
                                        }
                                } else {
-                                       newItem.setButtonImage(ImageResources.TREE_FOLD);
+                                       newItem.setButtonImages(ImageResources.CONTEXT_OPEN, 
+                                                       ImageResources.CONTEXT_OPEN,
+                                                       ImageResources.CONTEXT_OPEN,
+                                                       ImageResources.CONTEXT_OPEN);
                                        newItem.addListener(SWT.MouseHover, mouseListener);
                                }
                                Image icon = child.getIcon();
@@ -325,6 +327,7 @@ public class DAPopupMenu {
                }
                shell.layout();
                int popupWidth = itemWidth + DAPopupMenuItemButtonRenderer.MARGIN * 2
+                               + DAPopupMenuItemButtonRenderer.ICON_MARGIN
                                + DAPopupMenuItemButtonRenderer.TEXT_MARGIN
                                + DAPopupMenuItemButtonRenderer.DEFAULT_ICON_SIZE * 2;
                int popupHeight = itemHeight + DAPopupMenuItemButtonRenderer.MARGIN * 2;
@@ -340,7 +343,6 @@ public class DAPopupMenu {
 
                        @Override
                        public void paintControl(PaintEvent e) {
-                               // TODO Auto-generated method stub
                                e.gc.setForeground(ColorResources.POPUP_MENU_OUTLINE_STORKE1);
                                e.gc.drawRectangle(0, 0, e.width - 1, e.height - 1);
                                e.gc.setForeground(ColorResources.POPUP_MENU_OUTLINE_STORKE2);
index 1cd9634..bd7a374 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * yeongtaik byeon <yeongtaik.byeon@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -46,6 +47,7 @@ public class DAPopupMenuItemButtonRenderer extends DACustomButtonRenderer {
        protected static final int DEFAULT_ITEM_HEIGHT = 24;
        protected static final int DEFAULT_ICON_SIZE = 16;
        protected static final int DEFAULT_FONT_SIZE = 9;
+       protected static final int ICON_MARGIN = 3;
 
        @Override
        public void draw(GC gc, Canvas canvas, int state,
@@ -53,7 +55,7 @@ public class DAPopupMenuItemButtonRenderer extends DACustomButtonRenderer {
                Rectangle rect = canvas.getClientArea();
                drawButton(gc, rect, state, attr);
                drawIcon(gc, rect, state, attr);
-               drawButtonImage(gc, rect, attr);
+               drawButtonImage(gc, rect, attr, state);
        }
 
        protected void drawButton(GC gc, Rectangle rect, int state,
@@ -73,7 +75,7 @@ public class DAPopupMenuItemButtonRenderer extends DACustomButtonRenderer {
                Font font = null;
                Point p = null;
 
-               Rectangle textRect = new Rectangle(rect.x + DEFAULT_ICON_SIZE, rect.y,
+               Rectangle textRect = new Rectangle(rect.x + ICON_MARGIN + DEFAULT_ICON_SIZE, rect.y,
                                rect.width, rect.height);
 
                if (null != (text = attr.getText())) {
@@ -134,9 +136,9 @@ public class DAPopupMenuItemButtonRenderer extends DACustomButtonRenderer {
        }
 
        protected void drawButtonImage(GC gc, Rectangle rect,
-                       DACustomButtonAttribute attr) {
-               if (attr != null && attr.getButtonImage() != null) {
-                       Image img = attr.getButtonImage();
+                       DACustomButtonAttribute attr, int state) {
+               Image img = attr.getButtonImage(state);
+               if (attr != null && img != null) {
                        gc.drawImage(img, rect.width - img.getBounds().width - MARGIN,
                                        rect.height / 2 - img.getBounds().height / 2);
                }
index d918e88..5e0f54a 100644 (file)
@@ -288,6 +288,12 @@ public class AnalyzerConstants {
 
        public final static String DAEMONLOG_PREFIX = "da_daemon_log_";//$NON-NLS-1$
        public final static int DAEMONLOG_COUNT = 3;
+       
+       public final static String DOWNLOAD_FILE_FOLDER = "download_file";//$NON-NLS-1$
+       public final static String TMP_FOLDER = "tmp";//$NON-NLS-1$
+       public static final String CHECK_DOWNLOAD_FILE_STRING = "SkWek2n3_File:";//$NON-NLS-1$
+       
+       
 
        /*** version 3.0 */
        public final static int MSG_KEEP_ALIVE = 0x0001;
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java
new file mode 100644 (file)
index 0000000..b3d0065
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+public class DALimit {
+
+       /*
+        * limit of each information size
+        * if the size is over, read/write/send/receive in file or cut it down.
+        */
+       // common
+       public static final int FUNCTION_NAME_LENGTH = 1024;
+       public static final int FILEPATH_LENGTH = 1024;
+       public static final int FUNCTION_ARGUMENTS_FORMAT_LENGTH = 100;
+       public static final int FUNCTION_ARGUMENTS_VALUE_LENGTH = 1024;
+       // OpenGL Analysis
+       public static final int SHADER_SOURCE_LENGTH = 4096;
+       public static final int SHADER_VARIABLE_LENGTH = 1024;
+       // Network Analysis
+       public static final int HTML_SCRIPT_LENGTH = 4096;
+
+       
+       /*
+        * maximum limit of the tool can manager
+        * if one of the value is over, stop the trace.
+        */
+       // common
+       public static final int MAX_TRACE_TIME_INSECOND = 24*60*60;     // 1 day
+       public static final long MAX_SEQUENCE_NUMBER = Long.MAX_VALUE; //2^63-1,  4G*2G-1
+       public static final int MAX_PROCESS_COUNT = 2^16;       // 65535
+       public static final int MAX_BINARY_COUNT = 2^16; // 65535
+       public static final int MAX_FUNCTION_COUNT = 2^20;      // 1,048,576
+       public static final int MAX_FUNCTION_ARGUMENTS_COUNT = FUNCTION_ARGUMENTS_FORMAT_LENGTH; // Because "MAX_FUNCTION_ARGUMENTS_COUNT < FUNCTION_ARGUMENTS_FORMAT_LENGTH" is always true
+       
+       // Leak 
+       public static final int MAX_LEAK_CHECK_BUFFER_SIZE = 2^20; // 1,048,576
+
+       // File Analysis
+       public static final int MAX_FILE_COUNT = 2^10; // 1024
+       public static final int MAX_FILE_STATUS_COUNT = 2^10*100; // 102400
+       public static final int MAX_FILE_ACCESS_COUNT = 2^10*100; // 102400
+       public static final int MAX_FILE_ACCESSOR_COUNT = 2^10*100; // 102400
+       public static final int MAX_STRING_LENGTH = 12;
+       
+}
index 5e705a2..edf4b15 100644 (file)
@@ -291,11 +291,11 @@ public class DACommunicator {
                                                                || appInfo.getInfo(AppInfo.APPTYPE_INDEX)
                                                                                .contains(AppInfo.APPTYPE_WEB) || appInfo
                                                                .getInfo(AppInfo.APPTYPE_INDEX).contains(
-                                                                               AppInfo.APPTYPE_CAPP))
-                                               && appInfo.getInfo(AppInfo.MULTIPLE_INDEX).equals(
-                                                               AppInfo.FLAG_ZERO)
-                                               && appInfo.getInfo(AppInfo.NODISPLAY_INDEX).equals(
-                                                               AppInfo.FLAG_ZERO)) {
+                                                                               AppInfo.APPTYPE_CAPP))) {
+//                                             && appInfo.getInfo(AppInfo.MULTIPLE_INDEX).equals(
+//                                                             AppInfo.FLAG_ZERO)
+//                                             && appInfo.getInfo(AppInfo.NODISPLAY_INDEX).equals(
+//                                                             AppInfo.FLAG_ZERO)) {
                                        String pkgId = appInfo.getInfo(AppInfo.PACKAGE_INDEX);
                                        String appId = appInfo.getInfo(AppInfo.APPID_INDEX);
 
index 7ee8383..cae404e 100644 (file)
@@ -38,6 +38,7 @@ public class DBConstants {
        public static final String COMMON_COLUMN_PID = "PID";//$NON-NLS-1$
        public static final String COMMON_COLUMN_TID = "TID";//$NON-NLS-1$
        public static final String COMMON_COLUMN_ARG = "ARG";//$NON-NLS-1$
+       public static final String COMMON_COLUMN_RET = "RET";//$NON-NLS-1$
        public static final String COMMON_COLUMN_ERROR = "ERROR";//$NON-NLS-1$
        public static final String COMMON_COLUMN_CALLER_PC_ADDRESS = "CALLER_PC_ADDRESS";//$NON-NLS-1$
        public static final String COMMON_COLUMN_CALLER_LIB_NAME = "LIB_NAME";//$NON-NLS-1$
index 2940b73..3bbf117 100644 (file)
@@ -10,6 +10,8 @@ import java.sql.SQLWarning;
 import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
 
 import org.tizen.dynamicanalyzer.util.CommonUtil;
 import org.tizen.dynamicanalyzer.util.DALogger;
@@ -17,26 +19,77 @@ import org.tizen.dynamicanalyzer.util.DALogger;
 public class SqlConnectionManager {
        private static final DALogger DA_LOG = DALogger.getInstance();
 
-       private static Connection connection = null;
+       // apply multi connection of DB
+       private static final int CONNECTION_COUNT_UPDATE = 8;
+       private static final int CONNECTION_COUNT_QUERY = 8;
+       private static BlockingQueue<Connection> updateConnections = null;
+       private static BlockingQueue<Connection> queryConnections = null;
+       private static int realUpdateConnCount = 0;
+       private static int realQueryConnCount = 0;
+
+       // DATABASE state
+       private enum State {
+               NOT_CONNECTED,
+               CONNECTED,
+               TO_BE_CLOSED
+       }
+
+       private static State state = State.NOT_CONNECTED;
 
        public static boolean establishConnection(String dbFilePath) {
                boolean result = true;
                try {
                        synchronized (SqlConnectionManager.class) {
-                               if (connection == null) {
+                               if (updateConnections == null && queryConnections == null) {
+                                       updateConnections = new LinkedBlockingQueue<Connection>();
+                                       queryConnections = new LinkedBlockingQueue<Connection>();
+                                       realUpdateConnCount = 0;
+                                       realQueryConnCount = 0;
+
                                        Class.forName("org.hsqldb.jdbcDriver");
                                        String dbUrl = "jdbc:hsqldb:"
                                                        + dbFilePath
-                                                       + ";shutdown=false;hsqldb.default_table_type=cached;hsqldb.large_data=true;hdqldb.log_data=false"; //$NON-NLS-1$
-                                       connection = DriverManager.getConnection(dbUrl, "SA", "");
-                                       SQLWarning warning = connection.getWarnings();
-                                       while (warning != null) {
-                                               DA_LOG.debug("[DB] Message: " + warning.getMessage());
-                                               DA_LOG.debug("[DB] SQL state: " + warning.getSQLState());
-                                               DA_LOG.debug("[DB] Vendor code: "
-                                                               + warning.getErrorCode());
-                                               warning = warning.getNextWarning();
+                                                       + ";shutdown=false;hsqldb.default_table_type=cached"
+                                                       + ";hsqldb.tx=mvcc;hsqldb.large_data=true;hdqldb.log_data=false"; //$NON-NLS-1$
+
+                                       Connection conn;
+                                       // establish update connection pool
+                                       for (int i = 0; i < CONNECTION_COUNT_UPDATE; i++) {
+                                               conn = DriverManager.getConnection(dbUrl, "SA", "");
+                                               updateConnections.offer(conn);
+                                               realUpdateConnCount++;
+
+                                               SQLWarning warning = conn.getWarnings();
+                                               while (warning != null) {
+                                                       DA_LOG.debug("[DB][" + i + "] Message: "
+                                                                       + warning.getMessage());
+                                                       DA_LOG.debug("[DB][" + i + "] SQL state: "
+                                                                       + warning.getSQLState());
+                                                       DA_LOG.debug("[DB][" + i + "] Vendor code: "
+                                                                       + warning.getErrorCode());
+                                                       warning = warning.getNextWarning();
+                                               }
+                                       }
+
+                                       // establish query connection pool
+                                       for (int i = 0; i < CONNECTION_COUNT_QUERY; i++) {
+                                               conn = DriverManager.getConnection(dbUrl, "SA", "");
+                                               queryConnections.offer(conn);
+                                               realQueryConnCount++;
+
+                                               SQLWarning warning = conn.getWarnings();
+                                               while (warning != null) {
+                                                       DA_LOG.debug("[DB][" + i + "] Message: "
+                                                                       + warning.getMessage());
+                                                       DA_LOG.debug("[DB][" + i + "] SQL state: "
+                                                                       + warning.getSQLState());
+                                                       DA_LOG.debug("[DB][" + i + "] Vendor code: "
+                                                                       + warning.getErrorCode());
+                                                       warning = warning.getNextWarning();
+                                               }
                                        }
+
+                                       state = State.CONNECTED;
                                }
                        }
                } catch (ClassNotFoundException e) {
@@ -44,7 +97,7 @@ public class SqlConnectionManager {
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
-                       if (connection == null)
+                       if (updateConnections == null || queryConnections == null)
                                result = false;
                        else
                                result = true;
@@ -55,61 +108,163 @@ public class SqlConnectionManager {
 
        public static void closeConnection() {
                synchronized (SqlConnectionManager.class) {
-                       if (connection != null) {
-                               try {
-                                       Statement st = connection.createStatement();
-                                       st.execute("SHUTDOWN");
-                                       CommonUtil.tryClose(st);
-                                       connection.close();
-                               } catch (SQLException se) {
-                                       if (!se.getSQLState().equals("XJ015")) {
-                                               DA_LOG.debug("DB did not shutdown normally");
+                       // set close state
+                       // this value prevent other thread from getting connection
+                       state = State.TO_BE_CLOSED;
+
+                       // close update connection
+                       if (updateConnections != null) {
+                               synchronized (updateConnections) {
+                                       while (updateConnections.size() != realUpdateConnCount) {
+                                               // wait until other execution is finished
+                                               try {
+                                                       updateConnections.wait();
+                                               } catch (InterruptedException e) {
+                                                       e.printStackTrace();
+                                               }
+                                       }
+                               }
+
+                               // close all connection
+                               Connection conn;
+                               while ((conn = updateConnections.poll()) != null) {
+                                       try {
+                                               conn.close();
+                                       } catch (SQLException e) {
+                                               e.printStackTrace();
+                                       }
+                               }
+                       }
+
+                       // close query connection
+                       if (queryConnections != null) {
+                               synchronized (queryConnections) {
+                                       while (queryConnections.size() != realQueryConnCount) {
+                                               // wait until other execution is finished
+                                               try {
+                                                       queryConnections.wait();
+                                               } catch (InterruptedException e) {
+                                                       e.printStackTrace();
+                                               }
+                                       }
+                               }
+
+                               // close all connection
+                               Connection conn;
+                               while ((conn = queryConnections.poll()) != null) {
+                                       // if it is last connection of database
+                                       if (queryConnections.size() == 0) {
+                                               Statement st = null;
+                                               try {
+                                                       st = conn.createStatement();
+                                                       st.execute("SHUTDOWN");
+                                               } catch (SQLException se) {
+                                                       if (!se.getSQLState().equals("XJ015")) {
+                                                               DA_LOG.debug("DB did not shutdown normally");
+                                                       }
+                                               } finally {
+                                                       CommonUtil.tryClose(st);
+                                               }
+                                       }
+
+                                       try {
+                                               conn.close();
+                                       } catch (SQLException e) {
+                                               e.printStackTrace();
                                        }
                                }
-                               connection = null;
                        }
+
+                       updateConnections = null;
+                       queryConnections = null;
+
+                       state = State.NOT_CONNECTED;
                }
        }
 
-       public static boolean isConnected() {
-               return (connection != null);
-       }
+       private static Connection getUpdateConnection() {
+               Connection retConn = null;
+               if (state == State.CONNECTED) {
+                       try {
+                               retConn = updateConnections.take();
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
 
-       private static void semaphoreAcquire() {
+               return retConn;
+       }
 
+       private static void putUpdateConnection(Connection conn) {
+               if (conn != null) {
+                       try {
+                               updateConnections.put(conn);
+                               synchronized (updateConnections) {
+                                       updateConnections.notifyAll();
+                               }
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
        }
 
-       private static void semaphoreRelease() {
+       private static Connection getQueryConnection() {
+               Connection retConn = null;
+               if (state == State.CONNECTED) {
+                       try {
+                               retConn = queryConnections.take();
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
 
+               return retConn;
+       }
+
+       private static void putQueryConnection(Connection conn) {
+               if (conn != null) {
+                       try {
+                               queryConnections.put(conn);
+                               synchronized (queryConnections) {
+                                       queryConnections.notifyAll();
+                               }
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
        }
 
        public static void executeUpdate(String statement) {
+               Connection conn = null;
                Statement sm = null;
                try {
-                       if (connection != null) {
-                               semaphoreAcquire();
-                               sm = connection.createStatement();
+                       conn = getUpdateConnection();
+                       if (conn != null) {
+                               sm = conn.createStatement();
                                sm.executeUpdate(statement);
                        }
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
                        CommonUtil.tryClose(sm);
-                       semaphoreRelease();
+                       if (conn != null)
+                               putUpdateConnection(conn);
                }
        }
 
        public static void executePreparedWithType(String query,
                        List<List<Object>> data, List<String> columnType) {
+               Connection conn = null;
                PreparedStatement prep = null;
 
                if (data.size() == 0)
                        return;
 
                try {
-                       if (connection != null) {
+                       conn = getUpdateConnection();
+                       if (conn != null) {
                                int batchCount = 0;
-                               prep = connection.prepareStatement(query);
+                               prep = conn.prepareStatement(query);
 
                                // count ? in query
                                int questionCount = 0;
@@ -128,7 +283,7 @@ public class SqlConnectionManager {
                                        return;
                                }
 
-                               connection.setAutoCommit(false);
+                               conn.setAutoCommit(false);
 
                                for (int k = 0; k < datasize; k++) {
                                        List<Object> row = data.get(k);
@@ -214,13 +369,15 @@ public class SqlConnectionManager {
 
                                if (batchCount > 0)
                                        prep.executeBatch();
-                               connection.commit();
-                               connection.setAutoCommit(true);
+                               conn.commit();
+                               conn.setAutoCommit(true);
                        }
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
                        CommonUtil.tryClose(prep);
+                       if (conn != null)
+                               putUpdateConnection(conn);
                }
        }
 
@@ -230,15 +387,17 @@ public class SqlConnectionManager {
        // (no need to check the type of each column)
        public static void executePreparedWithInterface(String query,
                        List<List<Object>> data, IPreparedStatement ip) {
+               Connection conn = null;
                PreparedStatement prep = null;
 
                if (data.size() == 0)
                        return;
 
                try {
-                       if (connection != null) {
+                       conn = getUpdateConnection();
+                       if (conn != null) {
                                int batchCount = 0;
-                               prep = connection.prepareStatement(query);
+                               prep = conn.prepareStatement(query);
 
                                // count ? in query
                                int questionCount = 0;
@@ -251,7 +410,7 @@ public class SqlConnectionManager {
                                // set data into prepared statement
                                int datasize = data.size();
 
-                               connection.setAutoCommit(false);
+                               conn.setAutoCommit(false);
 
                                for (int k = 0; k < datasize; k++) {
                                        List<Object> row = data.get(k);
@@ -273,24 +432,28 @@ public class SqlConnectionManager {
 
                                if (batchCount > 0)
                                        prep.executeBatch();
-                               connection.commit();
-                               connection.setAutoCommit(true);
+                               conn.commit();
+                               conn.setAutoCommit(true);
                        }
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
                        CommonUtil.tryClose(prep);
+                       if (conn != null)
+                               putUpdateConnection(conn);
                }
        }
 
        public static List<List<Object>> executeQuery(String query) {
+               Connection conn = null;
                Statement sm = null;
                ResultSet rs = null;
                List<List<Object>> result = null;
+
                try {
-                       if (connection != null) {
-                               semaphoreAcquire();
-                               sm = connection.createStatement();
+                       conn = getQueryConnection();
+                       if (conn != null) {
+                               sm = conn.createStatement();
                                rs = sm.executeQuery(query);
                                if (rs != null) {
                                        result = new ArrayList<List<Object>>();
@@ -331,7 +494,8 @@ public class SqlConnectionManager {
                        e.printStackTrace();
                } finally {
                        CommonUtil.tryClose(sm);
-                       semaphoreRelease();
+                       if (conn != null)
+                               putQueryConnection(conn);
                }
 
                return result;
index e7fc4ef..f2263be 100644 (file)
-/*\r
- *  Dynamic Analyzer\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
- * Juyoung Kim <j0.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- * \r
- */\r
-\r
-package org.tizen.dynamicanalyzer.handlers;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.widgets.Display;\r
-import org.eclipse.swt.widgets.Shell;\r
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
-import org.tizen.dynamicanalyzer.common.GlobalInformation;\r
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;\r
-import org.tizen.dynamicanalyzer.constant.CommonConstants;\r
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;\r
-import org.tizen.dynamicanalyzer.model.ImageInfo;\r
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;\r
-import org.tizen.dynamicanalyzer.project.Project;\r
-import org.tizen.dynamicanalyzer.resources.ImageResources;\r
-import org.tizen.dynamicanalyzer.sql.SqlManager;\r
-import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;\r
-import org.tizen.dynamicanalyzer.swap.channel.control.TargetInfo;\r
-import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;\r
-import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;\r
-import org.tizen.dynamicanalyzer.swap.channel.data.LibraryObject;\r
-import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;\r
-import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;\r
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;\r
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;\r
-import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;\r
-import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;\r
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;\r
-import org.tizen.dynamicanalyzer.ui.range.RangePage;\r
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;\r
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;\r
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData;\r
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;\r
-import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;\r
-import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;\r
-import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingChildData;\r
-import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;\r
-import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;\r
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;\r
-import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceProgressManager;\r
-import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;\r
-import org.tizen.dynamicanalyzer.util.DALogger;\r
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;\r
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
-import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;\r
-import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;\r
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;\r
-\r
-public class OpenTraceHandler extends AbstractHandler {\r
-       private static final DALogger DA_LOG = DALogger.getInstance();\r
-\r
-       public static final String ID = OpenTraceHandler.class.getName();\r
-       Project project = null;\r
-\r
-       @Override\r
-       public Object execute(ExecutionEvent event) throws ExecutionException {\r
-\r
-               project = AnalyzerManager.getProject();\r
-\r
-               List<String> pInfo = SqlManager.getInstance().getDetailsInfo(\r
-                               project.getSavePath());\r
-\r
-               if (null == pInfo || pInfo.isEmpty()) {\r
-                       DA_LOG.debug("The trace file is invalid."); //$NON-NLS-1$\r
-                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE);\r
-                       AnalyzerUtil.executeCommand(ClearHandler.ID);\r
-                       return null;\r
-               }\r
-               project.loadSaveFormat(pInfo);\r
-\r
-//             OpenTraceProgressManager.getInstance().openTracePrgressStart(\r
-//                             AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING);\r
-\r
-               if (!DACommunicator.isDeviceConnected()) {\r
-                       Display.getDefault().syncExec(new Runnable() {\r
-                               @Override\r
-                               public void run() {\r
-                                       DACustomCombo deviceCombo = ToolbarArea.getInstance()\r
-                                                       .getDeviceCombo();\r
-                                       DACustomCombo appCombo = ToolbarArea.getInstance()\r
-                                                       .getAppCombo();\r
-                                       deviceCombo.setText(AnalyzerManager.getProject()\r
-                                                       .getDevice());\r
-                                       appCombo.setText(AnalyzerManager.getProject().getAppName());\r
-                                       deviceCombo.setEnabled(true);\r
-                                       appCombo.setEnabled(true);\r
-                               }\r
-                       });\r
-               }\r
-\r
-               int percent = OpenTraceProgressManager.getInstance().getPercent();\r
-               if (loadInfos() && loadCallStackData() && loadCallStackApis()\r
-                               && loadProfilingData() && loadProfilingChildData() &&\r
-                               // loadLeakData() &&\r
-                               // loadFailedData() &&\r
-                               loadImageSet()) {\r
-\r
-                       OpenTraceProgressManager.getInstance().setProgressPercent(\r
-                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 60);\r
-\r
-               } else {\r
-                       OpenTraceProgressManager.getInstance().closeOpenTraceDialog(\r
-                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING_FAILED);\r
-                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);\r
-                       AnalyzerUtil.executeCommand(ClearHandler.ID);\r
-                       return null;\r
-               }\r
-\r
-               ToolbarArea.getInstance().setTime(project.getLastTime());\r
-               ToolbarArea.getInstance().setDeviceComboText(project.getDevice());\r
-               ToolbarArea.getInstance().setAppComboText(project.getAppName());\r
-               ToolbarArea.getInstance().checkStartButtonAndAppListEnablement();\r
-               ToolbarArea.getInstance().setRepalyButtonEnable(true);\r
-               if (AnalyzerManager.getProject().getProcessInfoPackHash().isEmpty()) {\r
-                       ToolbarArea.getInstance().setSourceViewEnable(false);\r
-                       ToolbarArea.getInstance().setSourceViewTooltip(\r
-                                       AnalyzerLabels.MESSAGE_PROCESS_PG_WARNING);\r
-               } else {\r
-                       ToolbarArea.getInstance().setSourceViewEnable(true);\r
-                       ToolbarArea.getInstance().setSourceViewTooltip(\r
-                                       AnalyzerLabels.MESSAGE_PROCESS_VIEW_SOURCE);\r
-               }\r
-               OpenTraceProgressManager.getInstance().setProgressPercent(\r
-                               AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 3);\r
-               /* add each part action.. close... open...etc... */\r
-\r
-               /* resource log view action start */\r
-               // List<LogCenter> logCenters = AnalyzerManager.getLogCenters();\r
-               // List<Integer> ids = LogDataFactory.getLogList();\r
-               // size = ids.size();\r
-               // for (int i = 0; i < size; i++) {\r
-               // LogCenter center = logCenters.get(i);\r
-               // int dataSize = SqlManager.getInstance().selectCount(center);\r
-               // center.setDataSize(dataSize);\r
-               // }\r
-\r
-               if (RangeDataManager.getInstance().isBeingAnalyzed()) {\r
-                       DAPageComposite page = AnalyzerManager.getCurrentPage();\r
-                       if (page instanceof RangePage) {\r
-                               AnalyzerUtil.changePage(TimelinePage.pageID);\r
-                       }\r
-               }\r
-\r
-               OpenTraceProgressManager.getInstance().runThreads();\r
-               OpenTraceProgressManager.getInstance().openTraceComplete();\r
-               SqlManager.getInstance().closeConnection();\r
-\r
-               NetworkDataManager.getInstance().openProcess();\r
-               GLDataManager.getInstance().openProcess();\r
-               return null;\r
-       }\r
-\r
-       private void invalidProgress() {\r
-               OpenTraceProgressManager.getInstance().closeOpenTraceDialog(\r
-                               AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);\r
-               createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);\r
-               AnalyzerUtil.executeCommand(ClearHandler.ID);\r
-       }\r
-\r
-       private boolean loadCallStackData() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance()\r
-                               .getCallStackDataFromTable();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - loadCallStackData");\r
-                       isSuccess = false;\r
-               } else {\r
-                       for (int i = 0; i < dbInfo.size(); i++) {\r
-                               List<String> pInfo = dbInfo.get(i);\r
-                               int seq = Integer.parseInt(pInfo.get(0));\r
-                               String addrs = pInfo.get(1);\r
-                               if (null == addrs) {\r
-                                       continue;\r
-                               }\r
-                               String[] splitAddrs = addrs.split(CommonConstants.SLASH);\r
-                               CallStackData csd = new CallStackData(seq);\r
-                               List<Long> addrList = csd.getAddrs();\r
-                               int size = splitAddrs.length;\r
-                               for (int j = 0; j < size; j++) {\r
-                                       long addr = Long.parseLong(splitAddrs[j]);\r
-                                       addrList.add(addr);\r
-                               }\r
-                               AnalyzerManager.getCallstackManager()\r
-                                               .getCallStackDataBySeqMap().put(seq, csd);\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private boolean loadCallStackApis() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance()\r
-                               .setloadCallStackApis();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - loadCallStackApis");\r
-                       isSuccess = false;\r
-               } else {\r
-                       BaseCallstackManager callstackManager = AnalyzerManager\r
-                                       .getCallstackManager();\r
-                       for (int i = 0; i < dbInfo.size(); i++) {\r
-                               List<String> pInfo = dbInfo.get(i);\r
-                               long addr = Long.parseLong(pInfo.get(0));\r
-                               String api = pInfo.get(1);\r
-                               int pid = Integer.parseInt(pInfo.get(2));\r
-                               long time = Long.parseLong(pInfo.get(3));\r
-                               CallStackUnit csa = new CallStackUnit(addr, api, pid, time);\r
-                               callstackManager.getCallStackApiAddrByPidMap(pid)\r
-                                               .put(addr, csa);\r
-\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private boolean loadInfos() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance().loadTargetInfo();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - loadTargetInfo");\r
-                       isSuccess = false;\r
-               } else {\r
-                       List<String> info = dbInfo.get(0);\r
-                       TargetInfo targetInfo = new TargetInfo();\r
-                       targetInfo.loadSaveFormat(info);\r
-                       GlobalInformation.getCurrentDeviceInfo().setTargetInfo(targetInfo);\r
-               }\r
-\r
-               List<String> pids = SqlManager.getInstance().getPids();\r
-               int pidCount = pids.size();\r
-\r
-               HashMap<Integer, ProcessInfoPackage> processPkgMap = AnalyzerManager\r
-                               .getProject().getProcessInfoPackHash();\r
-               for (int h = 0; h < pidCount; h++) {\r
-                       ProcessInfoPackage pip = new ProcessInfoPackage();\r
-                       String option = " where pid = " + pids.get(h);\r
-                       dbInfo = SqlManager.getInstance().loadProcessInfo(option);\r
-                       if (null == dbInfo) {\r
-                               DA_LOG.debug("failed - load Process Info");\r
-                               isSuccess = false;\r
-                               continue;\r
-                       } else {\r
-                               List<ProcessInfo> pInfos = pip.getProcessSnapshots();\r
-                               for (int i = 0; i < dbInfo.size(); i++) {\r
-                                       List<String> info = dbInfo.get(i);\r
-                                       ProcessInfo process = new ProcessInfo();\r
-                                       process.loadSaveFormat(info.get(1));\r
-                                       pInfos.add(process);\r
-                                       if (i == 0) {\r
-                                               pip.setPid(process.getPid());\r
-                                               pip.setPpid(process.getPpid());\r
-                                               pip.setTargetBinaryPath(process\r
-                                                               .getMainTargetBinaryPath());\r
-                                       }\r
-                                       String subOption = "where pid = " + process.getPid()\r
-                                                       + " and time = \'"\r
-                                                       + process.getStartTime().toString() + "\'";\r
-                                       List<List<String>> objInfo = SqlManager.getInstance()\r
-                                                       .loadLibObj(subOption);\r
-                                       if (null == objInfo) {\r
-                                               DA_LOG.debug("failed - load Lib Object");\r
-                                               isSuccess = false;\r
-                                               continue;\r
-                                       } else {\r
-                                               for (List<String> libInfo : objInfo) {\r
-                                                       LibraryObject libObj = new LibraryObject();\r
-                                                       libObj.setPid(Integer.parseInt(libInfo.get(0)));\r
-                                                       // 1 : time\r
-                                                       libObj.setLowestAddress(Long.parseLong(libInfo\r
-                                                                       .get(2)));\r
-                                                       libObj.setHighestAddress(Long.parseLong(libInfo\r
-                                                                       .get(3)));\r
-                                                       libObj.setLibPath(libInfo.get(4));\r
-                                                       process.getLibObjs().add(libObj);\r
-                                                       process.getLibObjHash().put(libObj.getLibPath(),\r
-                                                                       libObj);\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-                       processPkgMap.put(pip.getPid(), pip);\r
-               }\r
-               dbInfo = SqlManager.getInstance().loadApiNames();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - load Api names");\r
-                       isSuccess = false;\r
-               } else {\r
-                       List<String> apiList = ApiNameManager.getApiList();\r
-                       for (List<String> info : dbInfo) {\r
-                               apiList.add(info.get(0));\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private boolean loadImageSet() {\r
-               List<List<String>> input = SqlManager.getInstance().getloadImageSet(3);\r
-               if (null == input) {\r
-                       return false;\r
-               }\r
-\r
-               int size = input.size();\r
-\r
-               for (int i = 0; i < size; i++) {\r
-                       List<String> imgLog = input.get(i);\r
-                       String seq = imgLog.get(0);\r
-                       String time = imgLog.get(1);\r
-                       ImageInfo imgInfo = new ImageInfo();\r
-                       imgInfo.setSeq(seq);\r
-                       imgInfo.setTime(time);\r
-\r
-                       String[] path = imgLog.get(2).split(CommonConstants.SLASH);\r
-                       imgInfo.setFileName(new String(path[path.length - 1]));\r
-\r
-                       AnalyzerManager.getImageSet().put(seq, imgInfo);\r
-               }\r
-               return true;\r
-       }\r
-\r
-       private boolean loadLeakData() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance().setloadLeakData();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("leak data loading failed..");\r
-                       isSuccess = false;\r
-               } else {\r
-                       LeakDetector leakDectector = AnalyzerManager.getLeakDetector();\r
-                       for (int i = 0; i < dbInfo.size(); i++) {\r
-                               List<String> info = dbInfo.get(i);\r
-                               LeakData leakData = new LeakData(info);\r
-                               if (-1 != leakData.getParentKey()) {\r
-                                       LeakData parent = leakDectector.getLeakHash().get(\r
-                                                       leakData.getParentKey());\r
-                                       if (null == parent) {\r
-                                               continue;\r
-                                       } else {\r
-                                               parent.getChildren().add(leakData);\r
-                                       }\r
-                               } else {\r
-                                       leakDectector.getLeakHash().put((long) leakData.getKey(),\r
-                                                       leakData);\r
-                               }\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private boolean loadFailedData() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance()\r
-                               .setloadFailedData();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - loadFailedData");\r
-                       isSuccess = false;\r
-               } else {\r
-                       FailedChecker failedChecker = AnalyzerManager.getFailedChecker();\r
-                       for (int i = 0; i < dbInfo.size(); i++) {\r
-                               List<String> pInfo = dbInfo.get(i);\r
-                               // possibility of extensions - network, efl, db, etc...\r
-                               int id = Integer.parseInt(pInfo\r
-                                               .get(LogCenterConstants.ID_INDEX));\r
-                               if (id == DataChannelConstants.MSG_PROBE_FILE) {\r
-                                       // if file failed api data is skip - file chart make it!\r
-                                       int type = Integer.parseInt(pInfo\r
-                                                       .get(LogCenterConstants.RESOURCE_FDTYPE_INDEX));\r
-                                       if (type == LogCenterConstants.FD_TYPE_FILE) {\r
-                                               continue;\r
-                                       }\r
-                               }\r
-                               FailedData failedData = new FailedData(pInfo);\r
-                               failedChecker.getFailedList().add(failedData);\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private boolean loadProfilingData() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance()\r
-                               .setloadProfilingData();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - loadProfilingData");\r
-                       isSuccess = false;\r
-               } else {\r
-                       for (int i = 0; i < dbInfo.size(); i++) {\r
-                               List<String> pInfo = dbInfo.get(i);\r
-                               int pid = Integer.parseInt(pInfo.get(ProfilingData.PID_INDEX));\r
-                               // possibility of extensions - network, efl, db, etc...\r
-                               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
-                                               .getProfileDataMakerByPid(pid);\r
-                               ProfilingData fupData = new ProfilingData(pInfo, profiler);\r
-                               String seq = pInfo.get(ProfilingData.SEQUENCE_INDEX);\r
-                               profiler.getProfilingDataMap().put(Integer.parseInt(seq),\r
-                                               fupData);\r
-                               String symbol = pInfo.get(ProfilingData.KEY_INDEX);\r
-                               profiler.getSymbolSeqHash().put(symbol, seq);\r
-                               UIDataManager.getInstance().getfunctionProfilingDataChecker()\r
-                                               .addProfilingData(fupData);\r
-                               // restore total sample count\r
-                               profiler.setTotalSampleCount(profiler.getTotalSampleCount()\r
-                                               + fupData.getExCount());\r
-                       }\r
-\r
-                       List<Integer> pids = FunctionUsageProfiler.getInstance()\r
-                                       .getPidsOfProfileDataMakerMap();\r
-                       for (int i = 0; i < pids.size(); i++) {\r
-                               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
-                                               .getProfileDataMakerByPid(pids.get(i));\r
-                               ProfilingData ab = profiler\r
-                                               .getProfilingDataByKey(FunctionUsageProfiler.APPLICATION_KEY);\r
-                               profiler.setAppBin(ab);\r
-                               ProfilingData dl = profiler\r
-                                               .getProfilingDataByKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);\r
-                               profiler.setDependentLib(dl);\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private boolean loadProfilingChildData() {\r
-               boolean isSuccess = true;\r
-               List<List<String>> dbInfo = SqlManager.getInstance()\r
-                               .setloadProfilingChildData();\r
-               if (null == dbInfo) {\r
-                       DA_LOG.debug("failed - loadProfilingChildData");\r
-                       isSuccess = false;\r
-               } else {\r
-                       for (int i = 0; i < dbInfo.size(); i++) {\r
-                               List<String> data = dbInfo.get(i);\r
-                               if (data.size() < 2) { // why?\r
-                                       continue;\r
-                               }\r
-                               int pid = Integer.parseInt(data.get(1)); // 1 == PID_INDEX\r
-                               String seqs = data.get(2); // 2 == CHILDLIST_INDEX\r
-                               String[] splitSeqs = seqs.split(CommonConstants.SLASH);\r
-                               List<Integer> childData = new ArrayList<Integer>();\r
-                               for (int ii = 0; ii < splitSeqs.length; ii++) {\r
-                                       childData.add(Integer.parseInt(splitSeqs[ii]));\r
-                               }\r
-                               int key = Integer.parseInt(data.get(0));\r
-                               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
-                                               .getProfileDataMakerByPid(pid);\r
-                               ProfilingData parent = profiler.getProfilingDataMap().get(key);\r
-                               ProfilingChildData child = parent.getChildData();\r
-                               child.getChildren().addAll(childData);\r
-                               profiler.getChildListMap().put(data.get(0), child);\r
-                       }\r
-               }\r
-               return isSuccess;\r
-       }\r
-\r
-       private void createWarningDialog(String message) {\r
-               final Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();\r
-               final DADialog dialog = new DADialog(shell, SWT.NONE);\r
-               dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);\r
-               dialog.setMessage(message);\r
-               Display.getDefault().syncExec(new Runnable() {\r
-                       @Override\r
-                       public void run() {\r
-                               dialog.open();\r
-                       }\r
-               });\r
-       }\r
-}\r
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.GlobalInformation;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.ImageInfo;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;
+import org.tizen.dynamicanalyzer.swap.channel.control.TargetInfo;
+import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
+import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
+import org.tizen.dynamicanalyzer.swap.channel.data.LibraryObject;
+import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
+import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangePage;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingChildData;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceProgressManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+
+public class OpenTraceHandler extends AbstractHandler {
+       private static final DALogger DA_LOG = DALogger.getInstance();
+
+       public static final String ID = OpenTraceHandler.class.getName();
+       Project project = null;
+
+       @Override
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               project = AnalyzerManager.getProject();
+
+               List<String> pInfo = SqlManager.getInstance().getDetailsInfo(
+                               project.getSavePath());
+
+               if (null == pInfo || pInfo.isEmpty()) {
+                       DA_LOG.debug("The trace file is invalid."); //$NON-NLS-1$
+                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE);
+                       AnalyzerUtil.executeCommand(ClearHandler.ID);
+                       return null;
+               }
+               project.loadSaveFormat(pInfo);
+
+               OpenTraceProgressManager.getInstance().openTracePrgressStart(
+                               AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING);
+
+               if (!DACommunicator.isDeviceConnected()) {
+                       Display.getDefault().syncExec(new Runnable() {
+                               @Override
+                               public void run() {
+                                       DACustomCombo deviceCombo = ToolbarArea.getInstance()
+                                                       .getDeviceCombo();
+                                       DACustomCombo appCombo = ToolbarArea.getInstance()
+                                                       .getAppCombo();
+                                       deviceCombo.setText(AnalyzerManager.getProject()
+                                                       .getDevice());
+                                       appCombo.setText(AnalyzerManager.getProject().getAppName());
+                                       deviceCombo.setEnabled(true);
+                                       appCombo.setEnabled(true);
+                               }
+                       });
+               }
+
+               int percent = OpenTraceProgressManager.getInstance().getPercent();
+               if (loadInfos() && loadCallStackData() && loadCallStackApis()
+                               && loadProfilingData() && loadProfilingChildData() &&
+                               // loadLeakData() &&
+                               // loadFailedData() &&
+                               loadImageSet()) {
+
+                       OpenTraceProgressManager.getInstance().setProgressPercent(
+                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 60);
+
+               } else {
+                       OpenTraceProgressManager.getInstance().closeOpenTraceDialog(
+                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING_FAILED);
+                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);
+                       AnalyzerUtil.executeCommand(ClearHandler.ID);
+                       return null;
+               }
+
+               ToolbarArea.getInstance().setTime(project.getLastTime());
+               ToolbarArea.getInstance().setDeviceComboText(project.getDevice());
+               ToolbarArea.getInstance().setAppComboText(project.getAppName());
+               ToolbarArea.getInstance().checkStartButtonAndAppListEnablement();
+               ToolbarArea.getInstance().setRepalyButtonEnable(true);
+               if (AnalyzerManager.getProject().getProcessInfoPackHash().isEmpty()) {
+                       ToolbarArea.getInstance().setSourceViewEnable(false);
+                       ToolbarArea.getInstance().setSourceViewTooltip(
+                                       AnalyzerLabels.MESSAGE_PROCESS_PG_WARNING);
+               } else {
+                       ToolbarArea.getInstance().setSourceViewEnable(true);
+                       ToolbarArea.getInstance().setSourceViewTooltip(
+                                       AnalyzerLabels.MESSAGE_PROCESS_VIEW_SOURCE);
+               }
+               OpenTraceProgressManager.getInstance().setProgressPercent(
+                               AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 3);
+               /* add each part action.. close... open...etc... */
+
+               /* resource log view action start */
+               // List<LogCenter> logCenters = AnalyzerManager.getLogCenters();
+               // List<Integer> ids = LogDataFactory.getLogList();
+               // size = ids.size();
+               // for (int i = 0; i < size; i++) {
+               // LogCenter center = logCenters.get(i);
+               // int dataSize = SqlManager.getInstance().selectCount(center);
+               // center.setDataSize(dataSize);
+               // }
+
+               if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+                       DAPageComposite page = AnalyzerManager.getCurrentPage();
+                       if (page instanceof RangePage) {
+                               AnalyzerUtil.changePage(TimelinePage.pageID);
+                       }
+               }
+
+               OpenTraceProgressManager.getInstance().runThreads();
+               OpenTraceProgressManager.getInstance().openTraceComplete();
+               SqlManager.getInstance().closeConnection();
+
+               NetworkDataManager.getInstance().openProcess();
+               GLDataManager.getInstance().openProcess();
+               return null;
+       }
+
+       private void invalidProgress() {
+               OpenTraceProgressManager.getInstance().closeOpenTraceDialog(
+                               AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);
+               createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);
+               AnalyzerUtil.executeCommand(ClearHandler.ID);
+       }
+
+       private boolean loadCallStackData() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .getCallStackDataFromTable();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - loadCallStackData");
+                       isSuccess = false;
+               } else {
+                       for (int i = 0; i < dbInfo.size(); i++) {
+                               List<String> pInfo = dbInfo.get(i);
+                               int seq = Integer.parseInt(pInfo.get(0));
+                               String addrs = pInfo.get(1);
+                               if (null == addrs) {
+                                       continue;
+                               }
+                               String[] splitAddrs = addrs.split(CommonConstants.SLASH);
+                               CallStackData csd = new CallStackData(seq);
+                               List<Long> addrList = csd.getAddrs();
+                               int size = splitAddrs.length;
+                               for (int j = 0; j < size; j++) {
+                                       long addr = Long.parseLong(splitAddrs[j]);
+                                       addrList.add(addr);
+                               }
+                               AnalyzerManager.getCallstackManager()
+                                               .getCallStackDataBySeqMap().put(seq, csd);
+                       }
+               }
+               return isSuccess;
+       }
+
+       private boolean loadCallStackApis() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadCallStackApis();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - loadCallStackApis");
+                       isSuccess = false;
+               } else {
+                       BaseCallstackManager callstackManager = AnalyzerManager
+                                       .getCallstackManager();
+                       for (int i = 0; i < dbInfo.size(); i++) {
+                               List<String> pInfo = dbInfo.get(i);
+                               long addr = Long.parseLong(pInfo.get(0));
+                               String api = pInfo.get(1);
+                               int pid = Integer.parseInt(pInfo.get(2));
+                               long time = Long.parseLong(pInfo.get(3));
+                               CallStackUnit csa = new CallStackUnit(addr, api, pid, time);
+                               callstackManager.getCallStackApiAddrByPidMap(pid)
+                                               .put(addr, csa);
+
+                       }
+               }
+               return isSuccess;
+       }
+
+       private boolean loadInfos() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance().loadTargetInfo();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - loadTargetInfo");
+                       isSuccess = false;
+               } else {
+                       List<String> info = dbInfo.get(0);
+                       TargetInfo targetInfo = new TargetInfo();
+                       targetInfo.loadSaveFormat(info);
+                       GlobalInformation.getCurrentDeviceInfo().setTargetInfo(targetInfo);
+               }
+
+               List<String> pids = SqlManager.getInstance().getPids();
+               int pidCount = pids.size();
+
+               HashMap<Integer, ProcessInfoPackage> processPkgMap = AnalyzerManager
+                               .getProject().getProcessInfoPackHash();
+               for (int h = 0; h < pidCount; h++) {
+                       ProcessInfoPackage pip = new ProcessInfoPackage();
+                       String option = " where pid = " + pids.get(h);
+                       dbInfo = SqlManager.getInstance().loadProcessInfo(option);
+                       if (null == dbInfo) {
+                               DA_LOG.debug("failed - load Process Info");
+                               isSuccess = false;
+                               continue;
+                       } else {
+                               List<ProcessInfo> pInfos = pip.getProcessSnapshots();
+                               for (int i = 0; i < dbInfo.size(); i++) {
+                                       List<String> info = dbInfo.get(i);
+                                       ProcessInfo process = new ProcessInfo();
+                                       process.loadSaveFormat(info.get(1));
+                                       pInfos.add(process);
+                                       if (i == 0) {
+                                               pip.setPid(process.getPid());
+                                               pip.setPpid(process.getPpid());
+                                               pip.setTargetBinaryPath(process
+                                                               .getMainTargetBinaryPath());
+                                       }
+                                       String subOption = "where pid = " + process.getPid()
+                                                       + " and time = \'"
+                                                       + process.getStartTime().toString() + "\'";
+                                       List<List<String>> objInfo = SqlManager.getInstance()
+                                                       .loadLibObj(subOption);
+                                       if (null == objInfo) {
+                                               DA_LOG.debug("failed - load Lib Object");
+                                               isSuccess = false;
+                                               continue;
+                                       } else {
+                                               for (List<String> libInfo : objInfo) {
+                                                       LibraryObject libObj = new LibraryObject();
+                                                       libObj.setPid(Integer.parseInt(libInfo.get(0)));
+                                                       // 1 : time
+                                                       libObj.setLowestAddress(Long.parseLong(libInfo
+                                                                       .get(2)));
+                                                       libObj.setHighestAddress(Long.parseLong(libInfo
+                                                                       .get(3)));
+                                                       libObj.setLibPath(libInfo.get(4));
+                                                       process.getLibObjs().add(libObj);
+                                                       process.getLibObjHash().put(libObj.getLibPath(),
+                                                                       libObj);
+                                               }
+                                       }
+                               }
+                       }
+                       processPkgMap.put(pip.getPid(), pip);
+               }
+               dbInfo = SqlManager.getInstance().loadApiNames();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - load Api names");
+                       isSuccess = false;
+               } else {
+                       List<String> apiList = ApiNameManager.getApiList();
+                       for (List<String> info : dbInfo) {
+                               apiList.add(info.get(0));
+                       }
+               }
+               return isSuccess;
+       }
+
+       private boolean loadImageSet() {
+               List<List<String>> input = SqlManager.getInstance().getloadImageSet(3);
+               if (null == input) {
+                       return false;
+               }
+
+               int size = input.size();
+
+               for (int i = 0; i < size; i++) {
+                       List<String> imgLog = input.get(i);
+                       String seq = imgLog.get(0);
+                       String time = imgLog.get(1);
+                       ImageInfo imgInfo = new ImageInfo();
+                       imgInfo.setSeq(seq);
+                       imgInfo.setTime(time);
+
+                       String[] path = imgLog.get(2).split(CommonConstants.SLASH);
+                       imgInfo.setFileName(new String(path[path.length - 1]));
+
+                       AnalyzerManager.getImageSet().put(seq, imgInfo);
+               }
+               return true;
+       }
+
+       private boolean loadLeakData() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance().setloadLeakData();
+               if (null == dbInfo) {
+                       DA_LOG.debug("leak data loading failed..");
+                       isSuccess = false;
+               } else {
+                       LeakDetector leakDectector = AnalyzerManager.getLeakDetector();
+                       for (int i = 0; i < dbInfo.size(); i++) {
+                               List<String> info = dbInfo.get(i);
+                               LeakData leakData = new LeakData(info);
+                               if (-1 != leakData.getParentKey()) {
+                                       LeakData parent = leakDectector.getLeakHash().get(
+                                                       leakData.getParentKey());
+                                       if (null == parent) {
+                                               continue;
+                                       } else {
+                                               parent.getChildren().add(leakData);
+                                       }
+                               } else {
+                                       leakDectector.getLeakHash().put((long) leakData.getKey(),
+                                                       leakData);
+                               }
+                       }
+               }
+               return isSuccess;
+       }
+
+       private boolean loadFailedData() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadFailedData();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - loadFailedData");
+                       isSuccess = false;
+               } else {
+                       FailedChecker failedChecker = AnalyzerManager.getFailedChecker();
+                       for (int i = 0; i < dbInfo.size(); i++) {
+                               List<String> pInfo = dbInfo.get(i);
+                               // possibility of extensions - network, efl, db, etc...
+                               int id = Integer.parseInt(pInfo
+                                               .get(LogCenterConstants.ID_INDEX));
+                               if (id == DataChannelConstants.MSG_PROBE_FILE) {
+                                       // if file failed api data is skip - file chart make it!
+                                       int type = Integer.parseInt(pInfo
+                                                       .get(LogCenterConstants.RESOURCE_FDTYPE_INDEX));
+                                       if (type == LogCenterConstants.FD_TYPE_FILE) {
+                                               continue;
+                                       }
+                               }
+                               FailedData failedData = new FailedData(pInfo);
+                               failedChecker.getFailedList().add(failedData);
+                       }
+               }
+               return isSuccess;
+       }
+
+       private boolean loadProfilingData() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadProfilingData();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - loadProfilingData");
+                       isSuccess = false;
+               } else {
+                       for (int i = 0; i < dbInfo.size(); i++) {
+                               List<String> pInfo = dbInfo.get(i);
+                               int pid = Integer.parseInt(pInfo.get(ProfilingData.PID_INDEX));
+                               // possibility of extensions - network, efl, db, etc...
+                               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                                               .getProfileDataMakerByPid(pid);
+                               ProfilingData fupData = new ProfilingData(pInfo, profiler);
+                               String seq = pInfo.get(ProfilingData.SEQUENCE_INDEX);
+                               profiler.getProfilingDataMap().put(Integer.parseInt(seq),
+                                               fupData);
+                               String symbol = pInfo.get(ProfilingData.KEY_INDEX);
+                               profiler.getSymbolSeqHash().put(symbol, seq);
+                               UIDataManager.getInstance().getfunctionProfilingDataChecker()
+                                               .addProfilingData(fupData);
+                               // restore total sample count
+                               profiler.setTotalSampleCount(profiler.getTotalSampleCount()
+                                               + fupData.getExCount());
+                       }
+
+                       List<Integer> pids = FunctionUsageProfiler.getInstance()
+                                       .getPidsOfProfileDataMakerMap();
+                       for (int i = 0; i < pids.size(); i++) {
+                               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                                               .getProfileDataMakerByPid(pids.get(i));
+                               ProfilingData ab = profiler
+                                               .getProfilingDataByKey(FunctionUsageProfiler.APPLICATION_KEY);
+                               profiler.setAppBin(ab);
+                               ProfilingData dl = profiler
+                                               .getProfilingDataByKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);
+                               profiler.setDependentLib(dl);
+                       }
+               }
+               return isSuccess;
+       }
+
+       private boolean loadProfilingChildData() {
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadProfilingChildData();
+               if (null == dbInfo) {
+                       DA_LOG.debug("failed - loadProfilingChildData");
+                       isSuccess = false;
+               } else {
+                       for (int i = 0; i < dbInfo.size(); i++) {
+                               List<String> data = dbInfo.get(i);
+                               if (data.size() < 2) { // why?
+                                       continue;
+                               }
+                               int pid = Integer.parseInt(data.get(1)); // 1 == PID_INDEX
+                               String seqs = data.get(2); // 2 == CHILDLIST_INDEX
+                               String[] splitSeqs = seqs.split(CommonConstants.SLASH);
+                               List<Integer> childData = new ArrayList<Integer>();
+                               for (int ii = 0; ii < splitSeqs.length; ii++) {
+                                       childData.add(Integer.parseInt(splitSeqs[ii]));
+                               }
+                               int key = Integer.parseInt(data.get(0));
+                               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                                               .getProfileDataMakerByPid(pid);
+                               ProfilingData parent = profiler.getProfilingDataMap().get(key);
+                               ProfilingChildData child = parent.getChildData();
+                               child.getChildren().addAll(childData);
+                               profiler.getChildListMap().put(data.get(0), child);
+                       }
+               }
+               return isSuccess;
+       }
+
+       private void createWarningDialog(String message) {
+               final Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
+               final DADialog dialog = new DADialog(shell, SWT.NONE);
+               dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
+               dialog.setMessage(message);
+               Display.getDefault().syncExec(new Runnable() {
+                       @Override
+                       public void run() {
+                               dialog.open();
+                       }
+               });
+       }
+}
index 103ac6f..0e03c1b 100644 (file)
@@ -102,7 +102,8 @@ public class LogInserter implements Runnable {
                                        int logId = logIds.get(i);
                                        Logs logs = logPack.getLogs(logId);
                                        if (null != logs
-                                                       && (logId == DataChannelConstants.MSG_DATA_RECORD || logId == DataChannelConstants.MSG_PROBE_GLES20)) {
+                                                       && (logId == DataChannelConstants.MSG_DATA_RECORD
+                                                                       || logId == DataChannelConstants.MSG_PROBE_GLES20 || logId == DataChannelConstants.MSG_PROBE_NETWORK)) {
                                                continue;
                                        }
                                        if (null != logs) {
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/Streamable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/Streamable.java
new file mode 100644 (file)
index 0000000..a6a3771
--- /dev/null
@@ -0,0 +1,15 @@
+package org.tizen.dynamicanalyzer.model;
+
+// this class is parent class of data class which is element of blocking queue.
+// this class has methods to confirm that is end of stream or not
+public abstract class Streamable {
+       private boolean endOfStream = false;
+       
+       public final boolean isEndOfStream() {
+               return endOfStream;
+       }
+       
+       public final void setEndOfStream() {
+               endOfStream = true;
+       }
+}
index 4317fe1..2e1f711 100755 (executable)
@@ -194,6 +194,8 @@ public class AnalyzerLabels extends NLS {
        public static String HEAP_MEMORY_WARNING_PRE;
        public static String HEAP_MEMORY_WARNING_POST;
        
+       public static String TIME_MS;
+       
        static {
                NLS.initializeMessages(BUNDLE_NAME, AnalyzerLabels.class);
        }
index bb42b7d..d1d3556 100755 (executable)
@@ -160,3 +160,5 @@ TABLE_COLUMN_RETURN=Return
 
 HEAP_MEMORY_WARNING_PRE=The trace has been stoped automatically for out of heap memory.\nIf you want to more, please edit the\n
 HEAP_MEMORY_WARNING_POST=/dynamic-analyzer.ini.
+
+TIME_MS = ms
index 2a98e51..55c882a 100644 (file)
@@ -41,6 +41,7 @@ public class FilePageLabels extends NLS {
        public static String FILE_API_LIST_VIEW_API;
        public static String FILE_API_LIST_VIEW_PARAMETER;
        public static String FILE_API_LIST_VIEW_THREAD_ID;
+       public static String FILE_API_LIST_VIEW_FD;
        public static String FILE_API_LIST_VIEW_RETURN;
        public static String FILE_API_LIST_VIEW_ERRNO;
 
index 150568f..bb15da7 100644 (file)
@@ -7,6 +7,7 @@ FILE_API_LIST_VIEW_PID=PID
 FILE_API_LIST_VIEW_API=API Name
 FILE_API_LIST_VIEW_PARAMETER=Parameter
 FILE_API_LIST_VIEW_THREAD_ID=TID
+FILE_API_LIST_VIEW_FD=FD
 FILE_API_LIST_VIEW_RETURN=Return
 FILE_API_LIST_VIEW_ERRNO=Error code
 
index 02c8369..7a09954 100644 (file)
@@ -83,32 +83,6 @@ public class NetworkPageLabels extends NLS {
        public static String NETWORK_CHART_SESSION_NAME;
        public static String NETWORK_CHART_TRANSACTION_NAME;
 
-       public static String NETWORK_DB_RID;
-       public static String NETWORK_DB_DESTINATION_ADDRESS; 
-       public static String NETWORK_DB_FD_VALUE;
-       public static String NETWORK_DB_API_ID;
-       
-       public static String NETWORK_API_DB_TABLENAME;
-       public static String NETWORK_API_DB_API_TIME;
-       
-       public static String NETWORK_API_DB_ERRNO;
-       public static String NETWORK_API_DB_ARGUMENT;
-       public static String NETWORK_API_DB_RETURN;
-       public static String NETWORK_API_DB_BYTE_SIZE;
-       public static String NETWORK_API_DB_PAYLOAD;
-       public static String NETWORK_API_DB_API_TYPE;
-       public static String NETWORK_API_DB_CALLER_PC_ADDRESS;
-       public static String NETWORK_API_DB_LIB_NAME;
-       
-       public static String NETWORK_SERIES_DB_TABLENAME;
-       public static String NETWORK_SERIES_DB_START_TIME;
-       public static String NETWORK_SERIES_DB_END_TIME;
-       public static String NETWORK_SERIES_DB_STATUS_TYPE;
-       
-       
-       
-       public static String TIME_MS;
-                       
        static {
                // initialize resource bundle
                NLS.initializeMessages(BUNDLE_NAME, NetworkPageLabels.class);
index 55fc8c4..bc53a42 100644 (file)
@@ -50,25 +50,3 @@ NETWORK_CHART_CLIENT_NAME=Client
 NETWORK_CHART_SESSION_NAME=Session
 NETWORK_CHART_TRANSACTION_NAME=Transaction
 
-TIME_MS = ms
-
-NETWORK_DB_RID = "RID"
-NETWORK_DB_DESTINATION_ADDRESS = DESTINATION_ADDRESS
-NETWORK_DB_FD_VALUE = FD_VALUE
-NETWORK_DB_API_ID = API_ID
-
-NETWORK_API_DB_TABLENAME = NETWORK_API
-NETWORK_API_DB_API_TIME = API_TIME
-NETWORK_API_DB_ERRNO = ERRNO
-NETWORK_API_DB_ARGUMENT = ARGUMENT
-NETWORK_API_DB_RETURN = RETURN
-NETWORK_API_DB_BYTE_SIZE = BYTE_SIZE
-NETWORK_API_DB_PAYLOAD = PAYLOAD
-NETWORK_API_DB_API_TYPE = API_TYPE
-NETWORK_API_DB_CALLER_PC_ADDRESS = CALLER_PC_ADDRESS
-NETWORK_API_DB_LIB_NAME = LIB_NAME
-
-NETWORK_SERIES_DB_TABLENAME = NETWORK_SERIES
-NETWORK_SERIES_DB_START_TIME = START_TIME
-NETWORK_SERIES_DB_END_TIME = END_TIME
-NETWORK_SERIES_DB_STATUS_TYPE = STATUS_TYPE
\ No newline at end of file
index 1cb10f8..0a70e14 100755 (executable)
@@ -328,7 +328,9 @@ public class SqlManager {
                                        ProcessInfoPackage processInfoPkg = AnalyzerManager
                                                        .getProject().getProcessInfoPackage(
                                                                        logData.getPid());
+                                       if (null != processInfoPkg) {
                                        processInfoPkg.addFunctionEntryInsertLogCount();
+                                       }
                                }
                                prep.addBatch();
 
index 164956c..a953e59 100644 (file)
@@ -355,7 +355,7 @@ public class SWAPCallStackManager extends BaseCallstackManager {
                                probeCallstack.set(size - 1, new CallStackItem(
                                                callerCallstackUnit));
                        } else {
-               //              DA_LOG.debug("probe caller is not the same as top of user callstack"); //$NON-NLS-1$
+                               DA_LOG.debug("probe caller is not the same as top of user callstack"); //$NON-NLS-1$
                        }
                }
 
@@ -479,7 +479,8 @@ public class SWAPCallStackManager extends BaseCallstackManager {
 
                String path = processInfo.getMainTargetBinaryPath();
                String key = AnalyzerUtil.getTargetPathKey(path);
-               BinaryInfo binInfo = GlobalInformation.getCurrentApplication().getBinaryInfo(key);
+               BinaryInfo binInfo = GlobalInformation.getCurrentApplication()
+                               .getBinaryInfo(key);
                if (null == binInfo) {
                        return false;
                }
index c9dc980..a32ad6a 100644 (file)
@@ -41,6 +41,7 @@ public class DataChannelConstants {
        public final static int MSG_CONTEXT_SWITCH_EXIT = 0x0011;
        public final static int MSG_PROCESS_MAP = 0x0012;
        public final static int MSG_PROCESS_UNMAP = 0x0013;
+       public final static int MSG_PROCESS_COMM = 0x0014;
        
        public static final int LOG_USER_FUNCTION = 0x002C;  //44
        public static final int LOG_CONTEXT_SWITCH = 0x002D;  //45 
index 5d215a6..fb5ea54 100644 (file)
@@ -12,6 +12,7 @@ public class ProcessInfoPackage {
        private String targetBinaryPath = null;
        private int functionEntryInsertLogCount = 0;
        private boolean dropLog = false;
+       private String cmdLineName = null;
 
        private List<ProcessInfo> processSnapshots = new ArrayList<ProcessInfo>();
 
@@ -39,6 +40,14 @@ public class ProcessInfoPackage {
                this.targetBinaryPath = localBinaryPath;
        }
 
+       public String getCmdLineName() {
+               return cmdLineName;
+       }
+
+       public void setCmdLineName(String cmdLineName) {
+               this.cmdLineName = cmdLineName;
+       }
+
        public List<ProcessInfo> getProcessSnapshots() {
                return processSnapshots;
        }
index 8fd3c4f..952ed42 100755 (executable)
@@ -30,9 +30,10 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import org.tizen.dynamicanalyzer.model.Streamable;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 
-public class LogPackage {
+public class LogPackage extends Streamable {
        private HashMap<Integer, Logs> logMap;
 
        public void clear() {
index 13f470d..d3a9593 100755 (executable)
@@ -169,10 +169,13 @@ public class MessageParser {
                long highAddr = 0;
                String targetBinaryPath = null;
                int dependantLibCount = 0;
+               String commandLineName = null;
 
                int index = MSG_HEADER_SIZE;
                pid = ByteUtils.toInt(data, index);
                index += INT_SIZE;
+               commandLineName = ByteUtils.getString(data, index);
+               index += ByteUtils.getStringLength(data, index);
                ppid = ByteUtils.toInt(data, index);
                index += INT_SIZE;
                int sec = ByteUtils.toInt(data, index);
@@ -196,6 +199,7 @@ public class MessageParser {
                        pInfoPack.setPid(pid);
                        pInfoPack.setPpid(ppid);
                        pInfoPack.setTargetBinaryPath(targetBinaryPath);
+                       pInfoPack.setCmdLineName(commandLineName);
                        if (processPkgMap.isEmpty()) {
                                AnalyzerManager.getProject().setMainPid(pid);
                        }
@@ -606,6 +610,24 @@ public class MessageParser {
                                }
                        }
                        break;
+               case DataChannelConstants.MSG_PROCESS_COMM:
+               {
+                       // process command line name is changed (/proc/<pid>/cmdline)
+                       int index = MSG_HEADER_SIZE;
+                       int pid = ByteUtils.toInt(data, index);
+                       index += INT_SIZE;
+                       String name = ByteUtils.getString(data, index);
+                       index += ByteUtils.getStringLength(data, index);
+
+                       HashMap<Integer, ProcessInfoPackage> processPkgMap = AnalyzerManager
+                                       .getProject().getProcessInfoPackHash();
+
+                       ProcessInfoPackage pInfoPack = processPkgMap.get(pid);
+                       if (null != pInfoPack) {
+                               pInfoPack.setCmdLineName(name);
+                       }
+               }
+                       break;
                default: // MSG_PROBE
                        if (AnalyzerManager.isProcessInfoArrived() && id > 0x0100
                                        && id < 0x0200) {
index 68f4147..123bd49 100644 (file)
@@ -3,56 +3,88 @@ package org.tizen.dynamicanalyzer.swap.logparser;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
 
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.util.DALogger;
 
 public abstract class PageDataManager implements Runnable {
        private static final DALogger DA_LOG = DALogger.getInstance();
-       
+
        private String name = null;
        private Thread thread = null;
-       private ReadBlockingQueue<LogPackage> logPackQueue = new ReadBlockingQueue<LogPackage>();
+       private BlockingQueue<LogPackage> logPackQueue = new LinkedBlockingQueue<LogPackage>();
        private List<DBTable> dbTableList = new ArrayList<DBTable>();
 
+       private enum State {
+               NOT_RUNNING,
+               RUNNING,
+               TO_BE_STOPED
+       }
+
+       private State state = State.NOT_RUNNING;
+
        public final String getName() {
                if (name == null) {
                        name = getClass().getName();
                }
                return name;
        }
-
+       
        public final void updateLog(LogPackage logPack) {
-               logPackQueue.offer(logPack);
+               try {
+                       logPackQueue.put(logPack);
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               }
        }
 
-       protected final LogPackage pollPack() {
-               return logPackQueue.poll();
+       private final LogPackage pollPack() {
+               LogPackage pack = null;
+               try {
+                       if (state == State.RUNNING)
+                               pack = logPackQueue.take();             // wait if empty
+                       else if (state == State.TO_BE_STOPED)
+                               pack = logPackQueue.poll();             // return null if empty
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               }
+               
+               return pack;
        }
-       
+
        protected final void addDBTable(DBTable table) {
                dbTableList.add(table);
        }
-       
+
        public final List<DBTable> getDBTableList() {
                return dbTableList;
        }
-       
-       public final void startThread() {
+
+       public synchronized final void startThread() {
                if (thread == null || !thread.isAlive()) {
                        thread = new Thread(null, this, getName());
+                       state = State.RUNNING;
                        thread.start();
                }
        }
 
-       public final void stopThread() {
+       // "called stopThread" means that there is no more data
+       // coming in this page data manager 
+       // It means that this function should be called only in data offerer
+       // when all data offer is finished.
+       public synchronized final void stopThread() {
                if (thread != null && thread.isAlive()) {
                        try {
-                               onThreadStop();
+                               state = State.TO_BE_STOPED;
                                sendNotify();
                                thread.join(AnalyzerConstants.THREAD_JOIN_WAIT_TIME);
+                               state = State.NOT_RUNNING;
                                thread = null;
+                               logPackQueue.clear();
                                DA_LOG.debug(getName() + " thread joined!"); //$NON-NLS-1$
                        } catch (InterruptedException e) {
                                e.printStackTrace();
@@ -67,17 +99,42 @@ public abstract class PageDataManager implements Runnable {
                return true;
        }
 
-       protected void sendNotify() {
-               logPackQueue.wake();
+       private void sendNotify() {
+               LogPackage endOfStream = new LogPackage();
+               endOfStream.setEndOfStream();
+               
+               try {
+                       logPackQueue.put(endOfStream);
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               }
        }
-       
+
+       @Override
+       public final void run() {
+               while (!AnalyzerManager.isExit()) {
+                       LogPackage pack = pollPack();
+                       if (null == pack || pack.isEndOfStream()) // stop thread
+                               break;
+
+                       makeData(pack);
+               }
+               
+               onThreadStop();
+
+               /* log for debug */
+               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
+       }
+
+       protected abstract void makeData(LogPackage pack);
+
        protected void onThreadStop() {
        }
-       
-       protected void saveData(Map<String, String> dataMap) {
+
+       public void saveData(Map<String, String> dataMap) {
        }
-       
-       protected void openData(Map<String, String> dataMap) {
+
+       public void openData(Map<String, String> dataMap) {
        }
-       
+
 }
index 4fbd928..26d9af8 100755 (executable)
@@ -157,65 +157,80 @@ public class SWAPLogParser implements Runnable {
                                        ProfileData pData = (ProfileData) log;
                                        long pcAddr = pData.getPcAddr();
 
+                                       
+                                       
+                                       
                                        ProcessInfoPackage processInfoPkg = AnalyzerManager
                                                        .getProject().getProcessInfoPackage(pData.getPid());
 
-                                       String apiName = pData.getApiName();
-                                       if (null == apiName || apiName.isEmpty()
-                                                       || apiName.equals("_end")) { //$NON-NLS-1$
-                                               apiName = getFuncName(pData);
-                                               if (apiName == null
-                                                               || apiName.equals("<unknown function>")) {
-                                                       continue;
-                                               } else {
-                                                       pData.setApiName(apiName);
-                                               }
+                                       if (pData.getProbeType() == 4) {
+                                               //System.out.println("log ====>" + pData.getProbeType() + ":" + pData.getProbeSubType());
+                                               //System.out.println("log ====> args:" + pData.getArgs());
                                        }
-
-                                       if (processInfoPkg.isDropLog()) {
-                                               apiName = pData.getApiName();
-                                               if (apiName.contains(OSP_MAIN)) {
-                                                       processInfoPkg.setDropLog(false);
-                                               } else {
-                                                       continue;
+                                       if (pData.getProbeType() == 1) {
+
+                                               String apiName = pData.getApiName();
+                                               if (null == apiName || apiName.isEmpty()
+                                                               || apiName.equals("_end")) { //$NON-NLS-1$
+                                                       apiName = getFuncName(pData);
+                                                       if (apiName == null
+                                                                       || apiName.equals("<unknown function>")) {
+                                                               continue;
+                                                       } else {
+                                                               pData.setApiName(apiName);
+                                                       }
                                                }
-                                       }
 
-                                       // irregular call check still necessary?
-                                       // if (AnalyzerManager.getCallstackManager()
-                                       // .isIrregularUserCall(pData)) {
-                                       // continue;
-                                       // }
-
-                                       ProcessInfo processInfo = processInfoPkg
-                                                       .getProcessInfo(pData.getTime());
-
-                                       // for debug
-                                       // System.out.println(" PROFILE LOG DEBUG = ID: "
-                                       // + pData.getId()
-                                       // + " PC : "
-                                       // + AnalyzerUtil.toHexdecimal(pData.getPcAddr())
-                                       // + " Api : "
-                                       // + pData.getApiName()
-                                       // + " caller :  "
-                                       // + AnalyzerUtil.toHexdecimal(pData.getCallerPcAddr())
-                                       // + "   base addr : "
-                                       // + AnalyzerUtil.toHexdecimal(processInfo
-                                       // .getLowestAddress()));
+                                               //System.out.println("====>" + apiName);
 
-                                       pushLog(log, logPack);
-                                       if (pcAddr >= processInfo.getLowestAddress()
-                                                       && pcAddr <= processInfo.getHighestAddress()) {
-                                               /* user callstack create by entry and exit */
-                                               AnalyzerManager.getCallstackManager()
-                                                               .makeUserCallstack(
-                                                                               pData,
-                                                                               FunctionUsageProfiler.getInstance()
-                                                                                               .getProfileDataMakerByPid(
-                                                                                                               pData.getPid()));
-                                       } else {
-                                               AnalyzerManager.getCallstackManager()
-                                                               .makeCallstackWithoutBacktrace(pData);
+                                               if (processInfoPkg.isDropLog()) {
+                                                       apiName = pData.getApiName();
+                                                       if (apiName.contains(OSP_MAIN)) {
+                                                               processInfoPkg.setDropLog(false);
+                                                       } else {
+                                                               continue;
+                                                       }
+                                               }
+
+                                               // irregular call check still necessary?
+                                               // if (AnalyzerManager.getCallstackManager()
+                                               // .isIrregularUserCall(pData)) {
+                                               // continue;
+                                               // }
+
+                                               ProcessInfo processInfo = processInfoPkg
+                                                               .getProcessInfo(pData.getTime());
+
+                                               // for debug
+                                               // System.out.println(" PROFILE LOG DEBUG = ID: "
+                                               // + pData.getId()
+                                               // + " PC : "
+                                               // + AnalyzerUtil.toHexdecimal(pData.getPcAddr())
+                                               // + " Api : "
+                                               // + pData.getApiName()
+                                               // + " caller :  "
+                                               // + AnalyzerUtil.toHexdecimal(pData.getCallerPcAddr())
+                                               // + "   base addr : "
+                                               // + AnalyzerUtil.toHexdecimal(processInfo
+                                               // .getLowestAddress()));
+
+                                               pushLog(log, logPack);
+                                               if (pcAddr >= processInfo.getLowestAddress()
+                                                               && pcAddr <= processInfo.getHighestAddress()) {
+                                                       /* user callstack create by entry and exit */
+                                                       AnalyzerManager.getCallstackManager()
+                                                                       .makeUserCallstack(
+                                                                                       pData,
+                                                                                       FunctionUsageProfiler.getInstance()
+                                                                                                       .getProfileDataMakerByPid(
+                                                                                                                       pData.getPid()));
+                                               } else {
+                                                       AnalyzerManager.getCallstackManager()
+                                                                       .makeCallstackWithoutBacktrace(pData);
+                                               }
+                                               // for file
+                                       } else if(pData.getProbeType() == 4) {
+                                               pushLog(log, logPack);
                                        }
                                } else {
                                        pushLog(log, logPack);
index ef7c53f..7d5546b 100644 (file)
@@ -36,11 +36,11 @@ import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
 
 public class FileData extends ProbeCommonData {
 
-       long size = 0;
-       long fdValue = 0;
-       int fdApiType = 0; // TODO: short
-       long fileSize = 0;
-       String filePath = null;
+       protected long size = 0;
+       protected long fdValue = 0;
+       protected int fdApiType = 0; // TODO: short
+       protected long fileSize = 0;
+       protected String filePath = null;
        
        public long getSize() {
                return size;
index 68accde..26fff64 100644 (file)
@@ -68,6 +68,7 @@ public class GLES20LogData extends ProbeCommonData {
                prep.setInt(index++, apiType);
                prep.setLong(index++, elapsedTime);
                prep.setString(index++, contextValue);
+
        }
 
        @Override
@@ -79,6 +80,3 @@ public class GLES20LogData extends ProbeCommonData {
                contextValue = rs.getString(index++);
        }
 }
-
-
-
index dc2efc9..619d5b1 100644 (file)
@@ -63,7 +63,6 @@ import org.tizen.dynamicanalyzer.swap.model.format.LogFormat;
 import org.tizen.dynamicanalyzer.swap.model.format.MemoryLogFormat;
 import org.tizen.dynamicanalyzer.swap.model.format.NetworkLogFormat;
 import org.tizen.dynamicanalyzer.swap.model.format.ProfilingLogFormat;
-import org.tizen.dynamicanalyzer.swap.model.format.ReplayLogFormat;
 import org.tizen.dynamicanalyzer.swap.model.format.SceneLogFormat;
 import org.tizen.dynamicanalyzer.swap.model.format.ScreenShotLogFormat;
 import org.tizen.dynamicanalyzer.swap.model.format.SyncLogFormat;
@@ -109,8 +108,8 @@ public class LogDataFactory {
                logList.add(MSG_PROBE_UICONTROL);
                logList.add(MSG_PROBE_UIEVENT);
                logList.add(MSG_PROBE_FILE);
-               logList.add(MSG_PROBE_NETWORK);
-               logList.add(MSG_PROBE_GLES20);
+//             logList.add(MSG_PROBE_NETWORK);
+//             logList.add(MSG_PROBE_GLES20);
                logList.add(MSG_PROBE_LIFECYCLE);
                logList.add(MSG_PROBE_SCREENSHOT);
                logList.add(MSG_PROBE_SCENE);
@@ -120,7 +119,7 @@ public class LogDataFactory {
                logList.add(MSG_DATA_SAMPLE);
                logList.add(MSG_DATA_SYSTEM);
                logList.add(LogCenterConstants.LOG_USER_FUNCTION);
-               logList.add(MSG_DATA_RECORD);
+//             logList.add(MSG_DATA_RECORD);
                logList.add(MSG_FUNCTION_ENTRY);
                logList.add(MSG_FUNCTION_EXIT);
                logList.add(MSG_CONTEXT_SWITCH_ENTRY);
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataSeqNoComparator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/data/LogDataSeqNoComparator.java
new file mode 100644 (file)
index 0000000..7e1cb95
--- /dev/null
@@ -0,0 +1,20 @@
+package org.tizen.dynamicanalyzer.swap.model.data;
+
+import java.util.Comparator;
+
+public class LogDataSeqNoComparator implements Comparator<LogData> {
+
+       @Override
+       public int compare(LogData arg0, LogData arg1) {
+               int seq0 = arg0.getSeq();
+               int seq1 = arg1.getSeq();
+
+               if (seq0 < seq1)
+                       return -1;
+               else if (seq0 > seq1)
+                       return 1;
+               else
+                       return 0;
+       }
+
+}
\ No newline at end of file
index bfbae26..52bfc6d 100644 (file)
@@ -87,15 +87,15 @@ public class ProfileData extends LogData {
 
        public void makeData(byte[] data) {
                super.makeData(data);
+               byte[] temp = new byte[4];
                switch (id) {
                case MSG_FUNCTION_ENTRY:
                        logCount++;
-                       pcAddr = ByteUtils.toLong(data, index);
-                       index += LONG_SIZE;
-                       callerPcAddr = ByteUtils.toLong(data, index);
-                       index += LONG_SIZE;
+                       pid = ByteUtils.toInt(data, index);
+                       index += INT_SIZE;
+                       tid = ByteUtils.toInt(data, index);
+                       index += INT_SIZE;
 
-                       byte[] temp = new byte[4];
                        System.arraycopy(data, index, temp, 0, 2);
                        probeType = ByteUtils.toInt(temp, 0);
                        index += 2;
@@ -104,10 +104,10 @@ public class ProfileData extends LogData {
                        probeSubType = ByteUtils.toInt(temp, 0);
                        index += 2;
 
-                       pid = ByteUtils.toInt(data, index);
-                       index += INT_SIZE;
-                       tid = ByteUtils.toInt(data, index);
-                       index += INT_SIZE;
+                       pcAddr = ByteUtils.toLong(data, index);
+                       index += LONG_SIZE;
+                       callerPcAddr = ByteUtils.toLong(data, index);
+                       index += LONG_SIZE;
                        cpuNum = ByteUtils.toInt(data, index);
                        index += INT_SIZE;
                        ArgsInfo info = LogDataUtils.parseArgs(data, index);
@@ -120,6 +120,15 @@ public class ProfileData extends LogData {
                        index += INT_SIZE;
                        tid = ByteUtils.toInt(data, index);
                        index += INT_SIZE;
+
+                       System.arraycopy(data, index, temp, 0, 2);
+                       probeType = ByteUtils.toInt(temp, 0);
+                       index += 2;
+
+                       System.arraycopy(data, index, temp, 0, 2);
+                       probeSubType = ByteUtils.toInt(temp, 0);
+                       index += 2;
+
                        pcAddr = ByteUtils.toLong(data, index);
                        index += LONG_SIZE;
                        callerPcAddr = ByteUtils.toLong(data, index);
@@ -159,14 +168,22 @@ public class ProfileData extends LogData {
                ProcessInfoPackage processInfoPkg = AnalyzerManager.getProject()
                                .getProcessInfoPackage(pid);
                if (time > 0) {
-                       ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);
-                       BinaryInfo binInfo = processInfo.getTargetBinary(pcAddr);
-                       if (null == binInfo) {
+                       if (null == processInfoPkg) {
                                libName = "unknown";
                        } else {
-                               libName = binInfo.getTargetBinaryPath();
+                               ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);
+                               if (null == processInfo) {
+                                       libName = "unknown";
+                               } else {
+                                       BinaryInfo binInfo = processInfo.getTargetBinary(pcAddr);
+                                       if (null == binInfo) {
+                                               libName = "unknown";
+                                       } else {
+                                               libName = binInfo.getTargetBinaryPath();
+                                       }
+                               // System.out.println("plib name : " + libName);
+                               }
                        }
-                       // System.out.println("plib name : " + libName);
                }
        }
 
index 9c04337..aefac16 100644 (file)
@@ -34,7 +34,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 
 import org.tizen.dynamicanalyzer.common.GlobalInformation;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.swap.model.ByteUtils;
 
@@ -78,8 +77,8 @@ public class SystemData extends LogData {
        String deviceEnergyUsage = null;
        String applicationEnergyUsage = null;
 
-       int callAlpha = 0;
-       int rssiAlpha = 0;
+//     int callAlpha = 0;
+//     int rssiAlpha = 0;
 
        public SystemData() {
        }
@@ -539,21 +538,21 @@ public class SystemData extends LogData {
                this.diskWrittenSectorCount = diskWrittenSectorCount;
        }
 
-       public int getCallAlpha() {
-               return callAlpha;
-       }
-
-       public void setCallAlpha(int callAlpha) {
-               this.callAlpha = callAlpha;
-       }
-
-       public int getRssiAlpha() {
-               return rssiAlpha;
-       }
-
-       public void setRssiAlpha(int rssiAlpha) {
-               this.rssiAlpha = rssiAlpha;
-       }
+//     public int getCallAlpha() {
+//             return callAlpha;
+//     }
+//
+//     public void setCallAlpha(int callAlpha) {
+//             this.callAlpha = callAlpha;
+//     }
+//
+//     public int getRssiAlpha() {
+//             return rssiAlpha;
+//     }
+//
+//     public void setRssiAlpha(int rssiAlpha) {
+//             this.rssiAlpha = rssiAlpha;
+//     }
 
        public int getEnergyUsage() {
                return energyUsage;
@@ -620,9 +619,10 @@ public class SystemData extends LogData {
                prep.setInt(index++, call);
                prep.setInt(index++, dnet);
                prep.setInt(index++, energyUsage);
-
-               prep.setInt(index++, callAlpha);
-               prep.setInt(index++, rssiAlpha);
+               prep.setString(index++, deviceEnergyUsage);
+               prep.setString(index++, applicationEnergyUsage);
+//             prep.setInt(index++, callAlpha);
+//             prep.setInt(index++, rssiAlpha);
        }
 
        @Override
@@ -664,9 +664,10 @@ public class SystemData extends LogData {
                call = rs.getInt(index++);
                dnet = rs.getInt(index++);
                energyUsage = rs.getInt(index++);
-
-               callAlpha = rs.getInt(index++);
-               rssiAlpha = rs.getInt(index++);
+               deviceEnergyUsage = rs.getString(index++);
+               applicationEnergyUsage = rs.getString(index++);
+//             callAlpha = rs.getInt(index++);
+//             rssiAlpha = rs.getInt(index++);
        }
 
        @Override
index a46c83f..d4d04e9 100755 (executable)
@@ -107,7 +107,7 @@ public class LogFormat {
                        logFormats.add(ControlLogFormat.getInstance());
                        logFormats.add(CustomChartLogFormat.getInstance());
                        logFormats.add(FileLogFormat.getInstance());
-                       logFormats.add(NetworkLogFormat.getInstance());
+       //              logFormats.add(NetworkLogFormat.getInstance());
                        logFormats.add(LifeCycleLogFormat.getInstance());
                        logFormats.add(MemoryLogFormat.getInstance());
                        logFormats.add(ProfilingLogFormat.getInstance());
index 1967b59..48bedd8 100644 (file)
@@ -50,7 +50,7 @@ public class SystemLogFormat extends LogFormat {
                                "NetworkReceiveSize","WiFi", "BlueTooth", "GPS", "Brightness",
                                "Camera", "Sound","Audio", "Vibration", "Voltage",
                                "Rssi", "Video", "CallValue","Dnet", "Energy",
-                               "CallAlpha", "RssiAlpha"};
+                               "EnergyPerDevice", "AppEnergyPerDevice"};
                dbColumnNames = new ArrayList<String>();
                dbColumnNames.addAll(HeaderColumns.getDBColumnNames());
                dbColumnNames.addAll(Arrays.asList(dcn));
@@ -63,7 +63,7 @@ public class SystemLogFormat extends LogFormat {
                                I, I, I, I, I,
                                I, I, I, I, I,
                                I,  I, I,
-                               I, I, I};
+                               I, T, T};
                dbColumnTypes = new ArrayList<Integer>();
                dbColumnTypes.addAll(HeaderColumns.getDBColumntypes());
                dbColumnTypes.addAll(Arrays.asList(dct));
@@ -76,7 +76,7 @@ public class SystemLogFormat extends LogFormat {
                                "Disk Sectors Written", "Network Send Size,", "Network Receive Size",
                                "WiFi", "BlueTooth", "GPS", "Brightness", "Camera", "Sound",
                                "Audio", "Vibration", "Voltage", "Rssi", "Video", "Call",
-                               "Dnet", "Energy", "CallAlpha", "RssiAlpha"  };
+                               "Dnet", "Energy", "Energy Usage Per Devices", "Application Energy Usage"  };
                tableColumnNames = new ArrayList<String>();
                tableColumnNames.addAll(HeaderColumns.getTableColumnNames());
                tableColumnNames.addAll(Arrays.asList(tcn));
@@ -89,7 +89,7 @@ public class SystemLogFormat extends LogFormat {
                                I, I, I, I, I,
                                I, I, I, I, I,
                                I,  I, I,
-                               I, I, I}; 
+                               I, S, S}; 
                logColumnTypes = new ArrayList<Integer>();
                logColumnTypes.addAll(HeaderColumns.getLogColumnTypes());
                logColumnTypes.addAll(Arrays.asList(types));
index 006829a..e97f07e 100644 (file)
@@ -4,8 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
- * Hyunjong Park <phjwithyou.park@samsung.com> 
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Hyeran kim <hyearn74.kim@samsung.com> 
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -47,6 +46,10 @@ import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
+import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+
 
 public class FileApiListTable extends DAApiListTableComposite {
        public FileApiListTable(Composite parent, int compStyle, int tableStyle) {
@@ -78,10 +81,10 @@ public class FileApiListTable extends DAApiListTableComposite {
                                                endTime = itemTime;
                                        }
                                }
-
                                DASelectionData selData = new DASelectionData(
                                                FilePage.apilistViewID, startTime, endTime, items,
                                                table);
+                               
                                AnalyzerManager.getCurrentPage().updateView(selData);
                        }
 
@@ -96,22 +99,19 @@ public class FileApiListTable extends DAApiListTableComposite {
                FileApiListView view = (FileApiListView) AnalyzerManager
                                .getCurrentPage().getView(FilePage.apilistViewID);
 
-               FileChartData data = view.getPageData();
-               if (null == data) {
-                       return null;
-               }
-
                long rangeStartTime = view.getRangeStartTime();
                long rangeEndTime = view.getRangeEndTime();
-
-               List<TableInput> input = new ArrayList<TableInput>();
-               List<FileChartDataEvent> contents = data.getContents();
+               
                HashMap<String, Integer> findStartAPITableIndexHashMap = new HashMap<String, Integer>();
                List<Integer> removeTableIndex = new ArrayList<Integer>();
-               FileChartDataEvent content;
+               List<TableInput> input = new ArrayList<TableInput>();
+               
+               List<FileEvent> contents = FileDataManager.getInstance().getSelectedTableAPIList();
+               if(contents == null) {
+                       return null;
+               }
                for (int i = 0; i < contents.size(); i++) {
-                       content = contents.get(i);
-                       FileData contentTemp = content.getContents();
+                       FileEvent contentTemp = contents.get(i);
                        int selectedPid = ToolbarArea.getInstance().getSelectedPid();
                        if (selectedPid != 0) {
                                if (selectedPid != contentTemp.getPid()) {
@@ -147,8 +147,7 @@ public class FileApiListTable extends DAApiListTableComposite {
                                        contentData.add(input.get(startLogIndex.intValue())
                                                        .getText().get(1));
 
-                                       long startTime = contents.get(startLogIndex.intValue())
-                                                       .getContents().getTime();
+                                       long startTime = contents.get(startLogIndex.intValue()).getTime();
                                        String timeFormat = Formatter
                                                        .toTimeFormat(time - startTime);
                                        String removeTimeFormat = timeFormat.replace(
@@ -180,6 +179,9 @@ public class FileApiListTable extends DAApiListTableComposite {
 
                        contentText.add(Integer.toString(contentTemp.getTid()));
                        contentData.add(Integer.toString(contentTemp.getTid()));
+                       
+                       contentText.add(Long.toString(contentTemp.getFdValue()));
+                       contentData.add(Long.toString(contentTemp.getFdValue()));
 
                        contentText.add(contentTemp.getApiName());
                        contentData.add(contentTemp.getApiName());
index cc104cf..c9042a2 100644 (file)
@@ -4,8 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
- * Hyunjong Park <phjwithyou.park@samsung.com> 
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Hyeran kim <hyearn74.kim@samsung.com> 
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 package org.tizen.dynamicanalyzer.ui.file;
 
-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;
 import org.eclipse.swt.widgets.Control;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.nl.FilePageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+import org.tizen.dynamicanalyzer.ui.file.model.FileSelectedData;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
 
 public class FileApiListView extends DAViewComposite {
-       private FileChartData data;
        private long analysisStartTime = 0;
        private long analysisEndTime = 0;
-       private long selectionStartTime = 0;
-       private long selectionEndTime = 0;
        private int preSelectionPId = 1;
+       private long preAnalysisStartTime = 0;
+       private long preAnalysisEndTime = 0;
+       private FileSelectedData selectedData = null;
 
        private String[] columnNames = { FilePageLabels.FILE_API_LIST_VIEW_INDEX,
                        FilePageLabels.FILE_API_LIST_VIEW_START_TIME,
                        FilePageLabels.FILE_API_LIST_VIEW_ELAPSED_TIME,
                        FilePageLabels.FILE_API_LIST_VIEW_PID,
                        FilePageLabels.FILE_API_LIST_VIEW_THREAD_ID,
+                       FilePageLabels.FILE_API_LIST_VIEW_FD,
                        FilePageLabels.FILE_API_LIST_VIEW_API,
                        FilePageLabels.FILE_API_LIST_VIEW_PARAMETER,
                        FilePageLabels.FILE_API_LIST_VIEW_RETURN,
                        FilePageLabels.FILE_API_LIST_VIEW_ERRNO };
 
-       private int[] columnSizes = { 40, 70, 100, 40, 40, 120, 250, 70, 100 };
+       private int[] columnSizes = { 40, 70, 100, 40, 40, 40, 120, 250, 70, 100 };
        private int[] columnAlignment = { SWT.RIGHT, SWT.RIGHT, SWT.RIGHT,
-                       SWT.RIGHT, SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.LEFT };
+                       SWT.RIGHT, SWT.RIGHT, SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.LEFT };
 
        int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_STRING,
                        AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+                       AnalyzerConstants.SORT_TYPE_NUM, 
+                       AnalyzerConstants.SORT_TYPE_NUM,
+                       AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_STRING,
                        AnalyzerConstants.SORT_TYPE_STRING,
                        AnalyzerConstants.SORT_TYPE_STRING,
                        AnalyzerConstants.SORT_TYPE_STRING };
 
        FileApiListTable tableComp = null;
+       FileDataManager manager = FileDataManager.getInstance();
 
        public FileApiListView(Composite parent, int style) {
                super(parent, style, true);
@@ -99,13 +104,30 @@ public class FileApiListView extends DAViewComposite {
 
        @Override
        public void updateView() {
-               if (null == data) {
+               if (null == tableComp || selectedData == null) {
                        return;
                }
 
+               if (isUpdateTable()) {
+                       tableComp.updateTable();
+               }
+       }
+
+       private boolean isUpdateTable() {
+               boolean isUpdate = false;
+               
+               // if preSelected PID is different with current selected PID, update
+               // table 
+               int selectedPid = ToolbarArea.getInstance().getSelectedPid();
+               if (preSelectionPId != -1 && preSelectionPId != selectedPid) {
+                       isUpdate = true;
+               }
+               preSelectionPId = selectedPid;
+
+               // if analyzer is changed, set the start and end time with changed
+               // analyzer and update table
                long newAnalysisStartTime = 0;
                long newAnalysisEndTime = 0;
-
                if (RangeDataManager.getInstance().isBeingAnalyzed()) {
                        newAnalysisStartTime = RangeDataManager.getInstance()
                                        .getAnalysisStartTime();
@@ -115,82 +137,26 @@ public class FileApiListView extends DAViewComposite {
                        newAnalysisStartTime = 0;
                        newAnalysisEndTime = 0;
                }
-
-               if (newAnalysisStartTime != analysisStartTime
-                               || newAnalysisEndTime != analysisEndTime) {
-                       analysisStartTime = newAnalysisStartTime;
-                       analysisEndTime = newAnalysisEndTime;
-                       tableComp.updateTable();
-                       return;
-               }
-
-               int selectedPid = ToolbarArea.getInstance().getSelectedPid();
-               if (preSelectionPId != -1 && preSelectionPId != selectedPid) {
-                       tableComp.updateTable();
-               }
-               preSelectionPId = selectedPid;
-
-               if (tableComp.getTable().getItemCount() > 0
-                               && data.getContents().size() != tableComp.getTable()
-                                               .getItemCount()) {
-                       tableComp.updateTable();
+               if (newAnalysisStartTime != preAnalysisStartTime
+                               || newAnalysisEndTime != preAnalysisEndTime) {
+                       preAnalysisStartTime = newAnalysisStartTime;
+                       preAnalysisEndTime = newAnalysisEndTime;
+                       isUpdate = true;
                }
-
-       }
-
-       @Override
-       public void updateView(DAViewData data) {
-               if (!(data instanceof DASelectionData))
-                       return;
                
-               DASelectionData seldata = (DASelectionData) data;
-               
-               if(seldata.isLogData()) {
-                       Object odata = seldata.getData();
-                       if(!(odata instanceof LogData) || odata == null)
-                               return;
-                       
-                       LogData ldata = (LogData) odata;
-                       
-                       int seq = ldata.getSeq();
-                       tableComp.updateTable();
-                       int nSize = tableComp.getTable().getItemCount();
-                       for (int ii = 0; ii < nSize; ii++) {
-                               if (tableComp.getTable().getItem(ii).getText(0)
-                                               .equals(Integer.toString(seq))) {
-                                       tableComp.getTable().setSelection(ii);
-                                       tableComp
-                                                       .getTable()
-                                                       .getVerticalBar()
-                                                       .setSelection(
-                                                                       getScrollSelectionIndex(tableComp.getTable(),
-                                                                                       ii));
-                                       tableComp.updateTable();
-                               }
+               // if new event is put from swap, update table 
+               List<FileEvent> events = manager.getApiDB().selectAPITable(
+                               selectedData.getDentry(), selectedData.getPid(),
+                               selectedData.getTid(), selectedData.isParentChart());
+               if(events != null) {
+                       if (tableComp.getTable().getItemCount() > 0
+                                       && events.size() != tableComp.getTable().getItemCount()) {
+                               manager.setSelectedTableAPIList(events);
+                               isUpdate = true;
                        }
-                       long selectedTime = ldata.getTime();
-                       DASelectionData selection = new DASelectionData(FilePage.apilistViewID,
-                                       selectedTime, selectedTime,
-                                       tableComp.getTable().getSelection(), tableComp.getTable());
-                       AnalyzerManager.getCurrentPage().updateView(selection);
-               } else {
-                       if (!(seldata.getData() instanceof FileChartData)) {
-                               selectionStartTime = seldata.getStartTime();
-                               selectionEndTime = seldata.getEndTime();
-                       } else {
-                               this.data = (FileChartData) seldata.getData();
-                       }
-                       tableComp.getTable().removeAll();
-                       tableComp.updateTable();
-                       tableComp.setSelectionByTime(selectionStartTime, selectionEndTime);
                }
-       }
-
-       private int getScrollSelectionIndex(Grid table, int selection) {
-               int size = table.getVerticalBar().getThumb() / 2;
-               int output = selection - size;
-               output = (output < 0) ? 0 : output;
-               return output;
+               
+               return isUpdate;
        }
 
        @Override
@@ -201,11 +167,33 @@ public class FileApiListView extends DAViewComposite {
        @Override
        public void clear() {
                tableComp.getTable().removeAll();
-               data = null;
+       }
+       
+       @Override
+       public void updateView(DAViewData data) {
+               DASelectionData selData = (DASelectionData) data;
+               long selectionStartTime = selData.getStartTime();
+               long selectionEndTime = selData.getEndTime();
+               if (selData.getData() instanceof FileSelectedData) {
+                       selectedData = (FileSelectedData) selData.getData();
+                       if (null == selectedData) {
+                               return;
+                       }
+                       manager.setSelectedTableAPIList(
+                                       manager.getApiDB().
+                                       selectAPITable(selectedData.getDentry(),
+                                                       selectedData.getPid(), 
+                                                       selectedData.getTid(), 
+                                                       selectedData.isParentChart()));
+
+                       tableComp.updateTable();
+                       tableComp.setSelectionByTime(selectionStartTime,
+                                       selectionEndTime);
+               }
        }
 
-       public FileChartData getPageData() {
-               return data;
+       public FileSelectedData getSelectedData() {
+               return selectedData;
        }
 
        public long getRangeStartTime() {
  * 
  */
 
-package org.tizen.dynamicanalyzer.ui.file.view;
+package org.tizen.dynamicanalyzer.ui.file;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.swt.graphics.Color;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
-import org.tizen.dynamicanalyzer.ui.file.FileChartData;
 import org.tizen.dynamicanalyzer.ui.file.model.FileAccess;
 import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
 import org.tizen.dynamicanalyzer.ui.file.model.FileStatus;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.Formatter;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
@@ -64,6 +58,7 @@ public class FileChart {
        private String filePath = null;
        private int pid = -1;
        private int tid = -1;
+       private long fd = -1;
        private long fileSize = 0;
        
        private List<FileEvent> statusList = new ArrayList<FileEvent>(); // only open, close event
@@ -74,9 +69,6 @@ public class FileChart {
        private boolean isReading = false;
        
        private double fileOpenedTime = 0;
-       private long fileClosedTime = 0;
-       private long fileLastUsedTime = 0;
-       private long fileTotalUsedTime = 0;
        
        public FileChart(String filePath) {
                this.filePath = filePath;
@@ -86,17 +78,19 @@ public class FileChart {
                this.dentry = dentry;
        }
        
-       public FileChart(String filePath, int pid, int tid) {
+       public FileChart(String filePath, int pid, int tid, long fd) {
                this.filePath = filePath;
                this.pid = pid;
                this.tid = tid;
+               this.fd = fd;
        }
        
-       public FileChart(long dentry, int pid, int tid, String filePath, long fileSize) {
+       public FileChart(long dentry, int pid, int tid, long fd,  String filePath, long fileSize) {
                this.dentry = dentry;
                this.filePath = filePath;
                this.pid = pid;
                this.tid = tid;
+               this.fd = fd;
                this.fileSize = fileSize;
        }
 
@@ -117,7 +111,10 @@ public class FileChart {
                }
        }
        
-       // TODO check
+       /**
+        * update api series chart
+        * @param apiList
+        */
        public void updateApiSeries(List<FileEvent> apiList){
                for(FileEvent event : apiList) {
                        if(event.getDentry() != this.dentry || 
@@ -125,13 +122,13 @@ public class FileChart {
                                        event.getTid() != this.tid) {
                                continue;
                        }
-                       double time = event.getEventTime() / TimelineConstants.MEGA_DOUBLE;
+                       double time = event.getTime() / TimelineConstants.MEGA_DOUBLE;
                        String apiName = event.getApiName();
                        Color color = ColorResources.FILE_OTHER_OPERATION;
-                       if (event.getErrNo() != 0) {
+                       if (event.getErrno() != 0) {
                                color = ColorResources.FILE_API_FAILED;
                        } else {
-                               int id = event.getApiType(); 
+                               int id = event.getFdApiType(); 
                                if( id == LogCenterConstants.FD_API_TYPE_READ_START
                                                || id ==  LogCenterConstants.FD_API_TYPE_READ_END
                                                || id == LogCenterConstants.FD_API_TYPE_WRITE_START
@@ -149,7 +146,10 @@ public class FileChart {
                chart.redraw();
        }
        
-       // TODO check
+       /**
+        * update access series chart - read/write/lock event
+        * @param accessList
+        */
        public void updateAccessSeries(List<FileAccess> accessList) {
                for(FileAccess data : accessList) {
                        if(data.getDentry() != this.dentry ||
@@ -164,6 +164,7 @@ public class FileChart {
                        
                        switch(data.getApiType()){
                        case LogCenterConstants.FD_API_TYPE_READ_START:
+                               // if a file is already read by other thread or process(concurrent read)
                                if(data.isAlreadyReading()) {
                                        accessSeries.addSeriesItem(new DAChartSeriesItem(
                                                        startTime, DAChartSeriesItem.SERIES_AREA_START,
@@ -172,7 +173,7 @@ public class FileChart {
                                                        FilePageLabels.FILE_CHART_TOOLTIP_READ));
                                        if(endTime > 0) { // if endTime <= 0, still accessing 
                                                accessSeries.addSeriesItem(new DAChartSeriesItem(
-                                                               startTime, DAChartSeriesItem.SERIES_AREA_END,
+                                                               endTime, DAChartSeriesItem.SERIES_AREA_END,
                                                                ColorResources.FILE_ACCESS_READ, 
                                                                ColorResources.FILE_ACCESS_READ, true,
                                                                FilePageLabels.FILE_CHART_TOOLTIP_READ));
@@ -185,7 +186,7 @@ public class FileChart {
                                                        FilePageLabels.FILE_CHART_TOOLTIP_READ));
                                        if(endTime > 0) {
                                                accessSeries.addSeriesItem(new DAChartSeriesItem(
-                                                               startTime, DAChartSeriesItem.SERIES_AREA_END,
+                                                               endTime, DAChartSeriesItem.SERIES_AREA_END,
                                                                ColorResources.FILE_ACCESS_READ, 
                                                                ColorResources.FILE_ACCESS_READ, false,
                                                                FilePageLabels.FILE_CHART_TOOLTIP_READ));
@@ -193,6 +194,7 @@ public class FileChart {
                                }
                                break;
                        case LogCenterConstants.FD_API_TYPE_WRITE_START:
+                               // if a file is already wrote by other thread or process(concurrent write)
                                if(data.isAlreadyWriting()) {
                                        accessSeries.addSeriesItem(new DAChartSeriesItem(
                                                        startTime, DAChartSeriesItem.SERIES_AREA_START,
@@ -201,7 +203,7 @@ public class FileChart {
                                                        FilePageLabels.FILE_CHART_TOOLTIP_WRITE));
                                        if(endTime > 0) { // if endTime <= 0, still accessing 
                                                accessSeries.addSeriesItem(new DAChartSeriesItem(
-                                                               startTime, DAChartSeriesItem.SERIES_AREA_END,
+                                                               endTime, DAChartSeriesItem.SERIES_AREA_END,
                                                                ColorResources.FILE_ACCESS_WRITE, 
                                                                ColorResources.FILE_ACCESS_WRITE, true,
                                                                FilePageLabels.FILE_CHART_TOOLTIP_WRITE));
@@ -214,7 +216,7 @@ public class FileChart {
                                                        FilePageLabels.FILE_CHART_TOOLTIP_WRITE));
                                        if(endTime > 0) {
                                                accessSeries.addSeriesItem(new DAChartSeriesItem(
-                                                               startTime, DAChartSeriesItem.SERIES_AREA_END,
+                                                               endTime, DAChartSeriesItem.SERIES_AREA_END,
                                                                ColorResources.FILE_ACCESS_WRITE, 
                                                                ColorResources.FILE_ACCESS_WRITE, false,
                                                                FilePageLabels.FILE_CHART_TOOLTIP_WRITE));
@@ -229,8 +231,8 @@ public class FileChart {
                                                FilePageLabels.FILE_CHART_TOOLTIP_LOCK));
                                if(endTime > 0){
                                        lockSeries.addSeriesItem(new DAChartSeriesItem(
-                                                       startTime, DAChartSeriesItem.SERIES_AREA_START,
-                                                       ColorResources.FILE_LOCK_ACQUIRED, 
+                                                       endTime, DAChartSeriesItem.SERIES_AREA_END,
+                                                       ColorResources.FILE_LOCK_ACQUIRED,
                                                        ColorResources.FILE_LOCK_ACQUIRED, false,
                                                        FilePageLabels.FILE_CHART_TOOLTIP_LOCK));
                                }
@@ -240,7 +242,10 @@ public class FileChart {
                chart.redraw();
        }
        
-       // TODO only parent, open/close, duplicated open/close
+       /**
+        * update status series chart - open/close event
+        * @param statusList
+        */
        public void updateStatusSeries(List<FileStatus> statusList) {
                int openNum = 0;
                int closeNum = 0;
@@ -250,7 +255,7 @@ public class FileChart {
                                        || data.getErrNo() != 0) {
                                continue;
                        }
-                       double time = data.getEventTime() / TimelineConstants.MEGA_DOUBLE;
+                       double time = Formatter.toLongTimeForDoubleTime(data.getEventTime());
                        switch(data.getApiType()){
                        case LogCenterConstants.FD_API_TYPE_OPEN:
                                if(openNum > 0){ // duplicated open
@@ -277,8 +282,9 @@ public class FileChart {
                                                        ColorResources.FILE_OPENED,
                                                        ColorResources.FILE_OPENED,
                                                        FilePageLabels.FILE_CHART_TOOLTIP_CLOSED));
-                       
-                               }else if((openNum-closeNum) == 1){ // duplicated close
+                                       openNum = 0;
+                                       closeNum = 0;
+                               } else { // duplicated close
                                        statusSeries.addSeriesItem(new DAChartSeriesItem(
                                                        time, DAChartSeriesItem.SERIES_AREA_END,
                                                        ColorResources.FILE_DUPLICATE_OPENED,
@@ -424,4 +430,13 @@ public class FileChart {
        public void getFileSize(long fileSize) {
                this.fileSize = fileSize;
        }
+       
+       public long getFd() {
+               return fd;
+       }
+       
+       public void setFd(long fd) {
+               this.fd = fd;
+       }
+
 }
\ No newline at end of file
@@ -24,7 +24,7 @@
  * 
  */
 
-package org.tizen.dynamicanalyzer.ui.file.view;
+package org.tizen.dynamicanalyzer.ui.file;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -32,11 +32,10 @@ import java.util.List;
 import java.util.Map;
 
 import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.DALimit;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
-import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
@@ -48,21 +47,14 @@ import org.tizen.dynamicanalyzer.ui.common.PopupFromSelectionMenuItemClickListen
 import org.tizen.dynamicanalyzer.ui.common.PopupStartMenuItemClickListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
-import org.tizen.dynamicanalyzer.ui.file.FileChartData;
 import org.tizen.dynamicanalyzer.ui.file.data.FileApiDB;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartDataMaker;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataMaker;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
 import org.tizen.dynamicanalyzer.ui.file.model.FileAccess;
 import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
 import org.tizen.dynamicanalyzer.ui.file.model.FileSelectedData;
 import org.tizen.dynamicanalyzer.ui.file.model.FileStatus;
-import org.tizen.dynamicanalyzer.ui.network.NetworkChart;
-import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSelectionType;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.Formatter;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
@@ -74,23 +66,21 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
 import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
 
-public class FileChartBoard extends DAChartBoard{
+public class FileChartBoard extends DAChartBoard {
 
        private List<FileChart> chartList = new ArrayList<FileChart>();
-       private FileChartManager fileChartManager = FileChartManager.getInstance();
+       private FileDataManager fileChartManager = FileDataManager.getInstance();
        private Map<String, Long> fileAccessorMap = new HashMap<String, Long>();
-       private FileChartDataMaker dataMaker;
+       private FileDataMaker dataMaker;
        private FileApiDB apiDB;
-       
+
        public FileChartBoard(Composite parent, String title) {
                super(parent, title);
                dataMaker = fileChartManager.getFileChartDataMaker();
-               //TODO
-               //apiDB = dataMaker.getApiDB();
                apiDB = fileChartManager.getApiDB();
                initIntervalMarkers();
        }
-       
+
        @Override
        protected void callBackScaleChanged() {
                super.callBackScaleChanged();
@@ -108,7 +98,12 @@ public class FileChartBoard extends DAChartBoard{
                layout(true, true);
                super.callBackSizeChanged();
        }
-       
+
+       /**
+        * starting point of processing file information for file chart 1.
+        * FileChartView->updateView : periodic, message received 2.
+        * callBackScaleChanged 3. callBackScrollChanged
+        */
        public void updateChart() {
                clearSeries();
                createChartList();
@@ -116,13 +111,13 @@ public class FileChartBoard extends DAChartBoard{
                updateAccessSeries();
                updateApiSeries();
        }
-       
+
        public void clear() {
                super.clear();
                chartList.clear();
                initIntervalMarkers();
        }
-       
+
        public void clearSeries() {
                if (null == chartList) {
                        return;
@@ -131,22 +126,27 @@ public class FileChartBoard extends DAChartBoard{
                        chart.clearSeries();
                }
        }
-       
-       // create chart rows
+
+       /**
+        * create chart rows
+        */
        private void createChartList() {
                FileChart parent = null;
                FileChart child = null;
-               long dentry = -1;
+               long dentry = 0;
                String key = null;
 
-               List<FileEvent> eventList =  dataMaker.getFileEventList();
-               if(eventList == null){
+               List<FileEvent> eventList = dataMaker.getFileEventList();
+               if (eventList == null) {
+                       // no file event at all.
                        return;
                }
-               for(FileEvent event : eventList) {
+
+               for (FileEvent event : eventList) {
+                       // TODO need to think about what value could be a key
                        key = createKey(event.getPid(), event.getTid());
-                       if(event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN){
-                               if(fileAccessorMap.get(key) == null) {
+                       if (event.getFdApiType() == LogCenterConstants.FD_API_TYPE_OPEN) {
+                               if (fileAccessorMap.get(key) == null) {
                                        fileAccessorMap.put(key, event.getDentry());
                                }
                        }
@@ -154,10 +154,10 @@ public class FileChartBoard extends DAChartBoard{
                        parent = getParentChart(dentry);
                        if (parent == null) {
                                parent = new FileChart(dentry);
-                               //TODO target process'file name only
+                               // TODO change to origin file path
                                parent.setFilePath(event.getFilePath());
-                               child = new FileChart(dentry, event.getPid(), event.getTid(), event.getFilePath(),
-                                               event.getFileSize());
+                               child = new FileChart(dentry, event.getPid(), event.getTid(),
+                                               event.getFdValue(), event.getFilePath(), event.getFileSize());
                                parent.addChild(child);
                                createChartItem(null, parent);
                                createChartItem(parent, child);
@@ -165,8 +165,9 @@ public class FileChartBoard extends DAChartBoard{
                                chartList.add(child);
                        } else {
                                child = parent.getChildChart(event);
-                               if(child == null){
-                                       child = new FileChart(dentry, event.getPid(), event.getTid(),  event.getFilePath(),
+                               if (child == null) {
+                                       child = new FileChart(dentry, event.getPid(),
+                                                       event.getTid(), event.getFdValue(), event.getFilePath(),
                                                        event.getFileSize());
                                        parent.addChild(child);
                                        createChartItem(parent, child);
@@ -175,34 +176,45 @@ public class FileChartBoard extends DAChartBoard{
                        }
                }
        }
-       
+
+       /**
+        * Drawing the chart title 1. parent: file name: max 2line, last: ... 2.
+        * child: "pid(PID) \n tid(TID)"
+        * 
+        * @param parent
+        * @param fileChart
+        */
        private void createChartItem(FileChart parent, FileChart fileChart) {
                DAChartBoardItem item;
                DAChart chart;
-       
-               if(parent != null){     // child chart row
+
+               if (parent != null) { // child chart row
                        DAChartBoardItem parentItem = parent.getItem();
-                       item = new DAChartBoardItem (parentItem, "0x"//$NON-NLS-1$
-                                       + Long.toHexString(fileChart.getPid()) + "(PID)"
+                       item = new DAChartBoardItem(parentItem, "0x"//$NON-NLS-1$
+                                       + Long.toHexString(fileChart.getPid())
+                                       + "(PID)"
                                        + CommonConstants.NEW_LINE
-                                       + Long.toHexString(fileChart.getTid()) + "(TID)"
-                                       );
+                                       + Long.toHexString(fileChart.getTid()) + "(TID)");
                        chart = item.getChart();
+                       // TODO change dentry to origin file path
                        item.setData(new FileSelectedData(fileChart.getDentry(), fileChart
-                                       .getPid(), fileChart.getTid(), false));
+                                       .getPid(), fileChart.getTid(), fileChart.getFd(), false));
                        initFileChart(chart, false);
                } else { // parent chart row
                        String fileName = fileChart.getFileName();
                        String title = fileName;
-                       if (fileName.length() > 12) {
-                               title = fileName.substring(0, 12)
-                                                       + CommonConstants.NEW_LINE
-                                                       + fileName.substring(12, fileName.length());
+                       int maxLen = DALimit.MAX_STRING_LENGTH;
+                       if (fileName.length() > maxLen && fileName.length() < maxLen * 2) {
+                               title = fileName.substring(0, maxLen) + CommonConstants.NEW_LINE
+                                               + fileName.substring(maxLen, fileName.length());
+                       } else if (fileName.length() >= maxLen *2) {
+                               title = fileName.substring(0, maxLen) + CommonConstants.NEW_LINE
+                                               + fileName.substring(maxLen, maxLen*2 - 1) + "...";
                        }
                        item = new DAChartBoardItem(this, title);
                        item.setData(new FileSelectedData(fileChart.getDentry(), fileChart
-                                       .getPid(), fileChart.getTid(), true, fileChart
-                                       .getFilePath(), fileChart.getFileSize()));
+                                       .getPid(), fileChart.getTid(), fileChart.getFd(), true,
+                                       fileChart.getFilePath(), fileChart.getFileSize()));
                        chart = item.getChart();
                        initFileChart(chart, true);
                }
@@ -210,97 +222,107 @@ public class FileChartBoard extends DAChartBoard{
                fileChart.setItem(item);
                chart.redraw();
        }
-       
-       // update file open status 
+
+       /**
+        * update file open status
+        */
        private void updateStatusSeries() {
-               if(chartList.size() > 0) {
-                       List<FileStatus> statusList = getVisibleSatausList();
+               if (chartList.size() > 0) {
+                       List<FileStatus> statusList = getVisibleStatusList();
                        for (FileChart chart : chartList) {
-                               if(!chart.isParentChart()) {
+                               if (!chart.isParentChart()) {
                                        continue;
                                }
                                chart.updateStatusSeries(statusList);
                        }
                }
        }
-       
-       // update file access status 
+
+       /**
+        * update file access status
+        */
        private void updateAccessSeries() {
-               if(chartList.size() >0) {
+               if (chartList.size() > 0) {
                        List<FileAccess> accessList = getVisibleAccessList();
                        for (FileChart chart : chartList) {
                                chart.updateAccessSeries(accessList);
                        }
                }
        }
-       
-       // update file api
+
+       /**
+        * update file api
+        */
        private void updateApiSeries() {
-               if(chartList.size() >0) {
-                       List<FileEvent> apiList = apiDB.selectAPISeries(getVisibleStartTime(),
-                                       getVisibleEndTime());
+               if (chartList.size() > 0) {
+                       List<FileEvent> apiList = apiDB.selectAPISeries(
+                                       getVisibleStartTime(), getVisibleEndTime());
                        if (null == apiList) {
+                               // no file event within the selected time range.
                                return;
                        }
                        for (FileChart chart : chartList) {
-                               if(chart.isParentChart()){
+                               if (chart.isParentChart()) {
                                        continue;
                                }
                                chart.updateApiSeries(apiList);
                        }
+               } else { // chartList.size() <= 0
+                                       // no data at all
                }
        }
-       
+
        private FileChart getParentChart(long dentry) {
                for (FileChart chart : chartList) {
-                       if (chart.getDentry() == dentry
-                                       && chart.isParentChart()) {
+                       if (chart.getDentry() == dentry && chart.isParentChart()) {
                                return chart;
                        }
                }
                return null;
        }
-       
+
        private String createKey(int pid, int tid) {
                StringBuffer key = new StringBuffer(pid);
                key.append(":");
                key.append(tid);
                return key.toString();
        }
-       
-       private List<FileStatus> getVisibleSatausList() {
+
+       private List<FileStatus> getVisibleStatusList() {
                return dataMaker.getFileStatusList();
        }
-       
+
        private List<FileAccess> getVisibleAccessList() {
                List<FileAccess> data = new ArrayList<FileAccess>();
-               for(FileAccess access : dataMaker.getFileAccessList()){
-                       double startTime = access.getStartTime() / TimelineConstants.MEGA_DOUBLE;
-                       double endTime = access.getEndTime() / TimelineConstants.MEGA_DOUBLE;
-                       if ( startTime >= getVisibleStartTime()
+               for (FileAccess access : dataMaker.getFileAccessList()) {
+                       double startTime = Formatter.toLongTimeForDoubleTime(access
+                                       .getStartTime());
+                       double endTime = Formatter.toLongTimeForDoubleTime(access
+                                       .getEndTime());
+                       if (startTime >= getVisibleStartTime()
                                        && startTime <= getVisibleEndTime()) {
                                data.add(access);
                        } else if (endTime >= getVisibleStartTime()
                                        && endTime <= getVisibleEndTime()) {
                                data.add(access);
-                       } else if (endTime <= 0) { // ing
+                       } else if (endTime <= 0) { // not finished
                                data.add(access);
                        }
                }
                return data;
        }
-       
+
+       // TODO change dentry to origin file path
        public int[] getChartIndex(FileEvent event) {
                FileChart data = null;
                for (int i = 0; i < chartList.size(); i++) {
                        data = chartList.get(i);
-                       if (data.isParentChart() 
-                                       && data.getDentry() == event.getDentry()) {
-                               for(int j = 0; j < data.getChild().size(); j++) {
+                       if (data.isParentChart() && data.getDentry() == event.getDentry()) {
+                               for (int j = 0; j < data.getChild().size(); j++) {
                                        FileChart child = data.getChild().get(i);
-                                       if(child.getPid() == event.getPid()
-                                                       && child.getTid() == event.getTid()){
-                                               return new int[] {i, j};
+                                       if (child.getPid() == event.getPid()
+                                                       && child.getTid() == event.getTid()) {
+                                               return new int[] { i, j };
                                        }
                                }
                        }
@@ -313,9 +335,7 @@ public class FileChartBoard extends DAChartBoard{
                        return;
                }
                DAChartPlot plot = chart.getPlot();
-               if (null == plot) {
-                       return;
-               }
+
                if (isParent) {
                        DAChartSeries statusSeries = new DAChartSeries(
                                        FilePageLabels.FILE_CHART_SERIES,
@@ -325,21 +345,22 @@ public class FileChartBoard extends DAChartBoard{
                } else {
                        DAChartSeries lockSeries = new DAChartSeries(
                                        FilePageLabels.FILE_CHART_API,
-                                       DAChartSeries.SERIES_STYLE_STATE_AREA, ColorResources.YELLOW);
+                                       DAChartSeries.SERIES_STYLE_STATE_AREA,
+                                       ColorResources.YELLOW);
                        chart.addSeries(lockSeries);
-                       
+
                        DAChartSeries accessSeries = new DAChartSeries(
                                        FilePageLabels.FILE_CHART_ACCESS,
-                                       DAChartSeries.SERIES_STYLE_EVENT_AREA, ColorResources.WHITE);
+                                       DAChartSeries.SERIES_STYLE_STATE_AREA, ColorResources.WHITE);
                        chart.addSeries(accessSeries);
                        plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
                }
-               
+
                plot.setAutoHeightRange(AutoRangeType.MANUAL);
                plot.setAxisFont(FontResources.CHART_AXIS_FONT);
                plot.setAxisRangeY(0, 101);
                plot.setAxisRangeX(getVisibleStartTime(), getVisibleEndTime());
-               
+
                DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
                tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
                plot.setTooltip(tooltip);
@@ -375,7 +396,8 @@ public class FileChartBoard extends DAChartBoard{
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
                clearItem.addListener(new PopupClearMenuItemClickListener());
 
-               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+               TimelineChartMouseEventListener timelineChartMouseEventListener =
+                               new TimelineChartMouseEventListener(
                                popupMenu, getTimeline());
                chart.addMouseListener(timelineChartMouseEventListener);
                chart.addMouseMoveListener(timelineChartMouseEventListener);
@@ -383,7 +405,7 @@ public class FileChartBoard extends DAChartBoard{
                                getTimeline()));
                plot.setMarkers(getMarkers());
        }
-       
+
        private void initIntervalMarkers() {
                // selection marker
                DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker(
@@ -407,7 +429,7 @@ public class FileChartBoard extends DAChartBoard{
                addIntervalMarker(rangeMarker);
        }
 
-       public int getChartSize(){
+       public int getChartSize() {
                return chartList.size();
        }
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartData.java
deleted file mode 100644 (file)
index 12f5a1e..0000000
+++ /dev/null
@@ -1,625 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Hyunjong Park <phjwithyou.park@samsung.com> 
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.util.DALogger;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
-
-public class FileChartData {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-       
-       private List<FileChartData> children = new ArrayList<FileChartData>();
-       private DAChartSeries apiSeries;
-       private DAChartSeries accessSeries;
-       private DAChartSeries statueSeries;
-
-       private long fd = -1;
-       private String filePath = AnalyzerLabels.EMPTY_STRING;
-       private boolean isClosedFile = true;
-       private boolean isFailedAPI = false;
-       // for Detail View Data
-       private List<FailedData> failedData = null;
-       private long fileSize = 0;
-       private long readSize = 0;
-       private long writeSize = 0;
-       private double fileOpendTime = 0;
-       private double fileClosedTime = 0;
-       private double fileLastUsedTime = 0;
-       private double fileTotalUsedTime = 0;
-
-       protected DAChartBoardItem item;
-       protected List<FileChartDataEvent> contents = new ArrayList<FileChartDataEvent>();
-       protected List<FileChartDataEvent> contentsQueue = new ArrayList<FileChartDataEvent>();
-
-       protected DAChart chart;
-       protected boolean hasUpdate = false;
-
-       // private int lastAccessIndexForParent = 0;
-
-       public FileChartData(String filePath, long Fd, boolean isRoot) {
-               setFilePath(filePath);
-               setFd(Fd);
-       }
-
-       public void pushChild(FileChartData data) {
-               children.add(data);
-               hasUpdate = true;
-       }
-
-       public DAChartBoardItem getItem() {
-               return item;
-       }
-
-       public DAChart getChart() {
-               return chart;
-       }
-
-       public void setChart(DAChart chart) {
-               this.chart = chart;
-       }
-
-       public void pushEvent(FileChartDataEvent event) {
-               contentsQueue.add(event);
-               makeDetailViewData(event);
-               hasUpdate = true;
-       }
-
-       public void makeDetailViewData(FileChartDataEvent event) {
-               setFileSize(event.getFileSize());
-               setReadSize(event.getReadSize());
-               setWriteSize(event.getWriteSize());
-               if (event.getFailedData() != null) {
-                       getFailedData().add(event.getFailedData());
-               }
-       }
-
-       public List<FailedData> getFailedData() {
-               if (null == failedData) {
-                       failedData = new ArrayList<FailedData>();
-               }
-               return failedData;
-       }
-
-       public List<Integer> getFailedRelations() {
-               List<Integer> output = new ArrayList<Integer>();
-               int size = getFailedData().size();
-               for (int i = 0; i < size; i++) {
-                       FailedData ffd = failedData.get(i);
-                       int seq = ffd.getSeq();
-                       output.add(seq);
-               }
-               return output;
-       }
-
-       public void setHasUpdate() {
-               hasUpdate = true;
-       }
-
-       public List<FileChartDataEvent> getContents() {
-               return contents;
-       }
-
-       public int getChildCount() {
-               return children.size();
-       }
-
-       public List<FileChartData> getChild() {
-               return children;
-       }
-
-       public long getFD() {
-               return fd;
-       }
-
-       public void setFd(long data) {
-               this.fd = data;
-       }
-
-       public void setClosed(boolean data) {
-               this.isClosedFile = data;
-       }
-
-       public boolean isClosed(FileChartDataEvent event) {
-               if (event == null) {
-                       return this.isClosedFile;
-               }
-               if (isParent()) {
-                       this.isClosedFile = true;
-                       for (int i = 0; i < children.size(); i++) {
-
-                               double fileOpendTime = children.get(i).getFileOpendTime();
-                               double fileClosedTime = children.get(i).getFileClosedTime();
-                               if (event.getApiChartTime() == fileOpendTime) {
-                                       this.isClosedFile = true;
-                                       break;
-                               }
-                               if (event.getApiChartTime() < fileOpendTime) {
-                                       continue;
-                               }
-                               if ((event.getApiChartTime() > fileClosedTime)
-                                               && (fileClosedTime != 0)) {
-                                       continue;
-                               }
-                               if (fileClosedTime == 0) {
-                                       if (!children.get(i).isClosed(null)) {
-                                               this.isClosedFile = false;
-                                               break;
-                                       }
-                               }
-                               if (fileOpendTime < event.getApiChartTime()
-                                               && event.getApiChartTime() < fileClosedTime) {
-                                       this.isClosedFile = false;
-                                       break;
-                               }
-                       }
-                       return this.isClosedFile;
-               }
-               return this.isClosedFile;
-       }
-
-       public boolean isFileOpenFailed() {
-               if (isParent()) {
-                       this.isClosedFile = true;
-                       for (int i = 0; i < children.size(); i++) {
-                               if (!children.get(i).isFileOpenFailed()) {
-                                       return false;
-                               }
-                       }
-                       return true;
-               } else {
-                       return isFailedAPI;
-               }
-       }
-
-       public void setFileOpenFailed(boolean data) {
-               this.isFailedAPI = data;
-       }
-
-       public void setFilePath(String name) {
-               this.filePath = name;
-       }
-
-       public String getFilePath() {
-               return filePath;
-       }
-
-       public String getFileName() {
-               String[] splitPath = this.filePath.split("\\/"); //$NON-NLS-1$
-               String fileName = new String(splitPath[splitPath.length - 1]);
-               return fileName;
-       }
-
-       public int getFailedApiCount() {
-               return getFailedData().size();
-       }
-
-       public int getApiCount() {
-               return getContents().size();
-       }
-
-       public void setFileSize(long data) {
-               if (data > 0) {
-                       this.fileSize = data;
-               }
-       }
-
-       public long getFileSize() {
-               return this.fileSize;
-       }
-
-       public void setReadSize(long data) {
-               this.readSize += data;
-       }
-
-       public long getReadSize() {
-               return this.readSize;
-       }
-
-       public void setWriteSize(long data) {
-               this.writeSize += data;
-       }
-
-       public long getWriteSize() {
-               return this.writeSize;
-       }
-
-       private boolean isParent() {
-               boolean isParent = false;
-               if (children.size() > 0) {
-                       isParent = true;
-               } else {
-                       isParent = false;
-               }
-               return isParent;
-       }
-
-       public FileChartData findChildData(FileChartDataEvent event) {
-               int size = children.size();
-               FileChartData ret;
-               for (int i = 0; i < size; i++) {
-                       ret = children.get(i);
-                       if ((ret.getFD() == event.getFd())
-                                       && (ret.isClosed(event) == false)) {
-                               return ret;
-                       }
-               }
-               return null;
-       }
-
-       public void setItem(DAChartBoardItem item) {
-               this.item = item;
-               setChart(item.getChart());
-               apiSeries = chart.getSeries(FilePageLabels.FILE_CHART_API);
-               accessSeries = chart.getSeries(FilePageLabels.FILE_CHART_ACCESS);
-               statueSeries = chart.getSeries(FilePageLabels.FILE_CHART_SERIES);
-
-       }
-
-       public void checkUpdate() {
-               if (false == hasUpdate && AnalyzerManager.isRunning()) {
-                       return;
-               } else {
-                       hasUpdate = false;
-               }
-
-               int size = contentsQueue.size();
-               FileChartDataEvent event = null;
-               if (size > 0) {
-                       for (int i = 0; i < size; i++) {
-                               event = contentsQueue.get(0);
-                               setStatusColor(event);
-                               getContents().add(event);
-                               createChartItem(event);
-                               contentsQueue.remove(0);
-                       }
-                       chart.redraw();
-               }
-
-               size = children.size();
-               if (size > 0) {
-                       FileChartData data;
-                       for (int i = 0; i < size; i++) {
-                               data = children.get(i);
-                               data.checkUpdate();
-                       }
-               }
-
-               if (!AnalyzerManager.isRunning()) {
-                       if (isParent() && (event == null)) {
-                               for (int i = 0; i < size; i++) {
-                                       if ((!children.get(i).isClosed(null))
-                                                       && (children.get(i).getFD() != -1)) {
-                                               setNotClosedFileStatus();
-                                               break;
-                                       }
-                               }
-                       } else {
-                               if (!isClosed(event)) {
-                                       setNotClosedFileStatus();
-                               }
-                       }
-               }
-       }
-
-       private void setStatusColor(FileChartDataEvent event) {
-               if ((isFileOpenFailed()) == true || (event.isFailedAPI() == true)) {
-                       return;
-               }
-               if (event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN) {
-                       if (isParent()) {
-                               if (isClosed(event)) {
-                                       setOpendFileStatus(event);
-                               }
-                       } else {
-                               setOpendFileStatus(event);
-                       }
-               } else if (event.getApiType() == LogCenterConstants.FD_API_TYPE_CLOSE) {
-                       if (isParent()) {
-                               if (isClosed(event)) {
-                                       setClosedFileStatus(event);
-                               }
-                       } else {
-                               setClosedFileStatus(event);
-                       }
-               }
-       }
-
-       private void setOpendFileStatus(FileChartDataEvent event) {
-               DAChartSeriesItem seriesItem = new DAChartSeriesItem(
-                               event.getApiChartTime(),
-                               DAChartSeriesItem.SERIES_STATE_CONTINUE,
-                               ColorResources.FILE_AREA_USED_END,
-                               ColorResources.FILE_AREA_USED_START,
-                               FilePageLabels.FILE_CHART_TOOLTIP_OPEND);
-               statueSeries.addSeriesItem(seriesItem);
-       }
-
-       private void setClosedFileStatus(FileChartDataEvent event) {
-               int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1;
-               if (nStatusLastIndex > -1) {
-                       statueSeries.getSeriesItemList().get(nStatusLastIndex)
-                                       .setColor(ColorResources.FILE_AREA_CLOSED_END);
-                       statueSeries
-                                       .getSeriesItemList()
-                                       .get(nStatusLastIndex)
-                                       .setGradationForegroundColor(
-                                                       ColorResources.FILE_AREA_CLOSED_START);
-                       DAChartSeriesItem seriesItem = new DAChartSeriesItem(
-                                       event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_AREA_CLOSED_END,
-                                       ColorResources.FILE_AREA_CLOSED_START,
-                                       FilePageLabels.FILE_CHART_TOOLTIP_CLOSED);
-                       seriesItem.setBarWidth(0);
-                       statueSeries.addSeriesItem(seriesItem);
-                       statueSeries.getSeriesItemList().get(nStatusLastIndex)
-                                       .setTooltipText(FilePageLabels.FILE_CHART_TOOLTIP_CLOSED);
-               }
-       }
-
-       private void setNotClosedFileStatus() {
-               int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1;
-               if (nStatusLastIndex > -1) {
-                       statueSeries.getSeriesItemList().get(nStatusLastIndex)
-                                       .setColor(ColorResources.FILE_AREA_NOT_ACCESS_END);
-                       statueSeries
-                                       .getSeriesItemList()
-                                       .get(nStatusLastIndex)
-                                       .setGradationForegroundColor(
-                                                       ColorResources.FILE_AREA_NOT_ACCESS_START);
-                       statueSeries.getSeriesItemList().get(nStatusLastIndex)
-                                       .setTooltipText(FilePageLabels.FILE_CHART_TOOLTIP_OPEND);
-               }
-       }
-
-       protected int createChartItem(FileChartDataEvent event) {
-               DAChartSeriesItem seriesItem = null;
-               DAChartSeriesItem accessItem = null;
-               int apiType = event.getApiType();
-               if (event.isFailedAPI() == true) {
-                       seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_API_FAILED, event.getTooltipContent());
-                       apiSeries.addSeriesItem(seriesItem);
-                       return apiType;
-               }
-               switch (apiType) {
-               case LogCenterConstants.FD_API_TYPE_OPEN:
-                       seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_API_USED, event.getTooltipContent());
-                       break;
-               case LogCenterConstants.FD_API_TYPE_CLOSE:
-                       seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_API_USED, event.getTooltipContent());
-                       break;
-               case LogCenterConstants.FD_API_TYPE_READ_START:
-                       seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_API_USED, event.getTooltipContent());
-                       accessItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       event.getApiChartTime(), ColorResources.FILE_ACCESS_READ,
-                                       event.getTooltipContent());
-                       break;
-               case LogCenterConstants.FD_API_TYPE_READ_END:
-                       setAccessSeriesEnd(accessSeries.getSeriesItemList().size() - 1,
-                                       event.getApiChartTime());
-                       break;
-               case LogCenterConstants.FD_API_TYPE_WRITE_START:
-                       seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_API_USED, event.getTooltipContent());
-                       accessItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       event.getApiChartTime(), ColorResources.FILE_ACCESS_WRITE,
-                                       event.getTooltipContent());
-                       break;
-               case LogCenterConstants.FD_API_TYPE_WRITE_END:
-                       setAccessSeriesEnd(accessSeries.getSeriesItemList().size() - 1,
-                                       event.getApiChartTime());
-                       break;
-
-               case LogCenterConstants.FD_API_TYPE_OTHERS:
-                       seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
-                                       DAChartSeriesItem.SERIES_STATE_BAR,
-                                       ColorResources.FILE_API_USED, event.getTooltipContent());
-                       break;
-               default:
-                       DA_LOG.debug("createChartItem : no case FileChartDataEvent");
-                       return -1;
-               }
-               if (seriesItem != null) {
-                       apiSeries.addSeriesItem(seriesItem);
-               }
-               if (accessItem != null) {
-                       accessSeries.addSeriesItem(accessItem);
-               }
-
-               return apiType;
-       }
-
-       public void setAccessSeriesEnd(int lastIndex, double endTime) {
-               if (lastIndex < 0) {
-                       return;
-               }
-               accessSeries.getSeriesItemList().get(lastIndex).setY(endTime);
-       }
-
-       public void setFileOpendTime(double data) {
-               this.fileOpendTime = data;
-       }
-
-       public double getFileOpendTime() {
-               return this.fileOpendTime / TimelineConstants.MEGA_DOUBLE;
-       }
-
-       public void setFileClosedTime(double data) {
-               fileClosedTime = data;
-       }
-
-       public double getFileClosedTime() {
-               return this.fileClosedTime / TimelineConstants.MEGA_DOUBLE;
-       }
-
-       public void setFileLastUsedTime(double data) {
-               fileLastUsedTime = data;
-       }
-
-       public double getFileLastUsedTime() {
-               return this.fileLastUsedTime / TimelineConstants.MEGA_DOUBLE;
-       }
-
-       public void setFileUsedTime(double data) {
-               if (this.fileOpendTime == 0) {
-                       this.setFileTotalUsedTime(0);
-               } else {
-                       this.setFileTotalUsedTime(data - this.fileOpendTime);
-               }
-               setFileLastUsedTime(data);
-       }
-
-       private double parentTotalUsedTime() {
-               List<String> totalUsedTimeList = new ArrayList<String>();
-               boolean firstInputData = false;
-               double fileTotalUsedTime = 0;
-               FileChartData fileData;
-               double firstUsedTime = 0;
-               double lastUsedTime = 0;
-               for (int i = 0; i < children.size(); i++) {
-                       fileData = children.get(i);
-                       firstUsedTime = fileData.getFileOpendTime()
-                                       * TimelineConstants.MEGA_DOUBLE;
-                       lastUsedTime = fileData.getFileLastUsedTime()
-                                       * TimelineConstants.MEGA_DOUBLE;
-                       if (lastUsedTime == 0) {
-                               continue;
-                       } else if (!fileData.isFileOpenFailed() && firstInputData == false) {
-                               firstInputData = true;
-                               totalUsedTimeList
-                                               .add(Double.toString(firstUsedTime)
-                                                               + CommonConstants.COLON
-                                                               + Double.toString(lastUsedTime));
-                       }
-                       int nLastIndex = totalUsedTimeList.size() - 1;
-                       if (nLastIndex < 0) {
-                               continue;
-                       }
-                       String data = totalUsedTimeList.get(nLastIndex);
-                       String[] splitTimeDataList = data.split(CommonConstants.COLON);
-                       double savedFirstUsedTime = Double
-                                       .parseDouble(splitTimeDataList[0]);
-                       double savedLastUsedTime = Double.parseDouble(splitTimeDataList[1]);
-                       if ((savedFirstUsedTime < firstUsedTime)
-                                       && (firstUsedTime < savedLastUsedTime)
-                                       && (savedFirstUsedTime < savedLastUsedTime)
-                                       && (savedLastUsedTime < lastUsedTime)) {
-                               totalUsedTimeList.remove(nLastIndex);
-                               totalUsedTimeList
-                                               .add(Double.toString(savedFirstUsedTime)
-                                                               + CommonConstants.COLON
-                                                               + Double.toString(lastUsedTime));
-                       } else if ((savedLastUsedTime < firstUsedTime)
-                                       && (savedLastUsedTime < lastUsedTime)) {
-                               totalUsedTimeList
-                                               .add(Double.toString(firstUsedTime)
-                                                               + CommonConstants.COLON
-                                                               + Double.toString(lastUsedTime));
-                       } else if ((lastUsedTime < savedFirstUsedTime)
-                                       && (lastUsedTime < savedLastUsedTime)) {
-                               totalUsedTimeList
-                                               .add(Double.toString(firstUsedTime)
-                                                               + CommonConstants.COLON
-                                                               + Double.toString(lastUsedTime));
-                       }
-               }
-               int nSize = totalUsedTimeList.size();
-               for (int i = 0; i < nSize; i++) {
-                       String data = totalUsedTimeList.get(i);
-                       String[] splitTimeDataList = data.split(CommonConstants.COLON); //$NON-NLS-1$
-                       double savedFirstUsedTime = Double
-                                       .parseDouble(splitTimeDataList[0]);
-                       double savedLastUsedTime = Double.parseDouble(splitTimeDataList[1]);
-                       fileTotalUsedTime += (savedLastUsedTime - savedFirstUsedTime);
-               }
-               return fileTotalUsedTime;
-       }
-
-       public double getFileTotalUseTime() {
-
-               if (isParent()) {
-                       double fistOpenTime = 1000000;
-                       FileChartData fileData;
-                       boolean isAllClosed = true;
-                       for (int i = 0; i < children.size(); i++) {
-                               fileData = children.get(i);
-                               if (fileData.getFileOpendTime() < fistOpenTime) {
-                                       fistOpenTime = fileData.getFileOpendTime();
-                               }
-                               if (fileData.isClosed(null) != true) {
-                                       if (isAllClosed) {
-                                               isAllClosed = false;
-                                       }
-                               }
-                       }
-                       if (isAllClosed) {
-                               return parentTotalUsedTime();
-                       } else {
-                               return ToolbarArea.getInstance().getTime() - fistOpenTime;
-                       }
-               }
-               if (isClosed(null) == true) {
-                       return this.fileLastUsedTime - this.fileOpendTime;
-               } else {
-                       return ToolbarArea.getInstance().getTime() - this.fileOpendTime;
-               }
-       }
-
-       public double getFileTotalUsedTime() {
-               return fileTotalUsedTime;
-       }
-
-       public void setFileTotalUsedTime(double fileTotalUsedTime) {
-               this.fileTotalUsedTime = fileTotalUsedTime;
-       }
-
-}
\ No newline at end of file
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartDataEvent.java
deleted file mode 100644 (file)
index 5a6a253..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyunjong Park <phjwithyou.park@samsung.com>
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file;
-
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-
-public class FileChartDataEvent {
-
-       private FileData contents;
-       private FailedData failedData = null;
-
-       private long fd = -1;
-       private String filePath = AnalyzerLabels.EMPTY_STRING;
-
-       private int apiType = -1;
-       private double logTime = -1;
-
-       private long fileSize = 0;
-       private long readSize = 0;
-       private long writeSize = 0;
-
-       private boolean isFailedAPI = false;
-
-       private String tooltip = null;
-
-       public FileChartDataEvent(String filePath, long fd, long time,
-                       String tooltip, FileData contents) {
-               setFilePath(filePath);
-               setFd(fd);
-               setLogTime(time);
-               setContents(contents);
-               setTooltipContent(tooltip);
-       }
-
-       public FileChartDataEvent(FileData contents) {
-               setContents(contents);
-       }
-
-       public FileData getContents() {
-               return contents;
-       }
-
-       public void setContents(FileData contents) {
-               this.contents = contents;
-       }
-
-       public long getFd() {
-               return fd;
-       }
-
-       public void setFd(long fd) {
-               this.fd = fd;
-       }
-
-       public boolean isFailedAPI() {
-               return isFailedAPI;
-       }
-
-       public void setFailedAPI() {
-               this.isFailedAPI = true;
-       }
-
-       public int getApiType() {
-               return apiType;
-       }
-
-       public void setApiType(int apiType) {
-               this.apiType = apiType;
-       }
-
-       public double getLogTime() {
-               return logTime;
-       }
-
-       public void setLogTime(double data) {
-               this.logTime = data;
-       }
-
-       public double getApiChartTime() {
-               return getLogTime() / TimelineConstants.MEGA_DOUBLE;
-       }
-
-       public void setFilePath(String data) {
-               this.filePath = data;
-       }
-
-       public String getFilePath() {
-               return filePath;
-       }
-
-       public void setFileSize(long data) {
-               this.fileSize = data;
-               this.writeSize = data;
-       }
-
-       public long getFileSize() {
-               return this.fileSize;
-       }
-
-       public void setReadSize(long data) {
-               this.readSize = data;
-       }
-
-       public long getReadSize() {
-               return this.readSize;
-       }
-
-       public void setWriteSize(long data) {
-               this.writeSize = data;
-       }
-
-       public long getWriteSize() {
-               return this.writeSize;
-       }
-
-       public void setFailedData(FailedData data) {
-               failedData = data;
-       }
-
-       public FailedData getFailedData() {
-               return failedData;
-       }
-
-       public String getTooltipContent() {
-               return tooltip;
-       }
-
-       public void setTooltipContent(String tooltip) {
-               this.tooltip = tooltip;
-       }
-}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartManager.java
deleted file mode 100644 (file)
index 9a1903c..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyunjong Park <phjwithyou.park@samsung.com>
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file;
-
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-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.logparser.PageDataManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.util.DALogger;
-
-public class FileChartManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-
-       private FileDataMaker fileDataMaker = null;
-       private static FileChartManager instance = null;
-
-       private FileChartManager() {
-               fileDataMaker = new FileDataMaker(AnalyzerManager.getFailedChecker(),
-                               AnalyzerManager.getLeakDetector(),
-                               AnalyzerManager.getWarningChecker());
-       }
-
-       public synchronized static FileChartManager getInstance() {
-               if (null == instance) {
-                       instance = new FileChartManager();
-               }
-               return instance;
-       }
-
-       public FileDataMaker getFileDataMaker() {
-               return fileDataMaker;
-       }
-
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if(pack == null)        // end of thread
-                               break;
-                       
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_FILE);
-                       if (null != logs && (logs.getRawLogs().size() != 0)) {
-                               List<LogData> inputs = logs.getLogs();
-                               getFileDataMaker().makeData(inputs);
-                       }
-               }
-
-               /* log for debug */
-               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-       }
-
-       public void clear() {
-               instance = null;
-               fileDataMaker.clear();
-       }
-
-       public int[] getParentChartIndex(int seq) {
-               int parentChartIndex = -1;
-               FileChartData chartData = null;
-               List<FileChartData> fileChartDataLow = getFileDataMaker().getFileChartLow();
-               for (int i = 0; i < fileChartDataLow.size(); i++) {
-                       chartData = fileChartDataLow.get(i);
-                       if (chartData.getChildCount() != 0) {
-                               parentChartIndex++;
-                               if (isEqualsSeq(chartData, seq)) {
-                                       return new int[] { parentChartIndex, i };
-                               }
-                       }
-               }
-               return new int[] { 0, 0 };
-       }
-
-       public int getChildChartIndex(int parentChartIndex, int seq) {
-               List<FileChartData> fileChartDataLow = getFileDataMaker().getFileChartLow();
-               List<FileChartData> childData = fileChartDataLow.get(parentChartIndex)
-                               .getChild();
-               FileChartData childChartData = null;
-               for (int i = 0; i < childData.size(); i++) {
-                       childChartData = childData.get(i);
-                       if (isEqualsSeq(childChartData, seq)) {
-                               return i;
-                       }
-               }
-               return 0;
-       }
-
-       public boolean isEqualsSeq(FileChartData chartData, int seq) {
-               for (int j = 0; j < chartData.getContents().size(); j++) {
-                       if (chartData.getContents().get(j).getContents()
-                                       .getSeq() == seq) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-}
index d9f1ee4..88f4d10 100644 (file)
@@ -4,8 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Hyunjong Park <phjwithyou.park@samsung.com>
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Hyeran kim <hyearn74.kim@samsung.com> 
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,6 +26,8 @@
 
 package org.tizen.dynamicanalyzer.ui.file;
 
+import java.util.List;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.events.PaintEvent;
@@ -44,6 +45,9 @@ import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
 import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
@@ -60,11 +64,13 @@ public class FileChartView extends DAViewComposite {
        public final static int FILE_CHART_HEIGHT = 40;
 
        private final Composite contents;
-       private DAChartBoard fileChart;
+       private FileChartBoard fileChartBoard;
        private final StackLayout stackLayout;
+       private DAChartBoardItem lastSelectedItemForSummary = null;
 
        private final RangeDataManager rangeDataManager = RangeDataManager
                        .getInstance();
+       private FileDataManager chartManager = FileDataManager.getInstance();
 
        public FileChartView(Composite parent, int style) {
                super(parent, style, false);
@@ -76,22 +82,21 @@ public class FileChartView extends DAViewComposite {
                contents.setBackground(ColorResources.WINDOW_BG_COLOR);
                stackLayout = new StackLayout();
                contents.setLayout(stackLayout);
-               fileChart = new DAChartBoard(contents, FilePageLabels.FILE_CHART_FILE);
-               fileChart.setNameFont(FontResources.CHART_NAME_FONT);
-               fileChart.addSelectionListener(new DAChartBoardSelectionListener() {
-
+               fileChartBoard = new FileChartBoard(contents, FilePageLabels.FILE_CHART_FILE);
+               fileChartBoard.setNameFont(FontResources.CHART_NAME_FONT);
+               fileChartBoard.addSelectionListener(new DAChartBoardSelectionListener() {
                        @Override
                        public void handleSelectionEvent(DAChartBoardItem item) {
+                               lastSelectedItemForSummary = item;
                                AnalyzerManager
-                                               .getCurrentPage()
-                                               .updateView(
+                                               .getCurrentPage().updateView(
                                                                new DASelectionData(
                                                                                FilePage.chartViewID,
-                                                                               (long) (((DAChartPlotIntervalMarker) fileChart
+                                                                               (long) (((DAChartPlotIntervalMarker) fileChartBoard
                                                                                                .getMarkers()
                                                                                                .get(UICommonConstants.SELECTION_MARKER_INDEX))
                                                                                                .getStartVal() * TimelineConstants.MEGA_DOUBLE),
-                                                                               (long) (((DAChartPlotIntervalMarker) fileChart
+                                                                               (long) (((DAChartPlotIntervalMarker) fileChartBoard
                                                                                                .getMarkers()
                                                                                                .get(UICommonConstants.SELECTION_MARKER_INDEX))
                                                                                                .getEndVal() * TimelineConstants.MEGA_DOUBLE),
@@ -99,10 +104,12 @@ public class FileChartView extends DAViewComposite {
                        }
                });
 
-               initIntervalMarkers(fileChart);
+               initIntervalMarkers(fileChartBoard);
 
-               stackLayout.topControl = fileChart;
-               Composite textBoxLabel = new Composite(fileChart.getTitleComp(),
+               stackLayout.topControl = fileChartBoard;
+               
+               // draw title what page on the top of the file chart board
+               Composite textBoxLabel = new Composite(fileChartBoard.getTitleComp(),
                                SWT.NONE);
                textBoxLabel.addPaintListener(new PaintListener() {
                        @Override
@@ -119,43 +126,44 @@ public class FileChartView extends DAViewComposite {
                        }
                });
 
-               DATimeline timeline = fileChart.getTimeline();
+               DATimeline timeline = fileChartBoard.getTimeline();
 
                timeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT);
                timeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT);
 
                LifecycleLogParser.getInstance().registerLifecycleBar(
-                               fileChart.getLifecycleBar());
+                               fileChartBoard.getLifecycleBar());
                LifecycleLogParser.getInstance().registerTimeline(timeline);
 
                timeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener(
-                               rangeDataManager, fileChart, timeline));
+                               rangeDataManager, fileChartBoard, timeline));
        }
 
        @Override
        public void updateView() {
-               FileChartManager.getInstance().getFileDataMaker().checkUpdate();
-               fileChart.setTotalEndTime(ToolbarArea.getInstance().getTime());
+               fileChartBoard.updateChart();
+               
+               fileChartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime());
 
-               fileChart.setTimelineMarkerStartTime(rangeDataManager
+               fileChartBoard.setTimelineMarkerStartTime(rangeDataManager
                                .getMarkerStartTime() / TimelineConstants.MEGA_DOUBLE);
-               fileChart.setTimelineMarkerEndTime(rangeDataManager.getMarkerEndTime()
+               fileChartBoard.setTimelineMarkerEndTime(rangeDataManager.getMarkerEndTime()
                                / TimelineConstants.MEGA_DOUBLE);
 
                if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                       ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+                       ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
                                        UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
                                        .setInterval(rangeDataManager.getAnalysisStartTime()
                                                        / TimelineConstants.MEGA_DOUBLE,
                                                        rangeDataManager.getAnalysisEndTime()
                                                                        / TimelineConstants.MEGA_DOUBLE);
                } else {
-                       ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+                       ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
                                        UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
                                        .setInterval(-1, -1);
                }
 
-               ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+               ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
                                UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
                                rangeDataManager.getMarkerStartTime()
                                                / TimelineConstants.MEGA_DOUBLE,
@@ -166,53 +174,53 @@ public class FileChartView extends DAViewComposite {
 
        @Override
        public void updateView(DAViewData data) {
-               if (!(data instanceof DASelectionData))
-                       return;
-
-               DASelectionData selData = (DASelectionData) data;
-               
-               if(selData.isLogData()) {
-                       Object odata = selData.getData();
-                       if(!(odata instanceof LogData) || odata == null)
-                               return;
-                       
-                       LogData ldata = (LogData) odata;
-                       int seq = ldata.getSeq();
-                       int selectedIndex[] = FileChartManager.getInstance()
-                                       .getParentChartIndex(seq);
-                       fileChart.selectItem(selectedIndex[0], FileChartManager.getInstance()
-                                       .getChildChartIndex(selectedIndex[1], seq));
-               } else {
-                       long start = selData.getStartTime();
-                       long end = selData.getEndTime();
-
-                       double startTime = (double) start / TimelineConstants.MEGA_DOUBLE;
-                       double endTime = (double) end / TimelineConstants.MEGA_DOUBLE;
-                       // double middleTime = (startTime + endTime) / 2.0;
-                       // if (start == end) {
-                       // middleTime = startTime;
-                       // }
-
-                       DAChartBoard chartBoard = (DAChartBoard) stackLayout.topControl;
+               fileChartBoard.updateChart();
+               if (data instanceof DASelectionData) {
+                       DASelectionData selData = (DASelectionData) data;
+                       long dataTime = -1;
+
+                       if (selData.isLogData()) {
+                               Object obData = selData.getData();
+                               if (null != obData && (obData instanceof LogData)) { // summary
+                                       LogData ldata = (LogData) obData;
+                                       dataTime = ldata.getTime();
+                                       int seq = ldata.getSeq();
+                                       List<FileEvent> event = chartManager.getApiDB().selectFileEventBySeq(seq);
+                                       if(event != null) {
+                                               int selectedIndex[] = fileChartBoard.getChartIndex(event.get(0));
+                                               fileChartBoard.selectItem(selectedIndex[0], selectedIndex[1]);
+                                               if (null != lastSelectedItemForSummary) {
+                                                       AnalyzerManager.getCurrentPage().updateView(
+                                                                       new DASelectionData(FilePage.chartViewID,
+                                                                                       dataTime, dataTime,
+                                                                                       lastSelectedItemForSummary.getData(),
+                                                                                       null));
+                                               }
+                                       } // else, no need to update
+                               }
+                       } else {
+                               dataTime = selData.getStartTime();
+                       }
+                       double startTime = dataTime / TimelineConstants.MEGA_DOUBLE;
+                       double endTime = selData.getEndTime() / TimelineConstants.MEGA_DOUBLE;
 
-                       // chartBoard.setVisibleMiddleTime(middleTime);
-                       DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) chartBoard
+                       DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker)fileChartBoard
                                        .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
                        intervalMarker.setInterval(startTime, endTime);
+
                }
        }
 
        @Override
        public void clear() {
-               fileChart.clear();
-               initIntervalMarkers(fileChart);
-               FileChartManager.getInstance().getFileDataMaker().clear();
-               FileChartManager.getInstance().getFileDataMaker().setBoard(fileChart);
+               fileChartBoard.clear();
+               initIntervalMarkers(fileChartBoard);
+               chartManager.getFileChartDataMaker().clear();
        }
 
        @Override
        public Control getControl() {
-               return fileChart;
+               return fileChartBoard;
        }
 
        private void initIntervalMarkers(DAChartBoard board) {
@@ -239,10 +247,10 @@ public class FileChartView extends DAViewComposite {
        }
        
        public void setRangeMarker(double starttime, double endtime) {
-               fileChart.setTimelineMarkerStartTime(starttime);
-               fileChart.setTimelineMarkerEndTime(endtime);
+               fileChartBoard.setTimelineMarkerStartTime(starttime);
+               fileChartBoard.setTimelineMarkerEndTime(endtime);
 
-               ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+               ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
                                UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
                                                starttime, endtime);
        }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java
deleted file mode 100644 (file)
index d96c676..0000000
+++ /dev/null
@@ -1,596 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyunjong Park <phjwithyou.park@samsung.com>
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
-import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupClearMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupEndMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupFromSelectionMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupStartMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
-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.FileChart;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
-import org.tizen.dynamicanalyzer.util.DALogger;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
-
-public class FileDataMaker {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-       
-       private DAChartBoard board;
-       private List<FileChartData> rows = new ArrayList<FileChartData>();
-       private List<FileChartDataEvent> fileEventQueue = new ArrayList<FileChartDataEvent>();
-       private List<FileChartDataEvent> fileEventWarningQueue = new ArrayList<FileChartDataEvent>();
-       private HashMap<Long, String> findPathHashMap = new HashMap<Long, String>();
-       private int timeLineFileChartFDCount = 0;
-       private FailedChecker failedChecker = null;
-       private WarningChecker warningChecker = null;
-       private int preSelectionPId = -1;
-
-       public FileDataMaker(FailedChecker failedChecker,
-                       LeakDetector leakDetector, WarningChecker warningChecker) {
-               this.failedChecker = failedChecker;
-               this.warningChecker = warningChecker;
-       }
-
-       public void setBoard(DAChartBoard board) {
-               this.board = board;
-       }
-
-       public void clear() {
-               rows.clear();
-               fileEventQueue.clear();
-               fileEventWarningQueue.clear();
-               findPathHashMap.clear();
-               timeLineFileChartFDCount = 0;
-       }
-
-       public List<FileChartData> getFileChartLow() {
-               return rows;
-       }
-
-       private boolean isOpenMainLog(FileData input) {
-               String filePath = input.getFilePath();
-               if (filePath.contains(CommonConstants.SLASH)) {
-                       String[] splitApiFilePath = filePath.split(CommonConstants.SLASH);
-                       String strApiFilePath = new String(
-                                       splitApiFilePath[splitApiFilePath.length - 1].trim());
-                       if (AnalyzerManager.getProject().getPkgId().equals(strApiFilePath)) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-
-       private boolean isPrintLog(FileData input) {
-               String apiName = input.getApiName();
-               if (apiName.contains("print")) {//$NON-NLS-1$
-                       return true;
-               }
-               return false;
-       }
-
-       public void makeData(List<LogData> inputs) {
-               int size = inputs.size();
-               for (int i = 0; i < size; i++) {
-                       FileData input = (FileData) inputs.get(i);
-
-                       if (ConfigurationDialogDataManager.getInstance()
-                                       .getfeatureValue(
-                                                       ConfigureLabels.INCLUDE_INSIDE_CALL_FILE) == 0) {
-                               if (input.isInternal()) {
-                                       continue;
-                               }
-                       }
-
-                       if (isPrintLog(input)) {
-                               continue;
-                       }
-
-                       if (isOpenMainLog(input)) {
-                               continue;
-                       }
-
-                       int fdApiType = input.getFdApiType();
-                       String path = input.getFilePath();
-                       long fd = input.getFdValue();
-
-                       long errno = input.getErrno();
-
-                       String name = input.getApiName();
-                       long time = input.getTime();
-
-                       if (fdApiType != LogCenterConstants.FD_API_TYPE_OPEN) {
-                               path = AnalyzerLabels.EMPTY_STRING;
-                       }
-                       FileChartDataEvent event = new FileChartDataEvent(path, fd, time,
-                                       name, input);
-
-                       // error check
-                       if (errno != 0) {
-                               FailedData ffd = new FailedData(input);
-                               event.setFailedData(ffd);
-                               this.failedChecker.getFailedList().add(ffd);
-                               event.setFailedAPI();
-                       } else if (name.equals("fdopen")) { //$NON-NLS-1$
-                               DA_LOG.debug("fdopen");
-                               continue;
-                       }
-
-                       if (fdApiType == LogCenterConstants.FD_API_TYPE_OPEN) {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_OPEN);
-                               checkDuplicateOpen(event);
-                               if (errno == 0) {
-                                       timeLineFileChartFDCount++;
-                                       FileChart.getInstance().setFDCount(1, time);
-                               }
-                       } else if (fdApiType == LogCenterConstants.FD_API_TYPE_CLOSE) {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_CLOSE);
-                               if (errno == 0) {
-                                       timeLineFileChartFDCount--;
-                                       if (timeLineFileChartFDCount >= 0) {
-                                               FileChart.getInstance().setFDCount(-1, time);
-                                       } else {
-                                               timeLineFileChartFDCount = 0;
-                                       }
-                               }
-                       } else if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_END
-                                       || fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_END) {
-                               long fileSize = input.getFileSize();
-                               if (fileSize < 0) {
-                                       fileSize = 0;
-                               }
-                               if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_END) {
-                                       event.setReadSize(fileSize);
-                                       event.setApiType(LogCenterConstants.FD_API_TYPE_READ_END);
-                                       FileChart.getInstance().setReadByte((int) fileSize, time);
-                               } else if (fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_END) {
-                                       event.setFileSize(fileSize);
-                                       event.setWriteSize(fileSize);
-                                       event.setApiType(LogCenterConstants.FD_API_TYPE_WRITE_END);
-                                       FileChart.getInstance().setWriteByte((int) fileSize, time);
-                               }
-                       }
-                       event.setApiType(fdApiType);
-                       fileEventQueue.add(event);
-                       fileEventWarningQueue.add(event);
-                       if (fdApiType == LogCenterConstants.FD_API_TYPE_CLOSE) {
-                               checkWithoutUsing(event);
-                       }
-               }
-       }
-
-       private void checkDuplicateOpen(FileChartDataEvent data) {
-               if (data.isFailedAPI()) {
-                       return;
-               }
-               for (int i = 0; i < fileEventWarningQueue.size(); i++) {
-                       FileChartDataEvent event = fileEventWarningQueue.get(i);
-                       if ((event.getFilePath().equals(data.getFilePath()))
-                                       && (event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN)) {
-                               if (!warningChecker.isChecked(data.getFilePath(),
-                                               WarningCase.DUPLICATE_OPEN.getType())) {
-                                       WarningData wData = new WarningData(
-                                                       WarningCase.DUPLICATE_OPEN.getType(),
-                                                       data.getContents(), data.getFilePath());
-                                       warningChecker.getWarningData().add(wData);
-                               }
-                       }
-               }
-       }
-
-       private void checkWithoutUsing(FileChartDataEvent data) {
-               int nAPICount = 0;
-               for (int i = 0; i < fileEventWarningQueue.size(); i++) {
-                       FileChartDataEvent event = fileEventWarningQueue.get(i);
-                       if ((event.getFd() == data.getFd())) {
-                               nAPICount++;
-                               if (event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN) {
-                                       data.setFilePath(event.getFilePath());
-                               }
-                               fileEventWarningQueue.remove(i--);
-                       }
-               }
-
-               if ((nAPICount < 3)
-                               && (data.getFilePath().equals(AnalyzerLabels.EMPTY_STRING) == false)) { // open-close
-                       if (!warningChecker.isChecked(data.getFilePath(),
-                                       WarningCase.WITHOUT_USING.getType())) {
-                               WarningData wData = new WarningData(
-                                               WarningCase.WITHOUT_USING.getType(),
-                                               data.getContents(), data.getFilePath());
-                               warningChecker.getWarningData().add(wData);
-                       }
-               }
-       }
-
-       private void initFileChart(DAChart chart, boolean isParent) {
-               if (null == chart) {
-                       return;
-               }
-
-               DAChartSeries apiSeries = new DAChartSeries(
-                               FilePageLabels.FILE_CHART_API,
-                               DAChartSeries.SERIES_STYLE_EVENT, ColorResources.YELLOW);
-
-               DAChartSeries stateSeries = new DAChartSeries(
-                               FilePageLabels.FILE_CHART_SERIES,
-                               DAChartSeries.SERIES_STYLE_STATE, ColorResources.WHITE);
-
-               DAChartSeries accessSeries = new DAChartSeries(
-                               FilePageLabels.FILE_CHART_ACCESS,
-                               DAChartSeries.SERIES_STYLE_EVENT_AREA, ColorResources.WHITE);
-
-               apiSeries.setSummarizeTooltipText(ThreadPageLabels.THREAD_TOOLTIP_APIS);
-
-               chart.addSeries(stateSeries);
-               chart.addSeries(apiSeries);
-               chart.addSeries(accessSeries);
-
-               DAChartPlot plot = chart.getPlot();
-               if (null == plot) {
-                       return;
-               }
-               if (true == isParent) {
-                       plot.setBackgroundImage(ImageResources.BG_GRADIENT);
-               } else {
-                       plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
-               }
-               plot.setAutoHeightRange(AutoRangeType.MANUAL);
-               plot.setAxisFont(FontResources.CHART_AXIS_FONT);
-               plot.setAxisRangeY(0, 101);
-               plot.setAxisRangeX(board.getVisibleStartTime(),
-                               board.getVisibleEndTime());
-               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());
-       }
-
-       private boolean createFileBoardItem(FileChartData parent,
-                       FileChartData sync, FileChartDataEvent event) {
-               DAChartBoardItem item;
-               DAChart chart;
-               if (null == parent) {
-                       String fileName = sync.getFileName();
-                       if (sync.getFileName().length() > 12) {
-                               fileName = sync.getFileName().substring(0, 12);
-                               fileName += CommonConstants.NEW_LINE
-                                               + sync.getFileName().substring(12,
-                                                               sync.getFileName().length());
-                       }
-                       item = new DAChartBoardItem(board, fileName);
-                       chart = item.getChart();
-                       initFileChart(chart, true);
-               } else {
-                       DAChartBoardItem parentItem = parent.getItem();
-                       if (sync.getFD() > 0x10000000) {
-                               item = new DAChartBoardItem(parentItem, "0x"//$NON-NLS-1$
-                                               + Long.toHexString(sync.getFD()));
-                       } else {
-                               item = new DAChartBoardItem(parentItem, Long.toString(sync
-                                               .getFD()));
-                       }
-
-                       chart = item.getChart();
-                       initFileChart(chart, false);
-               }
-
-               sync.setItem(item);
-               item.setData(sync);
-               chart.setData(sync);
-               chart.redraw();
-               return true;
-       }
-
-       private FileChartData findParent(String filePath, long fd) {
-               filePath = findPathHashMap.get(fd);
-               int size = rows.size();
-               FileChartData returnData = null;
-               for (int i = 0; i < size; i++) {
-                       returnData = rows.get(i);
-                       if (returnData.getFilePath().equals(filePath) == true) {
-                               return returnData;
-                       } else if ((returnData.getFilePath()
-                                       .equals(FilePageLabels.FILE_CHART_UNKNOWN_FILE))
-                                       && (filePath == null)) {
-                               return returnData;
-                       }
-               }
-               return null;
-       }
-
-       private void chartFilteringByPId() {
-               if (null == board || null == board.getItemList()) {
-                       return;
-               }
-               int selectedPid = ToolbarArea.getInstance().getSelectedPid();
-               boolean isCheck = false;
-
-               if (fileEventQueue.size() > 0) {
-                       isCheck = true;
-               }
-
-               if (preSelectionPId != -1 && preSelectionPId != selectedPid) {
-                       isCheck = true;
-               }
-
-               if (isCheck) {
-                       int parentSize = board.getItemList().getItemSize();
-                       for (int i = 0; i < parentSize; i++) {
-                               DAChartBoardItem parentItem = board.getItemList().get(i);
-                               int childSize = parentItem.getChildItemList().getItemSize();
-                               int hidedCount = 0;
-                               for (int j = 0; j < childSize; j++) {
-                                       DAChartBoardItem childItem = parentItem.getChildItemList()
-                                                       .get(j);
-                                       int itemPid = getItemPid(childItem);
-                                       if (itemPid == selectedPid) {
-                                               parentItem.getChildItemList().showItem(j);
-                                               board.showItem(i);
-                                       } else if (selectedPid == 0) {
-                                               parentItem.getChildItemList().showItem(j);
-                                               board.showItem(i);
-                                       } else if (itemPid == -1) {
-                                               board.showItem(i);
-                                       } else {
-                                               parentItem.getChildItemList().hideItem(j);
-                                               hidedCount++;
-                                       }
-                               }
-                               if (childSize == 0) {
-                                       int itemPid = getItemPid(parentItem);
-                                       if (itemPid == selectedPid) {
-                                               board.showItem(i);
-                                       } else if (selectedPid == 0) {
-                                               board.showItem(i);
-                                       } else if (itemPid == -1) {
-                                               board.showItem(i);
-                                       } else {
-                                               board.hideItem(i);
-                                               hidedCount++;
-                                       }
-                               } else {
-                                       if (childSize == hidedCount) {
-                                               board.hideItem(i);
-                                       }
-                               }
-                       }
-               }
-               preSelectionPId = selectedPid;
-       }
-
-       private int getItemPid(DAChartBoardItem item) {
-               int pid = -1;
-               if (item.getData() instanceof FileChartData) {
-                       FileChartData chartData = (FileChartData) item.getData();
-                       if (chartData.getContents().size() > 0) {
-                               pid = chartData.getContents().get(0).getContents().getPid();
-                       }
-               }
-               return pid;
-       }
-
-       public void checkUpdate() {
-               if (!AnalyzerManager.isRunning()) {
-                       int size = rows.size();
-                       FileChartData data;
-                       for (int i = 0; i < size; i++) {
-                               data = rows.get(i);
-                               data.checkUpdate();
-                       }
-               }
-               chartFilteringByPId();
-               int size = fileEventQueue.size();
-               if (size > 0) {
-                       FileChartData parentChart;
-                       FileChartData childChart;
-                       FileChartDataEvent event;
-                       for (int i = 0; i < size; i++) {
-                               event = fileEventQueue.get(0);
-                               int apiType = event.getApiType();
-                               String filePath = AnalyzerLabels.EMPTY_STRING;
-                               if (event.getFilePath().trim()
-                                               .equals(AnalyzerLabels.EMPTY_STRING)) {
-                                       filePath = FilePageLabels.FILE_CHART_UNKNOWN_FILE;
-                               } else {
-                                       filePath = event.getFilePath();
-                               }
-                               if (apiType == LogCenterConstants.FD_API_TYPE_OPEN) {
-                                       findPathHashMap.put(event.getFd(), filePath);
-                               }
-                               parentChart = findParent(event.getFilePath(), event.getFd());
-                               if (null == parentChart) {
-                                       findPathHashMap.put(event.getFd(), filePath);
-                                       parentChart = new FileChartData(filePath, event.getFd(),
-                                                       true);
-                                       childChart = new FileChartData(filePath, event.getFd(),
-                                                       false);
-                                       if (!event.isFailedAPI()) {
-                                               parentChart.setClosed(false);
-                                               childChart.setClosed(false);
-                                       }
-
-                                       if (event.isFailedAPI()) {
-                                               childChart.setFileOpenFailed(true);
-                                               parentChart.setFileOpenFailed(true);
-                                       } else if (filePath
-                                                       .equals(FilePageLabels.FILE_CHART_UNKNOWN_FILE)) {
-                                               childChart.setFileOpenFailed(true);
-                                               parentChart.setFileOpenFailed(true);
-                                       } else {
-                                               childChart.setFileOpenFailed(false);
-                                               parentChart.setFileOpenFailed(false);
-                                       }
-
-                                       parentChart.pushChild(childChart);
-                                       createFileBoardItem(null, parentChart, event);
-                                       createFileBoardItem(parentChart, childChart, event);
-                                       if (!event.isFailedAPI()) {
-                                               parentChart.setFileOpendTime((long) event.getLogTime());
-                                               childChart.setFileOpendTime((long) event.getLogTime());
-                                       } else {
-                                               childChart.setFileOpenFailed(true);
-                                               parentChart.setFileOpenFailed(true);
-                                       }
-                                       parentChart.pushEvent(event);
-                                       childChart.pushEvent(event);
-                                       rows.add(parentChart);
-                                       rows.add(childChart);
-                               } else if (null != parentChart) {
-                                       childChart = parentChart.findChildData(event);
-                                       if (null == childChart) {
-                                               childChart = new FileChartData(filePath, event.getFd(),
-                                                               false);
-                                               if (!event.isFailedAPI()) {
-                                                       childChart.setClosed(false);
-                                               }
-                                               if (event.isFailedAPI()) {
-                                                       childChart.setFileOpenFailed(true);
-                                                       parentChart.setFileOpenFailed(true);
-                                               } else if (filePath
-                                                               .equals(FilePageLabels.FILE_CHART_UNKNOWN_FILE)) {
-                                                       childChart.setFileOpenFailed(true);
-                                                       parentChart.setFileOpenFailed(true);
-                                               } else {
-                                                       childChart.setFileOpenFailed(false);
-                                                       parentChart.setFileOpenFailed(false);
-                                               }
-                                               rows.add(childChart);
-                                               parentChart.pushChild(childChart);
-                                               createFileBoardItem(parentChart, childChart, event);
-                                               if (!event.isFailedAPI()) {
-                                                       childChart.setFileOpendTime((long) event
-                                                                       .getLogTime());
-                                               } else {
-                                                       childChart.setFileOpenFailed(true);
-                                               }
-                                               childChart.pushEvent(event);
-                                       } else if (null != childChart) {
-                                               if (apiType == LogCenterConstants.FD_API_TYPE_CLOSE) {
-                                                       if (!event.isFailedAPI()) {
-                                                               childChart.setClosed(true);
-                                                               childChart.setFileClosedTime((long) event
-                                                                               .getLogTime());
-                                                       } else {
-                                                               childChart.setFileOpenFailed(true);
-                                                       }
-
-                                                       childChart.pushEvent(event);
-                                                       findPathHashMap.remove(event.getFd());
-                                               } else {
-                                                       childChart.pushEvent(event);
-                                               }
-                                       }
-                                       parentChart.pushEvent(event);
-                                       parentChart.setFileUsedTime(event.getLogTime());
-                                       childChart.setFileUsedTime(event.getLogTime());
-                               }
-                               fileEventQueue.remove(0);
-                       }
-               }
-               size = rows.size();
-               if (size > 0) {
-                       FileChartData data;
-                       for (int i = 0; i < size; i++) {
-                               data = rows.get(i);
-                               data.checkUpdate();
-                       }
-               }
-       }
-}
index 2896232..575992c 100644 (file)
@@ -4,8 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Hyunjong Park <phjwithyou.park@samsung.com>
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Hyeran kim <hyearn74.kim@samsung.com> 
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,6 +26,8 @@
 
 package org.tizen.dynamicanalyzer.ui.file;
 
+import java.util.List;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
@@ -41,6 +42,10 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.FilePageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
+import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+import org.tizen.dynamicanalyzer.ui.file.model.FileSelectedData;
 import org.tizen.dynamicanalyzer.utils.Formatter;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
@@ -54,8 +59,10 @@ public class FileDetailInfoView extends DAViewComposite {
        private long writeSize = 0;
        private long totalUseTime = 0;
        private int apiCount = 0;
-       private int failedApiCount = 0;
-
+       private int failedApiCount = 0; 
+       
+       private FileDataManager fileChartManager = FileDataManager.getInstance();
+       
        private void init() {
                fileName = AnalyzerLabels.EMPTY_STRING;
                filePath = AnalyzerLabels.EMPTY_STRING;
@@ -162,20 +169,32 @@ public class FileDetailInfoView extends DAViewComposite {
        private void updateData() {
                FileApiListView view = (FileApiListView) AnalyzerManager
                                .getCurrentPage().getView(FilePage.apilistViewID);
-               FileChartData selectData = view.getPageData();
+               FileSelectedData selectData = view.getSelectedData();
 
                if (null == selectData) {
                        return;
                }
-
-               fileName = selectData.getFileName();
-               filePath = selectData.getFilePath();
-               fileSize = selectData.getFileSize();
-               readSize = selectData.getReadSize();
-               writeSize = selectData.getWriteSize();
-               totalUseTime = (long) selectData.getFileTotalUseTime();
-               apiCount = selectData.getApiCount();
-               failedApiCount = selectData.getFailedApiCount();
+               List<FileEvent> events = null;
+               events = fileChartManager.getApiDB()
+                               .selectAPITable(selectData.getDentry(),
+                                               selectData.getPid(), selectData.getTid(), selectData.isParentChart());
+               if(events != null) {
+                       filePath = events.get(0).getFilePath();
+                       fileName = events.get(0).getFileName();
+                       fileSize = events.get(0).getFileSize();
+                       apiCount = events.size();
+               }
+               events = fileChartManager.getApiDB()
+                               .selectFailedAPI(selectData.getDentry(),
+                                               selectData.getPid(), selectData.getTid(), selectData.isParentChart());
+               if(events != null) {
+                       failedApiCount = events.size();
+               }
+               // TODO define What totalUseTime
+               // totalUseTime = (long) selectData.getFileTotalUseTime();
+               // readSize = selectData.getReadSize();
+               // writeSize = selectData.getWriteSize();
+                       
                canvas.redraw();
        }
 
index de74b1e..ca906c9 100644 (file)
@@ -37,6 +37,7 @@ import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
 import org.tizen.dynamicanalyzer.ui.page.ScreenshotTabComposite;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
 
 public class FilePage extends DAPageComposite {
        // page and view IDs
@@ -91,7 +92,7 @@ public class FilePage extends DAPageComposite {
                leftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
                rightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
                
-               DataManagerRegistry.registerPageDataManager(FileChartManager.getInstance());
+               DataManagerRegistry.registerPageDataManager(FileDataManager.getInstance());
        }
 
        @Override
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileChartDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileChartDataMaker.java
deleted file mode 100644 (file)
index 63a7b92..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyeran Lim <hyeran74.kim@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file.manager;
-
-
-import java.util.ArrayList;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.ui.file.data.FileAccessDB;
-import org.tizen.dynamicanalyzer.ui.file.data.FileApiDB;
-import org.tizen.dynamicanalyzer.ui.file.data.FileStatusDB;
-import org.tizen.dynamicanalyzer.ui.file.model.FileAccess;
-import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
-import org.tizen.dynamicanalyzer.ui.file.model.FileStatus;
-import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
-import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
-import org.tizen.dynamicanalyzer.ui.timeline.chart.FileChart;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
-import org.tizen.dynamicanalyzer.util.DALogger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
-import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
-
-public class FileChartDataMaker {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-       
-       private FailedChecker failedChecker = null;
-       private WarningChecker warningChecker = null;
-       private int timeLineFileChartFDCount = 0;
-       
-       private List<FileStatus> fileStatusList = new ArrayList<FileStatus>();
-       private List<FileAccess> fileAccessList = new ArrayList<FileAccess>();
-       private Map<String, Long> fileAccessorMap = new HashMap<String, Long>();
-       
-       private Map<Long, Integer> fileReadingCount = new HashMap<Long, Integer>();
-       private Map<Long, Integer> fileWritingCount = new HashMap<Long, Integer>();
-       private Map<Long, Boolean> isFileLocking = new HashMap<Long, Boolean>(); 
-       
-       private Queue<List<FileEvent>> queue = new ConcurrentLinkedQueue<List<FileEvent>>();
-       
-       public FileChartDataMaker(FailedChecker failedChecker,
-                       LeakDetector leakDetector, WarningChecker warningChecker) {
-               this.failedChecker = failedChecker;
-               this.warningChecker = warningChecker;
-       }
-
-       public void clear(){
-               fileStatusList.clear();
-               fileAccessList.clear();
-               fileAccessorMap.clear();
-               fileReadingCount.clear();
-               fileWritingCount.clear();
-               isFileLocking.clear();
-       }
-
-       public void makeData(List<LogData> inputs) {
-               if (!AnalyzerManager.isRunning()) {
-                       return;
-               }
-
-               List<FileEvent> fileEventQueue = new ArrayList<FileEvent>();
-               
-               FileChart timeLineFileChart = FileChart.getInstance();
-               int size = inputs.size();
-               FileEvent event = null;
-               String key = null;
-               
-               ArrayList<List<Object>> fileApiList = new ArrayList<List<Object>>();
-               for (int i = 0; i < size; i++) {
-                       FileData input = (FileData) inputs.get(i);
-                       if (ConfigurationDialogDataManager.getInstance()
-                                       .getfeatureValue(
-                                                       ConfigureLabels.INCLUDE_INSIDE_CALL_FILE) == 0) {
-                               if (input.isInternal()) {
-                                       continue;
-                               }
-                       }
-                       if (isPrintLog(input) || isOpenMainLog(input)) {
-                               continue;
-                       }
-                       int seqNum = input.getSeq();
-                       // TODO get dentry
-                       long dentry = 50000;
-                       int pid = input.getPid();
-                       int tid = input.getTid();
-                       String filePath = input.getFilePath();
-                       long fd = input.getFdValue();
-                       int apiType = input.getFdApiType();
-                       long eventTime = input.getTime(); ;
-                       String apiName = input.getApiName();
-                       long errNo = input.getErrno();
-                       long fileSize = input.getFileSize();
-                       String arg = input.getArgs();
-                       String returnVal = input.getReturn();
-               
-                       DA_LOG.info("seqNum:" + seqNum);
-                       DA_LOG.info("apiName:" + apiName);
-                       DA_LOG.info("errNo:" + errNo);
-                       
-                       // check error
-                       if (errNo != 0) {
-                               FailedData failedData = new FailedData(input);
-                               this.failedChecker.getFailedList().add(failedData);
-                       } else if (apiName.equals("fdopen")) { //$NON-NLS-1$
-                               DA_LOG.debug("fdopen");
-                               continue;
-                       }
-                       
-                       event = new FileEvent(seqNum, dentry, filePath, pid, tid, fd, 
-                                       apiType, apiName, eventTime, fileSize, arg, returnVal, errNo, true);
-                       key = createKey(pid, tid);
-                       
-                       // check fileAccessList, fileStatusList, fileAccessorMap size
-                       checkHeapMemory();
-                       
-                       switch(apiType){
-                       case LogCenterConstants.FD_API_TYPE_OPEN:
-                               if (errNo == 0) {
-                                       timeLineFileChartFDCount++;
-                                       timeLineFileChart.setFDCount(1, eventTime);
-                                       addFileAccessor(key, event.getDentry()); 
-                                       addStatusData(new FileStatus(dentry, pid, tid, filePath, apiType, eventTime, errNo));
-                               }
-                               break;
-                       case LogCenterConstants.FD_API_TYPE_CLOSE:
-                               if (errNo == 0) {
-                                       timeLineFileChartFDCount--;
-                                       if (timeLineFileChartFDCount >= 0) {
-                                               timeLineFileChart.setFDCount(-1, eventTime);
-                                       } else {
-                                               timeLineFileChartFDCount = 0;
-                                       }
-                                       addStatusData(new FileStatus(dentry, pid, tid, filePath, apiType, eventTime, errNo));
-                               }
-                               break;
-                       case  LogCenterConstants.FD_API_TYPE_READ_START:
-                               FileAccess readAccess = new FileAccess(dentry, filePath, pid, tid, apiType, eventTime);
-                               addReadingCount(dentry, readAccess);
-                               addStartAccessData(readAccess);
-                               break;
-                       case  LogCenterConstants.FD_API_TYPE_READ_END:
-                               timeLineFileChart.setReadByte((int) fileSize, eventTime);
-                               deleteReadingCount(dentry);
-                               addEndAccessData(dentry, pid, tid, filePath, eventTime, fileSize,
-                                               LogCenterConstants.FD_API_TYPE_READ_START);
-                               break;
-                       case  LogCenterConstants.FD_API_TYPE_WRITE_START:
-                               FileAccess writeAccess = new FileAccess(dentry, filePath, pid, tid, apiType, eventTime);
-                               addWritingCount(dentry, writeAccess);
-                               addStartAccessData(writeAccess);
-                               break;
-                       case LogCenterConstants.FD_API_TYPE_WRITE_END:
-                               timeLineFileChart.setWriteByte((int) fileSize, eventTime);
-                               deleteWritingCount(dentry);
-                               addEndAccessData(dentry, pid, tid, filePath, eventTime, fileSize,
-                                               LogCenterConstants.FD_API_TYPE_WRITE_START);
-                               break;
-                       case LogCenterConstants.FD_API_TYPE_LOCK_START:
-                               isFileLocking.put(dentry, true);
-                               addStartAccessData(new FileAccess(dentry, filePath, pid, tid, apiType, eventTime));
-                               break;
-                       case LogCenterConstants.FD_API_TYPE_LOCK_END:
-                               isFileLocking.put(dentry, false);
-                               addEndAccessData(dentry, pid, tid, filePath, eventTime, fileSize,
-                                               LogCenterConstants.FD_API_TYPE_WRITE_START);
-                               break;
-                       }
-                       fileEventQueue.add(event);
-                       
-               }
-               if(fileEventQueue.size() > 0) {
-                       queue.add(fileEventQueue);
-                       for(FileEvent data : fileEventQueue) {
-                               fileApiList.add(data.getDBData());
-                       }
-                       FileChartManager.getInstance().getApiDB().insert((List<List<Object>>)fileApiList);
-               }
-       }
-       
-       public void addStatusData(FileStatus data) {
-               fileStatusList.add(data);
-               FileChartManager.getInstance().getStatusDB().insert(data);
-       }
-       
-       public void addStartAccessData(FileAccess data) {
-               fileAccessList.add(data);
-       }
-
-       public void addEndAccessData(long dentry, int pid, int tid, String filePath, 
-                       long endTime, long fileSize, int apiType) {
-               for (int i = 0; i < fileAccessList.size(); i++) {
-                       FileAccess data = fileAccessList.get(i);
-                       if (data.getDentry() == dentry 
-                                       && data.getFilePath().equalsIgnoreCase(filePath)
-                                       && data.getPid() == pid
-                                       && data.getTid() == tid 
-                                       && data.getApiType() == apiType
-                                       && data.getEndTime() <= 0){
-                               data.setEndTime(endTime);
-                               data.setFileSize(fileSize);
-                               FileChartManager.getInstance().getAccessDB().insert(data);
-                               break;
-                       }
-               }
-       }
-       
-       private String createKey(int pid, int tid) {
-               StringBuffer key = new StringBuffer();
-               key.append(pid);
-               key.append(":");
-               key.append(tid);
-               
-               return key.toString();
-       }
-       
-       private void addFileAccessor(String key, long value) {
-               if(fileAccessorMap.get(key) == null) {
-                       fileAccessorMap.put(key, value);
-               }
-       }
-       
-       private void addReadingCount(long key, FileAccess readAccess) {
-               if(fileReadingCount.get(key) != null ) {
-                       if(fileReadingCount.get(key) > 0) {
-                               int count = fileReadingCount.get(key);
-                               fileReadingCount.put(key, count++);
-                               readAccess.setAlreadyReading(true);
-                       }
-               } else {
-                       fileReadingCount.put(key, 1);
-               }
-       }
-       
-       private void deleteReadingCount(long key) {
-               int count = fileReadingCount.get(key);
-               if(count > 0) {
-                       fileReadingCount.put(key, count--);
-               }
-       }
-       
-       private void addWritingCount(long key, FileAccess writeAccess) {
-               if(fileWritingCount.get(key) != null ) {
-                       if(fileWritingCount.get(key) > 0) {
-                               int count = fileWritingCount.get(key);
-                               fileWritingCount.put(key, count++);
-                       }
-               } else {
-                       fileWritingCount.put(key, 1);
-               }
-       }
-       
-       private void deleteWritingCount(long key) {
-               int count = fileWritingCount.get(key);
-               if(count > 0) {
-                       fileWritingCount.put(key, count--);
-               }
-       }
-       
-       public List<FileEvent> getFileEventList() {
-               return queue.poll();
-       }
-       
-       public List<FileAccess> getFileAccessList() {
-               return fileAccessList;
-       }
-       
-       public List<FileStatus> getFileStatusList() {
-               return fileStatusList;
-       }
-       
-       private void checkHeapMemory() {
-               if ( (fileAccessList.size() > 10000 
-                               || fileStatusList.size() > 100000) 
-                               || fileAccessorMap.size() > 100000) {
-                       ToolbarArea.getInstance().stopTrace();
-                       Display.getDefault().asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       final Shell shell = WorkbenchUtil.getWorkbenchWindow()
-                                                       .getShell();
-                                       DADialog dialog = new DADialog(shell, SWT.NONE, 550, 153);
-                                       dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
-                                       dialog.setMessage(AnalyzerLabels.HEAP_MEMORY_WARNING_PRE
-                                                       + PathManager.DA_INSTALL_PATH
-                                                       + AnalyzerLabels.HEAP_MEMORY_WARNING_POST);
-                                       dialog.open();
-                               }
-                       });
-               }
-       }
-       
-       private boolean isPrintLog(FileData input) {
-               String apiName = input.getApiName();
-               if (apiName.contains("print")) {//$NON-NLS-1$
-                       return true;
-               }
-               return false;
-       }
-       
-       private boolean isOpenMainLog(FileData input) {
-               String filePath = input.getFilePath();
-               if (filePath.contains(CommonConstants.SLASH)) {
-                       String[] splitApiFilePath = filePath.split(CommonConstants.SLASH);
-                       String strApiFilePath = new String(
-                                       splitApiFilePath[splitApiFilePath.length - 1].trim());
-                       if (AnalyzerManager.getProject().getPkgId().equals(strApiFilePath)) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-       
-       public void setFileAccessList(List<FileAccess> fileAccessList) {
-               this.fileAccessList = fileAccessList;
-       }
-       
-       public void setFileStatusList(List<FileStatus> fileStatusList) {
-               this.fileStatusList = fileStatusList;
-       }
-
-}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileChartManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileChartManager.java
deleted file mode 100644 (file)
index dc39b4a..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyeran Lim <hyeran74.kim@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file.manager;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-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.logparser.PageDataManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
-import org.tizen.dynamicanalyzer.ui.file.FileChartData;
-import org.tizen.dynamicanalyzer.ui.file.data.FileAccessDB;
-import org.tizen.dynamicanalyzer.ui.file.data.FileApiDB;
-import org.tizen.dynamicanalyzer.ui.file.data.FileStatusDB;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartDataMaker;
-import org.tizen.dynamicanalyzer.ui.file.model.FileAccess;
-import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
-import org.tizen.dynamicanalyzer.ui.file.model.FileStatus;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
-import org.tizen.dynamicanalyzer.util.DALogger;
-
-
-public class FileChartManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-       
-       private static FileChartManager instance = null;
-       private static FileChartDataMaker dataMaker = null;
-       
-       private FileAccessDB accessDB = null;
-       private FileApiDB apiDB = null;
-       private FileStatusDB statusDB = null;
-       
-       private List<FileEvent> eventList = new ArrayList<FileEvent>();
-       private List<FileEvent> selectedTableAPIList = new ArrayList<FileEvent>();
-       
-       private FileChartManager() {
-               dataMaker = new FileChartDataMaker(
-                               AnalyzerManager.getFailedChecker(),
-                               AnalyzerManager.getLeakDetector(),
-                               AnalyzerManager.getWarningChecker());
-
-               initDB();
-       }
-
-       public synchronized static FileChartManager getInstance() {
-               if (null == instance) {
-                       instance = new FileChartManager();
-               }
-               return instance;
-       }
-
-       public void initDB() {
-               accessDB = new FileAccessDB();
-               addDBTable(accessDB);
-               apiDB = new FileApiDB();
-               addDBTable(apiDB);
-               statusDB = new FileStatusDB();
-               addDBTable(statusDB);
-       }
-       
-       public void clear() {
-               accessDB = null;
-               apiDB = null;
-               statusDB = null;
-               eventList = new ArrayList<FileEvent>();
-               selectedTableAPIList = new ArrayList<FileEvent>();
-       }
-       
-       public FileAccessDB getAccessDB(){
-               return accessDB;
-       }
-       
-       public FileApiDB getApiDB() {
-               return apiDB;
-       }
-       
-       public FileStatusDB getStatusDB() {
-               return statusDB;
-       }
-       
-       /*** make network data thread ***/
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread
-                               break;
-                       
-                       // TODO Change to get data from syscalls message and probe message
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_FILE);
-                       if (null != logs && logs.getRawLogs().size() != 0) {
-                               List<LogData> inputs = logs.getLogs();
-                               dataMaker.makeData(inputs);
-                       }
-
-               }
-               DA_LOG.info(getName() + " thread end!!");
-       }
-
-       public void openProcess() {
-               // TODO
-       }
-
-       @Override
-       protected void onThreadStop() {
-               // TODO
-       }
-       
-       public FileChartDataMaker getFileChartDataMaker() {
-               return dataMaker;
-       }
-       
-       public void addFileEventQueue(FileEvent data){
-               eventList.add(data);
-       }
-
-       public List<FileEvent> getFileEventQueue() {
-               return eventList;
-       }
-       
-       public List<FileEvent> getSelectedTableAPIList() {
-               return selectedTableAPIList;
-       }
-
-       public void setSelectedTableAPIList(
-                       List<FileEvent> selectedTableAPIList) {
-               this.selectedTableAPIList = selectedTableAPIList;
-       }
-
-}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileDataMaker.java
new file mode 100644 (file)
index 0000000..fe1e00e
--- /dev/null
@@ -0,0 +1,373 @@
+package org.tizen.dynamicanalyzer.ui.file.manager;
+
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyeran Lim <hyeran74.kim@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+
+import java.util.ArrayList;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DALimit;
+import org.tizen.dynamicanalyzer.common.path.PathManager;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+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.FileData;
+import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.ui.file.model.FileAccess;
+import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+import org.tizen.dynamicanalyzer.ui.file.model.FileStatus;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.FileChart;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
+import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
+
+public class FileDataMaker {
+       private static final DALogger DA_LOG = DALogger.getInstance();
+       
+       private FailedChecker failedChecker = null;
+       private int timeLineFileChartFDCount = 0;
+       
+       private List<FileStatus> fileStatusList = new ArrayList<FileStatus>();
+       private List<FileAccess> fileAccessList = new ArrayList<FileAccess>();
+       private Map<String, String> fileAccessorMap = new HashMap<String, String>();
+       
+       private Map<Long, Boolean> isFileLocking = new HashMap<Long, Boolean>(); 
+       
+       private Queue<List<FileEvent>> fileLogsQueue = new ConcurrentLinkedQueue<List<FileEvent>>();
+       List<FileEvent> fileEventList = new ArrayList<FileEvent>();
+       
+       public FileDataMaker(FailedChecker failedChecker,
+                       LeakDetector leakDetector, WarningChecker warningChecker) {
+               this.failedChecker = failedChecker;
+       }
+
+       public void clear(){
+               fileStatusList.clear();
+               fileAccessList.clear();
+               fileAccessorMap.clear();
+               isFileLocking.clear();
+               timeLineFileChartFDCount = 0;
+       }
+
+       public void makeData(LogPackage pack) {
+               if (!AnalyzerManager.isRunning()) {
+                       return;
+               }
+               
+               List<FileEvent>  eventList = new ArrayList<FileEvent>();
+               
+               // 1. In case of target process that the user is interested to analyze
+               ArrayList<List<Object>> fileApiList = new ArrayList<List<Object>>();
+               Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_FILE);
+               
+               if (null == logs) {
+                       return;
+               } else if(logs.getRawLogs().size() == 0) {
+                       return;
+               } else {
+                       List<LogData> inputs = logs.getLogs();
+                       FileEvent event = null;
+                       String key = null;
+                       
+                       for (int i = 0; i < inputs.size(); i++) {
+                               FileData input = (FileData) inputs.get(i);
+                               
+                               // filtering out internal call
+                               if (ConfigurationDialogDataManager.getInstance()
+                                               .getfeatureValue(
+                                                               ConfigureLabels.INCLUDE_INSIDE_CALL_FILE) == 0) {
+                                       if (input.isInternal()) {
+                                               continue;
+                                       }
+                               }
+                               // filtering out print log and main func log
+                               if (checkInvalidApiName(input) || isOpenMainLog(input)) {
+                                       continue;
+                               }
+                               
+                               int seqNum = input.getSeq();
+                               // TODO change dentry to origin file path
+                               long dentry = 50000;
+                               int pid = input.getPid();
+                               int tid = input.getTid();
+                               String filePath = input.getFilePath();
+                               long fd = input.getFdValue();
+                               int apiType = input.getFdApiType();
+                               long eventTime = input.getTime(); ;
+                               String apiName = input.getApiName();
+                               long errNo = input.getErrno();
+                               long fileSize = input.getFileSize();
+                               String arg = input.getArgs();
+                               String returnVal = input.getReturn();
+                       
+                               DA_LOG.info("apiName:" + apiName + ", apiType:" + apiType);
+                               
+                               // check error
+                               if (errNo != 0) {
+                                       switch (input.getFdApiType()) {
+                                       case LogCenterConstants.SOCKET_API_ACCEPT_END:
+                                       case LogCenterConstants.SOCKET_API_SEND_END:
+                                       case LogCenterConstants.SOCKET_API_RECV_END:
+                                       case LogCenterConstants.SOCKET_API_EVENT_END: {
+                                               FailedData ffd = new FailedData(input);
+                                               this.failedChecker.getFailedList().add(ffd);
+                                       }
+                                       }
+                               } 
+                               
+                               event = new FileEvent(seqNum, dentry, filePath, pid, tid, fd, 
+                                               apiType, apiName, eventTime, fileSize, arg, returnVal, errNo, true);
+
+                               addFileEvent(eventList, event);
+                       
+                       }
+               }
+               
+               // 2. In case of non-target process that the user is not interested, but access the target files
+               //TODO filtering out non-target process from syscall messages
+               //TODO filtering out non-target file from syscall messages and addFileEvent
+               
+               if(eventList.size() > 0) {
+                       for(FileEvent data : eventList) {
+                               fileApiList.add(data.getDBData());
+                       }
+                       fileLogsQueue.add(eventList);
+                       FileDataManager.getInstance().getApiDB().insert((List<List<Object>>)fileApiList);
+               }
+       }
+       
+       public void addFileEvent(List<FileEvent> list, FileEvent event) {
+               // check heap memory
+               checkHeapMemory();
+               
+               // TODO change dentry to origin file path
+               long dentry = event.getDentry();
+               int pid = event.getPid();
+               int tid = event.getTid();
+               long fd = event.getFdValue();
+               String filePath = event.getFilePath();
+               int apiType = event.getFdApiType();
+               long eventTime = event.getTime();
+               long fileSize = event.getFileSize();
+               long errNo = event.getErrno();
+               boolean isTarget = event.isTarget();
+               String key = createKey(pid, tid, fd);
+               
+               switch (apiType) {
+               case LogCenterConstants.FD_API_TYPE_OPEN:
+                       // update FD count on timeLine chart
+                       if (isTarget && errNo == 0) {
+                               timeLineFileChartFDCount++;
+                               FileChart.getInstance().setFDCount(1, eventTime);
+                       }// else, in case of non-target process or failed api,
+                        // no need to update FD count on timeLine chart
+                       
+                       if(fileAccessorMap.get(key) == null) {
+                               fileAccessorMap.put(key, event.getOriginFilePath());
+                       }
+                       addStatusData(new FileStatus(dentry, pid, tid, fd, filePath, 
+                                       apiType, eventTime, errNo));
+                       break;
+               case LogCenterConstants.FD_API_TYPE_CLOSE:
+                       // update FD count on timeLine chart
+                       if (isTarget && errNo == 0) {
+                               timeLineFileChartFDCount--;
+                               if (timeLineFileChartFDCount >= 0) {
+                                       FileChart.getInstance().setFDCount(-1, eventTime);
+                               } else {
+                                       timeLineFileChartFDCount = 0;
+                               }
+                       }// else, no need to update FD count on timeLine chart
+                       addStatusData(new FileStatus(dentry, pid, tid, fd, filePath,
+                                               apiType, eventTime, errNo));
+                       break;
+               case LogCenterConstants.FD_API_TYPE_READ_START:
+                       FileAccess readAccess = new FileAccess(dentry, filePath, pid,
+                                       tid, fd, apiType, eventTime);
+                       addStartAccessData(readAccess);
+                       break;
+               case LogCenterConstants.FD_API_TYPE_READ_END:
+                       addEndAccessData(dentry, pid, tid, fd, filePath, eventTime,
+                                       fileSize, LogCenterConstants.FD_API_TYPE_READ_START);
+                       break;
+               case LogCenterConstants.FD_API_TYPE_WRITE_START:
+                       FileAccess writeAccess = new FileAccess(dentry, filePath, pid,
+                                       tid, fd, apiType, eventTime);
+                       addStartAccessData(writeAccess);
+                       break;
+               case LogCenterConstants.FD_API_TYPE_WRITE_END:
+                       addEndAccessData(dentry, pid, tid, fd,  filePath, eventTime,
+                                       fileSize, LogCenterConstants.FD_API_TYPE_WRITE_START);
+                       break;
+               case LogCenterConstants.FD_API_TYPE_LOCK_START:
+                       isFileLocking.put(dentry, true);
+                       addStartAccessData(new FileAccess(dentry, filePath, pid, tid, fd, 
+                                       apiType, eventTime));
+                       break;
+               case LogCenterConstants.FD_API_TYPE_LOCK_END:
+                       isFileLocking.put(dentry, false);
+                       addEndAccessData(dentry, pid, tid, fd, filePath, eventTime,
+                                       fileSize, LogCenterConstants.FD_API_TYPE_LOCK_START);
+                       break;
+               default:
+                               break;
+               }
+               list.add(event);
+       }
+       
+       public void addStatusData(FileStatus data) {
+               fileStatusList.add(data);
+               FileDataManager.getInstance().getStatusDB().insert(data);
+       }
+       
+       public void addStartAccessData(FileAccess data) {
+               fileAccessList.add(data);
+       }
+
+       public void addEndAccessData(long dentry, int pid, int tid, long fd, String filePath, 
+                       long endTime, long fileSize, int apiType) {
+               for (int i = 0; i < fileAccessList.size(); i++) {
+                       FileAccess data = fileAccessList.get(i);
+                       if (data.getPid() == pid
+                                       && data.getTid() == tid 
+                                       && data.getFd() == fd
+                                       && data.getApiType() == apiType
+                                       && data.getEndTime() <= 0){
+                               data.setEndTime(endTime);
+                               data.setFileSize(fileSize);
+                               FileDataManager.getInstance().getAccessDB().insert(data);
+                               break;
+                       }
+               }
+               // when failed search start time, dump endEvent.
+       }
+       
+       private String createKey(int pid, int tid, long fd) {
+               StringBuffer key = new StringBuffer(pid);
+               key.append(":");
+               key.append(tid);
+               key.append(":");
+               key.append(fd);
+               return key.toString();
+       }
+       
+       public List<FileEvent> getFileEventList() {
+               return fileLogsQueue.poll();
+       }
+       
+       public List<FileAccess> getFileAccessList() {
+               return fileAccessList;
+       }
+       
+       public List<FileStatus> getFileStatusList() {
+               return fileStatusList;
+       }
+       
+       private void checkHeapMemory() {
+               if ( (fileAccessList.size() > DALimit.MAX_FILE_ACCESS_COUNT
+                               || fileStatusList.size() > DALimit.MAX_FILE_STATUS_COUNT) 
+                               || fileAccessorMap.size() > DALimit.MAX_FILE_ACCESSOR_COUNT) {
+                       ToolbarArea.getInstance().stopTrace();
+                       Display.getDefault().asyncExec(new Runnable() {
+                               @Override
+                               // display a dialog to alert heap memory warning
+                               public void run() {
+                                       final Shell shell = WorkbenchUtil.getWorkbenchWindow()
+                                                       .getShell();
+                                       DADialog dialog = new DADialog(shell, SWT.NONE, 550, 153);
+                                       dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
+                                       dialog.setMessage(AnalyzerLabels.HEAP_MEMORY_WARNING_PRE
+                                                       + PathManager.DA_INSTALL_PATH
+                                                       + AnalyzerLabels.HEAP_MEMORY_WARNING_POST);
+                                       dialog.open();
+                               }
+                       });
+               }
+       }
+
+       
+       /**
+        * filtering out "print" and "fdopen" api name
+        * @param input
+        * @return
+        */
+       private boolean checkInvalidApiName(FileData input) {
+               String apiName = input.getApiName();
+               if (apiName.contains("print")
+                               || apiName.contains("fdopen")) {
+                       return true;
+               } 
+               return false;
+       }
+       
+       /**
+        * filtering out main function call when it's OSP api
+        * @param input
+        * @return
+        */
+       private boolean isOpenMainLog(FileData input) {
+               String filePath = input.getFilePath();
+               if (filePath.contains(CommonConstants.SLASH)) {
+                       String[] splitApiFilePath = filePath.split(CommonConstants.SLASH);
+                       String strApiFilePath = new String(
+                                       splitApiFilePath[splitApiFilePath.length - 1].trim());
+                       if (AnalyzerManager.getProject().getPkgId().equals(strApiFilePath)) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+       
+       public void setFileAccessList(List<FileAccess> fileAccessList) {
+               this.fileAccessList = fileAccessList;
+       }
+       
+       public void setFileStatusList(List<FileStatus> fileStatusList) {
+               this.fileStatusList = fileStatusList;
+       }
+
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/manager/FileDataManager.java
new file mode 100644 (file)
index 0000000..aa6269a
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyeran Lim <hyeran74.kim@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.dynamicanalyzer.ui.file.manager;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.PriorityQueue;
+import java.util.TreeSet;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+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.logparser.PageDataManager;
+import org.tizen.dynamicanalyzer.swap.model.data.FileData;
+import org.tizen.dynamicanalyzer.swap.model.data.LogData;
+import org.tizen.dynamicanalyzer.swap.model.data.LogDataSeqNoComparator;
+import org.tizen.dynamicanalyzer.swap.model.data.LogDataTimeComparator;
+import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
+import org.tizen.dynamicanalyzer.ui.file.data.FileAccessDB;
+import org.tizen.dynamicanalyzer.ui.file.data.FileApiDB;
+import org.tizen.dynamicanalyzer.ui.file.data.FileStatusDB;
+import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
+
+
+public class FileDataManager extends PageDataManager {
+       private static FileDataManager instance = null;
+       private static FileDataMaker dataMaker = null;
+       
+       private FileAccessDB accessDB = null;
+       private FileApiDB apiDB = null;
+       private FileStatusDB statusDB = null;
+       
+       // TODO: comment or rename eventList
+       private List<FileEvent> eventList = new ArrayList<FileEvent>();
+       private List<FileEvent> selectedTableAPIList = new ArrayList<FileEvent>();
+
+       private FileDataManager() {
+               dataMaker = new FileDataMaker(
+                               AnalyzerManager.getFailedChecker(),
+                               AnalyzerManager.getLeakDetector(),
+                               AnalyzerManager.getWarningChecker());
+
+               initDB();
+       }
+
+       public synchronized static FileDataManager getInstance() {
+               if (null == instance) {
+                       instance = new FileDataManager();
+               }
+               return instance;
+       }
+
+       public void initDB() {
+               accessDB = new FileAccessDB();
+               addDBTable(accessDB);
+               apiDB = new FileApiDB();
+               addDBTable(apiDB);
+               statusDB = new FileStatusDB();
+               addDBTable(statusDB);
+       }
+       
+       public void clear() {
+               accessDB = null;
+               apiDB = null;
+               statusDB = null;
+               eventList = new ArrayList<FileEvent>();
+               selectedTableAPIList = new ArrayList<FileEvent>();
+       }
+       
+       public FileAccessDB getAccessDB(){
+               return accessDB;
+       }
+       
+       public FileApiDB getApiDB() {
+               return apiDB;
+       }
+       
+       public FileStatusDB getStatusDB() {
+               return statusDB;
+       }
+       
+       public void openProcess() {
+               // TODO
+       }
+
+       @Override
+       protected void onThreadStop() {
+               // TODO
+       }
+       
+       public FileDataMaker getFileChartDataMaker() {
+               return dataMaker;
+       }
+       
+       public void addFileEventQueue(FileEvent data){
+               eventList.add(data);
+       }
+
+       public List<FileEvent> getFileEventQueue() {
+               return eventList;
+       }
+       
+       public List<FileEvent> getSelectedTableAPIList() {
+               return selectedTableAPIList;
+       }
+
+       public void setSelectedTableAPIList(
+                       List<FileEvent> selectedTableAPIList) {
+               this.selectedTableAPIList = selectedTableAPIList;
+       }
+       
+       /**
+        * get syscalls message and probe message about file
+        * @param logPack
+        * @return
+        */
+       private List<LogData> getLogsFromLogPackage(LogPackage logPack) {
+               Logs probeLogs = logPack
+                               .getLogs(DataChannelConstants.MSG_PROBE_FILE);
+               Logs functionEntryLogs = logPack
+                               .getLogs(DataChannelConstants.MSG_FUNCTION_ENTRY);
+               Logs functionExitLogs = logPack
+                               .getLogs(DataChannelConstants.MSG_FUNCTION_EXIT);
+       
+               
+               
+               PriorityQueue<LogData> sysQueue = new PriorityQueue<LogData>(100000, new LogDataSeqNoComparator());
+               PriorityQueue<LogData> pQueue = new PriorityQueue<LogData>(100000,
+                               new LogDataSeqNoComparator());
+               
+               //List<LogData> remainProbeLogs = dataMaker.getRemainProbeLogs();
+               //List<LogData> remainSysLogs = dataMaker.getRemainSysLogs();
+       
+               /*              // probe message
+               if (probeLogs != null) {
+                       List<LogData> probeLogList = probeLogs.getLogs();
+                       Iterator<LogData> probeIterator = probeLogList.iterator();
+                       while (probeIterator.hasNext()) {
+                               pQueue.offer(probeIterator.next());
+                       }
+               } else
+               
+               if(remainProbeLogs != null) {
+                       Iterator<LogData> iterator = remainProbeLogs.iterator();
+                       while (iterator.hasNext()) {
+                               pQueue.offer(iterator.next());
+                       }
+               }
+
+               // function entry message
+               if (functionEntryLogs != null) {
+                       List<LogData> functionEntryLogList = functionEntryLogs.getLogs();
+                       Iterator<LogData> fEntryiterator = functionEntryLogList.iterator();
+                       ProfileData fndata = null;
+                       while (fEntryiterator.hasNext()) {
+                               fndata = (ProfileData) fEntryiterator.next();
+                               if (fndata.getProbeType() == 4) {
+                                       sysQueue.offer(fndata);
+                               }
+                       }
+               }
+               // function exit message
+               if (functionExitLogs != null) {
+                       ProfileData fndata = null;
+                       List<LogData> functionExitLogList = functionExitLogs.getLogs();
+                       Iterator<LogData> fExitIterator = functionExitLogList.iterator();
+                       while (fExitIterator.hasNext()) {
+                               fndata = (ProfileData) fExitIterator.next();
+                               if (fndata.getProbeType() == 4) {
+                                       sysQueue.offer(fndata);
+                               }
+                       }
+               }
+               
+               if(remainSysLogs != null) {
+                       Iterator<LogData> iterator = remainSysLogs.iterator();
+                       while (iterator.hasNext()) {
+                               sysQueue.offer(iterator.next());
+                       }
+               }
+               
+               List<LogData> fileProbeLogs = new ArrayList<LogData>();
+               do {
+                       LogData probeTop = pQueue.poll();
+                       if(probeTop !=null) {
+                               fileProbeLogs.add(probeTop);
+                       }else {
+                               break;
+                       }
+
+               } while (true);
+               
+               // save syscall messages separated by pid in Map  
+               Map<Integer, List<LogData>> sysLogsMap = new HashMap<Integer, List<LogData>>();
+               List<LogData> fileSysLogs = new ArrayList<LogData>();
+               do {
+                       LogData sysTop = sysQueue.poll();
+                       if(sysTop != null) {
+                               int pid = sysTop.getPid();
+                               if(sysLogsMap.get(pid) != null) {
+                                       fileSysLogs = sysLogsMap.get(pid);
+                                       fileSysLogs.add(sysTop);
+                               } else {
+                                       fileSysLogs = new ArrayList<LogData>();
+                                       fileSysLogs.add(sysTop);
+                                       sysLogsMap.put(pid, fileSysLogs);
+                               }
+                       }else{
+                               break;
+                       }
+                       
+               } while (true);
+               
+               
+               dataMaker.addSysLogsMap(sysLogsMap);
+               return fileProbeLogs;*/
+               
+               
+               
+               
+               // probe message
+               ArrayList<LogData> fileLogs = new ArrayList<LogData>();
+               
+               // probe message
+               if (probeLogs != null) {
+                       List<LogData> probeLogList = probeLogs.getLogs();
+                       Iterator<LogData> probeIterator = probeLogList.iterator();
+                       while (probeIterator.hasNext()) {
+                               pQueue.offer(probeIterator.next());
+                       }
+               }
+               
+               // function entry message
+               if (functionEntryLogs != null) {
+                       List<LogData> functionEntryLogList = functionEntryLogs.getLogs();
+                       Iterator<LogData> fEntryiterator = functionEntryLogList.iterator();
+                       ProfileData fndata = null;
+                       while (fEntryiterator.hasNext()) {
+                               fndata = (ProfileData) fEntryiterator.next();
+                               if (fndata.getProbeType() == 4) {
+                                       pQueue.offer(fndata);
+                               }
+                       }
+               }
+               // function exit message
+               if (functionExitLogs != null) {
+                       ProfileData fndata = null;
+                       List<LogData> functionExitLogList = functionExitLogs.getLogs();
+                       Iterator<LogData> fExitIterator = functionExitLogList.iterator();
+                       while (fExitIterator.hasNext()) {
+                               fndata = (ProfileData) fExitIterator.next();
+                               if (fndata.getProbeType() == 4) {
+                                       pQueue.offer(fndata);
+                               }
+                       }
+               }
+               
+               do {
+                       LogData top = pQueue.poll();
+                       if (top == null)
+                               break;
+
+                       fileLogs.add(top);
+               } while (true);
+
+               return fileLogs;
+               
+       }
+
+       /**
+        * make log data about file into chart data for drawing chart
+        */
+       @Override
+       protected void makeData(LogPackage pack) {
+               // TODO change when the issue with SRR is resolved
+               /*List<LogData> logs = getLogsFromLogPackage(pack);
+               if (!logs.isEmpty()) {
+                       dataMaker.makeData(logs);
+               }*/
+               dataMaker.makeData(pack);
+       }
+       
+
+}
index ce5ac1a..f09505a 100644 (file)
@@ -47,8 +47,7 @@ public class FileAccess {
        private boolean isAlreadyWriting = false;
        private boolean isAlreadyLocking = false;
        
-       public FileAccess(long dentry, String filePath, int pid, int tid,
-                       int apiType, long startTime) {
+       public FileAccess(long dentry, String filePath, int pid, int tid, int apiType, long startTime) {
                this.dentry = dentry;
                this.filePath = filePath;
                this.pid = pid;
@@ -56,9 +55,8 @@ public class FileAccess {
                this.apiType = apiType;
                this.startTime = startTime;
        }
-       
-       public FileAccess(long dentry, String filePath, int pid, int tid, long fd,
-                       int apiType, long startTime) {
+
+       public FileAccess(long dentry, String filePath, int pid, int tid, long fd, int apiType, long startTime) {
                this.dentry = dentry;
                this.filePath = filePath;
                this.pid = pid;
index dd40136..36ee033 100644 (file)
@@ -34,89 +34,111 @@ import org.tizen.dynamicanalyzer.swap.model.data.FileData;
 import org.tizen.dynamicanalyzer.ui.file.data.FileApiDB;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 
-// file log data
 public class FileEvent extends FileData{
-       private int seqNo = -1;
-       private long dentry = -1;
-       private String filePath = null;
-       private int pid = -1;
-       private int tid = -1;
-       private long fd = -1;
-       private int apiType = -1;       
-       private long eventTime = -1;
+       protected long dentry = -1;
+       private String originFilePath = null;
+       // TODO considering apiId 
        private String apiName = null;
-       private long errNo = -1;
        private long ioSize =-1;
-       private long fileSize = -1;
-       private String returnVal = null;
-       private String args = null;
-       private boolean target = true;
+       private boolean target = false;
        
-       private long readSize = -1;
-       private long writeSize = -1;
+       public FileEvent() { }
        
-       public FileEvent(int seqNo, String filePath, int pid, int tid, 
+       public FileEvent(int seq, long dentry, int pid, int tid, String filePath) {
+               this.seq = seq;
+               this.dentry = dentry;
+               this.pid = pid;
+               this.tid = tid;
+               this.filePath = filePath;
+       }
+       
+
+       public FileEvent(int seq, long dentry, int pid, int tid, long fd, String filePath, String originFilePath) {
+               this.seq = seq;
+               this.dentry = dentry;
+               this.pid = pid;
+               this.tid = tid;
+               this.fdValue = fd;
+               this.filePath = filePath;
+               this.originFilePath = originFilePath;
+       }
+       
+       // for non-target process
+       public FileEvent(int seq, long dentry, int pid, int tid, long fd, String originFilePath, int apiType, long eventTime) {
+               this.seq = seq;
+               this.dentry = dentry;
+               this.pid = pid;
+               this.tid = tid;
+               this.fdValue = fd;
+               this.originFilePath = originFilePath;
+               this.fdApiType = apiType;
+               this.time = eventTime;
+               
+       }
+       
+       public FileEvent(int seq, String filePath, int pid, int tid, 
                        long fd, int apiType, long eventTime, long fileSize) {
+               this.seq = seq;
                this.filePath = filePath;
                this.pid = pid;
                this.tid = tid;
-               this.fd = fd;
-               this.apiType = apiType;
-               this.eventTime = eventTime;
+               this.fdValue = fd;
+               this.fdApiType = apiType;
+               this.time = eventTime;
                this.fileSize = fileSize;
        }
        
-       public FileEvent(int seqNo, long dentry, String filePath, int pid, int tid, 
+       public FileEvent(int seq, long dentry, String filePath, int pid, int tid, 
                        long fd, int apiType, String apiName, long eventTime, long fileSize,
                        String args, String returnVal, long errNo, boolean target){
-               this.seqNo = seqNo;
+               this.seq = seq;
                this.dentry = dentry;
                this.filePath = filePath;
                this.pid = pid;
                this.tid = tid;
-               this.fd = fd;
-               this.apiType = apiType;
+               this.fdValue = fd;
+               this.fdApiType = apiType;
                this.apiName = apiName;
-               this.eventTime = eventTime;
+               this.time = eventTime;
                this.fileSize = fileSize;
                this.args = args;
-               this.returnVal = returnVal;
-               this.errNo = errNo;
+               this.ret = returnVal;
+               this.errno = errNo;
                this.target = target;
        }
        
        public FileEvent(List<Object> data) {
-               this.seqNo = (Integer)data.get(FileApiDB.COLUMN.SEQ.getValue());
+               this.seq = (Integer)data.get(FileApiDB.COLUMN.SEQ.getValue());
                this.dentry = (Long)data.get(FileApiDB.COLUMN.DENTRY.getValue());
                this.filePath = (String)data.get(FileApiDB.COLUMN.FILE_PATH.getValue());
                this.pid = (Integer)data.get(FileApiDB.COLUMN.PID.getValue());
                this.tid = (Integer)data.get(FileApiDB.COLUMN.TID.getValue());
-               this.fd = (Long)data.get(FileApiDB.COLUMN.FD.getValue());
-               this.apiType = (Integer)data.get(FileApiDB.COLUMN.API_TYPE.getValue());
+               this.fdValue = (Long)data.get(FileApiDB.COLUMN.FD.getValue());
+               this.fdApiType = (Integer)data.get(FileApiDB.COLUMN.API_TYPE.getValue());
                this.apiName = (String)data.get(FileApiDB.COLUMN.API_NAME.getValue());
-               this.eventTime = (Long)data.get(FileApiDB.COLUMN.EVENT_TIME.getValue());
+               this.time = (Long)data.get(FileApiDB.COLUMN.EVENT_TIME.getValue());
                this.fileSize = (Long)data.get(FileApiDB.COLUMN.FILE_SIZE.getValue());
-               this.returnVal = (String)data.get(FileApiDB.COLUMN.RETURN_VALUE.getValue());
+               this.ret = (String)data.get(FileApiDB.COLUMN.RETURN_VALUE.getValue());
                this.args = (String)data.get(FileApiDB.COLUMN.ARGS.getValue());
-               this.errNo = (Long)data.get(FileApiDB.COLUMN.ERRNO.getValue());
+               this.errno = (Long)data.get(FileApiDB.COLUMN.ERRNO.getValue());
                this.target = (Boolean)data.get(FileApiDB.COLUMN.TARGET.getValue());
        }
        
        public List<Object> getDBData() {
                List<Object> data = new ArrayList<Object>();
-               data.add(this.seqNo);
+               data.add(this.seq);
                data.add(this.dentry);
                data.add(this.filePath);
                data.add(this.pid);
                data.add(this.tid);
-               data.add(this.fd);
-               data.add(this.apiType);
-               data.add(this.eventTime);
+               data.add(this.fdValue);
+               data.add(this.fdApiType);
+               data.add(this.time);
                data.add(this.apiName);
-               data.add(this.errNo);
+               data.add(this.errno);
                data.add(this.ioSize);
                data.add(this.fileSize);
-               data.add(this.returnVal);
+               data.add(this.ret);
                data.add(this.args);
                data.add(this.target);
                return data;
@@ -130,8 +152,22 @@ public class FileEvent extends FileData{
                this.filePath = filePath;
        }
        
+       public String getOriginFilePath() {
+               return originFilePath;
+       }
+       
+       public void setOriginFilePath(String originFilePath) {
+               this.originFilePath = originFilePath;
+       }
+       
+       public String getOriginFileName() {
+               String[] splitPath = originFilePath.split("\\/"); //$NON-NLS-1$
+               String fileName = new String(splitPath[splitPath.length - 1]);
+               return fileName;
+       }
+       
        public String getFileName() {
-               String[] splitPath = this.filePath.split("\\/"); //$NON-NLS-1$
+               String[] splitPath = filePath.split("\\/"); //$NON-NLS-1$
                String fileName = new String(splitPath[splitPath.length - 1]);
                return fileName;
        }
@@ -160,52 +196,12 @@ public class FileEvent extends FileData{
                this.tid = tid;
        }
        
-       public long getFd() {
-               return fd;
-       }
-       
-       public void setFd(long fd) {
-               this.fd = fd;
-       }
-       
-       public int getApiType() {
-               return apiType;
-       }
-       
-       public void setApiType(int apiType) {
-               this.apiType = apiType;
-       }
-       
-       public long getEventTime() {
-               return Math.round(eventTime);
-       }
-       
-       public void setEventTime(long eventTime) {
-               this.eventTime = eventTime;
-       }
-       
-       public long getTime() {
-               return Math.round(eventTime);
-       }
-       
-       public void setTime(long eventTime) {
-               this.eventTime = eventTime;
-       }
-       
-       public long getErrNo() {
-               return errNo;
-       }
-       
-       public void setErrNo(long errNo) {
-               this.errNo = errNo;
+       public int getSeq() {
+               return seq;
        }
 
-       public int getSeqNo() {
-               return seqNo;
-       }
-
-       public void setSeqNo(int seqNo) {
-               this.seqNo = seqNo;
+       public void setSeq(int seqNo) {
+               this.seq = seqNo;
        }
 
        public long getIoSize() {
@@ -224,14 +220,6 @@ public class FileEvent extends FileData{
                this.fileSize = fileSize;
        }
 
-       public String getReturnVal() {
-               return returnVal;
-       }
-
-       public void setReturnVal(String returnVal) {
-               this.returnVal = returnVal;
-       }
-
        public String getArgs() {
                return args;
        }
@@ -240,22 +228,6 @@ public class FileEvent extends FileData{
                this.args = args;
        }
 
-       public long getReadSize() {
-               return readSize;
-       }
-
-       public void setReadSize(long readSize) {
-               this.readSize = readSize;
-       }
-
-       public long getWriteSize() {
-               return writeSize;
-       }
-
-       public void setWriteSize(long writeSize) {
-               this.writeSize = writeSize;
-       }
-
        public String getApiName() {
                return apiName;
        }
index 2785655..0c6ea85 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.file.model;
 
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
-
-public class FileSelectedData {
-       private long dentry = -1;
-       private int pid = -1;
-       private int tid = -1;
+public class FileSelectedData extends FileEvent{
        private boolean isParentChart = false;
-       private String filePath = null;
-       private long fileSize = 0;
        
-       public FileSelectedData(long dentry, int pid, int tid, boolean isParentChart) {
+       public FileSelectedData(long dentry, int pid, int tid,long fd, boolean isParentChart) {
                this.dentry = dentry;
                this.pid = pid;
                this.tid = tid;
+               this.fdValue = fd;
                this.isParentChart = isParentChart;
        }
        
-       public FileSelectedData(long dentry, int pid, int tid,
+       public FileSelectedData(long dentry, int pid, int tid, long fd,
                        boolean isParentChart, String filePath, long fileSize) {
                this.dentry = dentry;
                this.pid = pid;
                this.tid = tid;
+               this.fdValue = fd;
                this.isParentChart = isParentChart;
                this.filePath = filePath;
                this.fileSize = fileSize;
@@ -102,4 +97,5 @@ public class FileSelectedData {
        public void getFileSize(long fileSize) {
                this.fileSize = fileSize;
        }
+
 }
index 4bb09bd..e3c7366 100644 (file)
@@ -42,12 +42,13 @@ public class FileStatus {
        private long eventTime = -1;
        private long errNo = 0;
        
-       public FileStatus(long dentry, int pid, int tid, String filePath,
+       public FileStatus(long dentry, int pid, int tid, long fd, String filePath,
                        int apiType, long eventTime, long errNo) {
                this.dentry = dentry;
                this.filePath = filePath;
                this.pid = pid;
                this.tid = tid;
+               this.fd = fd;
                this.apiType = apiType;
                this.eventTime = eventTime;
                this.errNo = errNo;
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileApiListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileApiListTable.java
deleted file mode 100644 (file)
index fd02458..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Hyeran kim <hyearn74.kim@samsung.com> 
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file.view;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-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.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.error.ErrorCodeManager;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.model.TableInput;
-import org.tizen.dynamicanalyzer.swap.model.data.FileData;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-import org.tizen.dynamicanalyzer.utils.Formatter;
-import org.tizen.dynamicanalyzer.ui.file.FilePage;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
-import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
-
-public class FileApiListTable extends DAApiListTableComposite {
-       public FileApiListTable(Composite parent, int compStyle, int tableStyle) {
-               super(parent, compStyle, tableStyle);
-               table.addSelectionListener(new SelectionListener() {
-
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-
-                               GridItem[] items = table.getSelection();
-                               if (null == items) {
-                                       return;
-                               }
-                               long startTime = 0;
-                               long endTime = 0;
-
-                               DATableDataFormat dataFormat;
-                               long itemTime;
-                               for (int i = 0; i < items.length; i++) {
-                                       dataFormat = (DATableDataFormat) items[i].getData();
-                                       itemTime = dataFormat.getLogData().getTime();
-                                       if (0 == startTime) {
-                                               startTime = itemTime;
-                                       }
-                                       if (startTime > itemTime) {
-                                               startTime = itemTime;
-                                       }
-                                       if (endTime < itemTime) {
-                                               endTime = itemTime;
-                                       }
-                               }
-                               DASelectionData selData = new DASelectionData(
-                                               FilePage.apilistViewID, startTime, endTime, items,
-                                               table);
-                               AnalyzerManager.getCurrentPage().updateView(selData);
-                       }
-
-                       @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                       }
-               });
-       }
-
-       @Override
-       protected List<TableInput> makeTableInput() {
-               FileApiListView view = (FileApiListView) AnalyzerManager
-                               .getCurrentPage().getView(FilePage.apilistViewID);
-
-               long rangeStartTime = view.getRangeStartTime();
-               long rangeEndTime = view.getRangeEndTime();
-               
-               HashMap<String, Integer> findStartAPITableIndexHashMap = new HashMap<String, Integer>();
-               List<Integer> removeTableIndex = new ArrayList<Integer>();
-               List<TableInput> input = new ArrayList<TableInput>();
-               
-               List<FileEvent> contents = FileChartManager.getInstance().getSelectedTableAPIList();
-               if(contents == null) {
-                       return null;
-               }
-               for (int i = 0; i < contents.size(); i++) {
-                       FileEvent contentTemp = contents.get(i);
-                       int selectedPid = ToolbarArea.getInstance().getSelectedPid();
-                       if (selectedPid != 0) {
-                               if (selectedPid != contentTemp.getPid()) {
-                                       continue;
-                               }
-                       }
-                       List<String> contentText = new ArrayList<String>();
-                       List<String> contentData = new ArrayList<String>();
-
-                       Integer startLogIndex = 0;
-                       int fdApiType = contentTemp.getApiType();
-
-                       int seq = contentTemp.getSeqNo();
-                       contentText.add(0, Integer.toString(seq));
-                       contentData.add(Integer.toString(seq));
-                       long time = contentTemp.getEventTime();
-
-                       boolean isExistStartTimeLog = false;
-                       if (fdApiType == LogCenterConstants.FD_API_TYPE_READ_START
-                                       || fdApiType == LogCenterConstants.FD_API_TYPE_WRITE_START) {
-                               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) {
-                               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
-                                       contentData.add(input.get(startLogIndex.intValue())
-                                                       .getText().get(1));
-
-                                       long startTime = contents.get(startLogIndex.intValue()).getEventTime();
-                                       String timeFormat = Formatter
-                                                       .toTimeFormat(time - startTime);
-                                       String removeTimeFormat = timeFormat.replace(
-                                                       "00:", CommonConstants.EMPTY);//$NON-NLS-1$
-
-                                       contentText.add(removeTimeFormat); // elapsed time
-                                       contentData.add(Long.toString(time - startTime));
-
-                                       isExistStartTimeLog = true;
-                                       removeTableIndex.add(startLogIndex.intValue());
-                               } else {
-                                       contentText.add(Formatter.toTimeFormat(contentTemp
-                                                       .getEventTime())); // start//
-                                       contentData.add(Long.toString(contentTemp.getEventTime()));
-                                       contentText.add("00.000");//$NON-NLS-1$
-                                       contentData.add("00.000");//$NON-NLS-1$
-                               }
-                       }
-
-                       if (!isExistStartTimeLog) {
-                               contentText.add(Formatter.toTimeFormat(time)); // start time
-                               contentData.add(Long.toString(time));
-                               contentText.add("00.000");//$NON-NLS-1$                                                 //elapsed time
-                               contentData.add("00.000");//$NON-NLS-1$                                                         
-                       }
-
-                       contentText.add(Integer.toString(contentTemp.getPid()));
-                       contentData.add(Integer.toString(contentTemp.getPid()));
-
-                       contentText.add(Integer.toString(contentTemp.getTid()));
-                       contentData.add(Integer.toString(contentTemp.getTid()));
-
-                       contentText.add(contentTemp.getApiName());
-                       contentData.add(contentTemp.getApiName());
-
-                       contentText.add(contentTemp.getArgs());
-                       contentData.add(contentTemp.getArgs());
-
-                       contentText.add(contentTemp.getReturnVal());
-                       contentData.add(contentTemp.getReturnVal());
-
-                       String errMsg = ErrorCodeManager.getInatance()
-                                       .getErrorCode(contentTemp.getErrNo()).name();
-                       if (null == errMsg) {
-                               errMsg = "undefined error code"; //$NON-NLS-1$
-                       }
-                       contentText.add(errMsg);
-                       contentData.add(errMsg);
-                       contentText.add(Long.toString(contentTemp.getFileSize()));
-                       contentData.add(Long.toString(contentTemp.getFileSize()));
-
-                       DATableDataFormat tableData = new DATableDataFormat(
-                                       contentTemp.getSeqNo());
-                       tableData.setLogData(contentTemp);
-                       tableData.getData().addAll(contentData);
-                       TableInput tableInput = new TableInput();
-                       tableInput.setText(contentText);
-                       tableInput.setData(tableData);
-                       if (!errMsg.contains("SUCCESS")) {//$NON-NLS-1$
-                               tableInput.setFailed(true);
-                       }
-                       input.add(tableInput);
-
-                       if (time >= rangeStartTime && time <= rangeEndTime) {
-                               tableInput.setInRange(true);
-                       }
-               }
-               int removeCount = 0;
-               for (int index : removeTableIndex) {
-                       int removeIndex = index - removeCount;
-                       if (removeIndex > 0) {
-                               input.remove(removeIndex);
-                               removeCount++;
-                       }
-               }
-               return input;
-       }
-
-       protected void actionSetStartEnd(int type) {
-               GridItem item = table.getItem(mousePoint);
-               if (null != item) {
-                       FileData data = (FileData) ((DATableDataFormat) item.getData())
-                                       .getLogData();
-                       long time = data.getTime();
-                       double startTime = -1;
-                       double endTime = -1;
-
-                       if (type == START_TIME) {
-                               rangeDataManager.setMarkerStartTime(time);
-                               startTime = time / TimelineConstants.MEGA_DOUBLE;
-                               endTime = rangeDataManager.getMarkerEndTime()
-                                               / TimelineConstants.MEGA_DOUBLE;
-
-                       } else if (type == END_TIME) {
-                               rangeDataManager.setMarkerEndTime(time);
-                               endTime = time / TimelineConstants.MEGA_DOUBLE;
-                               startTime = rangeDataManager.getMarkerStartTime()
-                                               / TimelineConstants.MEGA_DOUBLE;
-                       }
-
-                       FileChartView chartview = (FileChartView) (AnalyzerManager
-                                       .getCurrentPage().getView(FilePage.chartViewID));
-
-                       chartview.setRangeMarker(startTime, endTime);
-               }
-       }
-}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileApiListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileApiListView.java
deleted file mode 100644 (file)
index 4e05582..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Hyeran kim <hyearn74.kim@samsung.com> 
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file.view;
-
-import java.util.List;
-
-import org.eclipse.nebula.widgets.grid.Grid;
-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.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.ui.file.FileChartData;
-import org.tizen.dynamicanalyzer.ui.file.FilePage;
-import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
-import org.tizen.dynamicanalyzer.ui.file.model.FileSelectedData;
-import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
-import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSelectionType;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
-
-public class FileApiListView extends DAViewComposite {
-       private long analysisStartTime = 0;
-       private long analysisEndTime = 0;
-       private int preSelectionPId = 1;
-       private long preAnalysisStartTime = 0;
-       private long preAnalysisEndTime = 0;
-       private boolean isChangedSelected = true;
-       private FileSelectedData selectedData = null;
-
-       private String[] columnNames = { FilePageLabels.FILE_API_LIST_VIEW_INDEX,
-                       FilePageLabels.FILE_API_LIST_VIEW_START_TIME,
-                       FilePageLabels.FILE_API_LIST_VIEW_ELAPSED_TIME,
-                       FilePageLabels.FILE_API_LIST_VIEW_PID,
-                       FilePageLabels.FILE_API_LIST_VIEW_THREAD_ID,
-                       FilePageLabels.FILE_API_LIST_VIEW_API,
-                       FilePageLabels.FILE_API_LIST_VIEW_PARAMETER,
-                       FilePageLabels.FILE_API_LIST_VIEW_RETURN,
-                       FilePageLabels.FILE_API_LIST_VIEW_ERRNO };
-
-       private int[] columnSizes = { 40, 70, 100, 40, 40, 120, 250, 70, 100 };
-       private int[] columnAlignment = { SWT.RIGHT, SWT.RIGHT, SWT.RIGHT,
-                       SWT.RIGHT, SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, SWT.LEFT };
-
-       int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_STRING,
-                       AnalyzerConstants.SORT_TYPE_STRING };
-
-       FileApiListTable tableComp = null;
-       FileChartManager manager = FileChartManager.getInstance();
-
-       public FileApiListView(Composite parent, int style) {
-               super(parent, style, true);
-               this.setLayout(new FillLayout());
-
-               setTitle(FilePageLabels.FILE_API_LIST_VIEW_TITLE);
-
-               Composite contents = getContentArea();
-               contents.setBackground(ColorResources.WINDOW_BG_COLOR);
-               contents.setLayout(new FillLayout());
-               tableComp = new FileApiListTable(contents, SWT.NONE, SWT.MULTI
-                               | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
-               tableComp.setSortTypes(sortTypes);
-               tableComp.setColumnAlignment(columnAlignment);
-               tableComp.setColumns(columnNames);
-               tableComp.setColumnSize(columnSizes);
-               tableComp.setTableName(FilePageLabels.FILE_API_LIST_VIEW_TITLE);
-               contents.addControlListener(new TableColumnSizePackListener(tableComp,
-                               columnSizes));
-       }
-
-       @Override
-       public void updateView() {
-               if (null == tableComp || selectedData == null) {
-                       return;
-               }
-
-               long newAnalysisStartTime = 0;
-               long newAnalysisEndTime = 0;
-
-               if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                       newAnalysisStartTime = RangeDataManager.getInstance()
-                                       .getAnalysisStartTime();
-                       newAnalysisEndTime = RangeDataManager.getInstance()
-                                       .getAnalysisEndTime();
-               } else {
-                       newAnalysisStartTime = 0;
-                       newAnalysisEndTime = 0;
-               }
-
-               if (newAnalysisStartTime != analysisStartTime
-                               || newAnalysisEndTime != analysisEndTime) {
-                       analysisStartTime = newAnalysisStartTime;
-                       analysisEndTime = newAnalysisEndTime;
-                       tableComp.updateTable();
-                       return;
-               }
-
-               int selectedPid = ToolbarArea.getInstance().getSelectedPid();
-               if (preSelectionPId != -1 && preSelectionPId != selectedPid) {
-                       tableComp.updateTable();
-               }
-               preSelectionPId = selectedPid;
-
-               List<FileEvent> events = manager.getApiDB().selectAPITable(
-                               selectedData.getDentry(), selectedData.getPid(),
-                               selectedData.getTid(), selectedData.isParentChart());
-               if (tableComp.getTable().getItemCount() > 0
-                               && events.size() != tableComp.getTable().getItemCount()) {
-                       manager.setSelectedTableAPIList(events);
-                       tableComp.updateTable();
-               }
-       }
-
-       @Override
-       public Control getControl() {
-               return tableComp;
-       }
-
-       @Override
-       public void clear() {
-               tableComp.getTable().removeAll();
-       }
-       
-       @Override
-       public void updateView(DAViewData data) {
-               DASelectionData selData = (DASelectionData) data;
-               long selectionStartTime = selData.getStartTime();
-               long selectionEndTime = selData.getEndTime();
-               if (selData.getData() instanceof FileSelectedData) {
-                       selectedData = (FileSelectedData) selData.getData();
-                       if (null == selectedData) {
-                               return;
-                       }
-                       manager.setSelectedTableAPIList(
-                                       manager.getApiDB().
-                                       selectAPITable(selectedData.getDentry(),
-                                                       selectedData.getPid(), 
-                                                       selectedData.getTid(), 
-                                                       selectedData.isParentChart()));
-                       
-                       tableComp.updateTable();
-                       tableComp.setSelectionByTime(selectionStartTime,
-                                       selectionEndTime);
-                       isChangedSelected = true;
-               }
-       }
-
-       
-       public FileSelectedData getSelectedData() {
-               return selectedData;
-       }
-
-       public long getRangeStartTime() {
-               return analysisStartTime;
-       }
-
-       public long getRangeEndTime() {
-               return analysisEndTime;
-       }
-}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileChartView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileChartView.java
deleted file mode 100644 (file)
index 34ed11b..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyeran kim <hyearn74.kim@samsung.com> 
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file.view;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
-import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-import org.tizen.dynamicanalyzer.ui.file.FilePage;
-import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardSelectionListener;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
-
-public class FileChartView extends DAViewComposite {
-       public final static int FILE_CHART_HEIGHT = 40;
-
-       private final Composite contents;
-       private FileChartBoard fileChartBoard;
-       private final StackLayout stackLayout;
-       private DAChartBoardItem lastSelectedItemForSummary = null;
-
-       private final RangeDataManager rangeDataManager = RangeDataManager
-                       .getInstance();
-       private FileChartManager chartManager = FileChartManager.getInstance();
-
-       public FileChartView(Composite parent, int style) {
-               super(parent, style, false);
-               this.setLayout(new FillLayout());
-
-               setTitle(FilePageLabels.FILE_CHART_FILE);
-
-               contents = getContentArea();
-               contents.setBackground(ColorResources.WINDOW_BG_COLOR);
-               stackLayout = new StackLayout();
-               contents.setLayout(stackLayout);
-               fileChartBoard = new FileChartBoard(contents, FilePageLabels.FILE_CHART_FILE);
-               fileChartBoard.setNameFont(FontResources.CHART_NAME_FONT);
-               fileChartBoard.addSelectionListener(new DAChartBoardSelectionListener() {
-                       @Override
-                       public void handleSelectionEvent(DAChartBoardItem item) {
-                               lastSelectedItemForSummary = item;
-                               AnalyzerManager
-                                               .getCurrentPage().updateView(
-                                                               new DASelectionData(
-                                                                               FilePage.chartViewID,
-                                                                               (long) (((DAChartPlotIntervalMarker) fileChartBoard
-                                                                                               .getMarkers()
-                                                                                               .get(UICommonConstants.SELECTION_MARKER_INDEX))
-                                                                                               .getStartVal() * TimelineConstants.MEGA_DOUBLE),
-                                                                               (long) (((DAChartPlotIntervalMarker) fileChartBoard
-                                                                                               .getMarkers()
-                                                                                               .get(UICommonConstants.SELECTION_MARKER_INDEX))
-                                                                                               .getEndVal() * TimelineConstants.MEGA_DOUBLE),
-                                                                               item.getData(), null));
-                       }
-               });
-
-               initIntervalMarkers(fileChartBoard);
-
-               stackLayout.topControl = fileChartBoard;
-               Composite textBoxLabel = new Composite(fileChartBoard.getTitleComp(),
-                               SWT.NONE);
-               textBoxLabel.addPaintListener(new PaintListener() {
-                       @Override
-                       public void paintControl(PaintEvent e) {
-                               Composite composite = (Composite) e.widget;
-                               Rectangle rect = composite.getClientArea();
-
-                               e.gc.drawImage(ImageResources.TIMELINE_DROPDOWN_NORMAL, rect.x,
-                                               rect.y);
-                               e.gc.setFont(FontResources.COMBO);
-                               e.gc.setForeground(ColorResources.BLACK);
-                               e.gc.drawString(FilePageLabels.FILE_CHART_FILE, rect.x + 30,
-                                               rect.y + 2, true);
-                       }
-               });
-
-               DATimeline timeline = fileChartBoard.getTimeline();
-
-               timeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT);
-               timeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT);
-
-               LifecycleLogParser.getInstance().registerLifecycleBar(
-                               fileChartBoard.getLifecycleBar());
-               LifecycleLogParser.getInstance().registerTimeline(timeline);
-
-               timeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener(
-                               rangeDataManager, fileChartBoard, timeline));
-       }
-
-       @Override
-       public void updateView() {
-               fileChartBoard.updateChart();
-               
-               fileChartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime());
-
-               fileChartBoard.setTimelineMarkerStartTime(rangeDataManager
-                               .getMarkerStartTime() / TimelineConstants.MEGA_DOUBLE);
-               fileChartBoard.setTimelineMarkerEndTime(rangeDataManager.getMarkerEndTime()
-                               / TimelineConstants.MEGA_DOUBLE);
-
-               if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                       ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
-                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
-                                       .setInterval(rangeDataManager.getAnalysisStartTime()
-                                                       / TimelineConstants.MEGA_DOUBLE,
-                                                       rangeDataManager.getAnalysisEndTime()
-                                                                       / TimelineConstants.MEGA_DOUBLE);
-               } else {
-                       ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
-                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
-                                       .setInterval(-1, -1);
-               }
-
-               ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
-                               UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
-                               rangeDataManager.getMarkerStartTime()
-                                               / TimelineConstants.MEGA_DOUBLE,
-                               rangeDataManager.getMarkerEndTime()
-                                               / TimelineConstants.MEGA_DOUBLE);
-
-       }
-
-       @Override
-       public void updateView(DAViewData data) {
-               fileChartBoard.updateChart();
-               if (data instanceof DASelectionData) {
-                       DASelectionData selData = (DASelectionData) data;
-                       long dataTime = -1;
-
-                       if (selData.isLogData()) {
-                               Object obData = selData.getData();
-                               if (null != obData && (obData instanceof LogData)) { // summary
-                                       LogData ldata = (LogData) obData;
-                                       dataTime = ldata.getTime();
-                                       
-                                       int seq = ldata.getSeq();
-                                       List<FileEvent> event = chartManager.getApiDB().selectFileEventBySeq(seq);
-                                       int selectedIndex[] = fileChartBoard.getChartIndex(event.get(0));
-                                       fileChartBoard.selectItem(selectedIndex[0], selectedIndex[1]);
-
-                                       if (null != lastSelectedItemForSummary) {
-                                               AnalyzerManager.getCurrentPage().updateView(
-                                                               new DASelectionData(FilePage.chartViewID,
-                                                                               dataTime, dataTime,
-                                                                               lastSelectedItemForSummary.getData(),
-                                                                               null));
-                                       }
-                               }
-                       } else {
-                               dataTime = selData.getStartTime();
-                       }
-                       double startTime = dataTime / TimelineConstants.MEGA_DOUBLE;
-                       double endTime = selData.getEndTime() / TimelineConstants.MEGA_DOUBLE;
-
-                       DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker)fileChartBoard
-                                       .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
-                       intervalMarker.setInterval(startTime, endTime);
-
-               }
-       }
-
-       @Override
-       public void clear() {
-               fileChartBoard.clear();
-               initIntervalMarkers(fileChartBoard);
-               chartManager.getFileChartDataMaker().clear();
-       }
-
-       @Override
-       public Control getControl() {
-               return fileChartBoard;
-       }
-
-       private void initIntervalMarkers(DAChartBoard board) {
-               // selection marker
-               DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker(
-                               -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA);
-               selectionMarker.setBackgroundColor(ColorResources.SELECTION_RANGE);
-               selectionMarker.setAlpha((int) (255 * 0.25));
-               board.addIntervalMarker(selectionMarker);
-
-               // range analysis marker
-               DAChartPlotIntervalMarker rangeAnalyzeMarker = new DAChartPlotIntervalMarker(
-                               -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA);
-               rangeAnalyzeMarker.setBackgroundColor(ColorResources.YELLOW);
-               rangeAnalyzeMarker.setAlpha((int) (255 * 0.25));
-               board.addIntervalMarker(rangeAnalyzeMarker);
-
-               // range marker
-               DAChartPlotIntervalMarker rangeMarker = new DAChartPlotIntervalMarker(
-                               -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE);
-               rangeMarker.setForegroundColor(ColorResources.RED);
-               rangeMarker.setAlpha((int) (255 * 0.25));
-               board.addIntervalMarker(rangeMarker);
-       }
-       
-       public void setRangeMarker(double starttime, double endtime) {
-               fileChartBoard.setTimelineMarkerStartTime(starttime);
-               fileChartBoard.setTimelineMarkerEndTime(endtime);
-
-               ((DAChartPlotIntervalMarker) fileChartBoard.getMarkers().get(
-                               UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
-                                               starttime, endtime);
-       }
-
-}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileDetailInfoView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/view/FileDetailInfoView.java
deleted file mode 100644 (file)
index 2dc5266..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Hyeran kim <hyearn74.kim@samsung.com> 
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.dynamicanalyzer.ui.file.view;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.FilePageLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.ui.file.FilePage;
-import org.tizen.dynamicanalyzer.ui.file.manager.FileChartManager;
-import org.tizen.dynamicanalyzer.ui.file.model.FileEvent;
-import org.tizen.dynamicanalyzer.ui.file.model.FileSelectedData;
-import org.tizen.dynamicanalyzer.utils.Formatter;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-
-public class FileDetailInfoView extends DAViewComposite {
-       private Canvas canvas = null;
-       private String fileName = AnalyzerLabels.EMPTY_STRING;
-       private String filePath = AnalyzerLabels.EMPTY_STRING;
-       private long fileSize = 0;
-       private long readSize = 0;
-       private long writeSize = 0;
-       private long totalUseTime = 0;
-       private int apiCount = 0;
-       private int failedApiCount = 0;
-       
-       private FileChartManager fileChartManager = FileChartManager.getInstance();
-       
-       private void init() {
-               fileName = AnalyzerLabels.EMPTY_STRING;
-               filePath = AnalyzerLabels.EMPTY_STRING;
-               fileSize = 0;
-               readSize = 0;
-               writeSize = 0;
-               totalUseTime = 0;
-               apiCount = 0;
-               failedApiCount = 0;
-       }
-
-       public FileDetailInfoView(Composite parent, int style) {
-               super(parent, style, true);
-               this.setLayout(new FillLayout());
-
-               setTitle(FilePageLabels.FILE_DETAILS_TITLE);
-
-               Composite contents = getContentArea();
-               contents.setBackground(ColorResources.VIEW_BG_COLOR);
-               contents.setLayout(new FillLayout());
-               canvas = new Canvas(contents, SWT.TRANSPARENT);
-               canvas.addPaintListener(new PaintListener() {
-
-                       @Override
-                       public void paintControl(PaintEvent e) {
-                               int x = 0;
-                               int y = 0;
-                               Rectangle rect = canvas.getBounds();
-                               e.gc.setBackground(ColorResources.VIEW_BG_COLOR);
-                               e.gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
-                               e.gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
-                               e.gc.setFont(FontResources.DETAIL_INFO_FONT);
-
-                               String fName = FilePageLabels.FILE_DETAILS_FILE_NAME + fileName;
-                               Point textSize = e.gc.textExtent(fName, SWT.DRAW_MNEMONIC);
-                               if (textSize.x > rect.width) {
-                                       fName = FilePageLabels.FILE_DETAILS_FILE_NAME_NEWLINE
-                                                       + fileName;
-                               }
-                               int fontHeight = textSize.y + 5;
-                               e.gc.drawString(fName, x += 10, y += fontHeight);
-
-                               // file path bolck
-                               {
-                                       String pathLabel = FilePageLabels.FILE_DETAILS_FILE_PATH;
-                                       e.gc.drawString(pathLabel, x, y + fontHeight);
-                                       Point pathSize = e.gc.textExtent(pathLabel,
-                                                       SWT.DRAW_MNEMONIC);
-                                       int xPos = x + pathSize.x;
-                                       int width = rect.width - xPos;
-                                       String text = filePath;
-                                       if (text.length() > 0) {
-                                               while (text.length() > 0) {
-                                                       Point tSize = e.gc.textExtent(text,
-                                                                       SWT.DRAW_MNEMONIC);
-                                                       String inputText = AnalyzerLabels.EMPTY_STRING;
-                                                       if (tSize.x > width) {
-                                                               int strLen = (width * text.length()) / tSize.x;
-                                                               inputText += text.substring(0, strLen - 1);
-                                                               text = text.substring(strLen - 1, text.length());
-                                                       } else {
-                                                               inputText += text;
-                                                               text = AnalyzerLabels.EMPTY_STRING;
-                                                       }
-                                                       e.gc.drawString(inputText, xPos, y += fontHeight);
-                                               }
-                                       } else {
-                                               y += fontHeight;
-                                       }
-                               }
-
-                               e.gc.drawString(
-                                               FilePageLabels.FILE_DETAILS_TOTAL_SIZE
-                                                               + Long.toString(fileSize), x, y += fontHeight);
-                               e.gc.drawString(
-                                               FilePageLabels.FILE_DETAILS_READ_SIZE
-                                                               + Long.toString(readSize), x, y += fontHeight);
-                               e.gc.drawString(
-                                               FilePageLabels.FILE_DETAILS_WRITE_SIZE
-                                                               + Long.toString(writeSize), x, y += fontHeight);
-                               e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_USE_TIME
-                                               + Formatter.toTimeFormat(totalUseTime)
-                                               + FilePageLabels.TIME_MS, x, y += fontHeight);
-                               e.gc.drawString(
-                                               FilePageLabels.FILE_DETAILS_API_COUNT
-                                                               + Integer.toString(apiCount), x,
-                                               y += fontHeight);
-                               e.gc.drawString(FilePageLabels.FILE_DETAILS_FAILED_API_COUNT
-                                               + Integer.toString(failedApiCount), x, y += fontHeight);
-                       }
-               });
-       }
-
-       @Override
-       public void updateView(DAViewData data) {
-               updateData();
-       }
-
-       @Override
-       public void updateView() {
-               updateData();
-       }
-
-       private void updateData() {
-               FileApiListView view = (FileApiListView) AnalyzerManager
-                               .getCurrentPage().getView(FilePage.apilistViewID);
-               FileSelectedData selectData = view.getSelectedData();
-
-               if (null == selectData) {
-                       return;
-               }
-               List<FileEvent> events = null;
-               events = fileChartManager.getApiDB()
-                               .selectAPITable(selectData.getDentry(),
-                                               selectData.getPid(), selectData.getTid(), selectData.isParentChart());
-               if(events != null) {
-                       filePath = events.get(0).getFilePath();
-                       fileName = events.get(0).getFileName();
-                       fileSize = events.get(0).getFileSize();
-                       apiCount = events.size();
-               }
-               events = fileChartManager.getApiDB()
-                               .selectFailedAPI(selectData.getDentry(),
-                                               selectData.getPid(), selectData.getTid(), selectData.isParentChart());
-               if(events != null) {
-                       failedApiCount = events.size();
-               }
-               // TODO define What totalUseTime
-               // totalUseTime = (long) selectData.getFileTotalUseTime();
-               // readSize = selectData.getReadSize();
-               // writeSize = selectData.getWriteSize();
-                       
-               canvas.redraw();
-       }
-
-       @Override
-       public Control getControl() {
-               return canvas;
-       }
-
-       @Override
-       public void clear() {
-               init();
-               canvas.redraw();
-       }
-}
index 9e71193..e450664 100644 (file)
@@ -3,7 +3,6 @@ package org.tizen.dynamicanalyzer.ui.info.screenshot;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
@@ -11,11 +10,8 @@ import org.tizen.dynamicanalyzer.swap.logparser.Logs;
 import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.SystemData;
-import org.tizen.dynamicanalyzer.util.DALogger;
 
 public class ScreenshotDataManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-       
        private static ScreenshotDataManager instance = null;
        private List<Long> lastCpuRate = null;
        private int lastProcessMemory = 0;
@@ -32,34 +28,6 @@ public class ScreenshotDataManager extends PageDataManager {
                return instance;
        }
 
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if(pack == null)        // stop thread
-                               break;
-                       
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
-                       if (null != logs && null != logs.getRawLogs()   && !logs.getRawLogs().isEmpty()) {
-                               List<LogData> inputs = logs.getRawLogs();
-                               int lastIndex = inputs.size() - 1;
-                               SystemData input = (SystemData) inputs.get(lastIndex);
-                               
-                               String[] cpuRates = input.getCpuLoad().split(CommonConstants.COMMA);
-                               for (int i = 0; i < cpuRates.length - 1; i++) {
-                                       String cpu = cpuRates[i].trim();
-                                       lastCpuRate.add(new Long((long)Float.parseFloat(cpu)));
-                               }
-                               
-                               lastProcessMemory = input.getResidentMemory();
-                               lastStartTime = input.getTime();
-                       }
-               }
-               
-               /* log for debug */
-               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-       }
-
        public List<Long> getLastCpuRate() {
                return lastCpuRate;
        }
@@ -71,4 +39,23 @@ public class ScreenshotDataManager extends PageDataManager {
        public long getLastStartTime() {
                return lastStartTime;
        }
+
+       @Override
+       protected void makeData(LogPackage pack) {
+               Logs logs = pack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
+               if (null != logs && null != logs.getRawLogs()   && !logs.getRawLogs().isEmpty()) {
+                       List<LogData> inputs = logs.getRawLogs();
+                       int lastIndex = inputs.size() - 1;
+                       SystemData input = (SystemData) inputs.get(lastIndex);
+                       
+                       String[] cpuRates = input.getCpuLoad().split(CommonConstants.COMMA);
+                       for (int i = 0; i < cpuRates.length - 1; i++) {
+                               String cpu = cpuRates[i].trim();
+                               lastCpuRate.add(new Long((long)Float.parseFloat(cpu)));
+                       }
+                       
+                       lastProcessMemory = input.getResidentMemory();
+                       lastStartTime = input.getTime();
+               }
+       }
 }
index dab7c9e..38332e4 100644 (file)
@@ -30,7 +30,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.PriorityQueue;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
@@ -38,11 +37,8 @@ import org.tizen.dynamicanalyzer.swap.logparser.Logs;
 import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.LogDataTimeComparator;
-import org.tizen.dynamicanalyzer.util.DALogger;
 
 public class KernelDataManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-       
        private static KernelDataManager instance = null;
        private KernelDataMaker kdataMaker = null;
        
@@ -76,23 +72,6 @@ public class KernelDataManager extends PageDataManager {
                return instance;
        }
        
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (null == pack) {     // stop thread
-                               break;
-                       }
-
-                       ArrayList<LogData> logs = getLogsFromLogPackage(pack);
-                       if (!logs.isEmpty())
-                               kdataMaker.makeData(logs);
-               }
-
-               /* log for debug */
-               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-       }
-
        public void clear() {
                kdataMaker.clear();
        }
@@ -169,4 +148,11 @@ public class KernelDataManager extends PageDataManager {
 
                return kernelLogs;
        }
+
+       @Override
+       protected void makeData(LogPackage pack) {
+               ArrayList<LogData> logs = getLogsFromLogPackage(pack);
+               if (!logs.isEmpty())
+                       kdataMaker.makeData(logs);
+       }
 }
index fe3198c..47aaf96 100644 (file)
@@ -36,6 +36,7 @@ import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.swap.channel.data.ApiNameManager;
+import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
 import org.tizen.dynamicanalyzer.ui.network.data.StatusSeriesListSortComparator;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
@@ -49,7 +50,6 @@ public class NetworkChart {
        protected DAChartBoardItem item;
        protected DAChart chart;
        private List<NetworkChart> children = new ArrayList<NetworkChart>();
-
        private DAChartSeries statueSeries;
        private DAChartSeries apiSeries;
        private DAChartSeries accessSeries;
@@ -58,13 +58,20 @@ public class NetworkChart {
        private String destinationAddress = CommonConstants.EMPTY;
        private String fdValue = CommonConstants.EMPTY;
 
+       private int parentChartIndex = -1;
+       private int childChartIndex = -1;
+       private int pId = -1;
+
        public NetworkChart(String chartName, String destinationAddress,
-                       String fdValue, DAChartBoardItem item, DAChart chart) {
+                       String fdValue, DAChartBoardItem item, DAChart chart,
+                       int parentChartIndex, int childChartIndex) {
                setChartName(chartName);
                setDestinationAddress(destinationAddress);
                setFdValue(fdValue);
                setItem(item);
                setChart(chart);
+               setParentChartIndex(parentChartIndex);
+               setChildChartIndex(childChartIndex);
        }
 
        public String getChartName() {
@@ -138,7 +145,7 @@ public class NetworkChart {
                                }
                                NetworkAPIType data = apiList.get(i);
                                DAChartSeriesItem seriesItem = null;
-                               double time = data.getTime() / TimelineConstants.MEGA_DOUBLE;
+                               double time = getConvertTime(data.getTime());
                                Color color = ColorResources.NETWORK_API_USED;
                                String apiName = ApiNameManager.getApiName(data.getApiNameID());
                                if (data.getErrno() != 0) {
@@ -147,11 +154,21 @@ public class NetworkChart {
                                seriesItem = new DAChartSeriesItem(time,
                                                DAChartSeriesItem.SERIES_STATE_BAR, color, apiName);
                                apiSeries.addSeriesItem(seriesItem);
+                               if (!isParentChartRow() && data.getErrno() != 0) {
+                                       setChartIndexOfSeq(data.getSeq());
+                               }
                        }
                }
                chart.redraw();
        }
 
+       private void setChartIndexOfSeq(int seq) {
+               NetworkDataManager.getInstance().setParentIndexOfSeq(seq,
+                               getParentChartIndex());
+               NetworkDataManager.getInstance().setChildIndexOfSeq(seq,
+                               getChildChartIndex());
+       }
+
        private void sortStatusSeriesByStartTime(List<NetworkSeriesType> statusList) {
                Collections.sort(statusList, new StatusSeriesListSortComparator());
        }
@@ -161,7 +178,7 @@ public class NetworkChart {
                double startTime = -1;
                double endTime = -1;
 
-               double openTimeOfNotClosed = 999999999;
+               double openTimeOfNotClosed = NetworkDataManager.MAX_CHART_TIME;
 
                for (int i = 0; i < statusList.size(); i++) {
                        if (getDestinationAddress().equals(
@@ -172,8 +189,8 @@ public class NetworkChart {
                                        continue;
                                }
 
-                               startTime = data.getStartTime() / TimelineConstants.MEGA_DOUBLE;
-                               endTime = data.getEndTime() / TimelineConstants.MEGA_DOUBLE;
+                               startTime = getConvertTime(data.getStartTime());
+                               endTime = getConvertTime(data.getEndTime());
 
                                if (endTime > 0 && openTimeOfNotClosed > startTime) { // closed
                                        DAChartSeriesItem seriesItem = new DAChartSeriesItem(
@@ -221,7 +238,6 @@ public class NetworkChart {
                NetworkSeriesType data = null;
                double startTime = -1;
                double endTime = -1;
-
                for (int i = 0; i < statusList.size(); i++) {
                        if (getDestinationAddress().equals(
                                        statusList.get(i).getDestinationAddress())
@@ -231,9 +247,8 @@ public class NetworkChart {
                                if (isAccessEvnet(data.getAPIType())) {
                                        continue;
                                }
-                               startTime = data.getStartTime() / TimelineConstants.MEGA_DOUBLE;
-                               endTime = data.getEndTime() / TimelineConstants.MEGA_DOUBLE;
-
+                               startTime = getConvertTime(data.getStartTime());
+                               endTime = getConvertTime(data.getEndTime());
                        }
                }
                if (null == data) {
@@ -299,8 +314,8 @@ public class NetworkChart {
                                if (!isAccessEvnet(data.getAPIType())) {
                                        continue;
                                }
-                               startTime = data.getStartTime() / TimelineConstants.MEGA_DOUBLE;
-                               endTime = data.getEndTime() / TimelineConstants.MEGA_DOUBLE;
+                               startTime = getConvertTime(data.getStartTime());
+                               endTime = getConvertTime(data.getEndTime());
                                int status = data.getAPIType();
 
                                Color waitiColor = null;
@@ -325,6 +340,10 @@ public class NetworkChart {
                chart.redraw();
        }
 
+       private double getConvertTime(double logTime) {
+               return logTime / TimelineConstants.MEGA_DOUBLE;
+       }
+
        private boolean isAccessEvnet(int apiType) {
                {
                        if (apiType == NetworkSeriesType.ACCESS_TYPE_WAIT
@@ -337,4 +356,28 @@ public class NetworkChart {
                }
 
        }
+
+       public int getParentChartIndex() {
+               return parentChartIndex;
+       }
+
+       public void setParentChartIndex(int parentChartIndex) {
+               this.parentChartIndex = parentChartIndex;
+       }
+
+       public int getChildChartIndex() {
+               return childChartIndex;
+       }
+
+       public void setChildChartIndex(int childChartIndex) {
+               this.childChartIndex = childChartIndex;
+       }
+
+       public int getpId() {
+               return pId;
+       }
+
+       public void setpId(int pId) {
+               this.pId = pId;
+       }
 }
\ No newline at end of file
index 5dd1a51..cbddd54 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,6 +27,7 @@
 package org.tizen.dynamicanalyzer.ui.network;
 
 import java.util.ArrayList;
+import java.util.LinkedHashMap;
 import java.util.List;
 
 import org.eclipse.swt.widgets.Composite;
@@ -50,6 +51,7 @@ import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSelectionType;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
@@ -68,6 +70,11 @@ public class NetworkChartBoard extends DAChartBoard {
        private int statusSeriesListCount = -1;
        private boolean isFirstMakeChart = true;
 
+       private int parentChartIndex = -1;
+       private LinkedHashMap<Integer, Integer> lastChildChartIndexOfEachParent = new LinkedHashMap<Integer, Integer>();
+
+       private int preSelectionPId = -1;
+
        public NetworkChartBoard(Composite parent, String title) {
                super(parent, title);
                initIntervalMarkers();
@@ -104,6 +111,36 @@ public class NetworkChartBoard extends DAChartBoard {
                clearSeries();
                updateSeries();
                updateApiSeries();
+               chartFilteringByPId();
+       }
+
+       private void chartFilteringByPId() {
+               if (null == getItemList()) {
+                       return;
+               }
+               int selectedPid = ToolbarArea.getInstance().getSelectedPid();
+               boolean isCheck = false;
+
+               if (preSelectionPId != -1 && preSelectionPId != selectedPid) {
+                       isCheck = true;
+               }
+
+               if (isCheck) {
+                       int parentIndex = 0;
+                       for (NetworkChart chart : chartItemList) {
+                               if (chart.isParentChartRow()) {
+                                       if (selectedPid == 0) {
+                                               showItem(parentIndex);
+                                       } else if (selectedPid == chart.getpId()) {
+                                               showItem(parentIndex);
+                                       } else {
+                                               hideItem(parentIndex);
+                                       }
+                                       parentIndex++;
+                               }
+                       }
+               }
+               preSelectionPId = selectedPid;
        }
 
        public void clear() {
@@ -112,6 +149,9 @@ public class NetworkChartBoard extends DAChartBoard {
                statusSeriesListCount = -1;
                isFirstMakeChart = true;
                initIntervalMarkers();
+               parentChartIndex = -1;
+               lastChildChartIndexOfEachParent = new LinkedHashMap<Integer, Integer>();
+               preSelectionPId = -1;
        }
 
        public void initIntervalMarkers() {
@@ -266,6 +306,8 @@ public class NetworkChartBoard extends DAChartBoard {
 
                                NetworkChart parent = getParentChartData(destinationAddress, fd);
                                if (null == parent) {
+                                       parentChartIndex++;
+                                       lastChildChartIndexOfEachParent.put(parentChartIndex, 1);
                                        StringBuffer chartName = new StringBuffer(
                                                        destinationAddress);
                                        if (chartName.length() > 10) {
@@ -283,7 +325,7 @@ public class NetworkChartBoard extends DAChartBoard {
                                        addSeries(parentDAChart);
                                        NetworkChart parentChartData = new NetworkChart(
                                                        chartName.toString(), destinationAddress, fd,
-                                                       parentItem, parentDAChart);
+                                                       parentItem, parentDAChart, parentChartIndex, 0);
                                        chartItemList.add(parentChartData);
 
                                        String childChartName = NetworkPageLabels.NETWORK_CHILD_CHART_NAME
@@ -297,13 +339,17 @@ public class NetworkChartBoard extends DAChartBoard {
                                        addSeries(childDAChart);
                                        NetworkChart childChartData = new NetworkChart(
                                                        childChartName, destinationAddress, fd, childItem,
-                                                       childDAChart);
+                                                       childDAChart, parentChartIndex, 0);
                                        parentChartData.pushChild(childChartData);
                                        chartItemList.add(childChartData);
                                } else {
+                                       int childChartIndex = lastChildChartIndexOfEachParent
+                                                       .get(parent.getParentChartIndex());
+
                                        String childChartName = NetworkPageLabels.NETWORK_CHILD_CHART_NAME
                                                        + fd;
                                        DAChartBoardItem parentItem = parent.getItem();
+
                                        DAChartBoardItem childItem = new DAChartBoardItem(
                                                        parentItem, childChartName);
                                        childItem.setData(new NetworkSelectionType(
@@ -311,11 +357,15 @@ public class NetworkChartBoard extends DAChartBoard {
                                        DAChart childDAChart = childItem.getChart();
                                        initNetworkChart(childDAChart, false);
                                        addSeries(childDAChart);
+
                                        NetworkChart childChartData = new NetworkChart(
                                                        childChartName, destinationAddress, fd, childItem,
-                                                       childDAChart);
+                                                       childDAChart, parent.getParentChartIndex(),
+                                                       childChartIndex);
                                        parent.pushChild(childChartData);
                                        chartItemList.add(childChartData);
+                                       lastChildChartIndexOfEachParent.put(
+                                                       parent.getParentChartIndex(), ++childChartIndex);
                                }
                        }
                        statusSeriesListCount = NetworkDataManager.getInstance()
@@ -349,6 +399,14 @@ public class NetworkChartBoard extends DAChartBoard {
                List<NetworkSeriesType> seriesList = filetirngSeriresList();
                for (NetworkChart chart : chartItemList) {
                        chart.updateStatusSeries(seriesList);
+                       for (int i = 0; i < seriesList.size(); i++) {
+                               if (chart.getDestinationAddress().equals(
+                                               seriesList.get(i).getDestinationAddress())
+                                               && chart.getFdValue().equals(
+                                                               seriesList.get(i).getFdValue())) {
+                                       chart.setpId(seriesList.get(i).getpId());
+                               }
+                       }
                }
                for (NetworkChart chart : chartItemList) {
                        chart.updateAccessSeries(seriesList);
index e95b7fc..d65c0cf 100644 (file)
@@ -169,9 +169,16 @@ public class NetworkChartView extends DAViewComposite {
                networkChartBoard.updateChart();
                if (data instanceof DASelectionData) {
                        DASelectionData selData = (DASelectionData) data;
-                       long dataTime = -1;
 
-                       if (selData.isLogData()) {
+                       String id = data.getViewID();
+                       long dataTime = -1;
+                       if (id.equals(NetworkPage.listViewID)) {
+                               dataTime = selData.getStartTime();
+                               moveChartPosition(dataTime, -1);
+                       } else if (id.equals(NetworkPage.chartViewID)
+                                       || id.equals(NetworkPage.detailViewID)) {
+                               return;
+                       } else {
                                Object obData = selData.getData();
                                if (null != obData && (obData instanceof LogData)) { // summary
                                        LogData ldata = (LogData) obData;
@@ -183,17 +190,27 @@ public class NetworkChartView extends DAViewComposite {
                                                                                lastSelectedItemForSummary.getData(),
                                                                                null));
                                        }
+                                       moveChartPosition(dataTime, ldata.getSeq());
                                }
-                       } else {
-                               dataTime = selData.getStartTime();
                        }
-                       double selectionTime = dataTime / TimelineConstants.MEGA_DOUBLE;
-
-                       DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) networkChartBoard
-                                       .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
-                       intervalMarker.setInterval(selectionTime, selectionTime);
+               }
+       }
 
+       private void moveChartPosition(long dataTime, int seq) {
+               double selectionTime = dataTime / TimelineConstants.MEGA_DOUBLE;
+               networkChartBoard.setVisibleMiddleTime(selectionTime);
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) networkChartBoard
+                               .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
+               intervalMarker.setInterval(selectionTime, selectionTime);
+               if (seq > 0) {
+                       int parentChartIndex = NetworkDataManager.getInstance()
+                                       .getParentIndexOfSeq(seq);
+                       int childChartIndex = NetworkDataManager.getInstance()
+                                       .getChildIndexOfSeq(seq);
+
+                       networkChartBoard.selectItem(parentChartIndex, childChartIndex);
                }
+
        }
 
        @Override
index f3ec776..43cdc7d 100644 (file)
@@ -42,12 +42,14 @@ import org.eclipse.swt.widgets.Text;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.DownloadContentfileManager;
 import org.tizen.dynamicanalyzer.utils.Formatter;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
@@ -252,14 +254,15 @@ public class NetworkDetailView extends DAViewComposite {
                if (!sendAckTime.equals(CommonConstants.EMPTY)) {
                        strDetailView.append(leftFormAttachment
                                        + NetworkPageLabels.NETWORK_DETAILS_SEND_ACK_TIME
-                                       + sendAckTime + NetworkPageLabels.TIME_MS
+                                       + sendAckTime + AnalyzerLabels.TIME_MS
                                        + heightFormAttachment);
                }
 
                if (!payload.equals(CommonConstants.EMPTY)) {
                        detailText.getVerticalBar().setVisible(true);
                        detailText.getHorizontalBar().setVisible(true);
-                       strDetailView.append(setPacketMessage(payload));
+                       strDetailView.append(getPacketMessage(DownloadContentfileManager
+                                       .getFileContents(payload)));
                } else {
                        detailText.getVerticalBar().setVisible(true);
                        detailText.getHorizontalBar().setVisible(true);
@@ -269,7 +272,7 @@ public class NetworkDetailView extends DAViewComposite {
 
        }
 
-       public String setPacketMessage(String packetMessage) {
+       public String getPacketMessage(String packetMessage) {
                StringBuffer out = new StringBuffer();
                StringBuffer strHex = new StringBuffer();
                StringBuffer strAscii = new StringBuffer();
index 6f352a0..5e748db 100644 (file)
@@ -66,7 +66,7 @@ public class NetworkTable extends DAApiListTableComposite {
                                long startTime = 0;
                                long endTime = 0;
 
-                               DATableDataFormat dataFormat;
+                               DATableDataFormat dataFormat = null;
                                long itemTime;
                                for (int i = 0; i < items.length; i++) {
                                        dataFormat = (DATableDataFormat) items[i].getData();
@@ -83,6 +83,7 @@ public class NetworkTable extends DAApiListTableComposite {
                                }
                                DASelectionData selData = new DASelectionData(
                                                NetworkTableView.ID, startTime, endTime, items, table);
+
                                AnalyzerManager.getCurrentPage().updateView(selData);
                        }
 
index 9b75802..7c0b5a6 100644 (file)
@@ -1,6 +1,33 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
 package org.tizen.dynamicanalyzer.ui.network.data;
 
 import java.sql.PreparedStatement;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -9,45 +36,80 @@ import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
-import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 
 public class NetworkAPIDBManager extends DBTable {
-       private static final String TABLENAME = NetworkPageLabels.NETWORK_API_DB_TABLENAME;
+       private static final String TABLENAME = "NETWORK_API"; //$NON-NLS-1$ 
 
        public static final String SEQ = DBConstants.COMMON_COLUMN_SEQ;
-       public static final String DESTINATION_ADDRESS = NetworkPageLabels.NETWORK_DB_DESTINATION_ADDRESS;
-       public static final String FD_VALUE = NetworkPageLabels.NETWORK_DB_FD_VALUE;
-       public static final String API_TIME = NetworkPageLabels.NETWORK_API_DB_API_TIME;
-       public static final String API_NAME_ID = NetworkPageLabels.NETWORK_DB_API_ID;
-       public static final String ERRNO = NetworkPageLabels.NETWORK_API_DB_ERRNO;
+       public static final String DESTINATION_ADDRESS = "DESTINATION_ADDRESS"; //$NON-NLS-1$ 
+       public static final String FD_VALUE = "FD_VALUE"; //$NON-NLS-1$ 
+       public static final String API_TIME = DBConstants.COMMON_COLUMN_TIME;
+       public static final String API_NAME_ID = DBConstants.COMMON_COLUMN_ID;
+       public static final String ERRNO = DBConstants.COMMON_COLUMN_ERROR;
        public static final String PID = DBConstants.COMMON_COLUMN_PID;
        public static final String TID = DBConstants.COMMON_COLUMN_TID;
-       public static final String ARGUMENT = NetworkPageLabels.NETWORK_API_DB_ARGUMENT;
-       public static final String RETURN = NetworkPageLabels.NETWORK_API_DB_RETURN;
-       public static final String BYTE_SIZE = NetworkPageLabels.NETWORK_API_DB_BYTE_SIZE;
-       public static final String PAYLOAD = NetworkPageLabels.NETWORK_API_DB_PAYLOAD;
-       public static final String API_TYPE = NetworkPageLabels.NETWORK_API_DB_API_TYPE;
-       public static final String CALLER_PC_ADDRESS = NetworkPageLabels.NETWORK_API_DB_CALLER_PC_ADDRESS;
-       public static final String LIB_NAME = NetworkPageLabels.NETWORK_API_DB_LIB_NAME;
-
-       private static final String SELECT_API_SERIES_QUERY = "select " + SEQ //$NON-NLS-1$
-                       + CommonConstants.COMMA + CommonConstants.SPACE
-                       + DESTINATION_ADDRESS + CommonConstants.COMMA
-                       + CommonConstants.SPACE + FD_VALUE + CommonConstants.COMMA
-                       + CommonConstants.SPACE + API_TIME + CommonConstants.COMMA
-                       + CommonConstants.SPACE + API_NAME_ID + CommonConstants.COMMA
-                       + CommonConstants.SPACE + ERRNO
+       public static final String ARGUMENT = DBConstants.COMMON_COLUMN_ARG;
+       public static final String RETURN = DBConstants.COMMON_COLUMN_RET;
+       public static final String BYTE_SIZE = "BYTE_SIZE"; //$NON-NLS-1$ 
+       public static final String PAYLOAD = "PAYLOAD"; //$NON-NLS-1$ 
+       public static final String API_TYPE = "API_TYPE"; //$NON-NLS-1$ 
+       public static final String CALLER_PC_ADDRESS = DBConstants.COMMON_COLUMN_CALLER_PC_ADDRESS;
+       public static final String LIB_NAME = DBConstants.COMMON_COLUMN_CALLER_LIB_NAME;
+
+       public static final int DB_SEQ_INDEX = 0;
+       public static final int DB_DESTINATION_ADDRESS_INDEX = 1;
+       public static final int DB_FD_VALUE_INDEX = 2;
+       public static final int DB_API_TIME_INDEX = 3;
+       public static final int DB_API_NAME_ID_INDEX = 4;
+       public static final int DB_ERRNO_INDEX = 5;
+       public static final int DB_PID_INDEX = 6;
+       public static final int DB_TID_INDEX = 7;
+       public static final int DB_ARGUMENT_INDEX = 8;
+       public static final int DB_RETURN_INDEX = 9;
+       public static final int DB_BYTE_SIZE_INDEX = 10;
+       public static final int DB_PAYLOAD_INDEX = 11;
+       public static final int DB_API_TYPE_INDEX = 12;
+       public static final int DB_CALLER_PC_ADDRESS_INDEX = 13;
+       public static final int DB_LIB_NAME_INDEX = 14;
+
+       private static final String SELECT_API_SERIES_QUERY = "select " //$NON-NLS-1$ 
+                       + SEQ + CommonConstants.COMMA
+                       + DESTINATION_ADDRESS
+                       + CommonConstants.COMMA + FD_VALUE
+                       + CommonConstants.COMMA
+                       + API_TIME + CommonConstants.COMMA
+                       + API_NAME_ID
+                       + CommonConstants.COMMA + ERRNO
                        + " from " //$NON-NLS-1$
-                       + TABLENAME + " where %s <= " + API_TIME + " and " + API_TIME
+                       + TABLENAME + " where %s <= " + API_TIME + " and "
+                       + API_TIME
                        + " <= %s";//$NON-NLS-1$
 
-       private static final String SELECT_API_TABLE_CHILD_QUERY = "select * from "//$NON-NLS-1$
+       private static final String SELECT_API_TABLE_CHILD_QUERY = "select " + SEQ//$NON-NLS-1$
+                       + CommonConstants.COMMA + DESTINATION_ADDRESS
+                       + CommonConstants.COMMA + FD_VALUE + CommonConstants.COMMA
+                       + API_TIME + CommonConstants.COMMA + API_NAME_ID
+                       + CommonConstants.COMMA + ERRNO + CommonConstants.COMMA + PID
+                       + CommonConstants.COMMA + TID + CommonConstants.COMMA + ARGUMENT
+                       + CommonConstants.COMMA + RETURN + CommonConstants.COMMA
+                       + BYTE_SIZE + CommonConstants.COMMA + PAYLOAD
+                       + CommonConstants.COMMA + API_TYPE + CommonConstants.COMMA
+                       + CALLER_PC_ADDRESS + CommonConstants.COMMA + LIB_NAME + " from "//$NON-NLS-1$
                        + TABLENAME + " where " + DESTINATION_ADDRESS + " = '%s' and "//$NON-NLS-1$
                        + FD_VALUE + " = '%s'";//$NON-NLS-1$
 
-       private static final String SELECT_API_TABLE_PARENT_QUERY = "select * from "//$NON-NLS-1$
+       private static final String SELECT_API_TABLE_PARENT_QUERY = "select " + SEQ//$NON-NLS-1$
+                       + CommonConstants.COMMA + DESTINATION_ADDRESS
+                       + CommonConstants.COMMA + FD_VALUE + CommonConstants.COMMA
+                       + API_TIME + CommonConstants.COMMA + API_NAME_ID
+                       + CommonConstants.COMMA + ERRNO + CommonConstants.COMMA + PID
+                       + CommonConstants.COMMA + TID + CommonConstants.COMMA + ARGUMENT
+                       + CommonConstants.COMMA + RETURN + CommonConstants.COMMA
+                       + BYTE_SIZE + CommonConstants.COMMA + PAYLOAD
+                       + CommonConstants.COMMA + API_TYPE + CommonConstants.COMMA
+                       + CALLER_PC_ADDRESS + CommonConstants.COMMA + LIB_NAME + " from "//$NON-NLS-1$
                        + TABLENAME + " where " + DESTINATION_ADDRESS + " = '%s'";//$NON-NLS-1$ //$NON-NLS-2$
 
        @Override
@@ -126,8 +188,49 @@ public class NetworkAPIDBManager extends DBTable {
 
        @Override
        public boolean prepare(PreparedStatement prep, List<Object> rowData) {
-               // TODO Auto-generated method stub
-               return false;
+               boolean isPrepared = true;
+               int columnsize = getColumnSize();
+               if (columnsize != rowData.size()) {
+                       isPrepared = false;
+               } else {
+                       try {
+                               prep.setInt(DB_SEQ_INDEX + 1,
+                                               (Integer) (rowData.get(DB_SEQ_INDEX)));
+                               prep.setString(DB_DESTINATION_ADDRESS_INDEX + 1,
+                                               (String) (rowData.get(DB_DESTINATION_ADDRESS_INDEX)));
+                               prep.setString(DB_FD_VALUE_INDEX + 1,
+                                               (String) (rowData.get(DB_FD_VALUE_INDEX)));
+                               prep.setLong(DB_API_TIME_INDEX + 1,
+                                               (Long) (rowData.get(DB_API_TIME_INDEX)));
+                               prep.setInt(DB_API_NAME_ID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_API_NAME_ID_INDEX)));
+                               prep.setLong(DB_ERRNO_INDEX + 1,
+                                               (Long) (rowData.get(DB_ERRNO_INDEX)));
+                               prep.setInt(DB_PID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_PID_INDEX)));
+                               prep.setInt(DB_TID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_TID_INDEX)));
+                               prep.setString(DB_ARGUMENT_INDEX + 1,
+                                               (String) (rowData.get(DB_ARGUMENT_INDEX)));
+                               prep.setString(DB_RETURN_INDEX + 1,
+                                               (String) (rowData.get(DB_RETURN_INDEX)));
+                               prep.setInt(DB_BYTE_SIZE_INDEX + 1,
+                                               (Integer) (rowData.get(DB_BYTE_SIZE_INDEX)));
+                               prep.setString(DB_PAYLOAD_INDEX + 1,
+                                               (String) (rowData.get(DB_PAYLOAD_INDEX)));
+                               prep.setInt(DB_API_TYPE_INDEX + 1,
+                                               (Integer) (rowData.get(DB_API_TYPE_INDEX)));
+                               prep.setLong(DB_CALLER_PC_ADDRESS_INDEX + 1,
+                                               (Long) (rowData.get(DB_CALLER_PC_ADDRESS_INDEX)));
+                               prep.setString(DB_LIB_NAME_INDEX + 1,
+                                               (String) (rowData.get(DB_LIB_NAME_INDEX)));
+
+                       } catch (SQLException e) {
+                               e.printStackTrace();
+                               isPrepared = false;
+                       }
+               }
+               return isPrepared;
        }
 
 }
index a607de8..9a74d98 100644 (file)
@@ -40,26 +40,23 @@ import org.tizen.dynamicanalyzer.swap.model.data.NetworkData;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
 import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
-import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
 import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
 import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
 import org.tizen.dynamicanalyzer.util.DALogger;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.DownloadContentfileManager;
 
 public class NetworkDataMaker {
 
        private HashMap<String, String> addressByFdHashMap = new HashMap<String, String>();
        private HashMap<String, String> parentFDByFdHashMap = new HashMap<String, String>();
 
-       private FailedChecker failedChecker = null;
-
        List<NetworkAPIType> noDestinationApiSeriesList = new ArrayList<NetworkAPIType>();
        List<NetworkAPIType> destinationApiSeriesList = new ArrayList<NetworkAPIType>();
 
        public NetworkDataMaker(FailedChecker failedChecker,
                        LeakDetector leakDetector, WarningChecker warningChecker) {
-               this.failedChecker = failedChecker;
        }
 
        public void clear() {
@@ -83,13 +80,6 @@ public class NetworkDataMaker {
                        }
 
                        makeEventData(input);
-
-                       long errno = input.getErrno();
-
-                       if (errno != 0) {
-                               FailedData ffd = new FailedData(input);
-                               this.failedChecker.getFailedList().add(ffd);
-                       }
                }
 
                if (destinationApiSeriesList.size() > 0) {
@@ -120,7 +110,6 @@ public class NetworkDataMaker {
                String apiFD = Long.toString(input.getFdValue()).trim();
                apiFD = getHexString(apiFD);
                int apiId = input.getApiId();
-
                int apiType = input.getFdApiType();
                long time = input.getTime();
                long errno = input.getErrno();
@@ -148,6 +137,8 @@ public class NetworkDataMaker {
                case LogCenterConstants.SOCKET_API_CONNECT: {
                        String[] strInput = parameter.split(CommonConstants.COMMA);
                        if (strInput.length <= 0) {
+                               DALogger.getInstance().error(
+                                               "argument length is wrong : " + input.getApiName());
                                return;
                        }
                        apiAddress = strInput[1].trim();
@@ -156,7 +147,7 @@ public class NetworkDataMaker {
                }
                case LogCenterConstants.SOCKET_API_ACCEPT_START:
                        setStartSeries(apiAddress, apiFD, time, -1,
-                                       NetworkSeriesType.ACCESS_TYPE_WAIT, apiId);
+                                       NetworkSeriesType.ACCESS_TYPE_WAIT, apiId, pId);
                        break;
                case LogCenterConstants.SOCKET_API_ACCEPT_END: {
                        String clientFD = returnValue;
@@ -175,23 +166,27 @@ public class NetworkDataMaker {
                }
                case LogCenterConstants.SOCKET_API_RECV_START:
                        setStartSeries(apiAddress, apiFD, time, -1,
-                                       NetworkSeriesType.ACCESS_TYPE_READ, apiId);
+                                       NetworkSeriesType.ACCESS_TYPE_READ, apiId, pId);
                        break;
                case LogCenterConstants.SOCKET_API_RECV_END:
                        setEndSeries(apiAddress, apiFD, time,
                                        NetworkSeriesType.ACCESS_TYPE_READ);
+                       payloadInfo = DownloadContentfileManager
+                                       .getDowonloadFilePath(payloadInfo);
                        break;
                case LogCenterConstants.SOCKET_API_SEND_START:
                        setStartSeries(apiAddress, apiFD, time, -1,
-                                       NetworkSeriesType.ACCESS_TYPE_WRITE, apiId);
+                                       NetworkSeriesType.ACCESS_TYPE_WRITE, apiId, pId);
                        break;
                case LogCenterConstants.SOCKET_API_SEND_END:
                        setEndSeries(apiAddress, apiFD, time,
                                        NetworkSeriesType.ACCESS_TYPE_WRITE);
+                       payloadInfo = DownloadContentfileManager
+                                       .getDowonloadFilePath(payloadInfo);
                        break;
                case LogCenterConstants.SOCKET_API_EVENT_START:
                        setStartSeries(apiAddress, apiFD, time, -1,
-                                       NetworkSeriesType.ACCESS_TYPE_WAIT, apiId);
+                                       NetworkSeriesType.ACCESS_TYPE_WAIT, apiId, pId);
                        break;
                case LogCenterConstants.SOCKET_API_EVENT_END:
                        setEndSeries(apiAddress, apiFD, time,
@@ -200,6 +195,8 @@ public class NetworkDataMaker {
                case LogCenterConstants.SOCKET_API_BIND: {
                        String[] strInput = parameter.split(CommonConstants.COMMA);
                        if (strInput.length <= 0) {
+                               DALogger.getInstance().error(
+                                               "argument length is wrong : " + input.getApiName());
                                return;
                        }
                        apiAddress = strInput[1].trim();
@@ -212,6 +209,8 @@ public class NetworkDataMaker {
                        if (apiName.contains("epoll_ctl")) { //$NON-NLS-1$
                                String[] strInput = parameter.split(CommonConstants.COMMA);
                                if (strInput.length <= 0) {
+                                       DALogger.getInstance().error(
+                                                       "argument length is wrong : " + input.getApiName());
                                        return;
                                }
                                String clientFD = strInput[0].trim();
@@ -340,7 +339,7 @@ public class NetworkDataMaker {
                                NetworkDataManager.getInstance().getCheckStatusSeries()
                                                .put(apiFD.trim(), apiAddress.trim());
                                setStartSeries(apiAddress, apiFD, time, -1,
-                                               NetworkSeriesType.STATUS_TYPE_OPEN, apiId);
+                                               NetworkSeriesType.STATUS_TYPE_OPEN, apiId, pId);
                        }
                }
        }
@@ -363,10 +362,10 @@ public class NetworkDataMaker {
        }
 
        private void setStartSeries(String apiAddress, String apiFD, long time,
-                       int eventType, int apiType, int apiId) {
+                       int eventType, int apiType, int apiId, int pId) {
 
                NetworkSeriesType statusType = new NetworkSeriesType(apiAddress, apiFD,
-                               time, -1, apiType, apiId);
+                               time, -1, apiType, apiId, pId);
                NetworkDataManager.getInstance().setStartSeriesData(statusType);
        }
 
@@ -398,4 +397,52 @@ public class NetworkDataMaker {
                }
                return retStr;
        }
+
+       // private String getDowonloadPayloadFilePath(String payload) {
+       // if (payload.contains(AnalyzerConstants.CHECK_DOWNLOAD_FILE_STRING)) {
+       // String[] strFile = payload
+       // .split(AnalyzerConstants.CHECK_DOWNLOAD_FILE_STRING);
+       // if (strFile.length < 1) {
+       // return payload;
+       // }
+       // String downloadFilePath = strFile[1];
+       //
+       // String[] copyFilePathSplit = downloadFilePath.split(File.separator
+       // + AnalyzerConstants.TMP_FOLDER + File.separator);
+       // if (copyFilePathSplit.length < 1) {
+       // return payload;
+       // }
+       // String downloadFolderPath = File.separator
+       // + AnalyzerConstants.DOWNLOAD_FILE_FOLDER;
+       //
+       // File toDir = new File(AnalyzerManager.getProject().getSavePath()
+       // + downloadFolderPath);
+       // if (!toDir.exists() || !toDir.isDirectory()) {
+       // toDir.mkdirs();
+       // }
+       //
+       // String saveFilePath = downloadFolderPath + File.separator
+       // + copyFilePathSplit[1];
+       //
+       // if (pullPayloadFile(downloadFilePath, AnalyzerManager.getProject()
+       // .getSavePath() + saveFilePath)) {
+       // return saveFilePath;
+       // } else {
+       // return payload;
+       // }
+       // }
+       // return payload;
+       // }
+       //
+       // private boolean pullPayloadFile(String from, String to) {
+       // SyncResult res = CommunicatorUtils.pull(from, to);
+       // if (null != res && res.isOk()) {
+       //                      DALogger.getInstance().debug(from + "file copying success!!");//$NON-NLS-1$ 
+       // } else {
+       //                      DALogger.getInstance().debug("Failed to get " + from); //$NON-NLS-1$ 
+       // return false;
+       // }
+       // CommunicatorUtils.removeCommand(from);
+       // return true;
+       // }
 }
index cee30e5..7b27f21 100644 (file)
@@ -46,11 +46,18 @@ import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkAPIType;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.util.DALogger;
 import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
 import org.tizen.dynamicanalyzer.widgets.da.base.DADialog;
 
 public class NetworkDataManager extends PageDataManager {
+       public final static int MAX_CHART_TIME = 999999999;
+
+       public final static double NETWORK_SERIES_TYPE_HEAP_MEMORY_KB = 0.3;
+       public final static double CHART_TYPE_HEAP_MEMORY_KB = 4.6 * 5;
+       public final static double MAX_NETWORK_HEAP_MEMORY_KB = 5000; // possible to make approximately 200 chart
+       public final static double ONE_CHART_HEAP_MEMORY_KB = NETWORK_SERIES_TYPE_HEAP_MEMORY_KB;
+       public final static double ONE_ACCESS_SERIES_HEAP_MEMORY_KB = NETWORK_SERIES_TYPE_HEAP_MEMORY_KB;
+         
        private static NetworkDataManager instance = null;
 
        private NetworkDataMaker networkDataMaker = null;
@@ -60,9 +67,12 @@ public class NetworkDataManager extends PageDataManager {
        private List<NetworkAPIType> selectedTableAPIList = null;
        private LinkedHashMap<String, String> checkStatusSeries = new LinkedHashMap<String, String>();
        private List<NetworkSeriesType> seriesList = new ArrayList<NetworkSeriesType>();
+       private LinkedHashMap<Integer, Integer> parentChartIndexOfSeq = new LinkedHashMap<Integer, Integer>();
+       private LinkedHashMap<Integer, Integer> childChartIndexOfSeq = new LinkedHashMap<Integer, Integer>();
 
-       private int statusSeriesSize = 0;
+       private int chartCount = 0;
        private int accessSeriesSize = 0;
+
        private boolean isStopTrace = false;
 
        public NetworkDataManager() {
@@ -76,26 +86,6 @@ public class NetworkDataManager extends PageDataManager {
                return instance;
        }
 
-       /*** make network data thread ***/
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread
-                               break;
-
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_NETWORK);
-                       if (null != logs && logs.getRawLogs().size() != 0) {
-                               List<LogData> inputs = logs.getLogs();
-
-                               networkDataMaker.makeData(inputs);
-                       }
-               }
-
-               /* log for debug */
-               DALogger.getInstance().info(getName() + " thread end!!");
-       }
-
        private void initDB() {
                networkDataMaker = new NetworkDataMaker(
                                AnalyzerManager.getFailedChecker(),
@@ -115,7 +105,9 @@ public class NetworkDataManager extends PageDataManager {
                selectedTableAPIList = null;
                seriesList = new ArrayList<NetworkSeriesType>();
                checkStatusSeries = new LinkedHashMap<String, String>();
-               statusSeriesSize = 0;
+               parentChartIndexOfSeq = new LinkedHashMap<Integer, Integer>();
+               childChartIndexOfSeq = new LinkedHashMap<Integer, Integer>();
+               chartCount = 0;
                accessSeriesSize = 0;
                isStopTrace = false;
        }
@@ -130,7 +122,7 @@ public class NetworkDataManager extends PageDataManager {
 
        public void setStartSeriesData(NetworkSeriesType seriesType) {
                if (seriesType.getAPIType() == NetworkSeriesType.STATUS_TYPE_OPEN) {
-                       statusSeriesSize++;
+                       chartCount++;
                } else {
                        accessSeriesSize++;
                }
@@ -156,7 +148,7 @@ public class NetworkDataManager extends PageDataManager {
        public void openProcess() {
                // set series list from DB
                if (seriesList.size() == 0) {
-                       seriesList = seriesDBManager.select(0, 999999999);
+                       seriesList = seriesDBManager.select(0, MAX_CHART_TIME);
                }
        }
 
@@ -189,8 +181,9 @@ public class NetworkDataManager extends PageDataManager {
        }
 
        private void checkHeapMemory() {
-               if (isStopTrace == false
-                               && (statusSeriesSize > 1000 || accessSeriesSize > 10000)) {
+               double useHeapMemory = (chartCount * ONE_CHART_HEAP_MEMORY_KB)
+                               + (accessSeriesSize * ONE_ACCESS_SERIES_HEAP_MEMORY_KB);
+               if (!isStopTrace && (MAX_NETWORK_HEAP_MEMORY_KB < useHeapMemory)) {
                        isStopTrace = true;
                        ToolbarArea.getInstance().stopTrace();
                        Display.getDefault().asyncExec(new Runnable() {
@@ -209,4 +202,48 @@ public class NetworkDataManager extends PageDataManager {
                }
        }
 
+       public int getParentIndexOfSeq(int seq) {
+               Integer chartIndex = this.parentChartIndexOfSeq.get(seq);
+               if (null != chartIndex) {
+                       return chartIndex;
+               } else {
+                       return 0;
+               }
+       }
+
+       public void setParentIndexOfSeq(int seq, int paretnChartIndex) {
+               Integer chartIndex = this.parentChartIndexOfSeq.get(seq);
+               if (null == chartIndex) {
+                       this.parentChartIndexOfSeq.put(seq, paretnChartIndex);
+               }
+
+       }
+
+       public int getChildIndexOfSeq(int seq) {
+               Integer chartIndex = this.childChartIndexOfSeq.get(seq);
+               if (null != chartIndex) {
+                       return chartIndex;
+               } else {
+                       return 0;
+               }
+       }
+
+       public void setChildIndexOfSeq(int seq, int childChartIndex) {
+               Integer chartIndex = this.childChartIndexOfSeq.get(seq);
+               if (null == chartIndex) {
+                       this.childChartIndexOfSeq.put(seq, childChartIndex);
+               }
+
+       }
+
+       /*** make network data thread ***/
+       @Override
+       protected void makeData(LogPackage pack) {
+               Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_NETWORK);
+               if (null != logs && logs.getRawLogs().size() != 0) {
+                       List<LogData> inputs = logs.getLogs();
+
+                       networkDataMaker.makeData(inputs);
+               }
+       }
 }
index 9cd9e1b..6202167 100644 (file)
@@ -1,29 +1,79 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
 package org.tizen.dynamicanalyzer.ui.network.data;
 
 import java.sql.PreparedStatement;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
-import org.tizen.dynamicanalyzer.nl.NetworkPageLabels;
 import org.tizen.dynamicanalyzer.ui.network.data.type.NetworkSeriesType;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 
 public class NetworkSeriesDBManager extends DBTable {
+       private static final String TABLENAME = "       NETWORK_SERIES"; //$NON-NLS-1$ 
+       public static final String RID = "RID";
+       public static final String DESTINATION_ADDRESS = "DESTINATION_ADDRESS"; //$NON-NLS-1$ 
+       public static final String FD_VALUE = "FD_VALUE"; //$NON-NLS-1$ 
+       public static final String START_TIME = "START_TIME"; //$NON-NLS-1$ 
+       public static final String END_TIME = "END_TIME"; //$NON-NLS-1$ 
+       public static final String STATUS_TYPE = "STATUS_TYPE"; //$NON-NLS-1$ 
+       public static final String API_ID = DBConstants.COMMON_COLUMN_ID;
+       public static final String PID = DBConstants.COMMON_COLUMN_PID;
 
-       private static final String TABLENAME = NetworkPageLabels.NETWORK_SERIES_DB_TABLENAME;
-       public static final String RID = NetworkPageLabels.NETWORK_DB_RID;
-       public static final String DESTINATION_ADDRESS = NetworkPageLabels.NETWORK_DB_DESTINATION_ADDRESS;
-       public static final String FD_VALUE = NetworkPageLabels.NETWORK_DB_FD_VALUE;
-       public static final String START_TIME = NetworkPageLabels.NETWORK_SERIES_DB_START_TIME;
-       public static final String END_TIME = NetworkPageLabels.NETWORK_SERIES_DB_END_TIME;
-       public static final String STATUS_TYPE = NetworkPageLabels.NETWORK_SERIES_DB_STATUS_TYPE;
-       public static final String API_ID = NetworkPageLabels.NETWORK_DB_API_ID;
+       public final static int DB_RID_INDEX = 0;
+       public final static int DB_DESTINATION_ADDRESSINDEX = 1;
+       public final static int DB_FD_VALUE_INDEX = 2;
+       public final static int DB_START_TIME_INDEX = 3;
+       public final static int DB_END_TIME_INDEX = 4;
+       public final static int DB_STATUS_TYPE_INDEX = 5;
+       public final static int DB_API_ID_INDEX = 6;
+       public final static int DB_PID_INDEX = 7;
 
-       private static final String SELECT_QUERY = "select * from " + TABLENAME; //$NON-NLS-1$
+       private static final String SELECT_QUERY = "select " + RID
+                       + CommonConstants.COMMA + DESTINATION_ADDRESS
+                       + CommonConstants.COMMA + FD_VALUE + CommonConstants.COMMA
+                       + START_TIME + CommonConstants.COMMA + END_TIME
+                       + CommonConstants.COMMA + STATUS_TYPE + CommonConstants.COMMA
+                       + API_ID + CommonConstants.COMMA + PID + " from " + TABLENAME; //$NON-NLS-1$
+
+       private static final String SELECT_PID_QUERY = "select " + RID
+                       + CommonConstants.COMMA + DESTINATION_ADDRESS
+                       + CommonConstants.COMMA + FD_VALUE + CommonConstants.COMMA
+                       + START_TIME + CommonConstants.COMMA + END_TIME
+                       + CommonConstants.COMMA + STATUS_TYPE + CommonConstants.COMMA
+                       + API_ID + CommonConstants.COMMA + PID
+                       + " from " + TABLENAME + " where pid = '%s'"; //$NON-NLS-1$
 
        private static int rid = 0;
 
@@ -45,6 +95,7 @@ public class NetworkSeriesDBManager extends DBTable {
                                DBConstants.INTEGER));
                addColumn(new DBColumn(API_ID, DBConstants.NOT_NULL,
                                DBConstants.INTEGER));
+               addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER));
                rid = 0;
        }
 
@@ -57,10 +108,16 @@ public class NetworkSeriesDBManager extends DBTable {
 
        public List<NetworkSeriesType> select(double visibleStartTime,
                        double visibleEndTime) {
+               String selectQuery = SELECT_QUERY;
+               int selectedPid = ToolbarArea.getInstance().getSelectedPid();
+               if (selectedPid != 0) {
+                       selectQuery = String.format(SELECT_PID_QUERY, selectedPid);
+               }
+
                double selectStartTime = visibleStartTime
                                * TimelineConstants.MEGA_DOUBLE;
                double selectEndTime = visibleEndTime * TimelineConstants.MEGA_DOUBLE;
-               String query = String.format(SELECT_QUERY, selectStartTime,
+               String query = String.format(selectQuery, selectStartTime,
                                selectEndTime);
                List<List<Object>> result = SqlConnectionManager.executeQuery(query);
                if (null == result || result.size() == 0 || result.get(0).size() == 0) {
@@ -75,8 +132,35 @@ public class NetworkSeriesDBManager extends DBTable {
 
        @Override
        public boolean prepare(PreparedStatement prep, List<Object> rowData) {
-               // TODO Auto-generated method stub
-               return false;
+               boolean isPrepared = true;
+               int columnsize = getColumnSize();
+               if (columnsize != rowData.size()) {
+                       isPrepared = false;
+               } else {
+                       try {
+                               prep.setInt(DB_RID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_RID_INDEX)));
+                               prep.setString(DB_DESTINATION_ADDRESSINDEX + 1,
+                                               (String) (rowData.get(DB_DESTINATION_ADDRESSINDEX)));
+                               prep.setString(DB_FD_VALUE_INDEX + 1,
+                                               (String) (rowData.get(DB_FD_VALUE_INDEX)));
+                               prep.setLong(DB_START_TIME_INDEX + 1,
+                                               (Long) (rowData.get(DB_START_TIME_INDEX)));
+                               prep.setLong(DB_END_TIME_INDEX + 1,
+                                               (Long) (rowData.get(DB_END_TIME_INDEX)));
+                               prep.setInt(DB_STATUS_TYPE_INDEX + 1,
+                                               (Integer) (rowData.get(DB_STATUS_TYPE_INDEX)));
+                               prep.setInt(DB_API_ID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_API_ID_INDEX)));
+                               prep.setInt(DB_PID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_PID_INDEX)));
+
+                       } catch (SQLException e) {
+                               e.printStackTrace();
+                               isPrepared = false;
+                       }
+               }
+               return isPrepared;
        }
 
 }
index 551997d..e624c34 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
index f4c8cb0..19ab607 100644 (file)
@@ -32,6 +32,7 @@ import java.util.List;
 
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.swap.model.data.NetworkData;
+import org.tizen.dynamicanalyzer.ui.network.data.NetworkAPIDBManager;
 
 public class NetworkAPIType extends NetworkData {
        private final int apiSeriesColumnSize = 6;
@@ -63,24 +64,29 @@ public class NetworkAPIType extends NetworkData {
        }
 
        public NetworkAPIType(List<Object> data) {
-               setSeq((Integer) data.get(0));
-               setDestinationAddress((String) data.get(1));
-               setFdStr((String) data.get(2));
-               setTime((Long) data.get(3));
-               setApiNameID((Integer) data.get(4));
-               setErrno((Long) data.get(5));
+               setSeq((Integer) data.get(NetworkAPIDBManager.DB_SEQ_INDEX));
+               setDestinationAddress((String) data
+                               .get(NetworkAPIDBManager.DB_DESTINATION_ADDRESS_INDEX));
+               setFdStr((String) data.get(NetworkAPIDBManager.DB_FD_VALUE_INDEX));
+               setTime((Long) data.get(NetworkAPIDBManager.DB_API_TIME_INDEX));
+               setApiNameID((Integer) data
+                               .get(NetworkAPIDBManager.DB_API_NAME_ID_INDEX));
+               setErrno((Long) data.get(NetworkAPIDBManager.DB_ERRNO_INDEX));
                if (data.size() <= apiSeriesColumnSize) {
                        return;
                }
-               setPid((Integer) data.get(6));
-               setTid((Integer) data.get(7));
-               setArgs((String) data.get(8));
-               setReturn((String) data.get(9));
-               setPacketMessageSize((Integer) data.get(10));
-               setPacketMessage((String) data.get(11));
-               setFdApiType((Integer) data.get(12));
-               setCallerAddress((Long) data.get(13));
-               setLibName((String) data.get(14));
+               setPid((Integer) data.get(NetworkAPIDBManager.DB_PID_INDEX));
+               setTid((Integer) data.get(NetworkAPIDBManager.DB_PID_INDEX));
+               setArgs((String) data.get(NetworkAPIDBManager.DB_ARGUMENT_INDEX));
+               setReturn((String) data.get(NetworkAPIDBManager.DB_RETURN_INDEX));
+               setPacketMessageSize((Integer) data
+                               .get(NetworkAPIDBManager.DB_BYTE_SIZE_INDEX));
+               setPacketMessage((String) data
+                               .get(NetworkAPIDBManager.DB_PAYLOAD_INDEX));
+               setFdApiType((Integer) data.get(NetworkAPIDBManager.DB_API_TYPE_INDEX));
+               setCallerAddress((Long) data
+                               .get(NetworkAPIDBManager.DB_CALLER_PC_ADDRESS_INDEX));
+               setLibName((String) data.get(NetworkAPIDBManager.DB_LIB_NAME_INDEX));
        }
 
        public int getSeq() {
index 20d44f4..68c44f9 100644 (file)
@@ -31,13 +31,14 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.ui.network.data.NetworkSeriesDBManager;
 
 public class NetworkSeriesType {
-       public static final int HEAP_MEMORY = 128;
-       public static int STATUS_TYPE_OPEN = 0;
-       public static int ACCESS_TYPE_WAIT = 1;
-       public static int ACCESS_TYPE_READ = 2;
-       public static int ACCESS_TYPE_WRITE = 3;
+       public final static int STATUS_TYPE_OPEN = 0;
+       public final static int STATUS_TYPE_CONNECTED = 1;
+       public final static int ACCESS_TYPE_WAIT = 2;
+       public final static int ACCESS_TYPE_READ = 3;
+       public final static int ACCESS_TYPE_WRITE = 4;
 
        private int rid = 0;
        private String destinationAddress = CommonConstants.EMPTY;
@@ -47,9 +48,10 @@ public class NetworkSeriesType {
 
        private int apiType = -1;
        private int apiID = -1;
+       private int pId = -1;
 
        public NetworkSeriesType(String destinationAddress, String fdValue,
-                       long startTime, long endTime, int statusType, int apiId) {
+                       long startTime, long endTime, int statusType, int apiId, int pId) {
                setRid(0);
                setDestinationAddress(destinationAddress);
                setFdValue(fdValue);
@@ -57,16 +59,21 @@ public class NetworkSeriesType {
                setEndTime(endTime);
                setAPIType(statusType);
                setApiID(apiId);
+               setpId(pId);
        }
 
        public NetworkSeriesType(List<Object> data) {
-               setRid((Integer) data.get(0));
-               setDestinationAddress((String) data.get(1));
-               setFdValue((String) data.get(2));
-               setStartTime((Long) data.get(3));
-               setEndTime((Long) data.get(4));
-               setAPIType((Integer) data.get(5));
-               setApiID((Integer) data.get(6));
+               setRid((Integer) data.get(NetworkSeriesDBManager.DB_RID_INDEX));
+               setDestinationAddress((String) data
+                               .get(NetworkSeriesDBManager.DB_DESTINATION_ADDRESSINDEX));
+               setFdValue((String) data.get(NetworkSeriesDBManager.DB_FD_VALUE_INDEX));
+               setStartTime((Long) data
+                               .get(NetworkSeriesDBManager.DB_START_TIME_INDEX));
+               setEndTime((Long) data.get(NetworkSeriesDBManager.DB_END_TIME_INDEX));
+               setAPIType((Integer) data
+                               .get(NetworkSeriesDBManager.DB_STATUS_TYPE_INDEX));
+               setApiID((Integer) data.get(NetworkSeriesDBManager.DB_API_ID_INDEX));
+               setpId((Integer) data.get(NetworkSeriesDBManager.DB_API_ID_INDEX));
        }
 
        public int getRid() {
@@ -125,6 +132,14 @@ public class NetworkSeriesType {
                this.apiID = apiID;
        }
 
+       public int getpId() {
+               return pId;
+       }
+
+       public void setpId(int pId) {
+               this.pId = pId;
+       }
+
        public List<Object> getDBInsertData() {
                List<Object> data = new ArrayList<Object>();
                data.add(getRid());
@@ -134,7 +149,7 @@ public class NetworkSeriesType {
                data.add(getEndTime());
                data.add(getAPIType());
                data.add(getApiID());
+               data.add(getpId());
                return data;
        }
-
 }
\ No newline at end of file
index 6bf2b7b..8447b47 100644 (file)
@@ -53,6 +53,7 @@ import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateShaderType;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.DownloadContentfileManager;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
 
@@ -110,7 +111,6 @@ public class GLDetailsView extends DAViewComposite {
 
        @Override
        public void updateView(DAViewData vdata) {
-
                if (vdata instanceof GLSelectionData) {
                        GLSelectionData data = (GLSelectionData) vdata;
                        String id = vdata.getViewID();
@@ -125,7 +125,6 @@ public class GLDetailsView extends DAViewComposite {
                                updateProgramTableInfo(data);
                        }
                }
-
        }
 
        @Override
@@ -203,6 +202,11 @@ public class GLDetailsView extends DAViewComposite {
                        return;
                }
 
+               String contextId = items[0].getText(0);
+               if (contextId.contains(GLPageLabels.GL_CONTEXT)) {
+                       contextId = contextId.replace(GLPageLabels.GL_CONTEXT,
+                                       CommonConstants.EMPTY);
+               }
                String vertexShaderID = items[0].getText(2)
                                .replace(GLPageLabels.GL_SHADER, CommonConstants.EMPTY).trim();
                String fragmentID = items[0].getText(3)
@@ -212,13 +216,17 @@ public class GLDetailsView extends DAViewComposite {
                String fragmentSrc = CommonConstants.EMPTY;
 
                List<GLStateShaderType> shaderList = GLDataManager.getInstance()
-                               .getStateDataMagerInstance().getShaderList();
+                               .getStateDataMake().getShaderList();
                for (int i = 0; i < shaderList.size(); i++) {
-                       if (shaderList.get(i).getId() == Integer.parseInt(vertexShaderID)) {
-                               vertexSrc = shaderList.get(i).getShaderSrc();
+                       if (shaderList.get(i).getContextId() == Long.parseLong(contextId)
+                                       && shaderList.get(i).getId() == Integer
+                                                       .parseInt(vertexShaderID)) {
+                               vertexSrc = DownloadContentfileManager
+                                               .getFileContents(shaderList.get(i).getShaderSrc());
                        } else if (shaderList.get(i).getId() == Integer
                                        .parseInt(fragmentID)) {
-                               fragmentSrc = shaderList.get(i).getShaderSrc();
+                               fragmentSrc = DownloadContentfileManager
+                                               .getFileContents(shaderList.get(i).getShaderSrc());
                        }
                }
 
index 8866b77..f877f27 100644 (file)
@@ -31,17 +31,20 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.nl.GLPageLabels;
 import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
 import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
 import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
 import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
 import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
@@ -274,6 +277,27 @@ public class GLChartView extends DAViewComposite {
                                        frameRateChartBoard.updateViewFromDBData();
                                }
                        }
+               } else if (vdata instanceof DASelectionData) {
+                       DASelectionData selData = (DASelectionData) vdata;
+                       if (selData.isLogData()) {
+                               Object obData = selData.getData();
+                               if (null != obData && (obData instanceof LogData)) { // summary
+                                       LogData ldata = (LogData) obData;
+                                       long dataTime = ldata.getTime();
+                                       double selectionTime = dataTime
+                                                       / TimelineConstants.MEGA_DOUBLE;
+                                       if (selectionTime <= 1) {
+                                               selectionTime = GLDataManager.getInstance()
+                                                               .getStartFrameRateTime();
+                                       }
+                                       frameRateChartBoard.setVisibleMiddleTime(selectionTime);
+                                       DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) frameRateChartBoard
+                                                       .getMarkers().get(
+                                                                       UICommonConstants.SELECTION_MARKER_INDEX);
+                                       intervalMarker.setInterval(selectionTime, selectionTime);
+                                       frameRateChartBoard.updateViewFromDBData();
+                               }
+                       }
                }
        }
 
index 6f831d9..e4e5581 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
@@ -158,12 +155,6 @@ public class GLAPIDBTableManager extends DBTable {
        }
 
        public GLFrameType selectOpenGLAPIData(int frameIndex) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(
                                SELECT_API_TABLE_QUERY_FROM_FRAME_TIME_CHART, frameIndex);
                List<List<Object>> result = SqlConnectionManager.executeQuery(query);
@@ -179,12 +170,6 @@ public class GLAPIDBTableManager extends DBTable {
 
        public List<List<Object>> selectOpenGLAPIData(int frameStartIndex,
                        int frameEndIndex) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(
                                SELECT_API_TABLE_QUERY_FROM_FRAME_RATE_CHART, frameStartIndex,
                                frameEndIndex);
index 2c2dd9e..3f0da2a 100644 (file)
@@ -40,14 +40,15 @@ import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPIType;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLFrameType;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSharingContextType;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-import org.tizen.dynamicanalyzer.util.DALogger;
 
 public class GLDataManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
        private static GLDataManager instance = null;
-       private GLStateDataMaker GLStateDataMagerInstance = null;
+       private GLStateDataMaker GLStateDataMaker = null;
 
        private GLFrameType glFrameData = null;
        private List<FrameCountInfoType> frameInfoList;
@@ -62,9 +63,12 @@ public class GLDataManager extends PageDataManager {
        private GLStateProgramDBTableManager stateProgramDBTable = null;
        private GLStateHistoryDBTableManager stateHistoryDBTable = null;
        private GLStateTextureDBTableManager stateTextureDBTable = null;
+       private GLStateSharingDBTableManager stateSharingDBTable = null;
 
        private boolean isShowFrameRateChart = true;
 
+       List<GLSharingContextType> sharingContextList = null;
+
        public static GLDataManager getInstance() {
                if (instance == null) {
                        instance = new GLDataManager();
@@ -77,7 +81,7 @@ public class GLDataManager extends PageDataManager {
                currentFrameTimeIndex = 1;
                glFrameData = new GLFrameType(currentFrameTimeIndex);
                frameInfoList = new ArrayList<FrameCountInfoType>();
-               GLStateDataMagerInstance = new GLStateDataMaker();
+               GLStateDataMaker = new GLStateDataMaker();
                apiDBTable = new GLAPIDBTableManager();
                addDBTable(apiDBTable);
                frameRateDBTable = new GLFrameRateDBTableManager();
@@ -92,13 +96,16 @@ public class GLDataManager extends PageDataManager {
                addDBTable(stateHistoryDBTable);
                stateTextureDBTable = new GLStateTextureDBTableManager();
                addDBTable(stateTextureDBTable);
+               stateSharingDBTable = new GLStateSharingDBTableManager();
+               addDBTable(stateSharingDBTable);
        }
 
        public void clear() {
                currentFrameTimeIndex = 1;
                glFrameData = new GLFrameType(currentFrameTimeIndex);
                frameInfoList = new ArrayList<FrameCountInfoType>();
-               GLStateDataMagerInstance.clear();
+               GLStateDataMaker.clear();
+               sharingContextList = new ArrayList<GLSharingContextType>();
        }
 
        public void openProcess() {
@@ -111,21 +118,6 @@ public class GLDataManager extends PageDataManager {
                stateProgramDBTable.insertData();
        }
 
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread
-                               break;
-
-                       Logs glesLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_GLES20);
-                       if (glesLogs != null && glesLogs.getRawLogs().size() != 0) {
-                               makeGLData(glesLogs);
-                       }
-               }
-               DA_LOG.debug(getName() + " thread ended!");
-       }
-
        public void makeGLData(Logs glesLogs) {
                List<LogData> logDataList = glesLogs.getRawLogs();
                List<List<Object>> insetFrameTimeChartDataList = new ArrayList<List<Object>>();
@@ -155,13 +147,24 @@ public class GLDataManager extends PageDataManager {
                        if (currentFrameTimeIndex == 1) {
                                frameRateIndex = 1;
                        }
-                       GLStateDataMagerInstance.addGLAPIData(logData, frameRateIndex,
+                       GLStateDataMaker.addGLAPIData(logData, frameRateIndex,
                                        currentFrameTimeIndex);
+
+                       checkFailedAPI(logData);
+
                }
 
                frameTimeDBTable.insertData(insetFrameTimeChartDataList);
        }
 
+       private void checkFailedAPI(GLES20LogData logData) {
+               if (logData.getErrno() != GLES20ErrorDefine.EGL_SUCCESS
+                               && logData.getErrno() != GLES20ErrorDefine.GL_SUCCESS) {
+                       FailedData ffd = new FailedData(logData);
+                       AnalyzerManager.getFailedChecker().getFailedList().add(ffd);
+               }
+       }
+
        private void makeFrameRateChartDataList(GLES20LogData logData) {
                int time = getTimeLieTime(logData);
                for (FrameCountInfoType data : frameInfoList) {
@@ -175,6 +178,7 @@ public class GLDataManager extends PageDataManager {
                frameRateData.setTime(time);
                frameRateData.setStartFrameIndex(currentFrameTimeIndex);
                frameRateData.setErrno(glFrameData.hasError());
+               frameRateData.setPid(logData.getPid());
                frameRateData.addFrameCount();
                frameInfoList.add(frameRateData);
        }
@@ -189,6 +193,7 @@ public class GLDataManager extends PageDataManager {
                                framRateChartData.add(data.getFrameCount() - 1);
                                framRateChartData.add(data.getStartFrameIndex());
                                framRateChartData.add(data.hasErrno());
+                               framRateChartData.add(data.getPid());
                                insetData.add(framRateChartData);
                                removeframeInfoList.add(data);
 
@@ -210,6 +215,7 @@ public class GLDataManager extends PageDataManager {
                        framRateChartData.add(data.getFrameCount());
                        framRateChartData.add(data.getStartFrameIndex());
                        framRateChartData.add(data.hasErrno());
+                       framRateChartData.add(data.getPid());
                        insetData.add(framRateChartData);
                        removeframeInfoList.add(data);
                }
@@ -231,6 +237,7 @@ public class GLDataManager extends PageDataManager {
                framTimeChartData.add(glFrameData.hasError());
                framTimeChartData.add(glFrameData.getStartSeq());
                framTimeChartData.add(glFrameData.getEndSeq());
+               framTimeChartData.add(logData.getPid());
                return framTimeChartData;
        }
 
@@ -279,8 +286,8 @@ public class GLDataManager extends PageDataManager {
                return apiDBTable;
        }
 
-       public GLStateDataMaker getStateDataMagerInstance() {
-               return GLStateDataMagerInstance;
+       public GLStateDataMaker getStateDataMake() {
+               return GLStateDataMaker;
        }
 
        public GLFrameRateDBTableManager getFrameRateDBTableManager() {
@@ -307,6 +314,10 @@ public class GLDataManager extends PageDataManager {
                return stateTextureDBTable;
        }
 
+       public GLStateSharingDBTableManager getStateSharingDBTableManage() {
+               return stateSharingDBTable;
+       }
+
        public boolean isShowFrameRateChart() {
                return isShowFrameRateChart;
        }
@@ -322,4 +333,33 @@ public class GLDataManager extends PageDataManager {
        public void setStartFrameRateTime(int startFrameRateTime) {
                this.startFrameRateTime = startFrameRateTime;
        }
+
+       public void updateSharingContextList() {
+               this.sharingContextList = GLDataManager.getInstance()
+                               .getStateSharingDBTableManage().selectSharingData();
+       }
+
+       public boolean isSharingData(long itemContextId) {
+               if (null == sharingContextList) {
+                       return false;
+               }
+               for (int i = 0; i < sharingContextList.size(); i++) {
+                       long contextId = sharingContextList.get(i).getContextId();
+                       long sharingContextId = sharingContextList.get(i)
+                                       .getSharingContextId();
+                       if (contextId == GLDataManager.getInstance().getSelectedContextID()
+                                       && sharingContextId == itemContextId) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       @Override
+       protected void makeData(LogPackage pack) {
+               Logs glesLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_GLES20);
+               if (glesLogs != null && glesLogs.getRawLogs().size() != 0) {
+                       makeGLData(glesLogs);
+               }
+       }
 }
index 3fc5d1f..aa4e194 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 
 public class GLFrameRateDBTableManager extends DBTable {
        private static final String TABLENAME = "GL_FRAME_RATE";//$NON-NLS-1$
@@ -46,21 +44,32 @@ public class GLFrameRateDBTableManager extends DBTable {
        public static final String FRAME_COUNT = "FRAME_COUNT";//$NON-NLS-1$
        public static final String FRAME_INDEX = "FRAME_INDEX";//$NON-NLS-1$
        public static final String ERROR_INFO = "ERROR_INFO";//$NON-NLS-1$
+       public static final String PID = DBConstants.COMMON_COLUMN_PID;
 
        public final static int TABLE_CHART_TIME_INDEX = 0;
        public final static int TABLE_FRAME_COUNT_INDEX = 1;
        public final static int TABLE_FRAME_INDEX_INDEX = 2;
        public final static int TABLE_ERROR_INFO_INDEX = 3;
+       public final static int TABLE_PID_INDEX = 4;
 
        private static final String SELECT_FRAME_RATE_TABLE_QUERY = "select "//$NON-NLS-1$
                        + CHART_TIME + CommonConstants.COMMA
                        + FRAME_COUNT
                        + CommonConstants.COMMA + FRAME_INDEX
                        + CommonConstants.COMMA
-                       + ERROR_INFO + " from "//$NON-NLS-1$
+                       + ERROR_INFO + CommonConstants.COMMA + PID + " from "//$NON-NLS-1$
                        + TABLENAME + " where '%s' <= " + CHART_TIME + " and " + CHART_TIME//$NON-NLS-1$ //$NON-NLS-2$
                        + " <= '%s'";//$NON-NLS-1$
 
+       private static final String SELECT_PID_FRAME_RATE_TABLE_QUERY = "select "//$NON-NLS-1$
+                       + CHART_TIME + CommonConstants.COMMA
+                       + FRAME_COUNT
+                       + CommonConstants.COMMA + FRAME_INDEX
+                       + CommonConstants.COMMA
+                       + ERROR_INFO + CommonConstants.COMMA + PID + " from "//$NON-NLS-1$
+                       + TABLENAME + " where '%s' <= " + CHART_TIME + " and " + CHART_TIME//$NON-NLS-1$ //$NON-NLS-2$
+                       + " <= '%s' and " + PID + " = '%s'";//$NON-NLS-1$
+
        @Override
        public String getTableName() {
                return TABLENAME;
@@ -75,6 +84,7 @@ public class GLFrameRateDBTableManager extends DBTable {
                                DBConstants.INTEGER));
                addColumn(new DBColumn(ERROR_INFO, DBConstants.NOT_NULL,
                                DBConstants.INTEGER));
+               addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER));
        }
 
        public final void insert(List<List<Object>> data) {
@@ -82,12 +92,6 @@ public class GLFrameRateDBTableManager extends DBTable {
        }
 
        public FrameCountInfoType selectFrameCountInfo(int startIndex, int endIndex) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex,
                                endIndex);
                List<List<Object>> result = SqlConnectionManager.executeQuery(query);
@@ -115,20 +119,13 @@ public class GLFrameRateDBTableManager extends DBTable {
        }
 
        public List<List<Object>> selectFrameRate(double startIndex, double endIndex) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(SELECT_FRAME_RATE_TABLE_QUERY, startIndex,
                                endIndex);
+               if (ToolbarArea.getInstance().getSelectedPid() != 0) {
+                       query = String.format(SELECT_PID_FRAME_RATE_TABLE_QUERY,
+                                       startIndex, endIndex, ToolbarArea.getInstance()
+                                                       .getSelectedPid());
+               }
                return SqlConnectionManager.executeQuery(query);
        }
 
@@ -149,6 +146,8 @@ public class GLFrameRateDBTableManager extends DBTable {
                                                (Integer) (rowData.get(TABLE_FRAME_INDEX_INDEX)));
                                prep.setInt(TABLE_ERROR_INFO_INDEX + 1,
                                                (Integer) (rowData.get(TABLE_ERROR_INFO_INDEX)));
+                               prep.setInt(TABLE_PID_INDEX + 1,
+                                               (Integer) (rowData.get(TABLE_PID_INDEX)));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index b33b21d..476f42e 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
 import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 
 public class GLFrameTimeDBTableManager extends DBTable {
        private static final String TABLENAME = "GL_FRAME_TIME";//$NON-NLS-1$
@@ -47,6 +45,7 @@ public class GLFrameTimeDBTableManager extends DBTable {
        public static final String ERROR_INFO = "ERROR_INFO";//$NON-NLS-1$
        public static final String START_SEQ = "START_SEQ";//$NON-NLS-1$
        public static final String END_SEQ = "END_SEQ";//$NON-NLS-1$
+       public static final String PID = DBConstants.COMMON_COLUMN_PID;
 
        public final static int TABLE_CHART_TIME_INDEX = 0;
        public final static int TABLE_FRAME_RATE_INDEX = 1;
@@ -54,16 +53,14 @@ public class GLFrameTimeDBTableManager extends DBTable {
        public final static int TABLE_ERROR_INFO_INDEX = 3;
        public final static int TABLE_START_SEQ_INDEX = 4;
        public final static int TABLE_END_SEQ_INDEX = 5;
+       public final static int TABLE_PID_INDEX = 6;
 
-       private static final String SELECT_TOTALB_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$
-                       + CHART_TIME
-                       + CommonConstants.COMMA
+       private static final String SELECT_TOTAL_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$
+                       + CHART_TIME + CommonConstants.COMMA
                        + FRAME_RATE
+                       + CommonConstants.COMMA + VALUE
                        + CommonConstants.COMMA
-                       + VALUE
-                       + CommonConstants.COMMA
-                       + ERROR_INFO
-                       + CommonConstants.COMMA
+                       + ERROR_INFO + CommonConstants.COMMA
                        + START_SEQ
                        + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$
                        + TABLENAME;
@@ -79,6 +76,17 @@ public class GLFrameTimeDBTableManager extends DBTable {
                        + TABLENAME + " where '%s' <= " + CHART_TIME + " and "//$NON-NLS-1$//$NON-NLS-2$
                        + CHART_TIME + " <= '%s'";//$NON-NLS-1$
 
+       private static final String SELECT_PID_FRAME_TIME_TABLE_QUERY = "select "//$NON-NLS-1$
+                       + CHART_TIME + CommonConstants.COMMA
+                       + FRAME_RATE
+                       + CommonConstants.COMMA + VALUE
+                       + CommonConstants.COMMA
+                       + ERROR_INFO + CommonConstants.COMMA
+                       + START_SEQ
+                       + CommonConstants.COMMA + END_SEQ + " from "//$NON-NLS-1$
+                       + TABLENAME + " where '%s' <= " + CHART_TIME + " and "//$NON-NLS-1$//$NON-NLS-2$
+                       + CHART_TIME + " <= '%s' and " + PID + " = '%'";//$NON-NLS-1$
+
        @Override
        public String getTableName() {
                return TABLENAME;
@@ -96,17 +104,12 @@ public class GLFrameTimeDBTableManager extends DBTable {
                                DBConstants.INTEGER));
                addColumn(new DBColumn(END_SEQ, DBConstants.NOT_NULL,
                                DBConstants.INTEGER));
+               addColumn(new DBColumn(PID, DBConstants.NOT_NULL, DBConstants.INTEGER));
        }
 
        public int getFrameSize() {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                List<List<Object>> result = SqlConnectionManager
-                               .executeQuery(SELECT_TOTALB_FRAME_TIME_TABLE_QUERY);
+                               .executeQuery(SELECT_TOTAL_FRAME_TIME_TABLE_QUERY);
                if (null == result || result.size() == 0 || result.get(0).size() == 0) {
                        return 0;
                } else {
@@ -115,21 +118,20 @@ public class GLFrameTimeDBTableManager extends DBTable {
        }
 
        public List<List<Object>> selectFrameTime(double startIndex, double endIndex) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(SELECT_FRAME_TIME_TABLE_QUERY, startIndex,
                                endIndex);
+               if (ToolbarArea.getInstance().getSelectedPid() != 0) {
+                       query = String.format(SELECT_PID_FRAME_TIME_TABLE_QUERY,
+                                       startIndex, endIndex, ToolbarArea.getInstance()
+                                                       .getSelectedPid());
+               }
+
                return SqlConnectionManager.executeQuery(query);
        }
 
        @Override
        public boolean prepare(PreparedStatement prep, List<Object> rowData) {
                boolean isPrepared = true;
-
                int columnsize = getColumnSize();
                if (columnsize != rowData.size()) {
                        isPrepared = false;
@@ -147,6 +149,8 @@ public class GLFrameTimeDBTableManager extends DBTable {
                                                (Integer) (rowData.get(TABLE_START_SEQ_INDEX)));
                                prep.setInt(TABLE_END_SEQ_INDEX + 1,
                                                (Integer) (rowData.get(TABLE_END_SEQ_INDEX)));
+                               prep.setInt(TABLE_PID_INDEX + 1,
+                                               (Integer) (rowData.get(TABLE_PID_INDEX)));
 
                        } catch (SQLException e) {
                                e.printStackTrace();
index ee68581..9b25366 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
@@ -137,12 +134,6 @@ public class GLStateDBTableManager extends DBTable {
        }
 
        public List<String> getContextData(String seq, long contextID) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(SELECT_CONTEXT_TABLE__QUERY, seq,
                                contextID);
                List<List<Object>> result = SqlConnectionManager.executeQuery(query);
index b986985..1f3dbd2 100644 (file)
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
 
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.swap.model.data.GLES20LogData;
@@ -37,20 +41,20 @@ import org.tizen.dynamicanalyzer.ui.opengl.data.type.ContextValueType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLAPINameDefine;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLConstantDefine;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLContextNameEnum;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLES20ErrorDefine;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSharingContextType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateProgramType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateShaderType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLStateTextureType;
 import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.DownloadContentfileManager;
 
 public class GLStateDataMaker {
        public static int API_TYPE_INIT = 0;
        public static int API_TYPE_CONTEXT = 1;
        public static int API_TYPE_NO_CONTEXT = 2;
 
-       private List<GLStateProgramType> programList;
-       private List<GLStateShaderType> shaderList;
-       private List<GLStateTextureType> textureList;
-
        private LinkedHashMap<Long, ContextValueType> contextHashMap;
 
        public GLStateDataMaker() {
@@ -58,9 +62,6 @@ public class GLStateDataMaker {
        }
 
        public void init() {
-               programList = new ArrayList<GLStateProgramType>();
-               shaderList = new ArrayList<GLStateShaderType>();
-               textureList = new ArrayList<GLStateTextureType>();
                contextHashMap = new LinkedHashMap<Long, ContextValueType>();
        }
 
@@ -77,10 +78,6 @@ public class GLStateDataMaker {
                String parameter = logData.getArgs();
                long errorNo = logData.getErrno();
                long contextId = logData.getCurrentContextName();
-               setContextValueList(contextId, seq,
-                               GLContextNameEnum.CONTEXT_ID.ordinal(),
-                               Long.toString(contextId), currentFrameRateIndex,
-                               currentFrameIndex);
                String contextValue = logData.getContextValue().trim();
                ContextValueType curretnContextValue = contextHashMap.get(contextId);
 
@@ -92,13 +89,21 @@ public class GLStateDataMaker {
                }
 
                if (apiType == API_TYPE_INIT) {
-                       String contextValues[] = contextValue.split(CommonConstants.COMMA);
-                       int maxVertexAttribs = Integer.parseInt(contextValues[0]);
-                       int maxTextureUnits = Integer.parseInt(contextValues[1].trim());
-
+                       int maxVertexAttribs = 0;
+                       int maxTextureUnits = 0;
+                       if (contextValue.contains(CommonConstants.COMMA)) {
+                               String contextValues[] = contextValue
+                                               .split(CommonConstants.COMMA);
+                               maxVertexAttribs = Integer.parseInt(contextValues[0]);
+                               maxTextureUnits = Integer.parseInt(contextValues[1].trim());
+                       } else {
+                               maxVertexAttribs = 5;
+                               maxTextureUnits = 5;
+                       }
                        curretnContextValue.setTextureUnits(maxTextureUnits);
                        curretnContextValue.setVertexAttribs(maxVertexAttribs);
-               } else if (apiType == API_TYPE_CONTEXT && errorNo == 0) {
+               } else if (apiType == API_TYPE_CONTEXT
+                               && (errorNo == GLES20ErrorDefine.EGL_SUCCESS || errorNo == GLES20ErrorDefine.GL_SUCCESS)) {
                        String parameters[] = parameter.split(CommonConstants.COMMA
                                        + CommonConstants.SPACE);
                        String contextValues[] = contextValue.split(CommonConstants.COMMA);
@@ -609,279 +614,338 @@ public class GLStateDataMaker {
                                                viewPort.toString(), currentFrameRateIndex,
                                                currentFrameIndex);
                        }
-
+                       eglAPILogManager(logData, currentFrameRateIndex, currentFrameIndex);
                        programLogManage(logData);
                        textureLogManager(logData, currentFrameRateIndex, currentFrameIndex);
-               }
 
+               }
        }
 
-       private void textureLogManager(GLES20LogData logData,
+       private void eglAPILogManager(GLES20LogData logData,
                        int currentFrameRateIndex, int currentFrameIndex) {
 
-               int apiType = logData.getApiType();
-               long errorNo = logData.getErrno();
-               if (apiType == API_TYPE_CONTEXT && errorNo == 0) {
-
-                       String seq = String.valueOf(logData.getSeq());
-                       String apiName = logData.getApiName();
-                       String parameter = logData.getArgs();
-                       long contextId = logData.getCurrentContextName();
+               String seq = String.valueOf(logData.getSeq());
+               String apiName = logData.getApiName();
+               String parameter = logData.getArgs();
+               long contextId = logData.getCurrentContextName();
+               String parameters[] = parameter.split(CommonConstants.COMMA
+                               + CommonConstants.SPACE);
+               String returnValue = logData.getReturn();
+               if (apiName.equals(GLAPINameDefine.API_EGL_CREATE_CONTEXT)) {
+                       contextId = AnalyzerUtil.addrToLong(returnValue);
+                       long sharingContextId = -1;
+                       if (parameters.length > 2) {
+                               sharingContextId = AnalyzerUtil.addrToLong(parameters[2]);
+                       }
                        setContextValueList(contextId, seq,
                                        GLContextNameEnum.CONTEXT_ID.ordinal(),
                                        Long.toString(contextId), currentFrameRateIndex,
                                        currentFrameIndex);
-                       String contextValue = logData.getContextValue().trim();
-                       String parameters[] = parameter.split(CommonConstants.COMMA
-                                       + CommonConstants.SPACE);
-                       String contextValues[] = contextValue.split(CommonConstants.COMMA);
+                       if (sharingContextId != 0) {
+                               ContextValueType curretnContextValue = contextHashMap
+                                               .get(contextId);
+                               curretnContextValue.addSharingContextID(contextHashMap,
+                                               sharingContextId);
+                       }
 
-                       if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_ACTIVE)) {
-                               setContextValueList(contextId, seq,
-                                               GLContextNameEnum.TEXTURE_ACTIVE.ordinal(),
-                                               parameters[0], currentFrameRateIndex, currentFrameIndex);
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_GEN)) {
-                               int num = Integer.parseInt(parameters[0]);
+                       List<GLSharingContextType> sharingInfoList = new ArrayList<GLSharingContextType>();
+                       Set<Entry<Long, ContextValueType>> set = contextHashMap.entrySet();
+                       Iterator<Entry<Long, ContextValueType>> itr = set.iterator();
+                       while (itr.hasNext()) {
+                               Map.Entry<Long, ContextValueType> e = (Map.Entry<Long, ContextValueType>) itr
+                                               .next();
+                               ContextValueType contextValue = e.getValue();
+                               for (int i = 0; i < contextValue.sharingContextIdList.size(); i++) {
+                                       sharingInfoList.add(new GLSharingContextType(
+                                                       contextValue.contextID,
+                                                       contextValue.sharingContextIdList.get(i)));
+                               }
+                       }
+                       GLDataManager.getInstance().getStateSharingDBTableManage()
+                                       .insertSharingData(sharingInfoList);
+               }
 
-                               for (int i = 0; i < num; i++) {
-                                       textureList.add(new GLStateTextureType(Integer
-                                                       .parseInt(contextValues[i].trim()), contextId,
-                                                       logData.getSeq()));
+       }
+
+       private void textureLogManager(GLES20LogData logData,
+                       int currentFrameRateIndex, int currentFrameIndex) {
+
+               String seq = String.valueOf(logData.getSeq());
+               String apiName = logData.getApiName();
+               String parameter = logData.getArgs();
+               long contextId = logData.getCurrentContextName();
+               setContextValueList(contextId, seq,
+                               GLContextNameEnum.CONTEXT_ID.ordinal(),
+                               Long.toString(contextId), currentFrameRateIndex,
+                               currentFrameIndex);
+               String contextValue = logData.getContextValue().trim();
+               String parameters[] = parameter.split(CommonConstants.COMMA
+                               + CommonConstants.SPACE);
+               String contextValues[] = contextValue.split(CommonConstants.COMMA);
+               ContextValueType curretnContextValue = contextHashMap.get(contextId);
+
+               if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_ACTIVE)) {
+                       setContextValueList(contextId, seq,
+                                       GLContextNameEnum.TEXTURE_ACTIVE.ordinal(), parameters[0],
+                                       currentFrameRateIndex, currentFrameIndex);
+               } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_GEN)) {
+                       int num = Integer.parseInt(parameters[0]);
+
+                       for (int i = 0; i < num; i++) {
+                               curretnContextValue.textureList.add(new GLStateTextureType(
+                                               Integer.parseInt(contextValues[i].trim()), contextId,
+                                               logData.getSeq()));
+                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_BIND)) {
+                       for (int i = 0; i < curretnContextValue.textureList.size(); i++) {
+                               if (curretnContextValue.textureList.get(i).getObjID() == Integer
+                                               .parseInt(parameters[1].trim())
+                                               && curretnContextValue.textureList.get(i)
+                                                               .getContextID() == contextId) {
+                                       curretnContextValue.textureList.get(i).setTrxtureType(
+                                                       Integer.parseInt(parameters[0].trim()));
                                }
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_BIND)) {
-                               for (int i = 0; i < textureList.size(); i++) {
-                                       if (textureList.get(i).getObjID() == Integer
-                                                       .parseInt(parameters[1].trim())
-                                                       && textureList.get(i).getContextID() == contextId) {
-                                               textureList.get(i).setTrxtureType(
+                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_DEL)) {
+                       int num = Integer.parseInt(parameters[0]);
+
+                       for (int i = 0; i < num; i++) {
+                               for (int j = 0; j < curretnContextValue.textureList.size(); j++) {
+                                       if (curretnContextValue.textureList.get(j).getObjID() == Integer
+                                                       .parseInt(parameters[0].trim())
+                                                       && curretnContextValue.textureList.get(j)
+                                                                       .getContextID() == contextId) {
+                                               curretnContextValue.textureList.get(j).setTrxtureType(
                                                                Integer.parseInt(parameters[0].trim()));
                                        }
                                }
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_DEL)) {
-                               int num = Integer.parseInt(parameters[0]);
+                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_F)
+                               || apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_I)) {
 
-                               for (int i = 0; i < num; i++) {
-                                       for (int j = 0; j < textureList.size(); j++) {
-                                               if (textureList.get(j).getObjID() == Integer
-                                                               .parseInt(parameters[0].trim())
-                                                               && textureList.get(j).getContextID() == contextId) {
-                                                       textureList.get(j).setTrxtureType(
-                                                                       Integer.parseInt(parameters[0].trim()));
-                                               }
-                                       }
-                               }
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_F)
-                                       || apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_I)) {
-
-                               for (int i = 0; i < textureList.size(); i++) {
-                                       if (textureList.get(i).getContextID() == contextId) {
-                                               if (textureList.get(i).getTrxtureType() == Integer
-                                                               .parseInt(parameters[0].trim())) {
-
-                                                       if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_MAG_FILTER)) {
-                                                               textureList.get(i).setMagFilter(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_MIN_FILTER)) {
-                                                               textureList.get(i).setMinFilter(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_WRAP_S)) {
-                                                               textureList.get(i).setWrapS(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_WRAP_T)) {
-                                                               textureList.get(i).setWrapT(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else {
-                                                               DALogger.getInstance().error(
-                                                                               "undefine type : " + parameters[1]);
-                                                       }
+                       for (int i = 0; i < curretnContextValue.textureList.size(); i++) {
+                               if (curretnContextValue.textureList.get(i).getContextID() == contextId) {
+                                       if (curretnContextValue.textureList.get(i).getTrxtureType() == Integer
+                                                       .parseInt(parameters[0].trim())) {
+
+                                               if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_MAG_FILTER)) {
+                                                       curretnContextValue.textureList.get(i)
+                                                                       .setMagFilter(
+                                                                                       Integer.parseInt(parameters[2]));
+                                               } else if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_MIN_FILTER)) {
+                                                       curretnContextValue.textureList.get(i)
+                                                                       .setMinFilter(
+                                                                                       Integer.parseInt(parameters[2]));
+                                               } else if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_WRAP_S)) {
+                                                       curretnContextValue.textureList.get(i).setWrapS(
+                                                                       Integer.parseInt(parameters[2]));
+                                               } else if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_WRAP_T)) {
+                                                       curretnContextValue.textureList.get(i).setWrapT(
+                                                                       Integer.parseInt(parameters[2]));
+                                               } else {
+                                                       DALogger.getInstance().error(
+                                                                       "undefine type : " + parameters[1]);
                                                }
                                        }
                                }
-                               insertTextureData();
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_FV)
-                                       || apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_IV)) {
+                       }
+                       insertTextureData();
+               } else if (apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_FV)
+                               || apiName.equals(GLAPINameDefine.API_GL_TEXTURE_PARAM_IV)) {
 
-                               for (int i = 0; i < textureList.size(); i++) {
-                                       if (textureList.get(i).getObjID() == Integer
-                                                       .parseInt(parameters[0].trim())
-                                                       && textureList.get(i).getContextID() == contextId) {
-                                               if (textureList.get(i).getTrxtureType() == Integer
-                                                               .parseInt(parameters[0].trim())) {
-
-                                                       if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_MAG_FILTER)) {
-                                                               textureList.get(i).setMagFilter(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_MIN_FILTER)) {
-                                                               textureList.get(i).setMinFilter(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_WRAP_S)) {
-                                                               textureList.get(i).setWrapS(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       } else if (parameters[1]
-                                                                       .equals(GLAPINameDefine.GL_TEXTURE_WRAP_T)) {
-                                                               textureList.get(i).setWrapT(
-                                                                               Integer.parseInt(parameters[2]));
-                                                       }
+                       for (int i = 0; i < curretnContextValue.textureList.size(); i++) {
+                               if (curretnContextValue.textureList.get(i).getObjID() == Integer
+                                               .parseInt(parameters[0].trim())
+                                               && curretnContextValue.textureList.get(i)
+                                                               .getContextID() == contextId) {
+                                       if (curretnContextValue.textureList.get(i).getTrxtureType() == Integer
+                                                       .parseInt(parameters[0].trim())) {
+
+                                               if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_MAG_FILTER)) {
+                                                       curretnContextValue.textureList.get(i)
+                                                                       .setMagFilter(
+                                                                                       Integer.parseInt(parameters[2]));
+                                               } else if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_MIN_FILTER)) {
+                                                       curretnContextValue.textureList.get(i)
+                                                                       .setMinFilter(
+                                                                                       Integer.parseInt(parameters[2]));
+                                               } else if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_WRAP_S)) {
+                                                       curretnContextValue.textureList.get(i).setWrapS(
+                                                                       Integer.parseInt(parameters[2]));
+                                               } else if (parameters[1]
+                                                               .equals(GLAPINameDefine.GL_TEXTURE_WRAP_T)) {
+                                                       curretnContextValue.textureList.get(i).setWrapT(
+                                                                       Integer.parseInt(parameters[2]));
                                                }
                                        }
                                }
-                               insertTextureData();
                        }
+                       insertTextureData();
                }
        }
 
        private void insertTextureData() {
-               for (int i = 0; i < textureList.size(); i++) {
-                       if (textureList.get(i).validInsertState()) {
-                               GLDataManager.getInstance().getStateTextureDBTableManage()
-                                               .insertData(textureList.get(i));
-                               textureList.remove(i);
-                               break;
+               Set<Entry<Long, ContextValueType>> set = contextHashMap.entrySet();
+               Iterator<Entry<Long, ContextValueType>> itr = set.iterator();
+               while (itr.hasNext()) {
+                       Map.Entry<Long, ContextValueType> e = (Map.Entry<Long, ContextValueType>) itr
+                                       .next();
+                       ContextValueType contextValue = e.getValue();
+                       for (int i = 0; i < contextValue.textureList.size(); i++) {
+                               if (contextValue.textureList.get(i).validInsertState()) {
+                                       GLDataManager.getInstance().getStateTextureDBTableManage()
+                                                       .insertData(contextValue.textureList.get(i));
+                                       contextValue.textureList.remove(i);
+                                       break;
+                               }
                        }
                }
-
        }
 
        private void programLogManage(GLES20LogData logData) {
-               int apiType = logData.getApiType();
-               long errorNo = logData.getErrno();
-               if (apiType == API_TYPE_CONTEXT && errorNo == 0) {
+               String apiName = logData.getApiName();
+               String parameter = logData.getArgs();
+               String contextValue = logData.getContextValue().trim();
+               String returnValue = logData.getReturn();
+               String parameters[] = parameter.split(CommonConstants.COMMA
+                               + CommonConstants.SPACE);
+               String contextID = Long.toString(logData.getCurrentContextName());
+               long contextId = logData.getCurrentContextName();
+               ContextValueType curretnContextValue = contextHashMap.get(contextId);
 
-                       String apiName = logData.getApiName();
-                       String parameter = logData.getArgs();
-                       String contextValue = logData.getContextValue().trim();
-                       String returnValue = logData.getReturn();
-                       String parameters[] = parameter.split(CommonConstants.COMMA
-                                       + CommonConstants.SPACE);
-                       String contextID = Long.toString(logData.getCurrentContextName());
-
-                       if (apiName.equals(GLAPINameDefine.API_GL_SHADER_CREATE)) {
-                               int shaderID = Integer.parseInt(returnValue);
-                               int shaderType = Integer.parseInt(parameter);
-                               GLStateShaderType stateShaderType = new GLStateShaderType(
-                                               shaderID);
-                               stateShaderType.setShaderType(shaderType);
-                               shaderList.add(stateShaderType);
-
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_SOURCE)) {
-                               int shaderID = Integer.parseInt(parameters[0]);
-                               for (int i = 0; i < shaderList.size(); i++) {
-                                       if (shaderList.get(i).getId() == shaderID) {
-                                               shaderList.get(i).setShaderSrc(contextValue);
-                                               return;
-                                       }
+               if (apiName.equals(GLAPINameDefine.API_GL_SHADER_CREATE)) {
+                       int shaderID = Integer.parseInt(returnValue);
+                       int shaderType = Integer.parseInt(parameter);
+                       GLStateShaderType stateShaderType = new GLStateShaderType(
+                                       contextId, shaderID);
+                       stateShaderType.setShaderType(shaderType);
+                       curretnContextValue.shaderList.add(stateShaderType);
+
+               } else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_SOURCE)) {
+                       int shaderID = Integer.parseInt(parameters[0]);
+                       for (int i = 0; i < curretnContextValue.shaderList.size(); i++) {
+                               if (curretnContextValue.shaderList.get(i).getId() == shaderID) {
+                                       curretnContextValue.shaderList.get(i).setShaderSrc(
+                                                       DownloadContentfileManager
+                                                                       .getDowonloadFilePath(contextValue));
+                                       return;
                                }
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_COMPILE)) {
-                               int shaderID = Integer.parseInt(parameter);
-                               for (int i = 0; i < shaderList.size(); i++) {
-                                       if (shaderList.get(i).getId() == shaderID) {
-                                               shaderList.get(i).setCompileStatus(1);
-                                               return;
-                                       }
+                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_COMPILE)) {
+                       int shaderID = Integer.parseInt(parameter);
+                       for (int i = 0; i < curretnContextValue.shaderList.size(); i++) {
+                               if (curretnContextValue.shaderList.get(i).getId() == shaderID) {
+                                       curretnContextValue.shaderList.get(i).setCompileStatus(1);
+                                       return;
                                }
                        }
+               }
 
-                       else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_DEL)) {
-                               int shaderId = Integer.parseInt(parameter);
-                               for (int i = 0; i < shaderList.size(); i++) {
-                                       if (shaderList.get(i).getId() == shaderId) {
-                                               shaderList.get(i).setDeleteStatus(1);
-                                               break;
-                                       }
+               else if (apiName.equals(GLAPINameDefine.API_GL_SHADER_DEL)) {
+                       int shaderId = Integer.parseInt(parameter);
+                       for (int i = 0; i < curretnContextValue.shaderList.size(); i++) {
+                               if (curretnContextValue.shaderList.get(i).getId() == shaderId) {
+                                       curretnContextValue.shaderList.get(i).setDeleteStatus(1);
+                                       break;
                                }
                        }
+               }
 
-                       else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_CREATE)) {
-                               int programID = Integer.parseInt(returnValue);
-                               GLStateProgramType stateProgramType = new GLStateProgramType(
-                                               programID);
-                               programList.add(stateProgramType);
-                       } else if (apiName
-                                       .equals(GLAPINameDefine.API_GL_PROGRAM_ATTACH_SHADER)) {
-                               int programID = Integer.parseInt(parameters[0]);
-                               int shaderID = Integer.parseInt(parameters[1]);
-
-                               boolean isFragementShaser = false;
-                               for (int i = 0; i < shaderList.size(); i++) {
-                                       if (shaderList.get(i).getId() == shaderID) {
-                                               if (shaderList.get(i).isFragementShader()) {
-                                                       isFragementShaser = true;
-                                               } else {
-                                                       isFragementShaser = false;
-                                               }
-                                               break;
+               else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_CREATE)) {
+                       int programID = Integer.parseInt(returnValue);
+                       GLStateProgramType stateProgramType = new GLStateProgramType(
+                                       programID);
+                       curretnContextValue.programList.add(stateProgramType);
+               } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_ATTACH_SHADER)) {
+                       int programID = Integer.parseInt(parameters[0]);
+                       int shaderID = Integer.parseInt(parameters[1]);
+
+                       boolean isFragementShaser = false;
+                       for (int i = 0; i < curretnContextValue.shaderList.size(); i++) {
+                               if (curretnContextValue.shaderList.get(i).getId() == shaderID) {
+                                       if (curretnContextValue.shaderList.get(i)
+                                                       .isFragementShader()) {
+                                               isFragementShaser = true;
+                                       } else {
+                                               isFragementShaser = false;
                                        }
+                                       break;
                                }
+                       }
 
-                               for (int i = 0; i < programList.size(); i++) {
-                                       if (programList.get(i).getId() == programID) {
-                                               if (isFragementShaser) {
-                                                       programList.get(i).setFragmentShaderId(shaderID);
-                                               } else {
-                                                       programList.get(i).setVertexShaderId(shaderID);
-                                               }
-                                               return;
+                       for (int i = 0; i < curretnContextValue.programList.size(); i++) {
+                               if (curretnContextValue.programList.get(i).getId() == programID) {
+                                       if (isFragementShaser) {
+                                               curretnContextValue.programList.get(i)
+                                                               .setFragmentShaderId(shaderID);
+                                       } else {
+                                               curretnContextValue.programList.get(i)
+                                                               .setVertexShaderId(shaderID);
                                        }
+                                       return;
                                }
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_LINK)) {
-                               int programID = Integer.parseInt(parameter);
-                               for (int i = 0; i < programList.size(); i++) {
-                                       if (programList.get(i).getId() == programID) {
-                                               programList.get(i).setLinkStatus(1);
-                                               break;
-                                       }
+                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_LINK)) {
+                       int programID = Integer.parseInt(parameter);
+                       for (int i = 0; i < curretnContextValue.programList.size(); i++) {
+                               if (curretnContextValue.programList.get(i).getId() == programID) {
+                                       curretnContextValue.programList.get(i).setLinkStatus(1);
+                                       break;
                                }
-                       } else if (apiName
-                                       .equals(GLAPINameDefine.API_GL_PROGRAM_DETATCH_SHADER)) {
-                               int programID = Integer.parseInt(parameters[0]);
-                               int shaderID = Integer.parseInt(parameters[1]);
-                               boolean isFragementShaser = false;
-                               for (int i = 0; i < shaderList.size(); i++) {
-                                       if (shaderList.get(i).getId() == shaderID) {
-                                               if (shaderList.get(i).isFragementShader()) {
-                                                       isFragementShaser = true;
-                                               } else {
-                                                       isFragementShaser = false;
-                                               }
-                                               break;
+                       }
+               } else if (apiName
+                               .equals(GLAPINameDefine.API_GL_PROGRAM_DETATCH_SHADER)) {
+                       int programID = Integer.parseInt(parameters[0]);
+                       int shaderID = Integer.parseInt(parameters[1]);
+                       boolean isFragementShaser = false;
+                       for (int i = 0; i < curretnContextValue.shaderList.size(); i++) {
+                               if (curretnContextValue.shaderList.get(i).getId() == shaderID) {
+                                       if (curretnContextValue.shaderList.get(i)
+                                                       .isFragementShader()) {
+                                               isFragementShaser = true;
+                                       } else {
+                                               isFragementShaser = false;
                                        }
+                                       break;
                                }
+                       }
 
-                               for (int i = 0; i < programList.size(); i++) {
-                                       if (programList.get(i).getId() == programID) {
-                                               if (isFragementShaser) {
-                                                       programList.get(i).setFragmentShaderId(-1);
-                                               } else {
-                                                       programList.get(i).setVertexShaderId(-1);
-                                               }
-                                               return;
+                       for (int i = 0; i < curretnContextValue.programList.size(); i++) {
+                               if (curretnContextValue.programList.get(i).getId() == programID) {
+                                       if (isFragementShaser) {
+                                               curretnContextValue.programList.get(i)
+                                                               .setFragmentShaderId(-1);
+                                       } else {
+                                               curretnContextValue.programList.get(i)
+                                                               .setVertexShaderId(-1);
                                        }
+                                       return;
                                }
+                       }
 
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_USE)) {
-                               int programId = Integer.parseInt(parameter);
-                               for (int i = 0; i < programList.size(); i++) {
-                                       if (programList.get(i).getId() == programId) {
-                                               programList.get(i).setContextName(
-                                                               Integer.parseInt(contextID));
-                                               break;
-                                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_USE)) {
+                       long programId = Long.parseLong(parameter);
+                       for (int i = 0; i < curretnContextValue.programList.size(); i++) {
+                               if (curretnContextValue.programList.get(i).getId() == programId) {
+                                       curretnContextValue.programList.get(i).setContextId(
+                                                       Integer.parseInt(contextID));
+                                       break;
                                }
+                       }
 
-                       } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_DEL)) {
-                               int programId = Integer.parseInt(parameter);
-                               for (int i = 0; i < programList.size(); i++) {
-                                       if (programList.get(i).getId() == programId) {
-                                               programList.get(i).setDeleteStatus(1);
-                                               break;
-                                       }
+               } else if (apiName.equals(GLAPINameDefine.API_GL_PROGRAM_DEL)) {
+                       int programId = Integer.parseInt(parameter);
+                       for (int i = 0; i < curretnContextValue.programList.size(); i++) {
+                               if (curretnContextValue.programList.get(i).getId() == programId) {
+                                       curretnContextValue.programList.get(i).setDeleteStatus(1);
+                                       break;
                                }
                        }
                }
@@ -935,10 +999,32 @@ public class GLStateDataMaker {
        }
 
        public List<GLStateProgramType> getProgramList() {
+               List<GLStateProgramType> programList = new ArrayList<GLStateProgramType>();
+               Set<Entry<Long, ContextValueType>> set = contextHashMap.entrySet();
+               Iterator<Entry<Long, ContextValueType>> itr = set.iterator();
+               while (itr.hasNext()) {
+                       Map.Entry<Long, ContextValueType> e = (Map.Entry<Long, ContextValueType>) itr
+                                       .next();
+                       ContextValueType contextValue = e.getValue();
+                       for (int i = 0; i < contextValue.programList.size(); i++) {
+                               programList.add(contextValue.programList.get(i));
+                       }
+               }
                return programList;
        }
 
        public List<GLStateShaderType> getShaderList() {
+               List<GLStateShaderType> shaderList = new ArrayList<GLStateShaderType>();
+               Set<Entry<Long, ContextValueType>> set = contextHashMap.entrySet();
+               Iterator<Entry<Long, ContextValueType>> itr = set.iterator();
+               while (itr.hasNext()) {
+                       Map.Entry<Long, ContextValueType> e = (Map.Entry<Long, ContextValueType>) itr
+                                       .next();
+                       ContextValueType contextValue = e.getValue();
+                       for (int i = 0; i < contextValue.shaderList.size(); i++) {
+                               shaderList.add(contextValue.shaderList.get(i));
+                       }
+               }
                return shaderList;
        }
 
index 30a2c98..83ba1b5 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
@@ -107,12 +104,6 @@ public class GLStateHistoryDBTableManager extends DBTable {
 
        public List<Object> selectLastChangedSeq(long contextId, int stateIndex,
                        long seq) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                String query = String.format(SELECT_LAST_CHANGED_SEQ_QUERY, contextId,
                                stateIndex, seq);
                List<List<Object>> result = SqlConnectionManager.executeQuery(query);
@@ -124,13 +115,6 @@ public class GLStateHistoryDBTableManager extends DBTable {
 
        public List<Object> selectNextChangedSeq(long contextId, int stateIndex,
                        long seq) {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-
-               }
                String query = String.format(SELECT_NEXT_CHANGED_SEQ_QUERY, contextId,
                                stateIndex, seq);
                List<List<Object>> result = SqlConnectionManager.executeQuery(query);
index eca5328..f55759b 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
@@ -56,14 +53,14 @@ public class GLStateProgramDBTableManager extends DBTable {
        public static final String COMPILE_STATUS = "COMPILE_STATUS"; // only shader//$NON-NLS-1$
        public static final String FRAGMENT_ID = "FRAGMENT_ID"; // only program//$NON-NLS-1$
        public static final String VERTEX_ID = "VERTEX_ID"; // only program//$NON-NLS-1$
-       public static final String CONTEXT_NAME = "CONTEXT_NAME"; // only program//$NON-NLS-1$
+       public static final String CONTEXT_ID = "CONTEXT_ID"; // only program//$NON-NLS-1$
 
        private static final String SELECT_QUERY = "select " + TYPE//$NON-NLS-1$
                        + CommonConstants.COMMA + ID + CommonConstants.COMMA + SHADER_SRC
                        + CommonConstants.COMMA + DELETE_STATUS + CommonConstants.COMMA
                        + LINK_STATUS + CommonConstants.COMMA + COMPILE_STATUS
                        + CommonConstants.COMMA + FRAGMENT_ID + CommonConstants.COMMA
-                       + VERTEX_ID + CommonConstants.COMMA + CONTEXT_NAME + " from "
+                       + VERTEX_ID + CommonConstants.COMMA + CONTEXT_ID + " from "
                        + TABLENAME;
 
        public final static int TABLE_TYPE_INDEX = 0;
@@ -96,13 +93,13 @@ public class GLStateProgramDBTableManager extends DBTable {
                                DBConstants.INTEGER));
                addColumn(new DBColumn(VERTEX_ID, DBConstants.NOT_NULL,
                                DBConstants.INTEGER));
-               addColumn(new DBColumn(CONTEXT_NAME, DBConstants.NOT_NULL,
-                               DBConstants.INTEGER));
+               addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL,
+                               DBConstants.LONG));
        }
 
        public void insertData() {
                List<GLStateProgramType> programList = GLDataManager.getInstance()
-                               .getStateDataMagerInstance().getProgramList();
+                               .getStateDataMake().getProgramList();
 
                List<List<Object>> insertObjectList = new ArrayList<List<Object>>();
                for (int i = 0; i < programList.size(); i++) {
@@ -116,12 +113,12 @@ public class GLStateProgramDBTableManager extends DBTable {
                        itemList.add(STATUS_NULL);
                        itemList.add(programType.getFragmentShaderId());
                        itemList.add(programType.getVertexShaderId());
-                       itemList.add(programType.getContextName());
+                       itemList.add(programType.getContextId());
                        insertObjectList.add(itemList);
                }
 
                List<GLStateShaderType> shaderList = GLDataManager.getInstance()
-                               .getStateDataMagerInstance().getShaderList();
+                               .getStateDataMake().getShaderList();
 
                for (int i = 0; i < shaderList.size(); i++) {
                        GLStateShaderType shaderType = shaderList.get(i);
@@ -134,19 +131,13 @@ public class GLStateProgramDBTableManager extends DBTable {
                        itemList.add(shaderType.getCompileStatus());
                        itemList.add(STATUS_NULL);
                        itemList.add(STATUS_NULL);
-                       itemList.add(STATUS_NULL);
+                       itemList.add(shaderType.getContextId());
                        insertObjectList.add(itemList);
                }
                insertData(insertObjectList);
        }
 
        public void initProgramData() {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                List<List<Object>> result = SqlConnectionManager
                                .executeQuery(SELECT_QUERY);
                if (null == result || result.size() == 0 || result.get(0).size() == 0) {
@@ -165,18 +156,22 @@ public class GLStateProgramDBTableManager extends DBTable {
                                                TABLE_FRAGMENT_ID_INDEX));
                                programType.setVertexShaderId((Integer) result.get(i).get(
                                                TABLE_VERTEX_ID_INDEX));
-                               programType.setContextName((Integer) result.get(i).get(
+                               programType.setContextId((Integer) result.get(i).get(
                                                TABLE_CONTEXT_NAME_INDEX));
-                               GLDataManager.getInstance().getStateDataMagerInstance()
-                                               .getProgramList().add(programType);
+                               GLDataManager.getInstance().getStateDataMake().getProgramList()
+                                               .add(programType);
                        } else {
                                GLStateShaderType shaderType = new GLStateShaderType(
-                                               (Integer) result.get(i).get(1));
-                               shaderType.setShaderSrc((String) result.get(i).get(2));
-                               shaderType.setDeleteStatus((Integer) result.get(i).get(3));
-                               shaderType.setCompileStatus((Integer) result.get(i).get(4));
-                               GLDataManager.getInstance().getStateDataMagerInstance()
-                                               .getShaderList().add(shaderType);
+                                               (Long) result.get(i).get(TABLE_CONTEXT_NAME_INDEX),
+                                               (Integer) result.get(i).get(TABLE_ID_INDEX));
+                               shaderType.setShaderSrc((String) result.get(i).get(
+                                               TABLE_SHADER_SRC_INDEX));
+                               shaderType.setDeleteStatus((Integer) result.get(i).get(
+                                               TABLE_DELETE_STATUS_INDEX));
+                               shaderType.setCompileStatus((Integer) result.get(i).get(
+                                               TABLE_LINK_STATUS_INDEX));
+                               GLDataManager.getInstance().getStateDataMake().getShaderList()
+                                               .add(shaderType);
                        }
                }
        }
@@ -184,7 +179,6 @@ public class GLStateProgramDBTableManager extends DBTable {
        @Override
        public boolean prepare(PreparedStatement prep, List<Object> rowData) {
                boolean isPrepared = true;
-
                int columnsize = getColumnSize();
                if (columnsize != rowData.size()) {
                        isPrepared = false;
@@ -206,8 +200,8 @@ public class GLStateProgramDBTableManager extends DBTable {
                                                (Integer) (rowData.get(TABLE_FRAGMENT_ID_INDEX)));
                                prep.setInt(TABLE_VERTEX_ID_INDEX + 1,
                                                (Integer) (rowData.get(TABLE_VERTEX_ID_INDEX)));
-                               prep.setInt(TABLE_CONTEXT_NAME_INDEX + 1,
-                                               (Integer) (rowData.get(TABLE_CONTEXT_NAME_INDEX)));
+                               prep.setLong(TABLE_CONTEXT_NAME_INDEX + 1,
+                                               (Long) (rowData.get(TABLE_CONTEXT_NAME_INDEX)));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateSharingDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateSharingDBTableManager.java
new file mode 100644 (file)
index 0000000..c0ffdd6
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com> 
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+package org.tizen.dynamicanalyzer.ui.opengl.data;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.database.DBColumn;
+import org.tizen.dynamicanalyzer.database.DBConstants;
+import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
+import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSharingContextType;
+
+public class GLStateSharingDBTableManager extends DBTable {
+       private static final String TABLENAME = "GL_SHARING";//$NON-NLS-1$
+
+       public static final String CONTEXT_ID = "CONTEXT_ID";//$NON-NLS-1$
+       public static final String SHARING_CONTEXT_ID = "SHARING_CONTEXT_ID";//$NON-NLS-1$
+
+       public final static int TABLE_CONTEXT_ID_INDEX = 0;
+       public final static int TABLE_SHARING_CONTEXT_ID_INDEX = 1;
+
+       private static final String SELECT_QUERY = "select "//$NON-NLS-1$
+                       + CONTEXT_ID + CommonConstants.COMMA
+                       + SHARING_CONTEXT_ID
+                       + " from " + TABLENAME;//$NON-NLS-1$
+
+       List<GLSharingContextType> savedSharingInfoList = null;
+
+       @Override
+       public String getTableName() {
+               return TABLENAME;
+       }
+
+       public GLStateSharingDBTableManager() {
+               addColumn(new DBColumn(CONTEXT_ID, DBConstants.NOT_NULL,
+                               DBConstants.LONG));
+               addColumn(new DBColumn(SHARING_CONTEXT_ID, DBConstants.NOT_NULL,
+                               DBConstants.LONG));
+               savedSharingInfoList = new ArrayList<GLSharingContextType>();
+       }
+
+       public void insertSharingData(List<GLSharingContextType> sharingInfoList) {
+               List<List<Object>> insertList = new ArrayList<List<Object>>();
+               for (int i = 0; i < sharingInfoList.size(); i++) {
+                       GLSharingContextType insertSharingType = sharingInfoList.get(i);
+                       boolean isSavedData = false;
+                       for (int j = 0; j < savedSharingInfoList.size(); j++) {
+                               GLSharingContextType savedSharingType = savedSharingInfoList
+                                               .get(j);
+                               if (savedSharingType.getContextId() == insertSharingType
+                                               .getContextId()
+                                               && savedSharingType.getSharingContextId() == insertSharingType
+                                                               .getSharingContextId()) {
+                                       isSavedData = true;
+                                       break;
+                               }
+                       }
+                       if (!isSavedData) {
+                               List<Object> objectList = new ArrayList<Object>();
+                               objectList.add(insertSharingType.getContextId());
+                               objectList.add(insertSharingType.getSharingContextId());
+                               insertList.add(objectList);
+                               savedSharingInfoList.add(insertSharingType);
+                       }
+               }
+
+               insertData(insertList);
+       }
+
+       public List<GLSharingContextType> selectSharingData() {
+               List<List<Object>> result = SqlConnectionManager
+                               .executeQuery(SELECT_QUERY);
+               if (null == result || result.size() == 0 || result.get(0).size() == 0) {
+                       return null;
+               }
+
+               List<GLSharingContextType> sharingInfoList = new ArrayList<GLSharingContextType>();
+
+               for (int i = 0; i < result.size(); i++) {
+                       long contextId = (Long) result.get(i).get(TABLE_CONTEXT_ID_INDEX);
+                       long sharingContextId = (Long) result.get(i).get(
+                                       TABLE_SHARING_CONTEXT_ID_INDEX);
+
+                       sharingInfoList.add(new GLSharingContextType(contextId,
+                                       sharingContextId));
+               }
+
+               return sharingInfoList;
+       }
+
+       @Override
+       public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+               boolean isPrepared = true;
+               int columnsize = getColumnSize();
+               if (columnsize != rowData.size()) {
+                       isPrepared = false;
+               } else {
+                       try {
+                               prep.setLong(TABLE_CONTEXT_ID_INDEX + 1,
+                                               (Long) (rowData.get(TABLE_CONTEXT_ID_INDEX)));
+                               prep.setLong(TABLE_SHARING_CONTEXT_ID_INDEX + 1,
+                                               (Long) (rowData.get(TABLE_SHARING_CONTEXT_ID_INDEX)));
+                       } catch (SQLException e) {
+                               e.printStackTrace();
+                               isPrepared = false;
+                       }
+               }
+               return isPrepared;
+       }
+
+}
index 8ff5dd2..b7206b5 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.opengl.data;
 
-import java.io.File;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
@@ -114,12 +111,6 @@ public class GLStateTextureDBTableManager extends DBTable {
        }
 
        public List<GLStateTextureType> select() {
-               if (null != AnalyzerManager.getProject()) {
-                       SqlConnectionManager.establishConnection(AnalyzerManager
-                                       .getProject().getSavePath()
-                                       + File.separator
-                                       + AnalyzerConstants.DATABASE_NAME);
-               }
                List<List<Object>> result = SqlConnectionManager
                                .executeQuery(SELECT_QUERY);
                if (null == result || result.size() == 0 || result.get(0).size() == 0) {
index e8c4d61..89138ef 100644 (file)
@@ -37,7 +37,14 @@ import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
 public class ContextValueType {
        private static final int CONTEXT_VALUE_SIZE = GLContextNameEnum.values().length;
 
-       private long contextID = -1;
+       public long contextID = -1;
+
+       public List<Long> sharingContextIdList = null;
+
+       public List<GLStateProgramType> programList;
+       public List<GLStateShaderType> shaderList;
+       public List<GLStateTextureType> textureList;
+
        private List<String> defaultValueList = null;
        private List<String> preValueList = null;
        private List<String> currentValueList = null;
@@ -83,6 +90,12 @@ public class ContextValueType {
                vboSizeMap = new LinkedHashMap<String, String>();
                vboDataMap = new LinkedHashMap<String, String>();
                vboUsageMap = new LinkedHashMap<String, String>();
+
+               programList = new ArrayList<GLStateProgramType>();
+               shaderList = new ArrayList<GLStateShaderType>();
+               textureList = new ArrayList<GLStateTextureType>();
+
+               sharingContextIdList = new ArrayList<Long>();
        }
 
        public void setVertexAttribs(int size) {
@@ -194,4 +207,50 @@ public class ContextValueType {
                }
                return list;
        }
+
+       public void addSharingContextID(
+                       LinkedHashMap<Long, ContextValueType> contextMap,
+                       long sharingContextId) {
+
+               sharingContextIdList.add(sharingContextId);
+               ContextValueType sharingContextValueType = contextMap
+                               .get(sharingContextId);
+
+               // update sharingContextIdList of current contextValueType from
+               // sharingContextID of all shared contextValueType
+               for (int i = 0; i < sharingContextValueType.sharingContextIdList.size(); i++) {
+                       long savedSharingContextId = sharingContextValueType.sharingContextIdList
+                                       .get(i);
+                       if (savedSharingContextId == contextID
+                                       || savedSharingContextId == sharingContextId) {
+                               return;
+                       }
+                       for (int j = 0; j < sharingContextIdList.size(); j++) {
+                               long ContextId = sharingContextIdList.get(j);
+                               if (savedSharingContextId == ContextId) {
+                                       return;
+                               }
+                       }
+
+                       sharingContextIdList.add(savedSharingContextId);
+               }
+
+               sharingContextValueType.addSharingContextID(contextMap, contextID);
+
+               // update sharingContextIdList of all shared contextValueType from
+               // current sharingContextId
+               for (int i = 0; i < sharingContextValueType.sharingContextIdList.size(); i++) {
+                       long savedSharingContextId = sharingContextValueType.sharingContextIdList
+                                       .get(i);
+                       if (savedSharingContextId == contextID
+                                       || savedSharingContextId == sharingContextId) {
+                               return;
+                       }
+                       ContextValueType savedSharingContextValueType = contextMap
+                                       .get(savedSharingContextId);
+
+                       savedSharingContextValueType.addSharingContextID(contextMap,
+                                       contextID);
+               }
+       }
 }
index 0dcc0d1..d707613 100644 (file)
@@ -33,6 +33,7 @@ public class FrameCountInfoType {
        private int endFrameIndex = 0;
        private int frameCount = 0;
        private int errno = 0;
+       private int pid = 0;
 
        public int getTime() {
                return time;
@@ -77,4 +78,12 @@ public class FrameCountInfoType {
        public void setEndFrameIndex(int endFrameIndex) {
                this.endFrameIndex = endFrameIndex;
        }
+
+       public int getPid() {
+               return pid;
+       }
+
+       public void setPid(int pid) {
+               this.pid = pid;
+       }
 }
index 05794ac..1442b25 100644 (file)
@@ -125,4 +125,8 @@ public class GLAPINameDefine {
        public static final String API_GL_ENABLE = "glEnable";//$NON-NLS-1$
        public static final String API_EGL_SWAPBUFFERS = "eglSwapBuffers";//$NON-NLS-1$
        public static final String API_SGL_SWAPBUFFERS = "_SglSwapBuffers";//$NON-NLS-1$
+       
+       //EGL
+       public static final String API_EGL_CREATE_CONTEXT = "_SglCreateContext";//$NON-NLS-1$
+       
 }
index c6457d7..2828828 100644 (file)
@@ -53,16 +53,16 @@ public class GLContextDefaultValueHashMap {
                defaultContextHashMap.put("BLEND_SRC_RGB", "1"); //$NON-NLS-1$
                defaultContextHashMap.put("BLEND_SRC_ALPHA", "1"); //$NON-NLS-1$
 
-               defaultContextHashMap.put("CULLING_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$
+               defaultContextHashMap.put("CULLING_ENABLED", CommonConstants.ENABLE); //$NON-NLS-1$
                defaultContextHashMap.put("CULLING_ORIENTATION", "2305"); //$NON-NLS-1$
                defaultContextHashMap.put("CULLING_MODE", "1029"); //$NON-NLS-1$
 
-               defaultContextHashMap.put("DEPTH_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$
+               defaultContextHashMap.put("DEPTH_ENABLED", CommonConstants.ENABLE); //$NON-NLS-1$
                defaultContextHashMap.put("DEPTH_FUNC", "513"); //$NON-NLS-1$
                defaultContextHashMap.put("DEPTH_RANGE_N", "0"); //$NON-NLS-1$
-               defaultContextHashMap.put("DEPTH_RANGE_F", "1"); //$NON-NLS-1$
+               defaultContextHashMap.put("DEPTH_RANGE_F", "0"); //$NON-NLS-1$
 
-               defaultContextHashMap.put("DITHER_ENABLED", CommonConstants.DISABLE); //$NON-NLS-1$
+               defaultContextHashMap.put("DITHER_ENABLED", CommonConstants.ENABLE); //$NON-NLS-1$
 
                defaultContextHashMap.put("FRAME_BUFFER_BINDING", "0"); //$NON-NLS-1$
 
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLSharingContextType.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/type/GLSharingContextType.java
new file mode 100644 (file)
index 0000000..f0366bc
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.dynamicanalyzer.ui.opengl.data.type;
+
+public class GLSharingContextType {
+       private long contextId = -1;
+       private long sharingContextId = -1;
+
+       public GLSharingContextType(long contextId, long sharingContextId) {
+               this.contextId = contextId;
+               this.sharingContextId = sharingContextId;
+       }
+
+       public long getContextId() {
+               return contextId;
+       }
+
+       public void setContextId(long contextId) {
+               this.contextId = contextId;
+       }
+
+       public long getSharingContextId() {
+               return sharingContextId;
+       }
+
+       public void setSharingContextId(long sharingContextId) {
+               this.sharingContextId = sharingContextId;
+       }
+
+}
\ No newline at end of file
index 15f3236..6143daf 100644 (file)
@@ -35,7 +35,7 @@ public class GLStateProgramType {
        private int deleteStatus = -1;
        private int fragmentShaderId = -1;
        private int vertexShaderId = -1;
-       private int contextName = -1;
+       private long contextId = -1;
 
        public GLStateProgramType(int id) {
                setId(id);
@@ -81,12 +81,12 @@ public class GLStateProgramType {
                this.vertexShaderId = vertexShaderId;
        }
 
-       public int getContextName() {
-               return contextName;
+       public long getContextId() {
+               return contextId;
        }
 
-       public void setContextName(int contextName) {
-               this.contextName = contextName;
+       public void setContextId(long contextId) {
+               this.contextId = contextId;
        }
 
 }
\ No newline at end of file
index ffb7dff..1c9de00 100644 (file)
@@ -32,13 +32,15 @@ public class GLStateShaderType {
        public static int GL_FRAGMENT_SHADER = 1;
        public static int GL_VERTEX_SHADER = 2;
 
+       private long contextId = -1;
        private int id = -1;
        private int shaderType = -1;
        private String shaderSrc = CommonConstants.EMPTY;
        private int deleteStatus = -1;
        private int compileStatus = -1;
 
-       public GLStateShaderType(int id) {
+       public GLStateShaderType(long contextId, int id) {
+               setContextId(contextId);
                setId(id);
        }
 
@@ -90,4 +92,12 @@ public class GLStateShaderType {
                this.compileStatus = compileStatus;
        }
 
+       public long getContextId() {
+               return contextId;
+       }
+
+       public void setContextId(long contextId) {
+               this.contextId = contextId;
+       }
+
 }
\ No newline at end of file
index e8eaa42..e333319 100644 (file)
@@ -32,13 +32,16 @@ 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.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.nl.GLPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
 import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.FrameCountInfoType;
 import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
 
@@ -100,23 +103,24 @@ public class GLAPIListView extends DAViewComposite {
                        GLSelectionData data = (GLSelectionData) vdata;
                        String id = data.getViewID();
                        if (id.equals(GLPage.chartViewID)) {
+                               int startFrameIndex = data.getFrameTimeIndex();
                                int endFrameIndex = data.getSecondFrameIndex();
-                               int frameIndex = data.getFrameTimeIndex();
-                               if (GLDataManager.getInstance().isShowFrameRateChart()) {
+
+                               if (startFrameIndex == endFrameIndex) {
                                        title = GLPageLabels.GL_API_LIST_VIEW_TITLE
-                                                       + CommonConstants.OPEN_BRACKET + frameIndex
-                                                       + CommonConstants.DASH + endFrameIndex
+                                                       + CommonConstants.OPEN_BRACKET + startFrameIndex
                                                        + GLPageLabels.GL_FRAME
                                                        + CommonConstants.CLOSE_BRACKET;
-
                                } else {
                                        title = GLPageLabels.GL_API_LIST_VIEW_TITLE
-                                                       + CommonConstants.OPEN_BRACKET + frameIndex
+                                                       + CommonConstants.OPEN_BRACKET + startFrameIndex
+                                                       + CommonConstants.DASH + endFrameIndex
                                                        + GLPageLabels.GL_FRAME
                                                        + CommonConstants.CLOSE_BRACKET;
                                }
                                setTitle(title);
-                               glAPIListTable.updateTableFromChart(frameIndex, endFrameIndex);
+                               glAPIListTable.updateTableFromChart(startFrameIndex,
+                                               endFrameIndex);
                        } else if (id.equals(GLPage.contextHistoryID)) {
                                if (GLDataManager.getInstance().isShowFrameRateChart()) {
 
@@ -125,27 +129,7 @@ public class GLAPIListView extends DAViewComposite {
                                                frameRateIndex = GLDataManager.getInstance()
                                                                .getStartFrameRateTime();
                                        }
-
-                                       FrameCountInfoType selectionFrameCountInfo = GLDataManager
-                                                       .getInstance().getFrameRateStartIndex(
-                                                                       frameRateIndex, frameRateIndex);
-                                       if (null == selectionFrameCountInfo) {
-                                               return;
-                                       }
-                                       int startFrameIndex = selectionFrameCountInfo
-                                                       .getStartFrameIndex();
-
-                                       int endFrameIdnex = selectionFrameCountInfo
-                                                       .getEndFrameIndex();
-                                       title = GLPageLabels.GL_API_LIST_VIEW_TITLE
-                                                       + CommonConstants.OPEN_BRACKET + startFrameIndex
-                                                       + CommonConstants.DASH + endFrameIdnex
-                                                       + GLPageLabels.GL_FRAME
-                                                       + CommonConstants.CLOSE_BRACKET;
-
-                                       setTitle(title);
-                                       glAPIListTable.updateTableFromContext(startFrameIndex,
-                                                       endFrameIdnex, data.getSeq());
+                                       setSelectedAPI(frameRateIndex, data.getSeq());
                                } else {
                                        int frameIndex = data.getFrameTimeIndex();
                                        title = GLPageLabels.GL_API_LIST_VIEW_TITLE
@@ -157,8 +141,39 @@ public class GLAPIListView extends DAViewComposite {
                                                        frameIndex, data.getSeq());
                                }
                        }
+               } else if (vdata instanceof DASelectionData) {
+                       DASelectionData selData = (DASelectionData) vdata;
+                       Object obData = selData.getData();
+                       LogData ldata = (LogData) obData;
+                       long dataTime = ldata.getTime();
+                       double selectionTime = dataTime / TimelineConstants.MEGA_DOUBLE;
+                       if (selectionTime <= 1) {
+                               selectionTime = GLDataManager.getInstance()
+                                               .getStartFrameRateTime();
+                       }
+                       setSelectedAPI((int) selectionTime,
+                                       Integer.toString(ldata.getSeq()));
                }
+       }
+
+       private void setSelectedAPI(int selectionTime, String seq) {
+               FrameCountInfoType selectionFrameCountInfo = GLDataManager
+                               .getInstance().getFrameRateStartIndex(selectionTime,
+                                               selectionTime);
+               if (null == selectionFrameCountInfo) {
+                       return;
+               }
+               int startFrameIndex = selectionFrameCountInfo.getStartFrameIndex();
+
+               int endFrameIdnex = selectionFrameCountInfo.getEndFrameIndex();
+               title = GLPageLabels.GL_API_LIST_VIEW_TITLE
+                               + CommonConstants.OPEN_BRACKET + startFrameIndex
+                               + CommonConstants.DASH + endFrameIdnex + GLPageLabels.GL_FRAME
+                               + CommonConstants.CLOSE_BRACKET;
 
+               setTitle(title);
+               glAPIListTable.updateTableFromContext(startFrameIndex, endFrameIdnex,
+                               seq);
        }
 
        @Override
index 887dfd7..7c94eae 100644 (file)
@@ -143,7 +143,8 @@ public class GLContextTable extends DATableComposite {
                for (int i = 0; i < size; i++) {
                        if (i == GLContextNameEnum.RID.ordinal()
                                        || i == GLContextNameEnum.SEQ.ordinal()
-                                       || i == GLContextNameEnum.CONTEXT_ID.ordinal()) {
+                                       || i == GLContextNameEnum.CONTEXT_ID.ordinal()
+                                       || i == GLContextNameEnum.TEXTURE_ACTIVE.ordinal()) {
                                continue;
                        }
 
@@ -161,13 +162,11 @@ public class GLContextTable extends DATableComposite {
                        }
 
                        if (isInteger(currentValue)) {
-                               if (i != GLContextNameEnum.TEXTURE_ACTIVE.ordinal()) {
-                                       String glConstantDefine = GLConstantDefine
-                                                       .getConstantString(currentValue);
-                                       if (null != glConstantDefine) {
-                                               defaultValue = glConstantDefine;
-                                               currentValue = glConstantDefine;
-                                       }
+                               String glConstantDefine = GLConstantDefine
+                                               .getConstantString(currentValue);
+                               if (null != glConstantDefine) {
+                                       defaultValue = glConstantDefine;
+                                       currentValue = glConstantDefine;
                                }
                        }
                        text.add(stateName);
index 5ee4f17..7cc092b 100644 (file)
@@ -69,7 +69,7 @@ public class GLContextTableView extends DAViewComposite {
        private List<String> selectedStateValueList = null;
        private String selectedSeq = CommonConstants.EMPTY;
        private boolean isCheckedBox = true;
-       private Image checkImg = ImageResources.CHECKBOX_SELECTED;
+       private Image checkImg = ImageResources.OPENGL_SHOW_ONLY_CHANGED_SELECTED;
 
        private String[] columnNames = { GLPageLabels.GL_CONTEXT_VIEW_NAME,
                        GLPageLabels.GL_CONTEXT_VIEW_DEFAULT_VALUE,
@@ -179,10 +179,10 @@ public class GLContextTableView extends DAViewComposite {
                        if (width - checkBoxOffSet <= event.x && event.x <= width) {
                                if (isCheckedBox) {
                                        isCheckedBox = false;
-                                       checkImg = ImageResources.CHECKBOX_UNSELECTED;
+                                       checkImg = ImageResources.OPENGL_SHOW_ONLY_CHANGED_UNSELECTED;
                                } else {
                                        isCheckedBox = true;
-                                       checkImg = ImageResources.CHECKBOX_SELECTED;
+                                       checkImg = ImageResources.OPENGL_SHOW_ONLY_CHANGED_SELECTED;
                                }
                                titleBar.redraw();
                                tableComp.setSelectedSeq(isCheckedBox, selectedSeq,
index 25d29c5..ad6b0fa 100644 (file)
@@ -72,8 +72,10 @@ public class GLProgramTable extends DATableComposite {
 
                List<TableInput> input = new ArrayList<TableInput>();
 
+               GLDataManager.getInstance().updateSharingContextList();
+
                List<GLStateProgramType> programList = GLDataManager.getInstance()
-                               .getStateDataMagerInstance().getProgramList();
+                               .getStateDataMake().getProgramList();
 
                int size = programList.size();
 
@@ -84,7 +86,7 @@ public class GLProgramTable extends DATableComposite {
                                        Long.parseLong(programId));
 
                        String contextName = GLPageLabels.GL_CONTEXT
-                                       + programList.get(i).getContextName();
+                                       + programList.get(i).getContextId();
                        String programID = GLPageLabels.GL_PROGRAM + programId;
                        String vertexShaderID = GLPageLabels.GL_SHADER
                                        + programList.get(i).getVertexShaderId();
@@ -101,11 +103,14 @@ public class GLProgramTable extends DATableComposite {
                        tableInput.setData(tableData);
                        input.add(tableInput);
 
-                       int contextID = programList.get(i).getContextName();
+                       long contextID = programList.get(i).getContextId();
 
                        if (GLDataManager.getInstance().getSelectedContextID() == contextID) {
                                tableInput.setInRange(true);
                        }
+                       if (GLDataManager.getInstance().isSharingData(contextID)) {
+                               tableInput.setInRange(true);
+                       }
 
                }
                return input;
index 92c0f77..a6e7294 100644 (file)
@@ -66,8 +66,13 @@ public class GLTextureTable extends DATableComposite {
 
                List<TableInput> input = new ArrayList<TableInput>();
 
+               GLDataManager.getInstance().updateSharingContextList();
+
                List<GLStateTextureType> textureList = GLDataManager.getInstance()
                                .getStateTextureDBTableManage().select();
+               if (null == textureList) {
+                       return null;
+               }
 
                int size = textureList.size();
                for (int i = 0; i < size; i++) {
@@ -103,7 +108,9 @@ public class GLTextureTable extends DATableComposite {
                        if (GLDataManager.getInstance().getSelectedContextID() == contextID) {
                                tableInput.setInRange(true);
                        }
-
+                       if (GLDataManager.getInstance().isSharingData(contextID)) {
+                               tableInput.setInRange(true);
+                       }
                }
                return input;
        }
index bc7f47c..2f8fb0c 100755 (executable)
@@ -60,7 +60,8 @@ public class BaseView extends ViewPart {
 
                // create tab view in base composite
                tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED);
-               tabView.setTabWidth(110);
+               tabView.setTabWidth(114);
+               tabView.isImageTab(true);
                {
                        DABaseComposite timelinePage = new TimelinePage(
                                        tabView.getContentComposite(), SWT.NONE);
index 4309f7c..891d541 100644 (file)
@@ -42,13 +42,10 @@ import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
 import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogDataManager;
-import org.tizen.dynamicanalyzer.util.DALogger;
 
 public class FunctionUsageProfiler extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-
        // default sampling rate = 10 ms
-       public static long SAMPLE_TIME = 10;
+       public static long SAMPLE_TIME = -1;
        public static final String APPLICATION = SummaryLabels.FUNCTION_USAGE_PROFILER_APPLICATION;
        public static final String DEPENDENT_LIB = SummaryLabels.FUNCTION_USAGE_PROFILER_DEPENDENT_LIB;
        public static final String APPLICATION_KEY = "profiling_app_bin_key";//$NON-NLS-1$
@@ -58,6 +55,7 @@ public class FunctionUsageProfiler extends PageDataManager {
        private static FunctionUsageProfiler instance = null;
 
        private HashMap<Integer, ProfileDataMaker> profileDataMakerMap = null;
+
        /**
         * key: symbol(child) or file path (parent) - value : sequence num of
         * profiling data. all parent and child data is in
@@ -94,37 +92,28 @@ public class FunctionUsageProfiler extends PageDataManager {
                return instance;
        }
 
-       /*** profiling thread ***/
-       @Override
-       public void run() {
-               SAMPLE_TIME = ConfigurationDialogDataManager
-                               .getInstance()
-                               .getfeatureValue(
-                                               ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC);
+       public static void clear() {
+               instance = null;
+       }
 
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread
-                               break;
+       @Override
+       protected void makeData(LogPackage pack) {
+               if (SAMPLE_TIME < 0) {
+                       SAMPLE_TIME = ConfigurationDialogDataManager
+                                       .getInstance()
+                                       .getfeatureValue(
+                                                       ConfigureLabels.FUNCTION_PROFILING_SAMPLING_PERIODIC);
+               }
 
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_DATA_SAMPLE);
-                       if (null != logs && logs.getRawLogs().size() != 0) {
-                               List<LogData> sample = logs.getLogs();
-                               int size = sample.size();
-                               for (int i = 0; i < size; i++) {
-                                       getInstance().getProfileDataMakerByPid(
-                                                       sample.get(i).getPid())
-                                                       .makeFunctionUsageProfileData(
-                                                                       (ProfileData) sample.get(i));
-                               }
+               Logs logs = pack.getLogs(DataChannelConstants.MSG_DATA_SAMPLE);
+               if (null != logs && logs.getRawLogs().size() != 0) {
+                       List<LogData> sample = logs.getLogs();
+                       int size = sample.size();
+                       for (int i = 0; i < size; i++) {
+                               getInstance().getProfileDataMakerByPid(sample.get(i).getPid())
+                                               .makeFunctionUsageProfileData(
+                                                               (ProfileData) sample.get(i));
                        }
                }
-
-               /* log for debug */
-               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-       }
-
-       public static void clear() {
-               instance = null;
        }
 }
index 360cc6d..f8c65f2 100644 (file)
@@ -438,7 +438,7 @@ public class ProfileDataMaker {
                                }
                                addrs.add(0, selfAddr);
                        } else {
-               //              DA_LOG.debug("makeFunctionUsageProfileData : cannot find seq by time");
+                               DA_LOG.debug("makeFunctionUsageProfileData : cannot find seq by time");
                                addrs = new ArrayList<Long>();
                                addrs.add(selfAddr);
                        }
index 726c995..a36abdd 100644 (file)
@@ -28,7 +28,6 @@ package org.tizen.dynamicanalyzer.ui.thread;
 
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.swap.logparser.Logs;
@@ -36,12 +35,9 @@ import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataManager;
 import org.tizen.dynamicanalyzer.ui.thread.thread.ThreadPageThreadDataManager;
-import org.tizen.dynamicanalyzer.util.DALogger;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 
 public class ThreadChartManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-
        private static ThreadChartManager instance = null;
 
        private ThreadPageThreadDataManager tManager;
@@ -84,46 +80,6 @@ public class ThreadChartManager extends PageDataManager {
                sManager.clear();
        }
 
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread;
-                               break;
-
-                       List<LogData> loadInputs = getLogsFromLogPackage(pack,
-                                       DataChannelConstants.MSG_DATA_SYSTEM);
-                       if (null != loadInputs) {
-                               int logSize = loadInputs.size();
-                               for (int i = 0; i < logSize; i++) {
-                                       tManager.parseLoad(loadInputs.get(i));
-                               }
-                       }
-
-                       List<LogData> threadInputs = getLogsFromLogPackage(pack,
-                                       DataChannelConstants.MSG_PROBE_THREAD);
-                       if (null != threadInputs) {
-                               int logSize = threadInputs.size();
-                               for (int i = 0; i < logSize; i++) {
-                                       tManager.parseAPI(threadInputs.get(i));
-                               }
-                       }
-
-                       List<LogData> syncInputs = getLogsFromLogPackage(pack,
-                                       DataChannelConstants.MSG_PROBE_SYNC);
-                       if (null != syncInputs) {
-                               int logSize = syncInputs.size();
-                               for (int i = 0; i < logSize; i++) {
-                                       tManager.parseSync(syncInputs.get(i));
-                                       sManager.parseSync(syncInputs.get(i));
-                               }
-                       }
-               }
-
-               /* log for debug */
-               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-       }
-
        public int getItemIndexByTid(String tid) {
                return tManager.getItemIndexByTid(tid);
        }
@@ -133,4 +89,35 @@ public class ThreadChartManager extends PageDataManager {
                tManager.setBoard(threadBoard);
                sManager.setBoard(syncBoard);
        }
+
+       @Override
+       protected void makeData(LogPackage pack) {
+               List<LogData> loadInputs = getLogsFromLogPackage(pack,
+                               DataChannelConstants.MSG_DATA_SYSTEM);
+               if (null != loadInputs) {
+                       int logSize = loadInputs.size();
+                       for (int i = 0; i < logSize; i++) {
+                               tManager.parseLoad(loadInputs.get(i));
+                       }
+               }
+
+               List<LogData> threadInputs = getLogsFromLogPackage(pack,
+                               DataChannelConstants.MSG_PROBE_THREAD);
+               if (null != threadInputs) {
+                       int logSize = threadInputs.size();
+                       for (int i = 0; i < logSize; i++) {
+                               tManager.parseAPI(threadInputs.get(i));
+                       }
+               }
+
+               List<LogData> syncInputs = getLogsFromLogPackage(pack,
+                               DataChannelConstants.MSG_PROBE_SYNC);
+               if (null != syncInputs) {
+                       int logSize = syncInputs.size();
+                       for (int i = 0; i < logSize; i++) {
+                               tManager.parseSync(syncInputs.get(i));
+                               sManager.parseSync(syncInputs.get(i));
+                       }
+               }
+       }
 }
index e3a26dd..c3430b6 100644 (file)
@@ -70,10 +70,10 @@ public class CPUDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setInt(2, (Integer) (rowData.get(1)));
-                               prep.setFloat(3, (Float) (rowData.get(2)));
-                               prep.setFloat(4, (Float) (rowData.get(3)));     
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setInt(2, (Integer) (rowData.get(COLUMN.CORE_NUM.ordinal())));
+                               prep.setFloat(3, (Float) (rowData.get(COLUMN.CPU_LOAD.ordinal())));
+                               prep.setFloat(4, (Float) (rowData.get(COLUMN.CPU_FREQUENCY.ordinal())));        
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index a137060..6e067f0 100644 (file)
@@ -67,9 +67,9 @@ public class CustomDataDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setInt(2, (Integer) (rowData.get(1)));
-                               prep.setFloat(3, (Float) (rowData.get(2)));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setInt(2, (Integer) (rowData.get(COLUMN.CHART_HANDLE.ordinal())));
+                               prep.setFloat(3, (Float) (rowData.get(COLUMN.CHART_VALUE.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index edbec16..6093819 100644 (file)
@@ -70,10 +70,10 @@ public class EnergyDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setInt(2, (Integer) (rowData.get(1)));
-                               prep.setInt(3, (Integer) (rowData.get(2)));
-                               prep.setInt(4, (Integer) (rowData.get(3)));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setInt(2, (Integer) (rowData.get(COLUMN.DEVICE_NUM.ordinal())));
+                               prep.setInt(3, (Integer) (rowData.get(COLUMN.ENERGY_USAGE_DEVICE.ordinal())));
+                               prep.setInt(4, (Integer) (rowData.get(COLUMN.ENERGY_USAGE_APP.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index 5c03f86..313aa7b 100644 (file)
@@ -67,9 +67,9 @@ public class ProcessLoadDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setInt(2, (Integer) (rowData.get(1)));
-                               prep.setFloat(3, (Float) (rowData.get(2)));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setInt(2, (Integer) (rowData.get(COLUMN.PID.ordinal())));
+                               prep.setFloat(3, (Float) (rowData.get(COLUMN.CPU_LOAD.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index cdf115b..debcf6a 100644 (file)
@@ -69,9 +69,9 @@ public class ScreenShotDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setString(2, (String) (rowData.get(1)));
-                               prep.setInt(3, (Integer) (rowData.get(2)));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setString(2, (String) (rowData.get(COLUMN.IMAGE_FILE_PATH.ordinal())));
+                               prep.setInt(3, (Integer) (rowData.get(COLUMN.IMAGE_ORIENTATION.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index 55aa0d4..ca44b4a 100644 (file)
@@ -163,39 +163,39 @@ public class SystemDataDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setFloat(2, (Float) (rowData.get(1)));
-                               prep.setFloat(3, (Float) (rowData.get(2)));
-                               prep.setInt(4, (Integer) (rowData.get(3)));     
-                               prep.setLong(5, (Long) (rowData.get(4)));
-                               prep.setLong(6, (Long) (rowData.get(5)));
-                               prep.setInt(7, (Integer) (rowData.get(6)));
-                               prep.setInt(8, (Integer) (rowData.get(7)));
-                               prep.setInt(9, (Integer) (rowData.get(8)));
-                               prep.setInt(10, (Integer) (rowData.get(9)));
-                               prep.setLong(11, (Long) (rowData.get(10)));
-                               prep.setLong(12, (Long) (rowData.get(11)));
-                               prep.setInt(13, (Integer) (rowData.get(12)));
-                               prep.setInt(14, (Integer) (rowData.get(13)));
-                               prep.setInt(15, (Integer) (rowData.get(14)));
-                               prep.setInt(16, (Integer) (rowData.get(15)));
-                               prep.setInt(17, (Integer) (rowData.get(16)));
-                               prep.setInt(18, (Integer) (rowData.get(17)));
-                               prep.setInt(19, (Integer) (rowData.get(18)));
-                               prep.setInt(20, (Integer) (rowData.get(19)));
-                               prep.setInt(21, (Integer) (rowData.get(20)));
-                               prep.setInt(22, (Integer) (rowData.get(21)));
-                               prep.setInt(23, (Integer) (rowData.get(22)));
-                               prep.setInt(24, (Integer) (rowData.get(23)));
-                               prep.setInt(25, (Integer) (rowData.get(24)));
-                               prep.setInt(26, (Integer) (rowData.get(25)));
-                               prep.setInt(27, (Integer) (rowData.get(26)));
-                               prep.setInt(28, (Integer) (rowData.get(27)));
-                               prep.setInt(29, (Integer) (rowData.get(28)));
-                               prep.setInt(30, (Integer) (rowData.get(29)));
-                               prep.setInt(31, (Integer) (rowData.get(30)));
-                               prep.setInt(32, (Integer) (rowData.get(31)));
-                               prep.setInt(33, (Integer) (rowData.get(32)));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setFloat(2, (Float) (rowData.get(COLUMN.CPU_LOAD_APP.ordinal())));
+                               prep.setFloat(3, (Float) (rowData.get(COLUMN.CPU_LOAD_TOTAL.ordinal())));
+                               prep.setInt(4, (Integer) (rowData.get(COLUMN.PROCESS_COUNT.ordinal())));        
+                               prep.setLong(5, (Long) (rowData.get(COLUMN.HEAP_ALLOCATION_TOTAL.ordinal())));
+                               prep.setLong(6, (Long) (rowData.get(COLUMN.HEAP_ALLOCATION_APP.ordinal())));
+                               prep.setInt(7, (Integer) (rowData.get(COLUMN.MEMORY_VIRTUAL.ordinal())));
+                               prep.setInt(8, (Integer) (rowData.get(COLUMN.MEMORY_RESIDENT.ordinal())));
+                               prep.setInt(9, (Integer) (rowData.get(COLUMN.MEMORY_SHARED.ordinal())));
+                               prep.setInt(10, (Integer) (rowData.get(COLUMN.MEMORY_PSS.ordinal())));
+                               prep.setLong(11, (Long) (rowData.get(COLUMN.MEMORY_TOTAL_SYSTEM.ordinal())));
+                               prep.setLong(12, (Long) (rowData.get(COLUMN.MEMORY_USAGE_SYSTEM.ordinal())));
+                               prep.setInt(13, (Integer) (rowData.get(COLUMN.NETWORK_SIZE_SEND.ordinal())));
+                               prep.setInt(14, (Integer) (rowData.get(COLUMN.NETWORK_SIZE_RECEIVE.ordinal())));
+                               prep.setInt(15, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_WIFI.ordinal())));
+                               prep.setInt(16, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_BLUETOOTH.ordinal())));
+                               prep.setInt(17, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_GPS.ordinal())));
+                               prep.setInt(18, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_BRIGHTNESS.ordinal())));
+                               prep.setInt(19, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_DNET.ordinal())));
+                               prep.setInt(20, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_CAMERA.ordinal())));
+                               prep.setInt(21, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_SOUND.ordinal())));
+                               prep.setInt(22, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_AUDIO.ordinal())));
+                               prep.setInt(23, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_VIBRATION.ordinal())));
+                               prep.setInt(24, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_VOLTAGE.ordinal())));
+                               prep.setInt(25, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_RSSI.ordinal())));
+                               prep.setInt(26, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_VIDEO.ordinal())));
+                               prep.setInt(27, (Integer) (rowData.get(COLUMN.DEVICE_STATUS_CALL.ordinal())));
+                               prep.setInt(28, (Integer) (rowData.get(COLUMN.DISK_TOTAL_USAGE.ordinal())));
+                               prep.setInt(29, (Integer) (rowData.get(COLUMN.DISK_IO_READ_SIZE.ordinal())));
+                               prep.setInt(30, (Integer) (rowData.get(COLUMN.DISK_IO_READ_SECTOR.ordinal())));
+                               prep.setInt(31, (Integer) (rowData.get(COLUMN.DISK_IO_WRITE_SIZE.ordinal())));
+                               prep.setInt(32, (Integer) (rowData.get(COLUMN.DISK_IO_WRITE_SECTOR.ordinal())));
+                               prep.setInt(33, (Integer) (rowData.get(COLUMN.ENERGY_USAGE.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index 6fe846c..5e7ce3c 100644 (file)
@@ -81,13 +81,13 @@ public class UIEventDBTable extends DBTable {
                        isPrepared = false;
                } else {
                        try {
-                               prep.setLong(1, (Long) (rowData.get(0)));
-                               prep.setInt(2, (Integer) (rowData.get(1)));
-                               prep.setInt(3, (Integer) (rowData.get(2)));
-                               prep.setInt(4, (Integer) (rowData.get(3)));
-                               prep.setInt(5, (Integer) (rowData.get(4)));
-                               prep.setString(6, (String) (rowData.get(5)));
-                               prep.setInt(7, (Integer) (rowData.get(6)));
+                               prep.setLong(1, (Long) (rowData.get(COLUMN.TIME.ordinal())));
+                               prep.setInt(2, (Integer) (rowData.get(COLUMN.EVENT_TYPE.ordinal())));
+                               prep.setInt(3, (Integer) (rowData.get(COLUMN.DETAIL_TYPE.ordinal())));
+                               prep.setInt(4, (Integer) (rowData.get(COLUMN.POINT_X.ordinal())));
+                               prep.setInt(5, (Integer) (rowData.get(COLUMN.POINT_Y.ordinal())));
+                               prep.setString(6, (String) (rowData.get(COLUMN.INFO_INTEGER.ordinal())));
+                               prep.setInt(7, (Integer) (rowData.get(COLUMN.INFO_INTEGER.ordinal())));
                        } catch (SQLException e) {
                                e.printStackTrace();
                                isPrepared = false;
index 347d687..175b615 100644 (file)
@@ -95,7 +95,7 @@ public class CPUCoreChart extends TimelineChart {
                                DAChartSeries chartSeries = new DAChartSeries(
                                                TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE + i,
                                                DAChartSeries.SERIES_STYLE_LINE,
-                                               coreChartSeriesColors[i % ColorResources.MAX_SERIES_COLOR_COUNT]);
+                                               coreChartSeriesColors[i % coreSize]);
                                chart.addSeries(chartSeries);
                                coreChartSeriesList.add(chartSeries);
                        }
index 9a8b124..316748b 100644 (file)
@@ -90,7 +90,7 @@ public class CPUFrequencyChart extends TimelineChart {
                 DAChartSeries chartSeries =
                         new DAChartSeries(TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE + i,
                                           DAChartSeries.SERIES_STYLE_LINE,
-                                          coreChartSeriesColors[i % ColorResources.MAX_SERIES_COLOR_COUNT]);
+                                          coreChartSeriesColors[i % coreSize]);
                 chart.addSeries(chartSeries);
                 coreFrequencyChartSeriesList.add(chartSeries);
             }
index e84daef..74f4d15 100644 (file)
@@ -34,7 +34,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.GlobalInformation;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
@@ -83,7 +82,6 @@ import org.tizen.dynamicanalyzer.ui.timeline.chart.UserCustomChart;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.CustomLogParser;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
 import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
-import org.tizen.dynamicanalyzer.util.DALogger;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
@@ -92,7 +90,6 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.IDAChartSeriesMaker;
 
 
 public class TimelineChartManager extends PageDataManager implements IDAChartSeriesMaker {
-       private static final DALogger DA_LOG = DALogger.getInstance();
        private static TimelineChartManager instance = null;
 
     private boolean newCustomChart = false;
@@ -354,39 +351,6 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
         allocationSeriesDataSetMap.clear();
     }
 
-    @Override
-    public void run() {
-        while (!AnalyzerManager.isExit()) {
-            LogPackage pack = pollPack();
-            if (null == pack) // stop thread
-                break;
-
-            /*
-             * 1. Make SystemDataTable column
-             */
-            Logs systemLogs = pack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
-            Logs memoryLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_MEMORY);
-            Logs uiEventLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_UIEVENT);
-            Logs screenShotLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_SCREENSHOT);
-            makeSystemDataTableData(systemLogs, memoryLogs);
-            makeUIEventDBTableData(uiEventLogs);
-            makeScreenShotDBTableData(screenShotLogs);
-
-
-            Logs customLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_CUSTOM);
-            if (customLogs != null && !customLogs.getRawLogs().isEmpty()) {
-                customLogParser.parseLogPackage(pack);
-              }
-            Logs lifecycleLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_LIFECYCLE);
-            if (lifecycleLogs != null && !lifecycleLogs.getRawLogs().isEmpty()) {
-                lifecycleLogParser.parseLogPackage(pack);
-            }
-        }
-
-        /* log for debug */
-        DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-    }
-
     private void makeSystemDataTableData(Logs systemLogs, Logs memoryLogs) {
         int coreSize = GlobalInformation.getCurrentDeviceInfo().getTargetInfo().getCpuCount();
 
@@ -797,4 +761,28 @@ public class TimelineChartManager extends PageDataManager implements IDAChartSer
          */
         customLogParser.inputChartSeries(customDBData);
     }
+
+       @Override
+       protected void makeData(LogPackage pack) {
+        /*
+         * 1. Make SystemDataTable column
+         */
+        Logs systemLogs = pack.getLogs(DataChannelConstants.MSG_DATA_SYSTEM);
+        Logs memoryLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_MEMORY);
+        Logs uiEventLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_UIEVENT);
+        Logs screenShotLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_SCREENSHOT);
+        makeSystemDataTableData(systemLogs, memoryLogs);
+        makeUIEventDBTableData(uiEventLogs);
+        makeScreenShotDBTableData(screenShotLogs);
+
+
+        Logs customLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_CUSTOM);
+        if (customLogs != null && !customLogs.getRawLogs().isEmpty()) {
+            customLogParser.parseLogPackage(pack);
+          }
+        Logs lifecycleLogs = pack.getLogs(DataChannelConstants.MSG_PROBE_LIFECYCLE);
+        if (lifecycleLogs != null && !lifecycleLogs.getRawLogs().isEmpty()) {
+            lifecycleLogParser.parseLogPackage(pack);
+        }
+       }
 }
index dbfee1b..44eb074 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * jooyoul lee<jy.exe.lee@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -103,7 +104,7 @@ public class AboutDialog extends DAMessageBox {
                if (opened) {
                        return false;
                }
-               shell.setSize(446, 254);
+               shell.setSize(436, 254);
                shell.setLayout(new FormLayout());
                shell.setText(AnalyzerLabels.ABOUT_TITLE);
                shell.addDisposeListener(new DisposeListener() {
@@ -209,7 +210,7 @@ public class AboutDialog extends DAMessageBox {
                compData.top = new FormAttachment(base, 0);
                compData.left = new FormAttachment(0, 0);
                compData.right = new FormAttachment(100, 0);
-               compData.bottom = new FormAttachment(100, 0);
+               compData.height = 51;
                buttonComp.setLayoutData(compData);
 
                okButton = new DAButton(buttonComp, SWT.NONE);
index cd208b8..e2cc33f 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
  * yeongtaik byeon <yeongtaik.byeon@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
@@ -106,7 +107,7 @@ public class LicenseDialog {
 
        public int open() {
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
-               shell.setSize(608, 476 + 22);
+               shell.setSize(608, 438 + 22);
                FormLayout shellLayout = new FormLayout();
                shell.setLayout(shellLayout);
                shell.setText(AnalyzerLabels.LICENSE);
@@ -138,14 +139,14 @@ public class LicenseDialog {
                Text contents = new Text(base, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
                contents.setForeground(ColorResources.DEFAULT_FONT_COLOR);
                contents.setBackground(ColorResources.DIALOG_BG_UPPER);
-               contents.setFont(FontResources.getDADefaultFont());
+               contents.setFont(FontResources.LICENSE_TEXT);
                contents.setText(getLicenseString());
 
                layoutData = new FormData();
                layoutData.left = new FormAttachment(0, 18);
                layoutData.right = new FormAttachment(100, -18);
                layoutData.top = new FormAttachment(icon, 18);
-               layoutData.height = 327;
+               layoutData.height = 287;
                contents.setLayoutData(layoutData);
 
                Composite buttonComp = new Composite(base, SWT.NONE);
@@ -169,7 +170,7 @@ public class LicenseDialog {
                compData.top = new FormAttachment(contents, 0);
                compData.left = new FormAttachment(0, 0);
                compData.right = new FormAttachment(100, 0);
-               compData.bottom = new FormAttachment(100, 0);
+               compData.height = 51;
                buttonComp.setLayoutData(compData);
 
                okButton = new DAButton(buttonComp, SWT.NONE);
@@ -178,7 +179,7 @@ public class LicenseDialog {
                okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
 
                FormData okData = new FormData();
-               okData.top = new FormAttachment(0, 8);
+               okData.top = new FormAttachment(0, 9);
                okData.right = new FormAttachment(100, -9);
                okData.width = DesignConstants.DA_BUTTON_WIDTH;
                okData.height = DesignConstants.DA_BUTTON_HEIGHT;
index d11fb89..7c8417e 100755 (executable)
@@ -182,7 +182,7 @@ public class ToolbarArea {
                                                && (null != appName && !appName.isEmpty()
                                                                && !text.isEmpty() && appName.equals(text))) {
                                        replayButton.setButtonEnabled(true);
-                                       replayEditButton.setButtonEnabled(true);
+                                       replayEditButton.setButtonEnabled(false); //disable button until complete TV SDK   
                                } else {
                                        replayButton.setButtonEnabled(false);
                                        replayEditButton.setButtonEnabled(false);
@@ -317,11 +317,17 @@ public class ToolbarArea {
                                                .values());
                                for (ProcessInfoPackage pkg : processInfoPkgList) {
                                        // String pid = Integer.toString(pkg.getPid());
-                                       String binPath = pkg.getTargetBinaryPath();
                                        String binName = CommonConstants.EMPTY;
-                                       if (null != binPath && !binPath.isEmpty()) {
-                                               int index = binPath.lastIndexOf(CommonConstants.SLASH);
-                                               binName = binPath.substring(index + 1, binPath.length());
+                                       
+                                       String cmdLineName = pkg.getCmdLineName();
+                                       if(cmdLineName != null && !cmdLineName.isEmpty()) {
+                                               binName = cmdLineName;
+                                       } else {
+                                               String binPath = pkg.getTargetBinaryPath();
+                                               if (null != binPath && !binPath.isEmpty()) {
+                                                       int index = binPath.lastIndexOf(CommonConstants.SLASH);
+                                                       binName = binPath.substring(index + 1, binPath.length());
+                                               }
                                        }
                                        StringBuffer buffer = new StringBuffer();
                                        buffer.append(pkg.getPid()).append(PROCESS_SPLITER);
index e5f0724..2d1f190 100644 (file)
@@ -191,7 +191,7 @@ public class OpenTraceProgressManager implements Runnable {
                        OpenTraceInputReader.stopOpenTraceInputReader();
                        DataManagerRegistry.stopThreads();
                        try {
-                               if (DataManagerRegistry.isAnyoneAlive()) {
+                               if (!DataManagerRegistry.isAnyoneAlive()) {
                                        break;
                                } else {
                                        Thread.sleep(AnalyzerConstants.LOG_CHECK_INTERVAL);
index de9b1a7..6407217 100644 (file)
@@ -1,8 +1,35 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
 package org.tizen.dynamicanalyzer.ui.toolbar.replay.data;
 
 import java.sql.PreparedStatement;
+import java.sql.SQLException;
 import java.util.List;
 
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.database.DBColumn;
 import org.tizen.dynamicanalyzer.database.DBConstants;
 import org.tizen.dynamicanalyzer.database.DBTable;
@@ -13,19 +40,46 @@ import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
 
 public class ReplayDBManager extends DBTable {
 
-       private static final String TABLENAME = "REPLAY";
-       public static final String RID = "RID";
-       public static final String MESSAGE_ID = "MESSAGE_ID";
-       public static final String SEQ = "SEQ";
-       public static final String TIME = "TIME";
-       public static final String SEC = "SEC";
-       public static final String NANO = "NANO";
-       public static final String EVENT_ID = "EVENT_ID";
-       public static final String EVENT_TYPE = "EVENT_TYPE";
-       public static final String EVENT_CODE = "EVENT_CODE";
-       public static final String EVENT_VALUE = "EVENT_VALUE";
+       private static final String TABLENAME = "REPLAY";//$NON-NLS-1$
+       public static final String RID = "RID";//$NON-NLS-1$
+       public static final String SEQ = "SEQ";//$NON-NLS-1$
+       public static final String TIME = "TIME";//$NON-NLS-1$
+       public static final String SEC = "SEC";//$NON-NLS-1$
+       public static final String NANO = "NANO";//$NON-NLS-1$
+       public static final String EVENT_ID = "EVENT_ID";//$NON-NLS-1$
+       public static final String EVENT_TYPE = "EVENT_TYPE";//$NON-NLS-1$
+       public static final String EVENT_CODE = "EVENT_CODE";//$NON-NLS-1$
+       public static final String EVENT_VALUE = "EVENT_VALUE";//$NON-NLS-1$
 
-       private static final String SELECT_QUERY = "select * from " + TABLENAME + " order by " + TIME + " , " + RID; //$NON-NLS-1$
+       private final int DB_RID_INDEX = 0;
+       private final int DB_SEQ_INDEX = 1;
+       private final int DB_TIME_INDEX = 2;
+       private final int DB_SEC_INDEX = 3;
+       private final int DB_NANO_INDEX = 4;
+       private final int DB_EVENT_ID_INDEX = 5;
+       private final int DB_EVENT_TYPE_INDEX = 6;
+       private final int DB_EVENT_CODE_INDEX = 7;
+       private final int DB_EVENT_VALUE = 8;
+
+       private static final String SELECT_QUERY = "select "
+                       + RID
+                       + CommonConstants.COMMA
+                       + SEQ
+                       + CommonConstants.COMMA
+                       + TIME
+                       + CommonConstants.COMMA
+                       + SEC
+                       + CommonConstants.COMMA
+                       + NANO
+                       + CommonConstants.COMMA
+                       + EVENT_ID
+                       + CommonConstants.COMMA
+                       + EVENT_TYPE
+                       + CommonConstants.COMMA
+                       + EVENT_CODE
+                       + CommonConstants.COMMA
+                       + EVENT_VALUE
+                       + " from " + TABLENAME + " order by " + TIME + CommonConstants.COMMA + RID; //$NON-NLS-1$
        private static final String DELETE_QUERY = "delete from " + TABLENAME;
 
        @Override
@@ -36,8 +90,6 @@ public class ReplayDBManager extends DBTable {
        public ReplayDBManager() {
                addColumn(new DBColumn(RID, DBConstants.PRIMARY_KEY,
                                DBConstants.INTEGER));
-               addColumn(new DBColumn(MESSAGE_ID, DBConstants.NOT_NULL,
-                               DBConstants.INTEGER));
                addColumn(new DBColumn(SEQ, DBConstants.NOT_NULL, DBConstants.INTEGER));
                addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG));
                addColumn(new DBColumn(SEC, DBConstants.NOT_NULL, DBConstants.INTEGER));
@@ -64,17 +116,17 @@ public class ReplayDBManager extends DBTable {
                List<RecordEventObject> eventObjs = output.getRecordEvent();
                for (List<Object> data : result) {
                        RecordEventObject reObj = new RecordEventObject();
-                       reObj.setId((Integer) data.get(0));
-                       reObj.setSeq((Integer) data.get(2));
-                       reObj.setTime((Long) data.get(3));
+                       reObj.setId((Integer) data.get(DB_RID_INDEX));
+                       reObj.setSeq((Integer) data.get(DB_SEQ_INDEX));
+                       reObj.setTime((Long) data.get(DB_TIME_INDEX));
                        DATime eventTime = new DATime();
-                       eventTime.setSec((Integer) data.get(4));
-                       eventTime.setNano((Integer) data.get(5));
+                       eventTime.setSec((Integer) data.get(DB_SEC_INDEX));
+                       eventTime.setNano((Integer) data.get(DB_NANO_INDEX));
                        reObj.setEventTime(eventTime);
-                       reObj.setEventId((Integer) data.get(6));
-                       reObj.setEventType((Integer) data.get(7));
-                       reObj.setEventCode((Integer) data.get(8));
-                       reObj.setEventValue((Integer) data.get(9));
+                       reObj.setEventId((Integer) data.get(DB_EVENT_ID_INDEX));
+                       reObj.setEventType((Integer) data.get(DB_EVENT_TYPE_INDEX));
+                       reObj.setEventCode((Integer) data.get(DB_EVENT_CODE_INDEX));
+                       reObj.setEventValue((Integer) data.get(DB_EVENT_VALUE));
                        eventObjs.add(reObj);
                }
                output.setObjectCount(eventObjs.size());
@@ -88,7 +140,37 @@ public class ReplayDBManager extends DBTable {
 
        @Override
        public boolean prepare(PreparedStatement prep, List<Object> rowData) {
-               // TODO Auto-generated method stub
-               return false;
+               boolean isPrepared = true;
+
+               int columnsize = getColumnSize();
+               if (columnsize != rowData.size()) {
+                       isPrepared = false;
+               } else {
+                       try {
+                               prep.setInt(DB_RID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_RID_INDEX)));
+                               prep.setInt(DB_SEQ_INDEX + 1,
+                                               (Integer) (rowData.get(DB_SEQ_INDEX)));
+                               prep.setLong(DB_TIME_INDEX + 1,
+                                               (Long) (rowData.get(DB_TIME_INDEX)));
+                               prep.setInt(DB_SEC_INDEX + 1,
+                                               (Integer) (rowData.get(DB_SEC_INDEX)));
+                               prep.setInt(DB_NANO_INDEX + 1,
+                                               (Integer) (rowData.get(DB_NANO_INDEX)));
+                               prep.setInt(DB_EVENT_ID_INDEX + 1,
+                                               (Integer) (rowData.get(DB_EVENT_ID_INDEX)));
+                               prep.setInt(DB_EVENT_TYPE_INDEX + 1,
+                                               (Integer) (rowData.get(DB_EVENT_TYPE_INDEX)));
+                               prep.setInt(DB_EVENT_CODE_INDEX + 1,
+                                               (Integer) (rowData.get(DB_EVENT_CODE_INDEX)));
+                               prep.setInt(DB_EVENT_VALUE + 1,
+                                               (Integer) (rowData.get(DB_EVENT_VALUE)));
+                       } catch (SQLException e) {
+                               e.printStackTrace();
+                               isPrepared = false;
+                       }
+               }
+
+               return isPrepared;
        }
 }
index 7eea7f3..950e03a 100644 (file)
@@ -30,7 +30,6 @@ package org.tizen.dynamicanalyzer.ui.toolbar.replay.data;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.swap.logparser.Logs;
@@ -38,7 +37,6 @@ import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
 import org.tizen.dynamicanalyzer.swap.model.RecordEventObject;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
-import org.tizen.dynamicanalyzer.util.DALogger;
 
 public class ReplayDataManager extends PageDataManager {
        private static ReplayDataManager instance = null;
@@ -46,7 +44,7 @@ public class ReplayDataManager extends PageDataManager {
        private ReplayDBManager replayDBManager = null;
        private int rid = 0;
 
-       public ReplayDataManager() {
+       private ReplayDataManager() {
                replayDBManager = new ReplayDBManager();
                addDBTable(replayDBManager);
        }
@@ -58,49 +56,6 @@ public class ReplayDataManager extends PageDataManager {
                return instance;
        }
 
-       /*** make network data thread ***/
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread
-                               break;
-
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_DATA_RECORD);
-                       if (null != logs && logs.getRawLogs().size() != 0) {
-
-                               List<List<Object>> insertData = new ArrayList<List<Object>>();
-
-                               List<LogData> inputs = logs.getLogs();
-                               int dataRowSize = inputs.size();
-                               for (int i = 0; i < dataRowSize; i++) {
-                                       ReplayData replayData = (ReplayData) inputs.get(i);
-                                       List<RecordEventObject> events = replayData
-                                                       .getRecordEvent();
-                                       for (int ii = 0; ii < replayData.getObjectCount(); ii++) {
-                                               RecordEventObject reo = events.get(ii);
-                                               List<Object> insertObject = new ArrayList<Object>();
-                                               insertObject.add(rid++);
-                                               insertObject.add(7);
-                                               insertObject.add(reo.getSeq());
-                                               insertObject.add(reo.getTime());
-                                               insertObject.add(reo.getEventTime().getSec());
-                                               insertObject.add(reo.getEventTime().getNano());
-                                               insertObject.add(reo.getEventId());
-                                               insertObject.add(reo.getEventType());
-                                               insertObject.add(reo.getEventCode());
-                                               insertObject.add(reo.getEventValue());
-                                               insertData.add(insertObject);
-                                       }
-                               }
-                               replayDBManager.insertData(insertData);
-                       }
-               }
-
-               /* log for debug */
-               DALogger.getInstance().info(getName() + " thread end!!");
-       }
-
        public void clear() {
                instance = null;
                replayDBManager = null;
@@ -111,4 +66,36 @@ public class ReplayDataManager extends PageDataManager {
                return replayDBManager;
        }
 
+       @Override
+       protected void makeData(LogPackage pack) {
+               Logs logs = pack.getLogs(DataChannelConstants.MSG_DATA_RECORD);
+               if (null != logs && logs.getRawLogs().size() != 0) {
+
+                       List<List<Object>> insertData = new ArrayList<List<Object>>();
+
+                       List<LogData> inputs = logs.getLogs();
+                       int dataRowSize = inputs.size();
+                       for (int i = 0; i < dataRowSize; i++) {
+                               ReplayData replayData = (ReplayData) inputs.get(i);
+                               List<RecordEventObject> events = replayData
+                                               .getRecordEvent();
+                               for (int ii = 0; ii < replayData.getObjectCount(); ii++) {
+                                       RecordEventObject reo = events.get(ii);
+                                       List<Object> insertObject = new ArrayList<Object>();
+                                       insertObject.add(rid++);
+                                       insertObject.add(reo.getSeq());
+                                       insertObject.add(reo.getTime());
+                                       insertObject.add(reo.getEventTime().getSec());
+                                       insertObject.add(reo.getEventTime().getNano());
+                                       insertObject.add(reo.getEventId());
+                                       insertObject.add(reo.getEventType());
+                                       insertObject.add(reo.getEventCode());
+                                       insertObject.add(reo.getEventValue());
+                                       insertData.add(insertObject);
+                               }
+                       }
+                       replayDBManager.insertData(insertData);
+               }
+       }
+
 }
index 1564fc5..71b4877 100755 (executable)
@@ -4,7 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -70,8 +70,8 @@ public class RepalyEditSaveDialog extends DAMessageBox {
        public String saveFileName = null;
        private DAButton okButton = null;
        private DAButton cancelButton = null;
-       
-       private String targetPath = "";
+
+       private String targetPath = CommonConstants.EMPTY;
 
        public RepalyEditSaveDialog(Shell parentShell) {
                super(parentShell);
@@ -248,10 +248,9 @@ public class RepalyEditSaveDialog extends DAMessageBox {
        private boolean executeSaveTrace() {
                Project project = AnalyzerManager.getProject();
                String sourcePath = project.getSavePath();
-               targetPath = PathManager.DA_SAVE_PATH
-                               + File.separator + saveFileName;
+               targetPath = PathManager.DA_SAVE_PATH + File.separator + saveFileName;
 
-               if(AnalyzerManager.getProject().getSavePath().equals(targetPath)){
+               if (AnalyzerManager.getProject().getSavePath().equals(targetPath)) {
                        return true;
                }
 
@@ -289,7 +288,8 @@ public class RepalyEditSaveDialog extends DAMessageBox {
                }
                return true;
        }
-       public String getSavedPath(){
+
+       public String getSavedPath() {
                return this.targetPath;
        }
 
index 9fe498d..9ea769c 100644 (file)
@@ -37,7 +37,6 @@ import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
@@ -53,32 +52,22 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
 
 public class ReplayEditDialog extends DAMessageBox {
        private static final DALogger DA_LOG = DALogger.getInstance();
-       
+
        private static boolean opened = false;
        private DACustomButton cancelButton = null;
-       //private DATabComposite tabView = null;
        private DATableComposite replayTable;
 
        public ReplayEditDialog(Shell parent) {
                super(parent);
        }
 
-       private DACustomButtonClickEventListener saveButtonListener = new DACustomButtonClickEventListener() {
-
-               @Override
-               public void handleClickEvent(DACustomButton button) {
-                       ReplayEditDialogDataManager.getInstance().setTableItemsList(replayTable);
-                       ReplayEditDialogDataManager.getInstance().saveDialog();
-               }
-       };
-
        private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
-                       ReplayEditDialogDataManager.getInstance().setTableItemsList(replayTable);
-                       ReplayEditDialogDataManager.getInstance().insertDB(false,
-                                       AnalyzerManager.getProject().getSavePath());
+                       ReplayEditDialogDataManager.getInstance().setTableItemsList(
+                                       replayTable);
+                       ReplayEditDialogDataManager.getInstance().insertDB();
                        shell.dispose();
                }
        };
@@ -145,10 +134,8 @@ public class ReplayEditDialog extends DAMessageBox {
                compData.bottom = new FormAttachment(100, 0);
                featuresPage.setLayoutData(compData);
 
-               replayTable =featuresPage.getReplayTable(); 
-               
-               
-       
+               replayTable = featuresPage.getReplayTable();
+
                // button
                Composite buttonContentsComp = new Composite(shell, SWT.NONE);
                buttonContentsComp.addPaintListener(new PaintListener() {
@@ -183,27 +170,21 @@ public class ReplayEditDialog extends DAMessageBox {
                buttonData.height = 28;
                cancelButton.setLayoutData(buttonData);
 
-               ReplayEditDialogDataManager.getInstance().setOkButton(new DAButton(buttonContentsComp, SWT.NONE));
-               ReplayEditDialogDataManager.getInstance().getOkButton().addClickListener(okButtonListener);
-               ReplayEditDialogDataManager.getInstance().getOkButton().setText(ReplayEditLabels.OK);
-               ReplayEditDialogDataManager.getInstance().getOkButton().setFont(FontResources.DIALOG_BUTTON_FONT);
+               ReplayEditDialogDataManager.getInstance().setOkButton(
+                               new DAButton(buttonContentsComp, SWT.NONE));
+               ReplayEditDialogDataManager.getInstance().getOkButton()
+                               .addClickListener(okButtonListener);
+               ReplayEditDialogDataManager.getInstance().getOkButton()
+                               .setText(ReplayEditLabels.OK);
+               ReplayEditDialogDataManager.getInstance().getOkButton()
+                               .setFont(FontResources.DIALOG_BUTTON_FONT);
                buttonData = new FormData();
                buttonData.right = new FormAttachment(cancelButton, -8);
                buttonData.top = new FormAttachment(0, 11);
                buttonData.width = 100;
                buttonData.height = 28;
-               ReplayEditDialogDataManager.getInstance().getOkButton().setLayoutData(buttonData);
-
-               ReplayEditDialogDataManager.getInstance().setSaveButton(new DAButton(buttonContentsComp, SWT.NONE));
-               ReplayEditDialogDataManager.getInstance().getSaveButton().addClickListener(saveButtonListener);
-               ReplayEditDialogDataManager.getInstance().getSaveButton().setText(ReplayEditLabels.SAVE);
-               ReplayEditDialogDataManager.getInstance().getSaveButton().setFont(FontResources.DIALOG_BUTTON_FONT);
-               buttonData = new FormData();
-               buttonData.right = new FormAttachment(ReplayEditDialogDataManager.getInstance().getOkButton(), -8);
-               buttonData.top = new FormAttachment(0, 11);
-               buttonData.width = 100;
-               buttonData.height = 28;
-               ReplayEditDialogDataManager.getInstance().getSaveButton().setLayoutData(buttonData);
+               ReplayEditDialogDataManager.getInstance().getOkButton()
+                               .setLayoutData(buttonData);
 
                opened = true;
                ShortCutManager.getInstance().setEnabled(!opened);
index dfe8f21..69d97df 100644 (file)
@@ -44,7 +44,6 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 public class ReplayEditDialogDataManager {
        private DACustomButton saveButton = null;
        private DACustomButton okButton = null;
-       private final int MESSAGE_ID = 7;
        private final int sequenceNaumber = 0000;
        public static String MODIFIABILITY_TRUE = "MODIFIABILITY_TRUE ";
        public static String SELECTED_ITEM_COPY = "SELECTED_ITEM_COPY ";
@@ -99,7 +98,6 @@ public class ReplayEditDialogDataManager {
                        replayDBData = new ReplayData();
                        replayDBData = ReplayDataManager.getInstance().getReplayDBManager()
                                        .getReplayLogs(false);
-                       // replayDBData = SqlManager.getInstance().getReplayLogs(false);
                }
                return replayDBData;
        }
@@ -282,14 +280,14 @@ public class ReplayEditDialogDataManager {
                        if (dbPath.equals(AnalyzerManager.getProject().getSavePath())) {
                                dbPath = AnalyzerManager.getProject().getSavePath();
                        }
-                       insertDB(true, dbPath);
+                       insertDB();
                }
        }
 
-       public void insertDB(boolean isSave, String dbPath) {
+       public void insertDB() {
                ReplayDataManager.getInstance().getReplayDBManager()
                                .deleteReplayTableItems();
-               insertDBData(isSave, dbPath);
+               insertDBData();
        }
 
        private void cleanInsertData() {
@@ -297,7 +295,7 @@ public class ReplayEditDialogDataManager {
                insertkeySequence = 1;
        }
 
-       private void insertDBData(boolean isSave, String dbPath) {
+       private void insertDBData() {
                cleanInsertData();
                int size = getTableItemsList().size();
                for (int i = 0; i < size; i++) {
@@ -409,6 +407,9 @@ public class ReplayEditDialogDataManager {
                                .get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
                String itemMouseUpTime = getDBTime(item
                                .get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
+               if (itemMouseUpTime.equals(CommonConstants.EMPTY)) {
+                       itemMouseUpTime = itemMouseDownTime;
+               }
                DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
                DATime mouseUpTime = getDATimeValue(Long.parseLong(itemMouseUpTime));
                int itemValue1 = getKeyValue(item);
@@ -418,7 +419,6 @@ public class ReplayEditDialogDataManager {
                        List<Object> keyData = new ArrayList<Object>();
                        if (i == 0) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -429,7 +429,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(1);
                        } else if (i == 1) {
                                keyData.add(mouseUpTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -440,7 +439,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(0);
                        } else if (i == 2) {
                                keyData.add(mouseUpTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseUpTime.getSec());
@@ -451,7 +449,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(0);
                        } else if (i == 3) {
                                keyData.add(mouseUpTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseUpTime.getSec());
@@ -490,7 +487,6 @@ public class ReplayEditDialogDataManager {
                        List<Object> keyData = new ArrayList<Object>();
                        if (i == 0) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -501,7 +497,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(insertkeySequence++);
                        } else if (i == 1) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -512,7 +507,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(TOUCH_EVENT_VALUE_SECOND_ITEM);
                        } else if (i == 2) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -523,7 +517,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(getDBPoint(itemValue1));
                        } else if (i == 3) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -534,7 +527,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(getDBPoint(itemValue2));
                        } else if (i == 4) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseDownTime.getSec());
@@ -545,7 +537,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(0);
                        } else if (i == 5) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseUpTime.getSec());
@@ -556,7 +547,6 @@ public class ReplayEditDialogDataManager {
                                keyData.add(-1);
                        } else if (i == 6) {
                                keyData.add(mouseDownTime.getSec() + insertDBRid++);
-                               keyData.add(MESSAGE_ID);
                                keyData.add(sequenceNaumber);
                                keyData.add(Long.parseLong(itemMouseDownTime));
                                keyData.add(mouseUpTime.getSec());
index c4518ee..8efa25d 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
index 9ed0d4b..f665bff 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -50,7 +50,6 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.GlobalInformation;
 import org.tizen.dynamicanalyzer.common.ScreenshotConstants;
 import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
@@ -192,20 +191,22 @@ public class ReplayEditScreenshotDialog extends DAMessageBox {
                int point = 0;
                if (value.contains(ReplayEditLabels.CONTEXT_VALUE_X)) {
                        point = Integer.parseInt(value.replace(
-                                       ReplayEditLabels.CONTEXT_VALUE_X, ""));
-                       point = (point * ScreenshotConstants.DEFAULT_IMAGE_WIDTH) / Integer.parseInt(resolutionWidth);
+                                       ReplayEditLabels.CONTEXT_VALUE_X, CommonConstants.EMPTY));
+                       point = (point * ScreenshotConstants.DEFAULT_IMAGE_WIDTH)
+                                       / Integer.parseInt(resolutionWidth);
                }
                if (value.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
                        point = Integer.parseInt(value.replace(
-                                       ReplayEditLabels.CONTEXT_VALUE_Y, ""));
-                       point = (point * ScreenshotConstants.DEFAULT_IMAGE_HEIGHT) / Integer.parseInt(resolutionHeight);
+                                       ReplayEditLabels.CONTEXT_VALUE_Y, CommonConstants.EMPTY));
+                       point = (point * ScreenshotConstants.DEFAULT_IMAGE_HEIGHT)
+                                       / Integer.parseInt(resolutionHeight);
                }
                return point;
        }
 
        private void getDeviceResolution() {
-               String selDeviceName = GlobalInformation.getCurrentDeviceInfo().getIDevice()
-                               .getDeviceName();
+               String selDeviceName = GlobalInformation.getCurrentDeviceInfo()
+                               .getIDevice().getDeviceName();
                String resolutionInfoXmlPath = PathManager.TIZEN_SDK_DATA_PATH
                                + File.separator + "emulator-vms" + File.separator + "vms"//$NON-NLS-1$
                                + File.separator + selDeviceName + File.separator
index 1b24cce..6867d15 100644 (file)
@@ -84,6 +84,8 @@ public class ReplayEditTable extends DATableComposite {
 
        private DAText inputValueText = null;
 
+       private boolean enableCoordinateIcon = true;
+
        @Override
        protected List<TableInput> makeTableInput() {
                List<TableInput> input = new ArrayList<TableInput>();
@@ -196,7 +198,6 @@ public class ReplayEditTable extends DATableComposite {
                                        break;
                                }
                                case MOUSE_RIGHT: {
-                                       openPoppupMenuMouseDownSequenceColumn(item, event);
                                        break;
                                }
                                default: {
@@ -761,7 +762,11 @@ public class ReplayEditTable extends DATableComposite {
                        item.setImage(null);
                } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
                                || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
-                       item.setImage(ImageResources.REPLAY_EDIT_SNAPSHOT_DOWN);
+                       if (enableCoordinateIcon) {
+                               item.setImage(ImageResources.REPLAY_EDIT_SNAPSHOT_DOWN);
+                       } else {
+                               item.setImage(null);
+                       }
                } else {
                        item.setImage(ImageResources.REPLAY_EDIT_DROPDOWN_DOWN);
                }
@@ -1030,10 +1035,14 @@ public class ReplayEditTable extends DATableComposite {
                                                MousePt.x, MousePt.y);
                        } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
                                        || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
-                               ReplayEditScreenshotDialog dialog = new ReplayEditScreenshotDialog(
-                                               table.getShell(), item);
-                               dialog.open();
+                               if (enableCoordinateIcon) {
+                                       ReplayEditScreenshotDialog dialog = new ReplayEditScreenshotDialog(
+                                                       table.getShell(), item);
+                                       dialog.open();
+                               }
                                return false;
+                       } else {
+                               openPoppupMenuMouseDownSequenceColumn(item, event);
                        }
                }
                return true;
index a9ef91d..fee573e 100644 (file)
@@ -28,8 +28,6 @@ package org.tizen.dynamicanalyzer.ui.toolbar.replayEditor;
 
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Rectangle;
@@ -48,54 +46,18 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
        public void paint(GC gc, Object value) {
                GridItem item = (GridItem) value;
                gc.setFont(item.getFont(getColumn()));
-               paintBackground(gc, item);
                paintImage(gc, item);
                paintText(gc, item);
                paintTableBoardLine(gc, item);
                paintMouseOverColumn(gc, item);
                paintSelectedInputKey(gc, item);
-               // paintSelectedCopy(gc, item);
                paintVaildTime(gc, item);
 
        }
 
-       private void paintBackground(GC gc, GridItem item) {
-               boolean drawBackground = true;
-               String optionColumn = item.getText(6);
-               if (item.getChecked() && getColumn() == 0) {
-                       gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
-                       gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
-               } else if (!optionColumn
-                               .contains(ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
-                       gc.setBackground(ColorResources.YELLOW);
-               } else if (item.getText(ReplayEditTable.UP_TIME_TABLE_INDEX).equals("")) {
-                       gc.setBackground(ColorResources.YELLOW);
-               } else {
-                       if (item.getParent().isEnabled()) {
-                               Color bg = item.getBackground();
-                               if (bg != null) {
-                                       gc.setBackground(bg);
-                               } else {
-                                       drawBackground = false;
-                               }
-                       } else {
-                               gc.setBackground(getDisplay().getSystemColor(
-                                               SWT.COLOR_WIDGET_BACKGROUND));
-                       }
-               }
-
-               if (drawBackground && item.getChecked() && getColumn() == 0) {
-                       gc.fillGradientRectangle(getBounds().x, getBounds().y,
-                                       getBounds().width, getBounds().height, true);
-               } else if (drawBackground) {
-                       gc.fillRectangle(getBounds().x, getBounds().y + 1,
-                                       getBounds().width, getBounds().height);
-               }
-       }
-
        private void paintImage(GC gc, GridItem item) {
                menuImg = item.getImage();
-               if (menuImg != null && getColumn() != 0 && item.getChecked(getColumn())) {
+               if (menuImg != null && item.getChecked(getColumn())) {
                        int y = getBounds().y;
                        y += (getBounds().height - menuImg.getBounds().height) / 2;
 
@@ -134,7 +96,7 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
        }
 
        private void paintMouseOverColumn(GC gc, GridItem item) {
-               if (getColumn() != 0 && item.getChecked(getColumn())) {
+               if (item.getChecked(getColumn())) {
                        Rectangle focusRect = new Rectangle(getBounds().x - 1,
                                        getBounds().y - 1, getBounds().width,
                                        getBounds().height + 1);
@@ -152,8 +114,7 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
 
        private void paintSelectedInputKey(GC gc, GridItem item) {
                String optionColumn = item.getText(6);
-               if (getColumn() != 0
-                               && item.getChecked(getColumn())
+               if (item.getChecked(getColumn())
                                && optionColumn
                                                .contains(ReplayEditDialogDataManager.SELECTED_ITEM_KEY_INPUT)) {
                        Rectangle focusRect = new Rectangle(getBounds().x - 1,
@@ -171,35 +132,6 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
                }
        }
 
-       // private void paintSelectedCopy(GC gc, GridItem item) {
-       // String optionColumn = item.getText(6);
-       // if (optionColumn
-       // .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
-       // gc.setForeground(ColorResources.BLACK);
-       // gc.setLineWidth(2);
-       // gc.setLineStyle(SWT.LINE_DOT);
-       // gc.drawLine(getBounds().x, getBounds().y, getBounds().x
-       // + getBounds().width, getBounds().y);
-       //
-       // gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
-       // getBounds().x + getBounds().width, getBounds().y
-       // + getBounds().height);
-       // if (getColumn() == 0) {
-       // gc.drawLine(getBounds().x, getBounds().y, getBounds().x,
-       // getBounds().y + getBounds().height);
-       // }
-       //
-       // if (getColumn() == 0) {
-       // gc.drawLine(getBounds().x, getBounds().y, getBounds().x,
-       // getBounds().y + getBounds().height);
-       // }
-       //
-       // gc.setLineStyle(SWT.LINE_SOLID);
-       // gc.setLineWidth(1);
-       //
-       // }
-       // }
-
        private void paintVaildTime(GC gc, GridItem item) {
                String optionColumn = item.getText(6);
                if (optionColumn
index 6c4e4c6..12b64d4 100644 (file)
@@ -1,3 +1,29 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
 package org.tizen.dynamicanalyzer.ui.toolbar.replayEditor;
 
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
index 2519e9f..e54186a 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
index d8c9184..3a15fd4 100644 (file)
@@ -29,7 +29,6 @@ package org.tizen.dynamicanalyzer.ui.userinterface;
 import java.util.HashMap;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
@@ -41,11 +40,8 @@ import org.tizen.dynamicanalyzer.swap.model.data.SceneData;
 import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListDataChecker;
 import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingDataChecker;
 import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneDataChecker;
-import org.tizen.dynamicanalyzer.util.DALogger;
 
 public class UIDataManager extends PageDataManager {
-       private static final DALogger DA_LOG = DALogger.getInstance();
-
        private static UIDataManager instance = null;
 
        private static UIControlListDataChecker controlListDataChecker = null;
@@ -65,42 +61,6 @@ public class UIDataManager extends PageDataManager {
        private UIDataManager() {
        }
 
-       @Override
-       public void run() {
-               while (!AnalyzerManager.isExit()) {
-                       LogPackage pack = pollPack();
-                       if (pack == null) // stop thread
-                               break;
-
-                       Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_UICONTROL);
-                       if (null != logs && logs.getRawLogs() != null
-                                       && logs.getRawLogs().size() != 0) {
-                               List<LogData> inputs = logs.getLogs();
-                               int size = inputs.size();
-                               for (int i = 0; i < size; i++) {
-                                       getControlDataChecker().parserLog(
-                                                       (ControlData) inputs.get(i));
-                               }
-                       }
-
-                       logs = pack.getLogs(DataChannelConstants.MSG_PROBE_SCENE);
-                       if (null != logs && logs.getRawLogs() != null
-                                       && logs.getRawLogs().size() != 0) {
-                               List<LogData> inputs = logs.getLogs();
-                               int size = inputs.size();
-                               for (int i = 0; i < size; i++) {
-                                       getSceneTransformDataChecker().parserLog(
-                                                       (SceneData) inputs.get(i));
-                               }
-                       }
-                       
-                       UIDataManager.getInstance().getfunctionProfilingDataChecker().updateUIApiTreeSet();
-               }
-               
-               /* log for debug */
-               DA_LOG.debug(getName() + " thread end!!"); //$NON-NLS-1$
-       }
-
        public void clear() {
                controlListDataChecker = null;
                sceneTransformDataChecker = null;
@@ -144,4 +104,31 @@ public class UIDataManager extends PageDataManager {
        public HashMap<String, Long> getFindScreenshotViewHashMap() {
                return findScreenshotViewHashMap;
        }
+
+       @Override
+       protected void makeData(LogPackage pack) {
+               Logs logs = pack.getLogs(DataChannelConstants.MSG_PROBE_UICONTROL);
+               if (null != logs && logs.getRawLogs() != null
+                               && logs.getRawLogs().size() != 0) {
+                       List<LogData> inputs = logs.getLogs();
+                       int size = inputs.size();
+                       for (int i = 0; i < size; i++) {
+                               getControlDataChecker().parserLog(
+                                               (ControlData) inputs.get(i));
+                       }
+               }
+
+               logs = pack.getLogs(DataChannelConstants.MSG_PROBE_SCENE);
+               if (null != logs && logs.getRawLogs() != null
+                               && logs.getRawLogs().size() != 0) {
+                       List<LogData> inputs = logs.getLogs();
+                       int size = inputs.size();
+                       for (int i = 0; i < size; i++) {
+                               getSceneTransformDataChecker().parserLog(
+                                               (SceneData) inputs.get(i));
+                       }
+               }
+               
+               UIDataManager.getInstance().getfunctionProfilingDataChecker().updateUIApiTreeSet();
+       }
 }
\ No newline at end of file
index 85fdb98..87ae4af 100644 (file)
@@ -76,11 +76,13 @@ public class TitleComboPopupRenderer extends DACustomComboPopupRenderer {
                        gc.setFont(FontResources.DROPDOWN);
                        gc.drawString(items.get(i), 5, 6 + i * r.height, true);
 
+
                        Rectangle rect = canvas.getClientArea();
                        gc.setForeground(ColorResources.DEVICE_APPLICATION_POPUP_OUTER_1);
-                       gc.drawRectangle(rect);
+                       gc.drawLine(rect.x, rect.y, rect.x, rect.height);
+                       gc.drawLine(rect.width - 1, rect.y, rect.width - 1, rect.height);
                        gc.setForeground(ColorResources.DEVICE_APPLICATION_POPUP_OUTER_2);
-                       gc.drawRectangle(rect.x + 1, rect.y + 1, rect.width - 2,
+                       gc.drawRectangle(rect.x + 1, rect.y + 1, rect.width - 3,
                                        rect.height - 2);
                }
        }
index 010eac0..ec857cd 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.widgets;
 
+import java.util.List;
+
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
@@ -36,6 +39,7 @@ import org.eclipse.swt.widgets.Canvas;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
 import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboRenderer;
 
@@ -78,12 +82,6 @@ public class TitleComboRenderer extends DACustomComboRenderer {
        }
 
        @Override
-       public void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       String text, int state) {
-
-       }
-
-       @Override
        public void drawImage(GC gc, Canvas canvas, Image image, String text,
                        int textAlign, Font font, int state) {
                Rectangle rect = canvas.getClientArea();
@@ -126,4 +124,97 @@ public class TitleComboRenderer extends DACustomComboRenderer {
                }
        }
 
+       @Override
+       public void draw(GC gc, Canvas canvas, int drawType, List<Color> colors,
+                       List<Color> outlineColors, Point comboImagePoint,
+                       List<Image> comboImages, String text, int textAlign, Font font,
+                       Point fontPoint, int state) {
+               Rectangle rect = canvas.getClientArea();                
+               if (drawType == DACustomCombo.TYPE_COLOR) {
+                       gc.setBackground(colors.get(state));
+                       gc.fillRectangle(rect);
+               } else if (drawType == DACustomCombo.TYPE_GRADATION) {
+                       int index = state * 2;
+                       gc.setForeground(colors.get(index));
+                       gc.setBackground(colors.get(index + 1));
+                       gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true);
+               }
+
+               // text and font(size, style) 
+               if (null == text) {
+                       text = CommonConstants.EMPTY;
+               }
+               if (null == font) {
+                       gc.setFont(FontResources.COMBO);
+               } else {
+                       gc.setFont(font);
+               }
+
+               // font color
+               if (state == DACustomButton.STATE_DISABLE) {
+                       gc.setForeground(ColorResources.DEVICE_APPLICATION_DISABLE);
+               } else {
+                       gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE);
+               }
+               
+               // text position
+               if (fontPoint == null) {
+                       Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+                       int textX = 0;
+                       if (textAlign == DACustomCombo.TEXT_ALIGN_LEFT) {
+                               textX = 5;
+                       } else if (textAlign == DACustomCombo.TEXT_ALIGN_RIGHT) {
+                               textX = rect.width - p.x;
+                       } else { // DACustomCombo.TEXT_ALIGN_CENTER
+                               textX = (rect.width / 2) - (p.x / 2);
+                       }
+                       gc.drawString(text, textX, (rect.height - p.y) / 2, true);
+               } else {
+                       gc.drawString(text, fontPoint.x, fontPoint.y, true);    
+               }
+
+               // stroke
+               Color c = gc.getForeground();
+               Rectangle r = new Rectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
+               if (null != outlineColors.get(state)) {
+                       gc.setForeground(outlineColors.get(state));
+               } else {
+                       gc.setForeground(c);
+                       return;
+               }
+               gc.drawRectangle(r);
+               gc.setForeground(c);
+               
+               // draw button image
+               drawComboImage(gc, rect, state, comboImagePoint, comboImages);
+               
+       }
+       
+       protected void drawComboImage(GC gc, Rectangle rect,
+                       int state, Point comboImagePoint, List<Image> comboImages) {
+               Image img = comboImages.get(state);
+               Rectangle imgRect = null;
+               
+               if (null != img) {
+                       imgRect = img.getBounds();
+                       int x = 0, y = 0;
+                       if (null == comboImagePoint) {
+                               int width = rect.width - imgRect.width;
+                               int height = rect.height - imgRect.height;
+                               if (width > 0) {
+                                       x = width / 2;
+                               }
+
+                               if (height > 0) {
+                                       y = height / 2;
+                               }
+                       } else {
+                               x = comboImagePoint.x;
+                               y = comboImagePoint.y;
+                       }                               
+                       gc.drawImage(img, x, y);
+               }
+               
+       }
+
 }
index a7af4a7..86bb690 100644 (file)
@@ -372,6 +372,7 @@ public abstract class DATableComposite extends Composite {
                        DATableDataFormat tableData = (DATableDataFormat) selections[i]
                                        .getData();
                        LogData data = tableData.getLogData();
+                       
                        if(null != data){
                                selSeqs.add((long) data.getSeq());
                        }
index 936d53d..34850cd 100755 (executable)
@@ -57,8 +57,8 @@ import org.eclipse.ui.handlers.IHandlerService;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.GlobalInformation;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;
 import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;
@@ -435,7 +435,11 @@ public class AnalyzerUtil {
 
                String path = processInfo.getMainTargetBinaryPath();
                String key = getTargetPathKey(path);
-               BinaryInfo binInfo = GlobalInformation.getCurrentApplication().getBinaryInfo(key);
+               AppInfo curApp = GlobalInformation.getCurrentApplication();
+               if(curApp == null)
+                       return false;
+               
+               BinaryInfo binInfo = curApp.getBinaryInfo(key);
                if (null == binInfo) {
                        return false;
                }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/DownloadContentfileManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/DownloadContentfileManager.java
new file mode 100644 (file)
index 0000000..90fae67
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.DALogger;
+import org.tizen.sdblib.service.SyncResult;
+
+public class DownloadContentfileManager {
+
+       private final static int SPLIT_PATH_INDEX = 1;
+
+       /**
+        * Download file of contents that payload of network or shader source of
+        * OpenGL from device.
+        * 
+        * @param contents
+        *            It will check that string like
+        *            "SkWek2n3_File:/tmp/<file_name>" is included.
+        * @return new file path of download file
+        */
+       public static String getDowonloadFilePath(String contents) {
+               String returnString = contents;
+               if (contents.contains(AnalyzerConstants.CHECK_DOWNLOAD_FILE_STRING)) {
+                       String[] strFile = contents
+                                       .split(AnalyzerConstants.CHECK_DOWNLOAD_FILE_STRING);
+                       if (strFile.length < SPLIT_PATH_INDEX) {
+                               return returnString;
+                       }
+                       String deviceFilePath = strFile[SPLIT_PATH_INDEX];
+
+                       String[] fileNameSplit = deviceFilePath.split(File.separator
+                                       + AnalyzerConstants.TMP_FOLDER + File.separator);
+                       if (fileNameSplit.length < SPLIT_PATH_INDEX) {
+                               return returnString;
+                       }
+                       String downloadFolderPath = File.separator
+                                       + AnalyzerConstants.DOWNLOAD_FILE_FOLDER;
+
+                       makeFolder(AnalyzerManager.getProject().getSavePath()
+                                       + downloadFolderPath);
+
+                       String saveFilePath = downloadFolderPath + File.separator
+                                       + fileNameSplit[SPLIT_PATH_INDEX];
+
+                       if (pullFile(deviceFilePath, AnalyzerManager.getProject()
+                                       .getSavePath() + saveFilePath)) {
+                               returnString = saveFilePath;
+                       }
+               }
+               return returnString;
+       }
+
+       /**
+        * copy contents file from device to local save folder. if the copy of the
+        * file is successful, delete the file on the device.
+        * 
+        * @param from
+        *            device file path
+        * @param to
+        *            local file path
+        * @return
+        */
+       public static boolean pullFile(String from, String to) {
+               SyncResult res = CommunicatorUtils.pull(from, to);
+               if (null != res && res.isOk()) {
+                       DALogger.getInstance().debug(from + "file copying success!!");//$NON-NLS-1$ 
+               } else {
+                       DALogger.getInstance().debug("Failed to get " + from); //$NON-NLS-1$ 
+                       return false;
+               }
+               CommunicatorUtils.removeCommand(from);
+               return true;
+       }
+
+       /**
+        * get contents of file
+        * 
+        * @param contents
+        *            get file path from database. It will check that string like
+        *            "/download_file/<file_name>" is included.
+        * @return contents
+        */
+       public static String getFileContents(String contents) {
+               String returnString = contents;
+               if (contents.contains(AnalyzerConstants.DOWNLOAD_FILE_FOLDER
+                               + File.separator)) {
+                       StringBuffer contextsBuffer = new StringBuffer();
+
+                       String filePath = AnalyzerManager.getProject().getSavePath()
+                                       + contents;
+                       File contentsFile = new File(filePath);
+                       if (contentsFile.isFile()) {
+                               BufferedReader in = null;
+                               String content;
+                               try {
+                                       in = new BufferedReader(new FileReader(contentsFile));
+                                       while (null != (content = in.readLine())) {
+                                               contextsBuffer.append(content).append(
+                                                               CommonConstants.NEW_LINE);
+                                       }
+                               } catch (FileNotFoundException e) {
+                                       e.printStackTrace();
+                               } catch (IOException e) {
+                                       e.printStackTrace();
+                               } finally {
+                                       CommonUtil.tryClose(in);
+                               }
+                       }
+                       returnString = contextsBuffer.toString();
+               }
+               return returnString;
+       }
+
+       /**
+        * make new folder when not exist folder
+        * 
+        * @param folderPath
+        * 
+        */
+       private static void makeFolder(String folderPath) {
+               File toDir = new File(folderPath);
+               if (!toDir.exists() || !toDir.isDirectory()) {
+                       toDir.mkdirs();
+               }
+       }
+
+}
index c58b618..882fc77 100644 (file)
@@ -28,6 +28,8 @@ package org.tizen.dynamicanalyzer.utils;
 
 import java.text.DecimalFormat;
 
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+
 public class Formatter {
 
        public static String toHexString(String decimal) {
@@ -467,4 +469,9 @@ public class Formatter {
                }
                return value;
        }
+       
+       // translate long time to double time
+       public static double toLongTimeForDoubleTime(long time) {
+               return time / TimelineConstants.MEGA_DOUBLE;
+       }
 }