[Title] source copy
authorHyunjong,Pakr <phjwithyou.park@samsung.com>
Wed, 17 Apr 2013 05:02:48 +0000 (14:02 +0900)
committerHyunjong,Pakr <phjwithyou.park@samsung.com>
Wed, 17 Apr 2013 05:25:26 +0000 (14:25 +0900)
[Desc.] 172.21.17.55 /tizen_2.1 -> tizendev.org / tizen_2.1
[Issue] -

Change-Id: I37098140ece013ca9c92b89adc3bbe09afa2356b

183 files changed:
org.tizen.dynamicanalyzer.widgets/Images/event_list_end_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_end_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_start_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_start_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/animation/DAAnimationIcon.java
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/radio/DARadioButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/radio/DARadioSelectionListener.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartPlot.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartPlotIntervalMarker.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartPlotMarker.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartSeries.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoard.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItem.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItemList.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardManager.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/DACustomComboRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/contextMenu/ContextMenu.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/contextMenu/DAContextMenuItem.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/contextMenu/DAContextMenuListener.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/Formatter.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ImageResources.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/lifecycle/LifecycleBar.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/test/TestClass.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimeline.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimelineMarker.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimelineRenderer.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/config/config
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java
org.tizen.dynamicanalyzer/.classpath
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerPaths.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerPlugin.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerShellCommands.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PathManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/ReceiveCommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ClearHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ExitHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/AnalyzerPerspectiveListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/SummaryMouseDoubleClickListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/TableTooltipListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogCenterConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/DeviceInfo.java
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/ConfigureLabels.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/ThreadPageLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ThreadPageLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelineChartLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelineChartLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelinePageLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelinePageLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ColorResources.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/FontResources.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeBlack.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeWhite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextAnalysisMenuItemClickListener.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextClearMenuItemClickListener.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextEndMenuItemClickListener.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextFromSelectionMenuItemClickListener.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextStartMenuItemClickListener.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/SetRangeMarkerMouseMoveListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseEventListener.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseTrackAdapter.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/UICommonConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/UIEventChartContextMenuItem.java [new file with mode: 0644]
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/FileChartData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackUnit.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallstackTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageViewer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/SnapshotView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/DAPageComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangeDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/RangePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/SummaryPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/failed/FailedChecker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakDetector.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/ThreadAPIListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/sync/ThreadPageSyncDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/thread/ThreadPageThreadData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/thread/ThreadPageThreadDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUCoreChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUFrequencyChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/FileChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/HeapChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/ProcessMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/SystemMemoryChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/TimelineChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/UIEventChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineChartManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/logparser/LifecycleLogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialog.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialogTableCellRenderer.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/AboutDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ConfigureManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/RecordStartStopThread.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/SaveAsDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StopLogProcessor.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesTableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogSettingPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogValues.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/WelcomeDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceInputReader.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/TempFilesTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/UIPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/profiling/UIFunctionProfilingDataChecker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/scene/UISceneListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAContextMenu.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DADialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAGrid.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAMessageBox.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabButton.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/FindDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TabButtonRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TitleComboRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAApiListTableComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableEmptyCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATreeComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/UIRecorderTool.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/Formatter.java
org.tizen.dynamicanalyzer/theme/white/img/close_box_disable.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/close_box_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/close_box_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/close_box_push.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/tab_icon_file.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/tab_icon_range.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/tab_icon_summary.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/tab_icon_thread.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/tab_icon_timeline.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/tab_icon_userinterface.png [new file with mode: 0644]

diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_hover.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_hover.png
new file mode 100644 (file)
index 0000000..1361d17
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_hover.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_normal.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_normal.png
new file mode 100644 (file)
index 0000000..7a12ac6
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_normal.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_hover.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_hover.png
new file mode 100644 (file)
index 0000000..0b0ed4a
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_hover.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_normal.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_normal.png
new file mode 100644 (file)
index 0000000..79e64c7
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_end_selected_normal.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_hover.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_hover.png
new file mode 100644 (file)
index 0000000..8a59ad6
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_hover.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_normal.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_normal.png
new file mode 100644 (file)
index 0000000..d447161
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_normal.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_hover.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_hover.png
new file mode 100644 (file)
index 0000000..a545342
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_hover.png differ
diff --git a/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_normal.png b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_normal.png
new file mode 100644 (file)
index 0000000..0309125
Binary files /dev/null and b/org.tizen.dynamicanalyzer.widgets/Images/event_list_start_selected_normal.png differ
index e2392ff..361c383 100644 (file)
@@ -84,8 +84,9 @@ public class DAAnimationIcon extends Canvas {
        };
 
        private void startTimer() {
-               if (null != timer)
+               if (null != timer) {
                        stopTimer();
+               }
 
                startTime = System.currentTimeMillis();
                timer = new Timer();
index b1d820a..9bea689 100644 (file)
@@ -33,6 +33,7 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;
 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.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
@@ -82,13 +83,32 @@ public class DACustomButton extends Canvas {
         */
        public DACustomButton(Composite parent, int style) {
                super(parent, style);
-
                this.setForeground(ColorResources.WHITE);
                this.addPaintListener(buttonPaintListener);
                addListeners();
                buttonRenderer = new DACustomButtonRenderer();
                attr = new DACustomButtonAttribute();
                setDefaultColors();
+               this.addListener(SWT.MouseUp, new Listener() {
+
+                       @Override
+                       public void handleEvent(Event event) {
+                               DACustomButton button = (DACustomButton) event.widget;
+                               if (null != button) {
+                                       Rectangle rectangle = button.getBounds();
+                                       int x = event.x;
+                                       int y = event.y;
+
+                                       if (x < 0 || x > rectangle.width || y < 0
+                                                       || y > rectangle.height) {
+                                               return;
+                                       }
+                                       button.setFocus();
+                               } else {
+                                       return;
+                               }
+                       }
+               });
        }
 
        /**
@@ -227,7 +247,7 @@ public class DACustomButton extends Canvas {
                attr.setColor(STATE_NORMAL, new Color(Display.getCurrent(), 67, 67, 67));
        }
 
-       private PaintListener buttonPaintListener = new PaintListener() {
+       protected PaintListener buttonPaintListener = new PaintListener() {
 
                @Override
                public void paintControl(PaintEvent e) {
@@ -288,7 +308,7 @@ public class DACustomButton extends Canvas {
         * @param enabled
         *            state of button : true or false
         */
-       public void setEnabled(boolean enabled) {
+       public void setButtonEnabled(boolean enabled) {
                if (enabled) {
                        changeButtonState(STATE_NORMAL);
                } else {
@@ -548,4 +568,12 @@ public class DACustomButton extends Canvas {
        public void setFontColor(int state, Color color) {
                attr.setFontColor(state, color);
        }
+
+       public void setIcon(Image icon) {
+               attr.setIcon(icon);
+       }
+
+       public void setAlign(int align) {
+               attr.setAlign(align);
+       }
 }
index 601469d..ef1034c 100644 (file)
@@ -29,6 +29,7 @@ package org.tizen.dynamicanalyzer.widgets.button;
 import java.util.ArrayList;
 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.Image;
@@ -42,6 +43,9 @@ public class DACustomButtonAttribute {
        private Point fontPoint;
        private int drawType = DACustomButton.TYPE_COLOR;
 
+       private int align = SWT.CENTER;
+       private Image iconImage = null;
+
        private List<Image> images = new ArrayList<Image>();
        private List<Color> colors = new ArrayList<Color>();
        private List<Color> fontColors = new ArrayList<Color>();
@@ -143,4 +147,20 @@ public class DACustomButtonAttribute {
        public Color getOutlineInColor(int state) {
                return outlineInColors.get(state);
        }
+
+       public void setIcon(Image icon) {
+               iconImage = icon;
+       }
+
+       public Image getIcon() {
+               return iconImage;
+       }
+
+       public void setAlign(int align) {
+               this.align = align;
+       }
+
+       public int getAlign() {
+               return this.align;
+       }
 }
index fbd803a..d10921c 100644 (file)
@@ -45,28 +45,45 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
                Rectangle rect = canvas.getClientArea();
 
                if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       Image image = attr.getImage(state);
-                       if (null == image) {
-                               return;
-                       }
-
-                       gc.drawImage(image, rect.x, rect.y);
-                       drawButtonText(gc, rect, attr, state);
+                       drawImageButton(gc, rect, state, attr);
                } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
                                || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
                        drawButton(gc, rect, state, attr);
                }
                drawButtonImage(gc, rect, attr);
+               drawIcon(gc, rect, attr);
        }
 
        public int computeFontSize(Rectangle rect) {
-               if (rect.height > 20)
+               if (rect.height > 20) {
                        return 10;
-               else
+               } else {
                        return 8;
+               }
+       }
+
+       protected void drawImageButton(GC gc, Rectangle rect, int state,
+                       DACustomButtonAttribute attr) {
+               Image image = attr.getImage(state);
+               if (null == image) {
+                       return;
+               }
+
+               gc.drawImage(image, rect.x, rect.y);
+               drawButtonText(gc, rect, attr, state);
        }
 
-       public void drawButton(GC gc, Rectangle rect, int state,
+       protected void drawIcon(GC gc, Rectangle parentRect,
+                       DACustomButtonAttribute attr) {
+               Image icon = attr.getIcon();
+               if (null == icon) {
+                       return;
+               }
+               gc.drawImage(icon, parentRect.x + 2,
+                               parentRect.height - icon.getBounds().height / 2);
+       }
+
+       protected void drawButton(GC gc, Rectangle rect, int state,
                        DACustomButtonAttribute attr) {
                if (attr.getDrawType() == DACustomButton.TYPE_COLOR) {
                        gc.setBackground(attr.getColor(state));
@@ -126,10 +143,19 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
                String text = null;
                Font font = null;
                Point p = null;
+
+               Rectangle textRect = new Rectangle(rect.x, rect.y, rect.width,
+                               rect.height);
+               if (null != attr.getIcon()) {
+                       Rectangle iconRect = attr.getIcon().getBounds();
+                       textRect.x = textRect.x + iconRect.width;
+                       textRect.width = textRect.width - iconRect.width;
+               }
+
                if (null != (text = attr.getText())) {
                        if (null == (font = attr.getFont())) {
                                font = new Font(Display.getCurrent(), "Arial", //$NON-NLS-1$
-                                               computeFontSize(rect), SWT.NONE);
+                                               computeFontSize(textRect), SWT.NONE);
                                attr.setFont(font);
                        }
                        gc.setFont(font);
@@ -138,10 +164,15 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
                        int offset = 0;
                        if (null == (p = attr.getFontPoint())) {
                                p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-                               x = (rect.width - p.x) / 2;
-                               y = (rect.height - p.y) / 2;
-                               x = (x < 0) ? 0 : x;
-                               offset = 0;
+                               if (attr.getAlign() == SWT.CENTER) {
+                                       x = (textRect.width - p.x) / 2 + textRect.x;
+                                       x = (x < 0) ? 0 : x;
+                                       offset = -2;
+                               } else {
+                                       x = textRect.x;
+                                       offset = 2;
+                               }
+                               y = (textRect.height - p.y) / 2;
                        } else {
                                x = p.x;
                                y = p.y;
index f9a4855..810b7f1 100644 (file)
@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
 import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
 
 public class DARadioButton extends Canvas {
@@ -114,8 +115,12 @@ public class DARadioButton extends Canvas {
                        e.gc.fillRectangle(rect);
                        e.gc.drawImage(img, x, y);
 
-                       if (null != fgColor) {
-                               e.gc.setForeground(fgColor);
+                       if (isEnabled()) {
+                               if (null != fgColor) {
+                                       e.gc.setForeground(fgColor);
+                               }
+                       } else {
+                               e.gc.setForeground(ColorResources.BAR_GRAY1);
                        }
                        int fontHeight = e.gc.getFontMetrics().getHeight();
                        x = imgRect.width + 4;
index 120ae37..c76b359 100644 (file)
@@ -33,7 +33,6 @@ public abstract class DARadioSelectionListener implements Listener {
 
        @Override
        public void handleEvent(Event event) {
-               // TODO Auto-generated method stub
                handleSelectionEvent((DARadioButton) event.widget);
        }
 
index a5b3c9c..7674d4d 100644 (file)
@@ -34,6 +34,10 @@ import org.eclipse.swt.graphics.Rectangle;
 import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
 
 public class DAChartPlot {
+       public static enum UnitType {
+               DECIMAL, BINARY
+       };
+
        private double visibleStartX = 0;
        private double visibleEndX = 0;
        private double visibleStartY = 0;
@@ -45,13 +49,12 @@ public class DAChartPlot {
        private boolean bShowAxis = false;
        private Image backgroundImage = null;
        private DAChart chart;
-       private DAChartPlotIntervalMarker marker = null;
+       private List<DAChartPlotMarker> markers = new ArrayList<DAChartPlotMarker>();
        private DAChartPlotTooltip tooltip = null;
        protected boolean hasUpdate = false;
        private Font axisFont;
        private String axisUnit;
-
-       private List<DAChartHighlightInfo> highlightInfoList = new ArrayList<DAChartHighlightInfo>();
+       private UnitType axisUnitType = UnitType.DECIMAL;
 
        public DAChartPlot(DAChart chart) {
                this.chart = chart;
@@ -72,24 +75,31 @@ public class DAChartPlot {
                visibleEndY = 0;
                validEndX = 0;
                validEndY = 0;
-               removeIntervalMarker();
+               removeMarkers();
                removeTooltip();
        }
 
-       public void setIntervalMarker(DAChartPlotIntervalMarker marker) {
-               this.marker = marker;
-               this.marker.registerChart(chart);
+       public void setMarker(DAChartPlotMarker marker) {
+               markers.add(marker);
+               marker.registerChart(chart);
        }
 
-       public void removeIntervalMarker() {
-               if (null != marker) {
-                       this.marker.unRegisterChart(chart);
-                       this.marker = null;
+       public void setMarkers(List<DAChartPlotMarker> markers) {
+               if (null == markers) {
+                       return;
+               }
+               int size = markers.size();
+               for (int i = 0; i < size; i++) {
+                       setMarker(markers.get(i));
                }
        }
 
-       public DAChartPlotIntervalMarker getIntervalMarker() {
-               return marker;
+       public void removeMarkers() {
+               markers.clear();
+       }
+
+       public List<DAChartPlotMarker> getMarkers() {
+               return markers;
        }
 
        public void setTooltip(DAChartPlotTooltip tooltip) {
@@ -264,14 +274,6 @@ public class DAChartPlot {
                hasUpdate = bUpdate;
        }
 
-       public List<DAChartHighlightInfo> getHighlightInfoList() {
-               return highlightInfoList;
-       }
-       
-       public void addHighlightInfo(DAChartHighlightInfo info) {
-               highlightInfoList.add(info);
-       }
-
        public boolean isShowAxis() {
                return bShowAxis;
        }
@@ -298,4 +300,12 @@ public class DAChartPlot {
        public void setAxisUnit(String axisUnit) {
                this.axisUnit = axisUnit;
        }
+
+       public void setAxisUnitType(UnitType type) {
+               axisUnitType = type;
+       }
+
+       public UnitType getAxisUnitType() {
+               return axisUnitType;
+       }
 }
index dd4edb5..81306c7 100644 (file)
  */
 package org.tizen.dynamicanalyzer.widgets.chart;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-
-public class DAChartPlotIntervalMarker {
-       private double startVal;
-       private double endVal;
-       private int alpha = (int) (255*0.25);   //default
-       private Color backgroundColor;
-       private Color foregroundColor;
-       private List<DAChart> charts = new ArrayList<DAChart>();
+public class DAChartPlotIntervalMarker extends DAChartPlotMarker {
+       public final static int INTERVAL_MARKER_STYLE_LINE = 0;
+       public final static int INTERVAL_MARKER_STYLE_AREA = 1;
+       public final static int INTERVAL_MARKER_STYLE_LINE_AREA = 2;
        
-       public DAChartPlotIntervalMarker(double start, double end){
-               startVal = start;
+       private double endVal;
+       private int markerStyle = INTERVAL_MARKER_STYLE_LINE;
+
+       public DAChartPlotIntervalMarker(double start, double end, int markerStyle) {
+               super(start);
                endVal = end;
+               this.setMarkerStyle(markerStyle);
        }
-       
-       public List<DAChart> getRegisteChartList(){
-               return charts;
-       }
-       
-       public void registerChart(DAChart chart){
-               charts.add(chart);
-       }
-       
-       public void unRegisterChart(DAChart chart){
-               for(int i=0; i<charts.size(); i++){
-                       if(charts.get(i).equals(chart)){
-                               charts.remove(i);
-                       }
-               }
-       }
-       
-       private void redrawRegisteredChart(){
-               for(int i=charts.size()-1; i>=0; i--){
-                       if(charts.get(i).isDisposed()){
-                               charts.remove(i);
-                       }
-                       else{
-                               charts.get(i).redraw();
-                       }
-               }
-       }
-       
-       public void setInterval(double start, double end){
-               startVal = start;
+
+       public void setInterval(double start, double end) {
+               setVal(start);
                endVal = end;
                redrawRegisteredChart();
        }
 
        public double getStartVal() {
-               return startVal;
+               return getVal();
        }
 
        public void setStartVal(double startVal) {
-               this.startVal = startVal;
-               redrawRegisteredChart();
+               setVal(startVal);
        }
 
        public double getEndVal() {
@@ -95,33 +62,11 @@ public class DAChartPlotIntervalMarker {
                redrawRegisteredChart();
        }
 
-       public int getAlpha() {
-               return alpha;
-       }
-
-       public void setAlpha(int alpha) {
-               this.alpha = alpha;
-               redrawRegisteredChart();
-       }
-
-       public Color getBackgroundColor() {
-               if (null == backgroundColor) {
-                       backgroundColor = new Color(Display.getCurrent(), 23, 98, 132);
-               }
-               return backgroundColor;
+       public int getMarkerStyle() {
+               return markerStyle;
        }
 
-       public void setBackgroundColor(Color backgroundColor) {
-               this.backgroundColor = backgroundColor;
-               redrawRegisteredChart();
-       }
-
-       public Color getForegroundColor() {
-               return foregroundColor;
-       }
-
-       public void setForegroundColor(Color foregroundColor) {
-               this.foregroundColor = foregroundColor;
-               redrawRegisteredChart();
+       public void setMarkerStyle(int markerStyle) {
+               this.markerStyle = markerStyle;
        }
 }
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartPlotMarker.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartPlotMarker.java
new file mode 100644 (file)
index 0000000..9646483
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * 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.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+public class DAChartPlotMarker {
+       List<DAChart> charts = new ArrayList<DAChart>();
+       private double val;
+       private int alpha = (int) (255 * 0.25); // default
+       private int lineWidth = 2; // default
+       private Color backgroundColor;
+       private Color foregroundColor;
+
+       public DAChartPlotMarker(double val) {
+               this.setVal(val);
+       }
+
+       public List<DAChart> getRegisteChartList() {
+               return charts;
+       }
+
+       public void registerChart(DAChart chart) {
+               charts.add(chart);
+       }
+
+       public void unRegisterChart(DAChart chart) {
+               for (int i = 0; i < charts.size(); i++) {
+                       if (charts.get(i).equals(chart)) {
+                               charts.remove(i);
+                       }
+               }
+       }
+
+       protected void redrawRegisteredChart() {
+               for (int i = charts.size() - 1; i >= 0; i--) {
+                       if (charts.get(i).isDisposed()) {
+                               charts.remove(i);
+                       } else {
+                               charts.get(i).redraw();
+                       }
+               }
+       }
+
+       public double getVal() {
+               return val;
+       }
+
+       public void setVal(double val) {
+               this.val = val;
+               redrawRegisteredChart();
+       }
+
+       public int getAlpha() {
+               return alpha;
+       }
+
+       public void setAlpha(int alpha) {
+               this.alpha = alpha;
+               redrawRegisteredChart();
+       }
+
+       public Color getBackgroundColor() {
+               if (null == backgroundColor){
+                       backgroundColor = ColorResources.BLUE;
+               }
+               return backgroundColor;
+       }
+
+       public void setBackgroundColor(Color backgroundColor) {
+               this.backgroundColor = backgroundColor;
+               redrawRegisteredChart();
+       }
+
+       public Color getForegroundColor() {
+               if (null == foregroundColor){
+                       foregroundColor = ColorResources.BLUE;
+               }
+               return foregroundColor;
+       }
+
+       public void setForegroundColor(Color foregroundColor) {
+               this.foregroundColor = foregroundColor;
+               redrawRegisteredChart();
+       }
+
+       public int getLineWidth() {
+               return lineWidth;
+       }
+
+       public void setLineWidth(int lineWidth) {
+               this.lineWidth = lineWidth;
+       }
+}
index 2fd874e..694ca13 100644 (file)
@@ -53,11 +53,9 @@ public class DAChartRenderer {
        private DAChartPlot plot = null;
        private Rectangle r = null;
 
-       // private final int SCREENSHOT_HORIZONTAL_TOP_MARGIN = 13;
        private final int SCREENSHOT_Y_POSITION_MINI = 4;
        private final int SCREENSHOT_SELECTED_Y_POSITION = 4;
        private final int SCREENSHOT_SELECTED_Y_POSITION_MINI = 1;
-       // private final int SCREENSHOT_HORIZONTAL_SELECTED_MOVE_SIZE = 19;
        private final int SCREENSHOT_SELECTED_LINE_WIDTH = 2;
        private final int SCREENSHOT_BORDER_LINE_WIDTH = 1;
 
@@ -88,7 +86,6 @@ public class DAChartRenderer {
                if (r.height > DAChartPlotTooltip.TOOLTIP_SHOW_MIN) {
                        drawTooltip(gc);
                }
-               drawHighlights(gc);
                drawRange(gc);
        }
 
@@ -213,7 +210,7 @@ public class DAChartRenderer {
                String axisUnit = plot.getAxisUnit();
                gc.setFont(axisFont);
 
-               String text;
+               String text = "";
                int textX;
                int textHeight;
 
@@ -227,7 +224,11 @@ public class DAChartRenderer {
                gc.drawLine(x1, 0, x1, rt.height);
 
                gc.drawLine(x1, rt.height - 1, x2, rt.height - 1);
-               text = Formatter.toByteFormatConvert(min);
+               if (plot.getAxisUnitType() == DAChartPlot.UnitType.BINARY) {
+                       text = Formatter.toByteFormatConvertBinaryPrefix(min);
+               } else if (plot.getAxisUnitType() == DAChartPlot.UnitType.DECIMAL) {
+                       text = Formatter.toByteFormatConvertDecimalPrefix(min);
+               }
                if (null != axisUnit) {
                        text += axisUnit;
                }
@@ -240,7 +241,11 @@ public class DAChartRenderer {
                gc.drawText(text, textX, rt.height - textHeight, true);
 
                gc.drawLine(x1, rt.height / 2, x2, rt.height / 2);
-               text = Formatter.toByteFormatConvert((min + max) / 2);
+               if (plot.getAxisUnitType() == DAChartPlot.UnitType.BINARY) {
+                       text = Formatter.toByteFormatConvertBinaryPrefix((min + max) / 2);
+               } else if (plot.getAxisUnitType() == DAChartPlot.UnitType.DECIMAL) {
+                       text = Formatter.toByteFormatConvertDecimalPrefix((min + max) / 2);
+               }
                if (null != axisUnit) {
                        text += axisUnit;
                }
@@ -251,7 +256,11 @@ public class DAChartRenderer {
                gc.drawText(text, textX, rt.height / 2 - textHeight / 2, true);
 
                gc.drawLine(x1, 0, x2, 0);
-               text = Formatter.toByteFormatConvert(max);
+               if (plot.getAxisUnitType() == DAChartPlot.UnitType.BINARY) {
+                       text = Formatter.toByteFormatConvertBinaryPrefix(max);
+               } else if (plot.getAxisUnitType() == DAChartPlot.UnitType.DECIMAL) {
+                       text = Formatter.toByteFormatConvertDecimalPrefix(max);
+               }
                if (null != axisUnit) {
                        text += axisUnit;
                }
@@ -270,51 +279,57 @@ public class DAChartRenderer {
        }
 
        public void drawRange(GC gc) {
-               DAChartPlotIntervalMarker marker = plot.getIntervalMarker();
-               if (null == marker) {
+               List<DAChartPlotMarker> markers = plot.getMarkers();
+               if (null == markers) {
                        return;
                }
-               int pixcelStartX = plot.getXPixcelFromX(marker.getStartVal());
-               int pixcelEndX = plot.getXPixcelFromX(marker.getEndVal());
-
-               Color color = marker.getBackgroundColor();
-               int alpha = gc.getAlpha();
-               gc.setAlpha(marker.getAlpha());
-               if (pixcelStartX == pixcelEndX) {
-                       gc.setForeground(color);
-                       gc.setLineWidth(2);
-                       gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
-               } else {
-                       gc.setBackground(color);
-                       gc.fillRectangle(pixcelStartX, 0, pixcelEndX - pixcelStartX,
-                                       r.height);
-               }
-               gc.setAlpha(alpha);
-       }
 
-       public void drawHighlights(GC gc) {
-               for (DAChartHighlightInfo info : plot.getHighlightInfoList()) {
-                       if (info.getStartTime() >= 0 && info.getEndTime() >= 0) {
-                               int pixcelStartX = plot.getXPixcelFromX(info.getStartTime());
-                               int pixcelEndX = plot.getXPixcelFromX(info.getEndTime());
-
-                               Color color = info.getColor();
-                               int oldAlpha = gc.getAlpha();
-                               gc.setAlpha(info.getAlpha());
-
-                               if (pixcelStartX == pixcelEndX) {
-                                       gc.setForeground(color);
-                                       gc.setLineWidth(2);
+               int oldAlpha = gc.getAlpha();
+               Color oldBackColor = gc.getBackground();
+               Color oldForeColor = gc.getForeground();
+               int oldLineWidth = gc.getLineWidth();
+               int markerSize = markers.size();
+               DAChartPlotMarker marker;
+               int markerStyle;
+               int pixcelStartX;
+               int pixcelEndX;
+
+               for (int i = 0; i < markerSize; i++) {
+                       marker = markers.get(i);
+                       gc.setForeground(marker.getForegroundColor());
+                       gc.setBackground(marker.getBackgroundColor());
+                       gc.setAlpha(marker.getAlpha());
+
+                       pixcelStartX = plot.getXPixcelFromX(marker.getVal());
+                       markerStyle = DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA;
+                       
+                       if (marker instanceof DAChartPlotIntervalMarker) {
+                               pixcelEndX = plot
+                                               .getXPixcelFromX(((DAChartPlotIntervalMarker) marker)
+                                                               .getEndVal());
+                               markerStyle = ((DAChartPlotIntervalMarker) marker).getMarkerStyle();
+                               
+                               if(markerStyle != DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE){
+                                       int width = pixcelEndX - pixcelStartX;
+                                       if(width <= 1){
+                                               width = marker.getLineWidth();
+                                       }
+                                       gc.fillRectangle(pixcelStartX, 0, width,
+                                               r.height);
+                               }
+                               if(markerStyle != DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_AREA){
                                        gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
-                               } else {
-                                       gc.setBackground(color);
-                                       gc.fillRectangle(pixcelStartX, 0,
-                                                       pixcelEndX - pixcelStartX, r.height);
+                                       gc.drawLine(pixcelEndX, r.y, pixcelEndX, r.height);
                                }
-
-                               gc.setAlpha(oldAlpha);
+                       } else {
+                               gc.setLineWidth(marker.getLineWidth());
+                               gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
                        }
                }
+               gc.setAlpha(oldAlpha);
+               gc.setBackground(oldBackColor);
+               gc.setForeground(oldForeColor);
+               gc.setLineWidth(oldLineWidth);
        }
 
        private int getTooltipStartX(double startVal, int width, int margin) {
@@ -564,6 +579,8 @@ public class DAChartRenderer {
                gc.setBackground(color);
                gc.setAlpha((int) (255 * 0.8));
                gc.setAntialias(SWT.ON);
+               
+               int barAlign = series.getBarAlign();
 
                int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
                if (index < 0) {
@@ -591,6 +608,12 @@ public class DAChartRenderer {
                        if (barWidth < 1) {
                                barWidth = 1;
                        }
+                       
+                       if(barAlign == DAChartSeries.SERIES_BAR_ALIGN_CENTER){
+                               pixcelStartX -= barWidth/2;
+                       } else if(barAlign == DAChartSeries.SERIES_BAR_ALIGN_RIGHT){
+                               pixcelStartX -= barWidth;
+                       }
 
                        color = seriesItem.getEventColor();
                        if (null != color) {
@@ -625,7 +648,9 @@ public class DAChartRenderer {
                        Font tempFont = gc.getFont();
                        Font multiCheckBarFont = series.getFont();
                        gc.setFont(multiCheckBarFont);
-                       gc.drawText(series.getName(), rect.x + 3, rect.y + 3, true);
+                       gc.drawText(series.getName(), rect.x + 3, rect.y + rect.height / 2
+                                       - gc.stringExtent(series.getName()).y / 2 + seriesIndex,
+                                       true);
                        gc.setFont(tempFont);
                }
                if (seriesIndex != 0) {
@@ -1088,7 +1113,7 @@ public class DAChartRenderer {
                                gc.fillRectangle(pixcelStartX,
                                                (r.y + r.height) - barHeight * 2, width, barHeight);
                        }
-                       if (pixcelStartX > plot.getVisibleEndX()) {
+                       if (currentStartX > plot.getVisibleEndX()) {
                                break;
                        }
                }
index 744902d..d291d8c 100644 (file)
@@ -50,12 +50,16 @@ public class DAChartSeries {
        public static final int SERIES_STYLE_LAST_CONTINUE_STEP = 14;
 
        public static final double SERIES_DEFAULT_BAR_WIDTH = 0.5;
+       public static final int SERIES_BAR_ALIGN_LEFT = 0;
+       public static final int SERIES_BAR_ALIGN_CENTER = 1;
+       public static final int SERIES_BAR_ALIGN_RIGHT = 2;
 
        private String name;
        private int style = SERIES_STYLE_NONE;
        private List<DAChartSeriesItem> seriesItems = new ArrayList<DAChartSeriesItem>();
        private Color seriesColor;
        private double barWidth = SERIES_DEFAULT_BAR_WIDTH;
+       private int barAlign = SERIES_BAR_ALIGN_LEFT;
        private double maxX = 0;
        private double maxY = 0;
        private double endX = 0;
@@ -265,4 +269,12 @@ public class DAChartSeries {
        public void setSummarizeString(String summarizeString) {
                this.summarizeString = summarizeString;
        }
+
+       public int getBarAlign() {
+               return barAlign;
+       }
+
+       public void setBarAlign(int barAlign) {
+               this.barAlign = barAlign;
+       }
 }
index f7a3130..89d25ca 100644 (file)
@@ -55,20 +55,21 @@ import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotMarker;
 import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
 import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
 import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
 import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleBar;
 import org.tizen.dynamicanalyzer.widgets.scale.DAScale;
 import org.tizen.dynamicanalyzer.widgets.scale.DAScaleSelectionListener;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
 
 public class DAChartBoard extends Composite {
 
        // private DACustomButton titleButton;
        private Composite titleComp;
        private DACustomToggleButton chartZoomButton;
-       private DACustomTimeline timeline;
+       private DATimeline timeline;
        private LifecycleBar lifecycleBar;
        private DefaultToolTip lifecycleBarTooltip;
        private DefaultToolTip timelineTooltip;
@@ -82,7 +83,7 @@ public class DAChartBoard extends Composite {
        private DAChartBoardItem selectItem;
        private Image oldImage;
        private List<DAChartBoardSelectionListener> selectionListenrers;
-       private DAChartPlotIntervalMarker intervalMarker;
+       private List<DAChartPlotMarker> markers;
        private boolean bSelection = true;
        private int itemListHeight = 0;
        private Font nameFont;
@@ -125,7 +126,7 @@ public class DAChartBoard extends Composite {
                                        }
                                });
 
-               timeline = new DACustomTimeline(this);
+               timeline = new DATimeline(this);
                timelineTooltip = new DefaultToolTip(timeline);
                timelineTooltip.deactivate();
                timeline.addMouseTrackListener(timelineMouseTrackAdapter);
@@ -481,6 +482,20 @@ public class DAChartBoard extends Composite {
                lifecycleBar.setTotalEndTime(endTime);
        }
 
+       private void markerContentsClear() {
+               if (null == markers) {
+                       return;
+               }
+               int size = markers.size();
+               for (int i = 0; i < size; i++) {
+                       if ((markers.get(i)) instanceof DAChartPlotIntervalMarker) {
+                               ((DAChartPlotIntervalMarker) (markers.get(i))).setInterval(-1,
+                                               -1);
+
+                       }
+               }
+       }
+
        public void contentsClear() {
                itemList.contentsClear();
                setTotalEndTime(0);
@@ -492,9 +507,7 @@ public class DAChartBoard extends Composite {
                if (null != selectItem) {
                        selectItem = null;
                }
-               if (intervalMarker != null) {
-                       intervalMarker.setInterval(-1, -1);
-               }
+               markerContentsClear();
 
                timeline.getStartRangeMarker().setTime(-1);
                timeline.getEndRangeMarker().setTime(-1);
@@ -514,7 +527,10 @@ public class DAChartBoard extends Composite {
                if (null != selectItem) {
                        selectItem = null;
                }
-               intervalMarker = null;
+               if (null != markers) {
+                       markers.clear();
+                       markers = null;
+               }
        }
 
        public double getVisibleStartTime() {
@@ -614,18 +630,15 @@ public class DAChartBoard extends Composite {
                return titleComp;
        }
 
-       private void initIntervalMarker() {
-               intervalMarker = new DAChartPlotIntervalMarker(-1, -1);
-               intervalMarker.setBackgroundColor(ColorResources.CHART_SELECTION_RANGE);
-               intervalMarker.setAlpha((int) (255 * 0.25));
-       }
-
-       public DAChartPlotIntervalMarker getIntervalMarker() {
-               if (null == intervalMarker) {
-                       initIntervalMarker();
+       public void addIntervalMarker(DAChartPlotMarker marker) {
+               if (null == markers) {
+                       markers = new ArrayList<DAChartPlotMarker>();
                }
+               markers.add(marker);
+       }
 
-               return intervalMarker;
+       public List<DAChartPlotMarker> getMarkers() {
+               return markers;
        }
 
        public boolean isSelection() {
@@ -644,15 +657,13 @@ public class DAChartBoard extends Composite {
                return lifecycleBar;
        }
 
-       public void setMarkerStartTime(double time) {
+       public void setTimelineMarkerStartTime(double time) {
                timeline.getStartRangeMarker().setTime(time);
-               setHighlight(time, timeline.getEndRangeMarker().getTime(), 1);
                timeline.redraw();
        }
 
-       public void setMarkerEndTime(double time) {
+       public void setTimelineMarkerEndTime(double time) {
                timeline.getEndRangeMarker().setTime(time);
-               setHighlight(timeline.getStartRangeMarker().getTime(), time, 1);
                timeline.redraw();
        }
 
@@ -686,23 +697,11 @@ public class DAChartBoard extends Composite {
                itemList.reArrangeItem(a);
        }
 
-       public void setHighlight(double startTime, double endTime, int index) {
-               itemList.setHighlight(startTime, endTime, index);
-       }
-
-       public double getSelectionStartTime() {
-               return intervalMarker.getStartVal();
-       }
-
-       public double getSelectionEndTime() {
-               return intervalMarker.getEndVal();
-       }
-
        protected Composite getListComposite() {
                return itemListScrollComp;
        }
 
-       public DACustomTimeline getTimeline() {
+       public DATimeline getTimeline() {
                return timeline;
        }
 
@@ -716,8 +715,12 @@ public class DAChartBoard extends Composite {
        public void setNameFont(Font nameFont) {
                this.nameFont = nameFont;
        }
-       
-       public DAChartBoardItem getSelectItem(){
+
+       public DAChartBoardItem getSelectItem() {
                return selectItem;
        }
+
+       public double getLifecycleEndTime() {
+               return lifecycleBar.getEndTime();
+       }
 }
index c17944f..856debf 100644 (file)
@@ -33,7 +33,6 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartHighlightInfo;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 
 public class DAChartBoardItem extends Composite {
@@ -360,26 +359,6 @@ public class DAChartBoardItem extends Composite {
                }
        }
 
-       protected void setChartHightlight(double startX, double endX, int index) {
-               DAChart chart = getChart();
-               if (null == chart) {
-                       return;
-               }
-
-               DAChartPlot plot = chart.getPlot();
-
-               if (null == plot) {
-                       return;
-               }
-               plot.getHighlightInfoList().get(index).setStartTime(startX);
-               plot.getHighlightInfoList().get(index).setEndTime(endX);
-               chart.redraw();
-
-               if (null != childList) {
-                       childList.setHighlight(startX, endX, index);
-               }
-       }
-
        public void setItemCellHeight(int itemCellHeight) {
                this.itemCellHeight = itemCellHeight;
        }
@@ -414,8 +393,4 @@ public class DAChartBoardItem extends Composite {
                        return null;
                }
        }
-
-       public void addHighlightInfo(DAChartHighlightInfo info) {
-               getChart().getPlot().addHighlightInfo(info);
-       }
 }
index 7de51de..b6c0cee 100644 (file)
@@ -149,7 +149,7 @@ class DAChartBoardItemList extends Composite {
                        this.layout();
                        listHeight += itemHeight;
                }
-               
+
                return listHeight;
        }
 
@@ -276,40 +276,31 @@ class DAChartBoardItemList extends Composite {
                itemsTemp = null;
        }
 
-       public void setHighlight(double startTime, double endTime, int index) {
-               if (null == items) {
-                       return;
-               }
-               int itemsSize = items.size();
-               for (int i = 0; i < itemsSize; i++) {
-                       items.get(i).setChartHightlight(startTime, endTime, index);
-               }
-       }
-       
-       public int getItemChartWidth(){
-               int ret = getClientArea().width - DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH;
-               
-               if(ret < 0){
+       public int getItemChartWidth() {
+               int ret = getClientArea().width
+                               - DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH;
+
+               if (ret < 0) {
                        ret = 0;
                }
                return ret;
        }
-       
-       protected DAChartBoardItem get(int index){
+
+       protected DAChartBoardItem get(int index) {
                int itemSize = items.size();
-               if(index >= itemSize){
+               if (index >= itemSize) {
                        return null;
                }
                return items.get(index);
        }
-       
-       protected int getItemYPos(int index){
+
+       protected int getItemYPos(int index) {
                int pos = 0;
                int itemSize = items.size();
-               if(itemSize == 0 || index >= itemSize){
+               if (itemSize == 0 || index >= itemSize) {
                        return -1;
                }
-               for(int i=0; i<index; i++){
+               for (int i = 0; i < index; i++) {
                        pos += items.get(i).getItemHeight();
                }
                return pos;
index 44b624c..c62f10f 100644 (file)
@@ -25,7 +25,7 @@
  */
 package org.tizen.dynamicanalyzer.widgets.chartBoard;
 
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimelineRenderer;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimelineRenderer;
 
 class DAChartBoardManager {
        public final static int SCALE_100 = 1;
@@ -135,7 +135,7 @@ class DAChartBoardManager {
                        return 0;
                }
                double ret = (double) chartWidth
-                               / (double) ((DACustomTimelineRenderer.DEFAULT_INTERVAL * scale));
+                               / (double) ((DATimelineRenderer.DEFAULT_INTERVAL * scale));
 
                return ret;
        }
index f2a1b99..81e73fc 100644 (file)
@@ -28,13 +28,16 @@ package org.tizen.dynamicanalyzer.widgets.combo;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 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;
@@ -44,6 +47,7 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
@@ -59,6 +63,10 @@ public class DACustomCombo extends Canvas {
        public static final int STATE_PUSH = 2;
        public static final int STATE_DISABLE = 3;
 
+       public static final int TEXT_ALIGN_CENTER = 0;
+       public static final int TEXT_ALIGN_LEFT = 1;
+       public static final int TEXT_ALIGN_RIGHT = 2;
+
        private static final int pageSize = 5;
 
        Composite parent;
@@ -67,8 +75,11 @@ public class DACustomCombo extends Canvas {
        private int itemHeight = 0;
        private DACustomButton upArrowButton = null;
        private DACustomButton downArrowButton = null;
+       private int tmpItemIndex = 0;
        private int itemIndex = 0;
        private boolean dirty = false;
+       private Timer closeTimer = null;
+       private final int CLOSE_WAITING_TIME = 500;
 
        private List<String> items;
        private List<Rectangle> rects = null;
@@ -79,7 +90,8 @@ public class DACustomCombo extends Canvas {
        private boolean enabled = true;
        private Shell childShell = null;
        private int selection = 0;
-       private String text = ""; //$NON-NLS-1$
+       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();;
@@ -88,6 +100,8 @@ public class DACustomCombo extends Canvas {
 
        private List<Color> arrowColors = null;
        private List<Image> arrowImages = null;
+       private int titleAlign = TEXT_ALIGN_LEFT;
+       private Font font;
 
        public DACustomCombo(Composite parent, int style) {
                super(parent, style);
@@ -100,7 +114,7 @@ public class DACustomCombo extends Canvas {
                initCombo();
        }
 
-       public void addListeners() {
+       protected void addListeners() {
                addListener(SWT.MouseEnter, comboMouseListener);
                addListener(SWT.MouseHover, comboMouseListener);
                addListener(SWT.MouseExit, comboMouseListener);
@@ -150,13 +164,19 @@ public class DACustomCombo extends Canvas {
        private Listener comboMouseListener = new Listener() {
                @Override
                public void handleEvent(Event event) {
+                       Canvas comboArea = (Canvas) event.widget;
+                       Rectangle rect = comboArea.getClientArea();
                        if (enabled) {
                                if (event.type == SWT.MouseEnter) {
                                        changeComboState(STATE_HOVER);
+                                       if (null != closeTimer) {
+                                               closeTimer.cancel();
+                                               closeTimer = null;
+                                       }
                                }
 
                                if (event.type == SWT.MouseHover) {
-                                       if (!isOutOfBounds(event.x, event.y)) {
+                                       if (rect.contains(event.x, event.y)) {
                                                if (0 != (event.stateMask & SWT.BUTTON1)) {
                                                        changeComboState(STATE_PUSH);
                                                } else if (0 == (event.stateMask & SWT.BUTTON1)) {
@@ -180,9 +200,9 @@ public class DACustomCombo extends Canvas {
                                }
 
                                if (event.type == SWT.MouseMove) {
-                                       if (isOutOfBounds(event.x, event.y)) {
+                                       if (!rect.contains(event.x, event.y)) {
                                                changeComboState(STATE_NORMAL);
-                                       } else if (isOutOfBounds(event.x, event.y)) {
+                                       } else if (!rect.contains(event.x, event.y)) {
                                                if (0 != (event.stateMask & SWT.BUTTON1)) {
                                                        changeComboState(STATE_PUSH);
                                                } else if (0 == (event.stateMask & SWT.BUTTON1)) {
@@ -193,21 +213,15 @@ public class DACustomCombo extends Canvas {
 
                                if (event.type == SWT.MouseExit) {
                                        changeComboState(STATE_NORMAL);
+                                       if (event.y < rect.y || event.x < rect.x
+                                                       || event.x > rect.x + rect.width) {
+                                               closePopup(CLOSE_WAITING_TIME);
+                                       }
                                }
                        }
                }
        };
 
-       protected boolean isOutOfBounds(int x, int y) {
-               Rectangle rectangle = combo.getBounds();
-
-               if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {
-                       return true;
-               }
-
-               return false;
-       }
-
        private int getShellWidth() {
                if (getItems().isEmpty()) {
                        return 0;
@@ -257,9 +271,21 @@ public class DACustomCombo extends Canvas {
 
                childShell.setSize(shellWidth, shellHeight);
                childShell.setLocation(p.x, p.y + rect.height);
-               // childShell.setBackground(ColorResources.BLUE);
+               childShell.addDisposeListener(new DisposeListener() {
+
+                       @Override
+                       public void widgetDisposed(DisposeEvent e) {
+                               if (null != closeTimer) {
+                                       closeTimer.cancel();
+                                       closeTimer = null;
+                               }
+                       }
+               });
                setSelect(text);
 
+               tmpSelection = selection;
+               tmpItemIndex = itemIndex;
+
                popup = new Canvas(childShell, SWT.DOUBLE_BUFFERED);
                popup.setData(this);
                popup.setBackground(ColorResources.WHITE);
@@ -269,6 +295,8 @@ public class DACustomCombo extends Canvas {
                popup.addListener(SWT.FocusOut, popupMouseEventListener);
                popup.addListener(SWT.MouseUp, popupSelectionListener);
                popup.addListener(SWT.MouseWheel, popupMouseEventListener);
+               popup.addListener(SWT.MouseExit, popupMouseEventListener);
+               popup.addListener(SWT.MouseEnter, popupMouseEventListener);
 
                if (size > MAX_SIZE) {
                        upArrowButton = makeButton();
@@ -283,13 +311,14 @@ public class DACustomCombo extends Canvas {
                        data.right = new FormAttachment(100, 0);
                        data.height = height;
                        upArrowButton.setLayoutData(data);
-                       upArrowButton.addMouseListener(upArrowListener);
-                       upArrowButton.addListener(SWT.MouseExit, upButtonMouseExitListener);
+                       upArrowButton.addListener(SWT.MouseExit, upButtonMouseListener);
+                       upArrowButton.addListener(SWT.MouseEnter, upButtonMouseListener);
+                       upArrowButton.addListener(SWT.MouseUp, upButtonMouseListener);
                        shellHeight += height;
-                       if (itemIndex > 0) {
-                               upArrowButton.setEnabled(true);
+                       if (tmpItemIndex > 0) {
+                               upArrowButton.setButtonEnabled(true);
                        } else {
-                               upArrowButton.setEnabled(false);
+                               upArrowButton.setButtonEnabled(false);
                        }
 
                        data = new FormData();
@@ -299,9 +328,7 @@ public class DACustomCombo extends Canvas {
                        data.height = height * boundSize + 5 - 2;
                        popup.setLayoutData(data);
 
-                       // downArrowButton = new DACustomButton(childShell, SWT.NONE);
                        downArrowButton = makeButton();
-                       //                      downArrowButton.setText("down"); //$NON-NLS-1$
                        if (null == buttonDown) {
                                downArrowButton.setText(Messages.DACustomCombo_2);
                        } else {
@@ -313,14 +340,15 @@ public class DACustomCombo extends Canvas {
                        data.right = new FormAttachment(100, 0);
                        data.height = height;
                        downArrowButton.setLayoutData(data);
-                       downArrowButton.addMouseListener(downArrowListener);
-                       downArrowButton.addListener(SWT.MouseExit,
-                                       downButtonMouseExitListener);
+                       downArrowButton.addListener(SWT.MouseExit, downButtonMouseListener);
+                       downArrowButton
+                                       .addListener(SWT.MouseEnter, downButtonMouseListener);
+                       downArrowButton.addListener(SWT.MouseUp, downButtonMouseListener);
                        shellHeight += height;
-                       if (itemIndex + MAX_SIZE < size - 1) {
-                               downArrowButton.setEnabled(true);
+                       if (tmpItemIndex + MAX_SIZE < size - 1) {
+                               downArrowButton.setButtonEnabled(true);
                        } else {
-                               downArrowButton.setEnabled(false);
+                               downArrowButton.setButtonEnabled(false);
                        }
 
                        childShell.setSize(shellWidth, shellHeight);
@@ -343,99 +371,6 @@ public class DACustomCombo extends Canvas {
                childShell.open();
        }
 
-       private MouseListener upArrowListener = new MouseListener() {
-
-               @Override
-               public void mouseUp(MouseEvent event) {
-                       if (!upArrowButton.isButtonEnabled()) {
-                               return;
-                       }
-
-                       if (null != upArrowButton) {
-                               Rectangle rectangle = upArrowButton.getBounds();
-                               int x = event.x;
-                               int y = event.y;
-
-                               if (x < 0 || x > rectangle.width || y < 0
-                                               || y > rectangle.height) {
-                                       return;
-                               }
-                       }
-
-                       int size = getItems().size();
-                       if (itemIndex - pageSize < 0) {
-                               itemIndex = 0;
-                               upArrowButton.setEnabled(false);
-                       } else {
-                               itemIndex -= pageSize;
-                       }
-
-                       if (itemIndex + pageSize < size - 1) {
-                               downArrowButton.setEnabled(true);
-                       }
-                       popup.redraw();
-               }
-
-               @Override
-               public void mouseDown(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void mouseDoubleClick(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-
-               }
-       };
-
-       private MouseListener downArrowListener = new MouseListener() {
-
-               @Override
-               public void mouseUp(MouseEvent event) {
-
-                       if (!downArrowButton.isButtonEnabled()) {
-                               return;
-                       }
-
-                       if (null != downArrowButton) {
-                               Rectangle rectangle = downArrowButton.getBounds();
-                               int x = event.x;
-                               int y = event.y;
-
-                               if (x < 0 || x > rectangle.width || y < 0
-                                               || y > rectangle.height) {
-                                       return;
-                               }
-                       }
-
-                       int size = getItems().size();
-                       if (itemIndex + pageSize + MAX_SIZE >= size - 1) {
-                               itemIndex = size - MAX_SIZE;
-                               downArrowButton.setEnabled(false);
-                       } else {
-                               itemIndex += pageSize;
-                       }
-
-                       // if (itemIndex - pageSize > 0) {
-                       if (itemIndex > 0) {
-                               upArrowButton.setEnabled(true);
-                       }
-                       popup.redraw();
-               }
-
-               @Override
-               public void mouseDown(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void mouseDoubleClick(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-               }
-       };
-
        private PaintListener popupPaintListener = new PaintListener() {
 
                @Override
@@ -444,10 +379,10 @@ public class DACustomCombo extends Canvas {
                        List<String> input = new ArrayList<String>();
                        int size = (items.size() > MAX_SIZE) ? MAX_SIZE : items.size();
                        for (int i = 0; i < size; i++) {
-                               input.add(items.get(itemIndex + i));
+                               input.add(items.get(tmpItemIndex + i));
                        }
-                       popupRenderer
-                                       .draw(e.gc, popup, state, getRects(), selection, input);
+                       popupRenderer.draw(e.gc, popup, state, getRects(), tmpSelection,
+                                       input);
                }
        };
 
@@ -487,7 +422,7 @@ public class DACustomCombo extends Canvas {
                if (getItems().size() > 0) {
                        setText(getItems().get(itemIndex + selection));
                } else {
-                       setText(""); //$NON-NLS-1$
+                       setText(DAWidgetConstants.EMPTY_STRING);
                }
                childShell.close();
                childShell = null;
@@ -502,49 +437,64 @@ public class DACustomCombo extends Canvas {
                                int size = rs.size();
                                for (int i = 0; i < size; i++) {
                                        if (rs.get(i).contains(event.x, event.y)) {
-                                               selection = i;
+                                               tmpSelection = i;
                                                popup.redraw();
                                                break;
                                        }
                                }
                        }
 
-                       if (event.type == SWT.FocusOut) {
-                               childShell.close();
-                               childShell = null;
+                       if (event.type == SWT.MouseUp) {
+                               selection = tmpSelection;
+                               itemIndex = tmpItemIndex;
                        }
 
                        if (event.type == SWT.MouseWheel) {
                                int size = getItems().size();
-                               if (null != downArrowButton && null != upArrowButton) {
+                               if (null != downArrowButton && !downArrowButton.isDisposed()
+                                               && null != upArrowButton && !upArrowButton.isDisposed()) {
                                        if (event.count < 0) {
-                                               if (itemIndex - event.count + MAX_SIZE >= size - 1) {
-                                                       itemIndex = size - MAX_SIZE;
-                                                       downArrowButton.setEnabled(false);
+                                               if (tmpItemIndex - event.count + MAX_SIZE >= size - 1) {
+                                                       tmpItemIndex = size - MAX_SIZE;
+                                                       downArrowButton.setButtonEnabled(false);
                                                } else {
-                                                       itemIndex -= event.count;
+                                                       tmpItemIndex -= event.count;
                                                }
 
-                                               // if (itemIndex - pageSize > 0) {
-                                               if (itemIndex > 0) {
-                                                       upArrowButton.setEnabled(true);
+                                               if (tmpItemIndex > 0) {
+                                                       upArrowButton.setButtonEnabled(true);
                                                }
                                        } else {
 
-                                               if (itemIndex - event.count < 0) {
-                                                       itemIndex = 0;
-                                                       upArrowButton.setEnabled(false);
+                                               if (tmpItemIndex - event.count < 0) {
+                                                       tmpItemIndex = 0;
+                                                       upArrowButton.setButtonEnabled(false);
                                                } else {
-                                                       itemIndex -= event.count;
+                                                       tmpItemIndex -= event.count;
                                                }
 
-                                               if (itemIndex + event.count < size - 1) {
-                                                       downArrowButton.setEnabled(true);
+                                               if (tmpItemIndex + event.count < size - 1) {
+                                                       downArrowButton.setButtonEnabled(true);
                                                }
                                        }
                                        popup.redraw();
                                }
                        }
+
+                       if (event.type == SWT.MouseExit) {
+                               Canvas canvas = (Canvas) event.widget;
+                               Rectangle rect = canvas.getClientArea();
+                               if (event.x < rect.x || event.x > rect.x + rect.width) {
+                                       closePopup(CLOSE_WAITING_TIME);
+                               }
+                       }
+
+                       if (event.type == SWT.MouseEnter) {
+                               if (null != closeTimer) {
+                                       closeTimer.cancel();
+                                       closeTimer = null;
+                               }
+                       }
                }
        };
 
@@ -560,6 +510,16 @@ public class DACustomCombo extends Canvas {
                        if (isImageCombo()) {
                                setBackgroundImage(images.get(STATE_DISABLE));
                        }
+
+                       Display.getDefault().syncExec(new Runnable() {
+                               @Override
+                               public void run() {
+                                       if (null != childShell && !childShell.isDisposed()) {
+                                               childShell.close();
+                                               childShell = null;
+                                       }
+                               }
+                       });
                }
        }
 
@@ -568,10 +528,10 @@ public class DACustomCombo extends Canvas {
                @Override
                public void paintControl(PaintEvent e) {
                        if (!isImageCombo()) {
-                               comboRenderer.draw(e.gc, combo, text, state);
+                               comboRenderer.draw(e.gc, combo, text, titleAlign, font, state);
                        } else {
                                comboRenderer.drawImage(e.gc, combo, images.get(state), text,
-                                               state);
+                                               titleAlign, font, state);
                        }
                }
        };
@@ -584,10 +544,6 @@ public class DACustomCombo extends Canvas {
                popupRenderer = newRenderer;
        }
 
-       // public void removeAll() {
-       // getItems().clear();
-       // }
-
        public void add(String item) {
                if (dirty) {
                        getItems().add(item);
@@ -607,7 +563,7 @@ public class DACustomCombo extends Canvas {
                if (getItems().size() > 0) {
                        return getItems().get(index);
                }
-               return ""; //$NON-NLS-1$
+               return DAWidgetConstants.EMPTY_STRING;
        }
 
        public void setImages(Image normal, Image hover, Image push, Image disable) {
@@ -638,18 +594,109 @@ public class DACustomCombo extends Canvas {
                return imgCombo;
        }
 
-       private Listener upButtonMouseExitListener = new Listener() {
+       private Listener upButtonMouseListener = new Listener() {
 
                @Override
                public void handleEvent(Event event) {
+                       DACustomButton upButton = (DACustomButton) event.widget;
+                       Rectangle rect = upButton.getBounds();
+
+                       if (event.type == SWT.MouseExit) {
+                               if (event.y < rect.y || event.x < rect.x
+                                               || event.x > rect.x + rect.width) {
+                                       closePopup(CLOSE_WAITING_TIME);
+                               }
+                       }
+
+                       if (event.type == SWT.MouseEnter) {
+                               if (null != closeTimer) {
+                                       closeTimer.cancel();
+                                       closeTimer = null;
+                               }
+                       }
+
+                       if (event.type == SWT.MouseUp) {
+                               if (!upArrowButton.isButtonEnabled()) {
+                                       return;
+                               }
+
+                               if (null != upArrowButton) {
+                                       Rectangle rectangle = upArrowButton.getBounds();
+                                       int x = event.x;
+                                       int y = event.y;
+
+                                       if (x < 0 || x > rectangle.width || y < 0
+                                                       || y > rectangle.height) {
+                                               return;
+                                       }
+                               }
+
+                               int size = getItems().size();
+                               if (tmpItemIndex - pageSize < 0) {
+                                       tmpItemIndex = 0;
+                                       upArrowButton.setButtonEnabled(false);
+                               } else {
+                                       tmpItemIndex -= pageSize;
+                               }
+
+                               if (tmpItemIndex + pageSize < size - 1) {
+                                       downArrowButton.setButtonEnabled(true);
+                               }
+                               popup.redraw();
+                       }
                }
        };
 
-       private Listener downButtonMouseExitListener = new Listener() {
+       private Listener downButtonMouseListener = new Listener() {
 
                @Override
                public void handleEvent(Event event) {
+                       DACustomButton upButton = (DACustomButton) event.widget;
+                       Rectangle rect = upButton.getClientArea();
+
+                       if (event.type == SWT.MouseExit) {
+                               if (event.y > rect.y || event.x < rect.x
+                                               || event.x > rect.x + rect.width) {
+                                       closePopup(CLOSE_WAITING_TIME);
+                               }
+                       }
 
+                       if (event.type == SWT.MouseEnter) {
+                               if (null != closeTimer) {
+                                       closeTimer.cancel();
+                                       closeTimer = null;
+                               }
+                       }
+
+                       if (event.type == SWT.MouseUp) {
+                               if (!downArrowButton.isButtonEnabled()) {
+                                       return;
+                               }
+
+                               if (null != downArrowButton) {
+                                       Rectangle rectangle = downArrowButton.getBounds();
+                                       int x = event.x;
+                                       int y = event.y;
+
+                                       if (x < 0 || x > rectangle.width || y < 0
+                                                       || y > rectangle.height) {
+                                               return;
+                                       }
+                               }
+
+                               int size = getItems().size();
+                               if (tmpItemIndex + pageSize + MAX_SIZE >= size - 1) {
+                                       tmpItemIndex = size - MAX_SIZE;
+                                       downArrowButton.setButtonEnabled(false);
+                               } else {
+                                       tmpItemIndex += pageSize;
+                               }
+
+                               if (tmpItemIndex > 0) {
+                                       upArrowButton.setButtonEnabled(true);
+                               }
+                               popup.redraw();
+                       }
                }
        };
 
@@ -659,6 +706,7 @@ public class DACustomCombo extends Canvas {
 
        public void initCombo() {
                getItems().clear();
+               tmpItemIndex = 0;
                itemIndex = 0;
                selection = 0;
                items.add(DAWidgetConstants.EMPTY_STRING);
@@ -729,6 +777,7 @@ public class DACustomCombo extends Canvas {
                if (null != buttonRenderer) {
                        button.setRenderer(buttonRenderer);
                }
+
                return button;
        }
 
@@ -751,4 +800,29 @@ public class DACustomCombo extends Canvas {
                }
                return true;
        }
+
+       public void closePopup(int interval) {
+               closeTimer = new Timer();
+               closeTimer.schedule(new TimerTask() {
+                       public void run() {
+                               Display.getDefault().syncExec(new Runnable() {
+                                       @Override
+                                       public void run() {
+                                               if (null != childShell && !childShell.isDisposed()) {
+                                                       childShell.close();
+                                                       childShell = null;
+                                               }
+                                       }
+                               });
+                       }
+               }, interval, interval);
+       }
+
+       public void setTextAlign(int align) {
+               this.titleAlign = align;
+       }
+
+       public void setFont(Font font) {
+               this.font = font;
+       }
 }
index 46e7efa..d777255 100644 (file)
@@ -27,6 +27,7 @@
 package org.tizen.dynamicanalyzer.widgets.combo;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
@@ -34,11 +35,10 @@ import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Canvas;
 import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
 
-
 public class DACustomComboDefaultRenderer extends DACustomComboRenderer {
 
        @Override
-       public void draw(GC gc, Canvas canvas, String text, int state) {
+       public void draw(GC gc, Canvas canvas, String text, int textAlign, Font font, int state) {
                Rectangle rect = canvas.getClientArea();
                if (state == DACustomCombo.STATE_NORMAL) {
                        gc.setBackground(ColorResources.WINDOW_BG_COLOR);
@@ -49,6 +49,7 @@ public class DACustomComboDefaultRenderer extends DACustomComboRenderer {
                } else if (state == DACustomCombo.STATE_DISABLE) {
                        gc.setBackground(ColorResources.BAR_GRAY1);
                }
+               
                gc.fillRectangle(rect);
                gc.drawRectangle(rect.x, rect.y, rect.width - 20, rect.height - 1);
 
@@ -56,7 +57,15 @@ public class DACustomComboDefaultRenderer extends DACustomComboRenderer {
                        text = ""; //$NON-NLS-1$
                }
                Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-               gc.drawString(text, 5, (rect.height - p.y)/2, true);
+               int textX = 0;
+               if (textAlign == DACustomCombo.TEXT_ALIGN_LEFT) {
+                       textX = 5;
+               } else if (textAlign == DACustomCombo.TEXT_ALIGN_RIGHT) {
+                       textX = rect.width - p.x;
+               } else {
+                       textX = (rect.width / 2) - (p.x / 2);
+               }
+               gc.drawString(text, textX, (rect.height - p.y) / 2, true);
                gc.fillRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
                gc.drawRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
        }
@@ -64,12 +73,11 @@ public class DACustomComboDefaultRenderer 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 state) {
+                       int textAlign, Font font, int state) {
 
        }
 
index 8a01fa5..45f1fbd 100644 (file)
@@ -7,7 +7,7 @@
  * Jooyoul Lee <jy.exe.lee@samsung.com>
  * Juyoung Kim <j0.kim@samsung.com>
  *
 * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
  *
 
 package org.tizen.dynamicanalyzer.widgets.combo;
 
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Canvas;
 
 public abstract class DACustomComboRenderer {
-       public abstract void draw(GC gc, Canvas canvas, String text, 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 state);
+       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);
 }
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/contextMenu/ContextMenu.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/contextMenu/ContextMenu.java
new file mode 100644 (file)
index 0000000..725eb94
--- /dev/null
@@ -0,0 +1,538 @@
+/*
+ *  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.widgets.contextMenu;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+/**
+ * Newly implemented contextMenuItem class
+ * 
+ * @author ParkHyunJong
+ * 
+ */
+public class ContextMenu {
+
+       public static final int STATE_NORMAL = 0;
+       public static final int STATE_PUSH = 1;
+       public static final int STATE_HOVER = 2;
+       public static final int STATE_DISABLE = 3;
+
+       private final int DEFAULT_HEIGHT = 24;
+       private final int CHARACTER_WIDTH_PIXEL = 8;
+       private final int STORKE_PIXEL = 2;
+       private final int STAUES_ITEMS_CHECK_TIME = 500;
+       private final int ADJUSTED_CONTEXT_MENU_POINT = 5;
+
+       private int menuShellWidth = 25;
+       private int titleHeight = 0;
+       private String title = null;
+       private Font titleFont = null;
+       private Color titleFontColor = null;
+       private Color titleBacgroundColor = null;
+
+       public static final int MOUSE_LEFT = 1;
+       public static final int MOUSE_RIGHT = 3;
+       private static Shell lastMenuShell = null;
+       private Shell menuShell = null;
+       private Shell parentShell = null;
+       private Composite menuComp = null;
+       private Composite menuTitleComp = null;
+       private Composite parentComp = null;
+       private Rectangle parentArea = null;
+       private Timer checkEableTimer = null;
+       private List<DAContextMenuItem> itemList = null;
+       private Font itemFont = null;
+
+       /**
+        * create contextMenu Shell and Composite, add mouse listeners - mouse down.<br>
+        */
+       private void setDefaultSetting() {
+               if (null != menuShell) {
+                       return;
+               }
+               menuShell = new Shell(parentShell, SWT.NO_TRIM);
+               menuShell.setLayout(new FillLayout());
+               menuComp = new Composite(menuShell, SWT.NONE);
+               menuComp.addPaintListener(new PaintListener() {
+
+                       @Override
+                       public void paintControl(PaintEvent e) {
+                               // TODO Auto-generated method stub
+                               e.gc.setForeground(ColorResources.CONTEXT_MENU_STORKE_IN);
+                               e.gc.drawRectangle(menuComp.getBounds().x + STORKE_PIXEL - 1,
+                                               menuComp.getBounds().y + STORKE_PIXEL - 1,
+                                               menuComp.getBounds().width - 3,
+                                               menuComp.getBounds().height - 3);
+                       }
+               });
+
+               menuComp.setLayout(new FormLayout());
+               menuComp.setBackground(ColorResources.CONTEXT_MENU_STORKE_OUT);
+               parentComp.addMouseListener(new MouseListener() {
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+
+                       @Override
+                       public void mouseDown(MouseEvent event) {
+                               // TODO Auto-generated method stub
+                               switch (event.button) {
+                               case MOUSE_LEFT: {
+                                       disappearContextMenu();
+                                       break;
+                               }
+                               case MOUSE_RIGHT: {
+                                       if (null != parentArea) {
+                                               if (event.x > parentArea.x && event.y > parentArea.y
+                                                               && event.x < parentArea.x + parentArea.width
+                                                               && event.y < parentArea.y + parentArea.height) {
+                                                       open();
+                                               }
+                                       } else {
+                                               open();
+                                       }
+                                       break;
+                               }
+                               default: {
+                                       break;
+                               }
+                               }
+                       }
+
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+
+       }
+
+       /**
+        * generated Title area of context menu
+        */
+       public void setTitleComposite() {
+               if (getTitle().length() > 0) {
+                       menuTitleComp = new Composite(menuComp, SWT.NONE);
+                       menuTitleComp.addPaintListener(new PaintListener() {
+                               @Override
+                               public void paintControl(PaintEvent e) {
+                                       // TODO Auto-generated method stub
+                                       e.gc.setForeground(getTitleFontColor());
+                                       if (null != getTitleFont()) {
+                                               e.gc.setFont(getTitleFont());
+                                       }
+                                       e.gc.drawString(getTitle(), 5, getTitleHeight() / 6);
+                               }
+                       });
+
+                       menuTitleComp.setLayout(new FormLayout());
+                       menuTitleComp.setBackground(getTitleBacgroundColor());
+                       FormData compData = new FormData();
+                       compData.top = new FormAttachment(STORKE_PIXEL + 1, 0);
+                       compData.left = new FormAttachment(STORKE_PIXEL + 1, 0);
+                       compData.right = new FormAttachment(100, -STORKE_PIXEL - 1);
+                       compData.bottom = new FormAttachment(menuShellWidth - 4, 0);
+                       menuTitleComp.setLayoutData(compData);
+               }
+       }
+
+       /**
+        * Construct a new instance of this class.<br>
+        * 
+        * @param parent
+        *            a composite control which will be the parent of the new
+        *            instance (cannot be bull)
+        */
+       public ContextMenu(Composite parent) {
+               parentComp = parent;
+               parentShell = parent.getShell();
+               setDefaultSetting();
+       }
+
+       /**
+        * Get contextMenu Shell.<br>
+        * 
+        * @return contextMenu Shell
+        */
+       public Shell getShell() {
+               return menuShell;
+       }
+
+       /**
+        * Get contextMenu composite.<br>
+        * 
+        * @return contextMenu composite
+        */
+       public Composite getComposite() {
+               return this.menuComp;
+       }
+
+       /**
+        * implementation item mouse listeners event.<br>
+        */
+       protected Listener itemMouseListener = new Listener() {
+               @Override
+               public void handleEvent(Event event) {
+
+                       DAContextMenuItem itme = (DAContextMenuItem) event.widget;
+                       if (event.type == SWT.MouseUp) {
+                               switch (event.button) {
+                               case MOUSE_LEFT: {
+                                       if (itme.getState() != STATE_DISABLE) {
+                                               disappearContextMenu();
+                                       }
+                                       break;
+                               }
+                               default: {
+                                       break;
+                               }
+                               }
+                       }
+               }
+       };
+
+       /**
+        * disappear contextMenu
+        */
+       public void disappearContextMenu() {
+               if(!menuShell.isDisposed()) {
+                       menuShell.setVisible(false);
+               }
+       }
+
+       /**
+        * Appear contextMenu when click mouse leftButton.<br>
+        * 
+        * @param x
+        *            The value of x of the right mouse button to click
+        * @param y
+        *            The value of y of the right mouse button to click
+        */
+       public void open(int x, int y) {
+               if (null == lastMenuShell) {
+                       lastMenuShell = menuShell;
+               } else {
+                       lastMenuShell.setVisible(false);
+                       lastMenuShell = menuShell;
+               }
+
+               if (null == menuShell) {
+                       setDefaultSetting();
+                       lastMenuShell = menuShell;
+
+               }
+
+               setTitleComposite();
+
+               if (getItems() == null) {
+                       menuShell.setSize(CHARACTER_WIDTH_PIXEL, DEFAULT_HEIGHT
+                                       + (getTitleHeight()));
+               } else {
+                       int shellHeight = (DEFAULT_HEIGHT * getItems().size())
+                                       + (STORKE_PIXEL * 2) + (getTitleHeight());
+                       if (getTitle().length() >= itemLongestTextLenght()) {
+                               menuShellWidth = getTitle().length() * CHARACTER_WIDTH_PIXEL;
+                       } else {
+                               menuShellWidth = itemLongestTextLenght()
+                                               * CHARACTER_WIDTH_PIXEL;
+                       }
+                       menuShell.setSize(menuShellWidth, shellHeight);
+               }
+
+               menuShell.setLocation(x, y);
+               menuShell.setVisible(true);
+
+               if (checkEableTimer != null) {
+                       checkEableTimer.cancel();
+                       checkEableTimer = null;
+               }
+               disposeContextMenu(STAUES_ITEMS_CHECK_TIME);
+       }
+
+       /**
+        * Get the coordinates of the mouse click.<br>
+        * 
+        * @return Point object of coordinates of the mouse click
+        */
+       private Point computeContextMenuLocation() {
+               Display display = Display.getCurrent();
+               if (null == display) {
+                       display = Display.getDefault();
+               }
+               Point pt = Display.getCurrent().getCursorLocation();
+               return pt;
+       }
+
+       /**
+        * Show the ContextMenu when click the right button.<br>
+        */
+       public void open() {
+               Point pt = computeContextMenuLocation();
+               pt.x = pt.x -= ADJUSTED_CONTEXT_MENU_POINT;
+               pt.y = pt.y -= ADJUSTED_CONTEXT_MENU_POINT;
+               open(pt.x, pt.y);
+       }
+
+       /**
+        * Periodically check the focus has been on the context Menu.<br>
+        * 
+        * @param milliseconds
+        *            Set the time to check regularly.
+        */
+       public void disposeContextMenu(int milliseconds) {
+               this.checkEableTimer = new Timer();
+               this.checkEableTimer.schedule(new TimerTask() {
+                       public void run() {
+                               Display.getDefault().syncExec(new Runnable() {
+                                       @Override
+                                       public void run() {
+                                               Rectangle rt = menuShell.getBounds();
+                                               Point pt = Display.getCurrent().getCursorLocation();
+                                               if (false == rt.contains(pt)) {
+                                                       if (checkEableTimer != null) {
+                                                               checkEableTimer.cancel();
+                                                               checkEableTimer = null;
+                                                       }
+                                                       disappearContextMenu();
+                                               }
+                                       }
+                               });
+                       }
+               }, milliseconds, milliseconds);
+       }
+
+       /**
+        * Register the DAContextMenuItem to the contextMenu.<br>
+        * 
+        * @param item
+        *            contextMenu item object
+        */
+       public void addItem(DAContextMenuItem item) {
+               if (itemList == null) {
+                       itemList = new ArrayList<DAContextMenuItem>();
+               }
+
+               FormData compData = new FormData();
+               if (getItems() == null) {
+                       compData.top = new FormAttachment(0, STORKE_PIXEL
+                                       + getTitleHeight());
+               } else {
+                       compData.top = new FormAttachment(0, DEFAULT_HEIGHT
+                                       * getItems().size() + STORKE_PIXEL + getTitleHeight());
+               }
+               compData.left = new FormAttachment(0, STORKE_PIXEL);
+               compData.right = new FormAttachment(100, -STORKE_PIXEL);
+               compData.height = DEFAULT_HEIGHT;
+               item.setLayoutData(compData);
+               if (itemFont != null) {
+                       item.setFont(this.itemFont);
+               }
+               itemList.add(item);
+               item.addListener(SWT.MouseUp, itemMouseListener);
+       }
+
+       /**
+        * Get the DAContextMenuItem.<br>
+        * 
+        * @return contextMenu items list
+        */
+       public List<DAContextMenuItem> getItems() {
+               if (itemList == null) {
+                       itemList = new ArrayList<DAContextMenuItem>();
+               }
+               return itemList;
+       }
+
+       /**
+        * get The text length of the longest item
+        * 
+        * @return text length
+        */
+       public int itemLongestTextLenght() {
+               int lenght = 0;
+               if (getItems() == null) {
+                       return lenght;
+               }
+               for (DAContextMenuItem item : getItems()) {
+                       if (lenght < item.getText().length()) {
+                               lenght = item.getText().length();
+                       }
+               }
+               return lenght;
+       }
+
+       /**
+        * set parent area
+        * 
+        * @param area
+        *            parent area
+        */
+       public void setParentArea(Rectangle area) {
+               parentArea = area;
+       }
+
+       /**
+        * Sets the font of the contxtImtes text.
+        * 
+        * @param font
+        *            The font of the contextItem text.
+        */
+       public void setFont(Font font) {
+               this.itemFont = font;
+               for (DAContextMenuItem item : getItems()) {
+                       item.setFont(font);
+               }
+       }
+
+       /**
+        * get the height of the title area
+        * 
+        * @return height
+        */
+       public int getTitleHeight() {
+               return titleHeight;
+       }
+
+       /**
+        * set the height of the title area
+        * 
+        * @param contextMenuTitleHeight
+        *            height
+        */
+       public void setTitleHeight(int contextMenuTitleHeight) {
+               this.titleHeight = contextMenuTitleHeight;
+       }
+
+       /**
+        * get the title name
+        * 
+        * @return the title name
+        */
+       public String getTitle() {
+               if (title == null) {
+                       return "";//$NON-NLS-1$
+               }
+               return title;
+       }
+
+       /**
+        * set the title name
+        * 
+        * @param title
+        *            the title name
+        */
+       public void setTitle(String title) {
+               this.title = title;
+               setTitleHeight(15);
+       }
+
+       /**
+        * get the title font
+        * 
+        * @return the title font
+        */
+       public Font getTitleFont() {
+               return titleFont;
+       }
+
+       /**
+        * set the title font
+        * 
+        * @param titleFont
+        *            the title font
+        */
+       public void setTitleFont(Font titleFont) {
+               this.titleFont = titleFont;
+       }
+
+       /**
+        * get color of the title font
+        * 
+        * @return color
+        */
+       public Color getTitleFontColor() {
+               if (titleFontColor == null) {
+                       titleFontColor = ColorResources.CONTEXT_MENU_TITLE_FONT_COLOR;
+               }
+               return titleFontColor;
+       }
+
+       /**
+        * set color of the title font
+        * 
+        * @param titleFontColor
+        *            color
+        */
+       public void setTitleFontColor(Color titleFontColor) {
+               this.titleFontColor = titleFontColor;
+       }
+
+       /**
+        * get The background color of the title
+        * 
+        * @return The background color
+        */
+       public Color getTitleBacgroundColor() {
+               if (titleBacgroundColor == null) {
+                       titleBacgroundColor = ColorResources.CONTEXT_MENU_TITLE_BACKGROUND_COLOR;
+               }
+               return titleBacgroundColor;
+       }
+
+       /**
+        * set The background color of the title
+        * 
+        * @param titleBacgroundColor
+        *            The background color
+        */
+       public void setTitleBacgroundColor(Color titleBacgroundColor) {
+               this.titleBacgroundColor = titleBacgroundColor;
+       }
+}
index eb53388..004f1f0 100644 (file)
@@ -41,10 +41,6 @@ import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
 public class DAContextMenuItem extends DACustomButton {
        private double doubleData;
 
-       private int seriesIndex = -1;
-       private int eventListStartIndex = -1;
-       private int eventListEndIndex = -1;
-
        /**
         * Constructs a new instance of this class given its menu and style value
         * describing its behavior and appearance.
@@ -63,7 +59,7 @@ public class DAContextMenuItem extends DACustomButton {
         * @param style
         *            the style of control to construct
         */
-       public DAContextMenuItem(DAContextMenu menu) {
+       public DAContextMenuItem(ContextMenu menu) {
                super(menu.getComposite(), SWT.NONE);
                setDefaultSetting();
                menu.addItem(this);
@@ -123,28 +119,4 @@ public class DAContextMenuItem extends DACustomButton {
        public void setDoubleData(double data) {
                doubleData = data;
        }
-
-       public int getSeriesIndex() {
-               return seriesIndex;
-       }
-
-       public void setSeriesIndex(int index) {
-               seriesIndex = index;
-       }
-
-       public int getEventListStartintdex() {
-               return eventListStartIndex;
-       }
-
-       public void setEventListStartIndex(int index) {
-               eventListStartIndex = index;
-       }
-
-       public double getEventListEndIndex() {
-               return eventListEndIndex;
-       }
-
-       public void setEventListEndIndex(int index) {
-               eventListEndIndex = index;
-       }
 }
index a13d864..01b0613 100644 (file)
@@ -41,7 +41,7 @@ public abstract class DAContextMenuListener implements Listener {
         * listener of contextMenu 
         */
        public void handleEvent(Event event) {
-               if (event.button == DAContextMenu.MOUSE_RIGHT) {
+               if (event.button == ContextMenu.MOUSE_RIGHT) {
                        return;
                }
                DAContextMenuItem item = (DAContextMenuItem) event.widget;
index 49ef2e2..234bddd 100644 (file)
@@ -122,6 +122,8 @@ public class ColorResources {
        
        
        /*** context menu colors ***/
+       public static Color CONTEXT_MENU_TITLE_BACKGROUND_COLOR = getColor("context_menu_title_background_color", new RGB(247, 247, 247)); //$NON-NLS-1$
+       public static Color CONTEXT_MENU_TITLE_FONT_COLOR = getColor("context_menu_title_font_color", new RGB(70, 70, 70)); //$NON-NLS-1$
        public static Color CONTEXT_MENU_STATUS_NORMAL_COLOR = getColor("context_menu_status_normal_color", new RGB(230, 230, 230)); //$NON-NLS-1$);
        public static Color CONTEXT_MENU_STATUS_PUSH_COLOR = getColor("context_menu_status_push_color", new RGB(50, 185, 231)); //$NON-NLS-1$
        public static Color CONTEXT_MENU_STATUS_HOVER_COLOR = getColor("context_menu_status_hover_color", new RGB(230, 230, 230)); //$NON-NLS-1$
index 7100ca3..421f2e6 100644 (file)
@@ -99,7 +99,9 @@ public class FontResources {
        public static final Font TIMELINE_FONT = getFont(
                        "table_font", resizeSystemFont(8));//$NON-NLS-1$
        public static final Font TIMELINE_TICK_FONT = getFont(
-                       "time_tick", resizeSystemFont(7));//$NON-NLS-1$
+                       "time_tick", resizeSystemFont(6));//$NON-NLS-1$
+       public static final Font TIMELINE_BALLOON_FONT = getFont(
+                       "time_balloon", resizeSystemFont(7));//$NON-NLS-1$
 
        public static final Font CIRCULAR_GRAPH_FONT = getFont(
                        "circular_graph_font", resizeSystemFont(13));//$NON-NLS-1$
index 9f2851b..7c5785b 100644 (file)
@@ -347,29 +347,61 @@ public class Formatter {
                return value;
        }
        
-       public static String toByteFormatConvert(double input){
-               char[] c = new char[]{'K', 'M', 'G', 'T'};
+       public static String toByteFormatConvertDecimalPrefix(double input){
+               String[] units = new String[]{"K", "M", "G", "T"};
+               long k = 1000;
+               String unit = "";
+               long quotient = (long)input;
+               long remainder = ((long)(input*(double)k)) % k;
+               String ret;
+               
+               long n = k;
+               for(int i=0; i<units.length; i++){
+                       if(input < n){
+                               break;
+                       }
+                       remainder = quotient % k;
+                       quotient /= k;
+                       unit = units[i];
+                       n *= k;
+               }
+               if(0 == remainder || unit.equals("")){
+                       ret = String.format("%d",quotient);
+               }
+               else{
+                       remainder /= 100;
+                       remainder = Math.round(remainder);
+                       ret = String.format("%d.%d%s", quotient,remainder,unit);
+               }
+               return ret;
+       }
+       
+       public static String toByteFormatConvertBinaryPrefix(double input){
+               String[] units = new String[]{"Ki", "Mi", "Gi", "Ti"};
                long k = 1024;
-               char unit = ' ';
+               String unit = "";
                long quotient = (long)input;
                long remainder = ((long)(input*(double)k)) % k;
                String ret;
                
                long n = k;
-               for(int i=0; i<c.length; i++){
+               for(int i=0; i<units.length; i++){
                        if(input < n){
                                break;
                        }
                        remainder = quotient % k;
                        quotient /= k;
-                       unit = c[i];
+                       unit = units[i];
                        n *= k;
                }
-               if(0 == remainder || unit == ' '){
+               if(0 == remainder || unit.equals("")){
                        ret = String.format("%d",quotient);
                }
                else{
-                       ret = String.format("%d.%d%c", quotient,remainder,unit);
+                       remainder /= 100;
+                       remainder = Math.round(remainder);
+                       ret = String.format("%d.%d%s", quotient,remainder,unit);
+                       ret = String.format("%d.%d%s", quotient,remainder,unit);
                }
                return ret;
        }
index f7457fa..5a12dde 100644 (file)
@@ -131,6 +131,16 @@ public class ImageResources {
        public static final Image STOP_PROGRESS_LOADING_07 = getPngImage("loading_icon_07"); //$NON-NLS-1$
        public static final Image STOP_PROGRESS_LOADING_08 = getPngImage("loading_icon_08"); //$NON-NLS-1$
 
+       // ui event dialog
+       public static final Image UIEVENT_DIALOG_START_NORMAL = getPngImage("event_list_start_normal"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_START_HOVER = getPngImage("event_list_start_hover"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_START_SELECTED_NORMAL = getPngImage("event_list_start_selected_normal"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_START_SELECTED_HOVER = getPngImage("event_list_start_selected_hover"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_END_NORMAL = getPngImage("event_list_end_normal"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_END_HOVER = getPngImage("event_list_end_hover"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_END_SELECTED_NORMAL = getPngImage("event_list_end_selected_normal"); //$NON-NLS-1$
+       public static final Image UIEVENT_DIALOG_END_SELECTED_HOVER = getPngImage("event_list_end_selected_hover"); //$NON-NLS-1$
+
        private static Image getImage(String folderName, String imageName,
                        String extension) {
                // if (null == imageRegistry.get(imageName)
index c354aca..b14dc26 100644 (file)
@@ -35,20 +35,24 @@ import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimelineRenderer;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimelineRenderer;
 
 public class LifecycleBar extends Canvas {
        public static final int HEIGHT = 4;
        private double visibleStartTime = 0;
        private double totalEndTime = 0;
-       private int scale = DACustomTimeline.SCALE_100;
-       private List<LifecycleData> lifecycleDataList = new ArrayList<LifecycleData>();
+       private int scale = DATimeline.SCALE_100;
+       private ArrayList<LifecycleData> lifecycleDataList = new ArrayList<LifecycleData>();
 
        private PaintListener paintListener = new PaintListener() {
                @Override
                public void paintControl(PaintEvent e) {
-                       for (LifecycleData lifecycleData : lifecycleDataList) {
+                       @SuppressWarnings("unchecked")
+                       List<LifecycleData> cloneList = (List<LifecycleData>) lifecycleDataList
+                                       .clone();
+
+                       for (LifecycleData lifecycleData : cloneList) {
                                double startTime = lifecycleData.getStartTime();
                                int startPx = (int) secondToPixcel(startTime);
                                double endTime = lifecycleData.getEndTime();
@@ -83,6 +87,18 @@ public class LifecycleBar extends Canvas {
                this.visibleStartTime = visibleStartTime;
        }
 
+       public double getEndTime() {
+               double endTime = 0;
+               int dataSize = lifecycleDataList.size();
+               if (dataSize > 0) {
+                       endTime = lifecycleDataList.get(dataSize - 1).getStartTime();
+               }
+               if (endTime < totalEndTime) {
+                       endTime = totalEndTime;
+               }
+               return endTime;
+       }
+
        public void setTotalEndTime(double totalEndTime) {
                this.totalEndTime = totalEndTime;
                redraw();
@@ -134,11 +150,11 @@ public class LifecycleBar extends Canvas {
 
        private double secondToPixcel(double second) {
                return (second - visibleStartTime) * scale
-                               * DACustomTimelineRenderer.DEFAULT_INTERVAL;
+                               * DATimelineRenderer.DEFAULT_INTERVAL;
        }
 
        private double pixcelToSecond(int pixcel) {
-               return (double) pixcel / scale
-                               / DACustomTimelineRenderer.DEFAULT_INTERVAL + visibleStartTime;
+               return (double) pixcel / scale / DATimelineRenderer.DEFAULT_INTERVAL
+                               + visibleStartTime;
        }
 }
index 21005fd..c663615 100644 (file)
@@ -99,7 +99,7 @@ public class TestClass {
                                ImageResources.VIEW_SOURCE, ImageResources.VIEW_SOURCE_PUSH,
                                ImageResources.VIEW_SOURCE_HOVER,
                                ImageResources.VIEW_SOURCE_DISABLE,
-                               ImageResources.VIEW_SOURCE_TOGGLE, 
+                               ImageResources.VIEW_SOURCE_TOGGLE,
                                ImageResources.VIEW_SOURCE_HOVER);
                imgToggle.setText("toggle");
                data = new FormData();
@@ -184,14 +184,13 @@ public class TestClass {
                scale.setMaximum(10);
                scale.setMinimum(5);
                scale.addSelectionListener(new DAScaleSelectionListener() {
-                       
+
                        @Override
                        public void widgetSelected() {
                                System.out.println("test selection listener");
-                               
+
                        }
                });
-               
 
                DACustomComboSelectionListener comboSelectionListener = new DACustomComboSelectionListener() {
                        @Override
@@ -203,8 +202,9 @@ public class TestClass {
                combo.addSelectionListener(comboSelectionListener);
 
                while (!shell.isDisposed()) {
-                       if (!display.readAndDispatch())
+                       if (!display.readAndDispatch()) {
                                display.sleep();
+                       }
                }
                clock.stop();
                display.dispose();
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimeline.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimeline.java
new file mode 100644 (file)
index 0000000..67b9267
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * 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.widgets.timeline;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DATimeline extends Canvas {
+       public final static int SCALE_100 = 1;
+       public final static int SCALE_400 = 4;
+       public final static int SCALE_800 = 8;
+       private double startTime = 0;
+       private int scale = SCALE_100;
+
+       List<Double> stickyTimeList = new ArrayList<Double>();
+       private double totalEndTime = 0;
+
+       private boolean drawDetailedTime = false;
+       private double detailedTime;
+       private int detailedTimePosition;
+
+       private DATimelineRenderer timelineRenderer = new DATimelineRenderer();
+       private DATimelineMarker startRangeMarker = new DATimelineMarker(
+                       ImageResources.RANGE_MARKER_START,
+                       ImageResources.RANGE_MARKER_START_PUSH);
+       private DATimelineMarker endRangeMarker = new DATimelineMarker(
+                       ImageResources.RANGE_MARKER_END,
+                       ImageResources.RANGE_MARKER_END_PUSH);
+
+       public DATimeline(Composite parent) {
+               super(parent, SWT.NONE);
+               this.addPaintListener(chartPaintListener);
+               this.addMouseListener(new RangeMarkerMouseEventListener());
+               this.addMouseMoveListener(new RangeMarkerMouseMoveEventListener());
+       }
+
+       public double getStartTime() {
+               return startTime;
+       }
+
+       public void setStartTime(double startTime) {
+               this.startTime = startTime;
+       }
+
+       public int getScale() {
+               return scale;
+       }
+
+       public void setScale(int scale) {
+               this.scale = scale;
+       }
+
+       public DATimelineMarker getStartRangeMarker() {
+               return startRangeMarker;
+       }
+
+       public DATimelineMarker getEndRangeMarker() {
+               return endRangeMarker;
+       }
+
+       private PaintListener chartPaintListener = new PaintListener() {
+               @Override
+               public void paintControl(PaintEvent e) {
+                       timelineRenderer.draw(e.gc, (DATimeline) e.widget);
+               }
+       };
+
+       public void setDrawDetailedTime(boolean draw) {
+               drawDetailedTime = draw;
+       }
+
+       public boolean getDrawDetailedTime() {
+               return drawDetailedTime;
+       }
+
+       public void setDetailedTime(double detailedTime) {
+               this.detailedTime = detailedTime;
+       }
+
+       public double getDetailedTime() {
+               return detailedTime;
+       }
+
+       public void setDetailedTimePosition(int position) {
+               this.detailedTimePosition = position;
+       }
+
+       public int getDetailedTimePosition() {
+               return detailedTimePosition;
+       }
+
+       private double secondToPixcel(double second) {
+               return (second - startTime) * scale
+                               * DATimelineRenderer.DEFAULT_INTERVAL;
+       }
+
+       private double pixcelToSecond(int pixcel) {
+               return (double) pixcel / scale
+                               / DATimelineRenderer.DEFAULT_INTERVAL + startTime;
+       }
+
+       public void setTotalEndTime(double time) {
+               totalEndTime = time;
+       }
+
+       public void addStickyTime(double time) {
+               stickyTimeList.add(time);
+       }
+
+       public Font getTimeTickFont() {
+               return timelineRenderer.getTimeTickFont();
+       }
+
+       public void setTimeTickFont(Font font) {
+               timelineRenderer.setTimeTickFont(font);
+       }
+
+       public Font getTimeBalloonFont() {
+               return timelineRenderer.getTimeBalloonFont();
+       }
+
+       public void setTimeBalloonFont(Font font) {
+               timelineRenderer.setTimeBalloonFont(font);
+       }
+
+       public void clear() {
+               setStartTime(0);
+               stickyTimeList.clear();
+       }
+
+       private class RangeMarkerMouseEventListener extends MouseAdapter {
+               public void mouseDown(MouseEvent e) {
+                       double startMarkerPosition = secondToPixcel(startRangeMarker
+                                       .getTime());
+                       double endMarkerPosition = secondToPixcel(endRangeMarker.getTime());
+
+                       if (e.x >= endMarkerPosition
+                                       - endRangeMarker.getImage().getBounds().width
+                                       && e.x <= endMarkerPosition) {
+                               endRangeMarker.setPushStatus(true);
+                               DATimeline.this.redraw();
+                       } else if (e.x >= startMarkerPosition
+                                       && e.x <= startMarkerPosition
+                                                       + startRangeMarker.getImage().getBounds().width) {
+                               startRangeMarker.setPushStatus(true);
+                               DATimeline.this.redraw();
+                       }
+               }
+
+               public void mouseUp(MouseEvent e) {
+                       if (startRangeMarker.isPushed()) {
+                               startRangeMarker.setPushStatus(false);
+                               DATimeline.this.redraw();
+                       } else if (endRangeMarker.isPushed()) {
+                               endRangeMarker.setPushStatus(false);
+                               DATimeline.this.redraw();
+                       }
+               }
+       }
+
+       private class RangeMarkerMouseMoveEventListener implements
+                       MouseMoveListener {
+               public void mouseMove(MouseEvent e) {
+                       double stickyTime;
+
+                       if (stickyTimeList.size() == 0) {
+                               stickyTime = 0;
+                       } else if (stickyTimeList.size() == 1) {
+                               stickyTime = stickyTimeList.get(0);
+                       } else {
+                               double eTime = pixcelToSecond(e.x);
+                               double minGapTime = stickyTimeList.get(0);
+
+                               for (int i = 1; i < stickyTimeList.size(); i++) {
+                                       if (Math.abs(eTime - minGapTime) > Math.abs(eTime
+                                                       - stickyTimeList.get(i))) {
+                                               minGapTime = stickyTimeList.get(i);
+                                       }
+                               }
+
+                               if (Math.abs(eTime - minGapTime) > Math.abs(eTime
+                                               - totalEndTime)) {
+                                       minGapTime = totalEndTime;
+                               }
+
+                               stickyTime = minGapTime;
+                       }
+
+                       int timePixcel = (int) secondToPixcel(stickyTime);
+
+                       if (e.x - timePixcel < 5 && e.x - timePixcel > -5) {
+                               e.x = timePixcel;
+                       }
+
+                       if (startRangeMarker.isPushed()) {
+                               if (e.x < 0) {
+                                       e.x = 0;
+                               } else if (e.x > DATimeline.this.getBounds().width
+                                               - startRangeMarker.getImage().getBounds().width) {
+                                       double endTimePx = secondToPixcel(totalEndTime);
+                                       if (e.x > endTimePx) {
+                                               e.x = (int) endTimePx;
+                                       } else {
+                                               e.x = DATimeline.this.getBounds().width
+                                                               - startRangeMarker.getImage().getBounds().width;
+                                       }
+                               } else {
+                                       double endTimePx = secondToPixcel(totalEndTime);
+                                       if (e.x > endTimePx) {
+                                               e.x = (int) endTimePx;
+                                       }
+                               }
+
+                               double movedTime = pixcelToSecond(e.x);
+                               startRangeMarker.setTime(movedTime);
+                               DATimeline.this.redraw();
+                       } else if (endRangeMarker.isPushed()) {
+                               if (e.x < 0 + endRangeMarker.getImage().getBounds().width) {
+                                       e.x = endRangeMarker.getImage().getBounds().width;
+                               } else if (e.x > DATimeline.this.getBounds().width) {
+                                       double endTimePx = secondToPixcel(totalEndTime);
+                                       if (e.x > endTimePx) {
+                                               e.x = (int) endTimePx;
+                                       } else {
+                                               e.x = DATimeline.this.getBounds().width;
+                                       }
+                               } else {
+                                       double endTimePx = secondToPixcel(totalEndTime);
+                                       if (e.x > endTimePx) {
+                                               e.x = (int) endTimePx;
+                                       }
+                               }
+
+                               double movedTime = pixcelToSecond(e.x);
+                               endRangeMarker.setTime(movedTime);
+                               DATimeline.this.redraw();
+                       }
+               }
+       }
+}
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimelineMarker.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimelineMarker.java
new file mode 100644 (file)
index 0000000..6045ea3
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * 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.widgets.timeline;
+
+import org.eclipse.swt.graphics.Image;
+
+public class DATimelineMarker {
+       private double time;
+       private Image normalImage;
+       private Image pushedImage;
+       
+       private boolean isPushed = false;
+
+       public DATimelineMarker(Image normalImage, Image pushedImage) {
+               this.normalImage = normalImage;
+               this.pushedImage = pushedImage;
+       }
+
+       public void setTime(double time) {
+               this.time = time;
+       }
+
+       public double getTime() {
+               return time;
+       }
+       
+       public void setPushStatus(boolean status) {
+               this.isPushed = status;
+       }
+       
+       public Image getImage() {
+               if(isPushed) {
+                       return pushedImage;
+               } else {
+                       return normalImage;
+               }
+       }
+       
+       public boolean isPushed() {
+               return isPushed;
+       }
+}
\ No newline at end of file
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimelineRenderer.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DATimelineRenderer.java
new file mode 100644 (file)
index 0000000..6f81e94
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * 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.widgets.timeline;
+
+import org.eclipse.swt.SWT;
+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.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DATimelineRenderer {
+       public static final int DEFAULT_INTERVAL = 5;
+
+       private final Image balloon = ImageResources.TIMELINE_DETAILED_TIME_BALLOON;
+       private final int balloonHalfWidth = balloon.getBounds().width / 2;
+       private final int balloonHalfHeight = balloon.getBounds().height / 2;
+
+       private Font timeTickFont = FontResources.TIMELINE_TICK_FONT;
+       private Font timeBalloonFont = FontResources.TIMELINE_BALLOON_FONT;
+
+       private int startTime;
+       int scale;
+
+       public Font getTimeTickFont() {
+               return timeTickFont;
+       }
+
+       public void setTimeTickFont(Font font) {
+               timeTickFont = font;
+       }
+
+       public Font getTimeBalloonFont() {
+               return timeBalloonFont;
+       }
+
+       public void setTimeBalloonFont(Font font) {
+               timeBalloonFont = font;
+       }
+
+       private void drawRangeMarkers(GC gc, DATimeline timeline) {
+               DATimelineMarker startMarker = timeline
+                               .getStartRangeMarker();
+               DATimelineMarker endMarker = timeline.getEndRangeMarker();
+
+               if (startMarker.getTime() >= 0) {
+                       double startMarkerTime = startMarker.getTime()
+                                       - timeline.getStartTime();
+                       int pixcelStartX = (int) Math.round(startMarkerTime * scale
+                                       * DEFAULT_INTERVAL);
+                       gc.drawImage(startMarker.getImage(), pixcelStartX, 1);
+               }
+
+               if (endMarker.getTime() >= 0) {
+                       double endMarkerTime = endMarker.getTime()
+                                       - timeline.getStartTime();
+                       int pixcelEndX = (int) Math.round(endMarkerTime * scale
+                                       * DEFAULT_INTERVAL);
+                       gc.drawImage(endMarker.getImage(), pixcelEndX
+                                       - endMarker.getImage().getBounds().width, 1);
+               }
+       }
+
+       private void drawTimeString(GC gc, int totalSecond, int pixcelX, int pixcelY) {
+               Point p;
+               String timeString = Formatter.toTimelineFormat(totalSecond);
+
+               p = gc.textExtent(timeString, SWT.DRAW_MNEMONIC);
+               gc.setForeground(ColorResources.TIMELINE_NUMBER_COLOR);
+               gc.drawText(timeString, pixcelX - p.x / 2, pixcelY, true);
+               gc.setForeground(ColorResources.TIMELINE_TICK_COLOR);
+       }
+
+       public void draw(GC gc, DATimeline timeline) {
+               Rectangle rt = timeline.getClientArea();
+               gc.setFont(timeTickFont);
+               gc.setBackground(ColorResources.TIMELINE_BG_COLOR);
+               gc.fillRectangle(rt);
+
+               // draw underLine
+               gc.drawLine(0, rt.height - 1, rt.width, rt.height - 1);
+
+               // draw time
+               int pixcelX = 0;
+               scale = timeline.getScale();
+               int secondInterval = scale * DEFAULT_INTERVAL;
+               startTime = (int) timeline.getStartTime();
+               pixcelX -= (timeline.getStartTime() - (double) startTime)
+                               * ((double) secondInterval);
+
+               for (; pixcelX < rt.width; startTime++, pixcelX += secondInterval) {
+                       if (startTime % 10 == 0) {
+                               drawTimeString(gc, startTime, pixcelX, 1);
+                               gc.drawLine(pixcelX, rt.height - 7, pixcelX, rt.height - 1);
+                       } else if (startTime % 5 == 0) {
+                               if (scale >= DATimeline.SCALE_400) {
+                                       drawTimeString(gc, startTime, pixcelX, 1);
+                               }
+                               gc.drawLine(pixcelX, rt.height - 5, pixcelX, rt.height - 1);
+                       } else {
+                               if (scale >= DATimeline.SCALE_800) {
+                                       drawTimeString(gc, startTime, pixcelX, 1);
+                               }
+                               gc.drawLine(pixcelX, rt.height - 3, pixcelX, rt.height - 1);
+                       }
+               }
+
+               drawRangeMarkers(gc, timeline);
+
+               if (timeline.getDrawDetailedTime()) {
+                       gc.drawImage(balloon, 0, 0, balloon.getBounds().width,
+                                       balloon.getBounds().height,
+                                       timeline.getDetailedTimePosition() - balloonHalfWidth, 0,
+                                       balloon.getBounds().width, timeline.getBounds().height - 1);
+
+                       String time = Formatter.toTimeFormat((long) (timeline
+                                       .getDetailedTime() * 1000000));
+                       gc.setForeground(ColorResources.BLACK);
+                       gc.setFont(timeBalloonFont);
+                       gc.drawString(time,
+                                       timeline.getDetailedTimePosition()
+                                                       - gc.stringExtent(time).x / 2, balloonHalfHeight
+                                                       - gc.stringExtent(time).y / 2 - 4, true);
+               }
+       }
+}
index a93048e..7313d1d 100644 (file)
@@ -1,7 +1,6 @@
 Internal call=off
 Platform=tizen2.1
-Ragne auto select=on
 Build time=09/05/2012 10:30 AM (GMT)
-Snapshot=off
+Snapshot=0
 Selected chart list=CPU,CPU core,CPU frequency,Heap allocation,Process Size,Memory,File,Screenshot,UI event
 Available chart list=CPU,CPU core,CPU frequency,Heap allocation,Process Size,Memory,File,Screenshot,UI event
\ No newline at end of file
index 47efb5b..17a1e10 100644 (file)
@@ -74,7 +74,7 @@ public class Application implements IApplication {
                } else {
                        ApplicationWorkbenchWindowAdvisor.setAutoStart(false);
                }
-
+               
                int returnCode = PlatformUI.createAndRunWorkbench(display,
                                new ApplicationWorkbenchAdvisor());
 
index 3b6fae2..ff97f72 100644 (file)
@@ -38,12 +38,10 @@ import org.eclipse.ui.application.ActionBarAdvisor;
 import org.eclipse.ui.application.IActionBarConfigurer;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DASingletonFocusManager;
 import org.tizen.dynamicanalyzer.common.PathManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
-import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
 import org.tizen.dynamicanalyzer.handlers.ExitHandler;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogValues;
@@ -107,25 +105,18 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
                PathManager.pathCheck();
                DASingletonFocusManager.setSaveFocusDAPid();
                IDECommunicator.startIDECommunicatorThread();
-               if (!isAutoStart) {
-                       ConfigurationDialogValues.getInstance()
-                                       .setSettingValueFromConfigFile();
-                       if (!ConfigurationDialogValues.getInstance().isShowInitia()) {
-                               final Shell shell = AnalyzerUtil.getWorkbenchWindow()
-                                               .getShell();
-                               WelcomeDialog dialog = new WelcomeDialog(shell, SWT.NONE); // FIXME
-                               dialog.open();
-                       }
+               ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
+               if (!ConfigurationDialogValues.getInstance().isShowInitia()) {
+                       final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+                       WelcomeDialog dialog = new WelcomeDialog(shell, SWT.NONE); // FIXME
+                       dialog.open();
                }
                PathManager.setLogPostFix(WorkbenchPathManager.getLogPostFix());
        }
 
        public boolean preWindowShellClose() {
-               if (ResourceCommunicator.isRunning()) {
-                       ResourceCommunicator
-                                       .sendMessage(AnalyzerConstants.MSG_STOP
-                                                       + CommonConstants.CMD_SPLIT + 0
-                                                       + CommonConstants.CMD_SPLIT);
+               if (DACommunicator.isRunning()) {
+                       DACommunicator.sendStopMessage();
                }
 
                AnalyzerUtil.executeCommand(ExitHandler.ID);
index 164aa67..8c8ac7f 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.nebula.widgets.grid_1.0.0.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/sqlitejdbc-v056.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.core_5.3.1.201109151620.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.debug.edc_2.0.0.201109151658.jar"/>
@@ -8,6 +9,5 @@
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src"/>
-       <classpathentry kind="lib" path="lib/org.eclipse.nebula.widgets.grid_1.0.0.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index ca27bce..0f5c11f 100644 (file)
@@ -30,7 +30,7 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 
 public class AnalyzerConstants {
        // if log change occurs then increase save data version!!
-       public static final String SAVE_DATA_VERSION = "0.84"; //$NON-NLS-1$
+       public static final String SAVE_DATA_VERSION = "0.85"; //$NON-NLS-1$
        public static final boolean CHECK_INTERNAL = true;
 
        /* folder names */
@@ -56,6 +56,10 @@ public class AnalyzerConstants {
        public static final String ABOUT_FILE_NAME = "about.mappings"; //$NON-NLS-1$
        public static final String LICENSE_FILE_NAME = "license"; //$NON-NLS-1$
        public static final String USER_INTERFACE_API_LIST_FILE_NAME = "user_interface_api_list"; //$NON-NLS-1$
+       public static final String TIZEN_FOLDER_ROOTSTRAPS = "rootstraps"; //$NON-NLS-1$
+       public static final String TIZEN_FOLDER_USR = "usr"; //$NON-NLS-1$
+       public static final String TIZEN_FOLDER_INCLUDE = "include"; //$NON-NLS-1$
+       public static final String TIZEN_FOLDER_OSP = "osp"; //$NON-NLS-1$
 
        public static final String DA_DAEMON_NAME = "da_manager"; //$NON-NLS-1$
        public static final String TOOL_RECORDER_NAME = "da_event"; //$NON-NLS-1$
@@ -91,6 +95,7 @@ public class AnalyzerConstants {
        public static final String THREAD_CHART_MANAGER_THREAD = "Thread Chart Manager thread"; //$NON-NLS-1$
        public static final String FUNCTION_USAGE_PROFILING_THREAD = "Function usage profiling thread"; //$NON-NLS-1$
        public static final String USER_INTERFACE_PAGE_MANAGER_THREAD = "User Interface Page Managerthread"; //$NON-NLS-1$ 
+       public static final String SQL_INSERTER_THREAD = "sql_inserter_thread"; //$NON-NLS-1$
 
        /* log parsing token and callstack parsing token, etc... */
        public static final String CALLSTACK_START = "callstack_start"; //$NON-NLS-1$
@@ -136,6 +141,25 @@ public class AnalyzerConstants {
        /* log parsing size */
        public static final int DATABASE_READ_SIZE = 99;
 
+       public static final String MSG_START = "100"; //$NON-NLS-1$
+       public static final String MSG_STOP = "101"; //$NON-NLS-1$
+       public static final String MSG_OPTION = "103"; //$NON-NLS-1$
+       public static final String MSG_VERSION = "999"; //$NON-NLS-1$
+       public static final String MSG_OK = "901"; //$NON-NLS-1$
+       public static final String MSG_NOT_OK = "902"; //$NON-NLS-1$
+       public static final String MSG_SNAPSHOT = "103"; //$NON-NLS-1$
+
+       public static final int OPT_OFF = 0x0000;
+       public static final int OPT_CPUMEM = 0x0001;
+       public static final int OPT_FUNC = 0x0002;
+       public static final int OPT_ALLOC = 0x0004;
+       public static final int OPT_FILE = 0x0008;
+       public static final int OPT_THREAD = 0x0010;
+       public static final int OPT_UI = 0x0020;
+       public static final int OPT_SNAPSHOT = 0x0040;
+       public static final int OPT_EVENT = 0x0080;
+       public static final int OPT_RECORD = 0x0100;
+
        /* Message Type */
        public static final int MSG_APP_INFO = 1; //$NON-NLS-1$
        public static final int MSG_USER_PROFILING_SAMPLE = 3; //$NON-NLS-1$
@@ -145,14 +169,6 @@ public class AnalyzerConstants {
        public static final int MSG_TERMINATE = 7; //$NON-NLS-1$
        public static final int MSG_DEBUG = 9; //$NON-NLS-1$
 
-       public static final String MSG_START = "100"; //$NON-NLS-1$
-       public static final String MSG_STOP = "101"; //$NON-NLS-1$
-       public static final String MSG_PAUSE = "102"; //$NON-NLS-1$
-       public static final String MSG_SNAPSHOT = "103"; //$NON-NLS-1$
-       public static final String MSG_BATT_START = "104"; //$NON-NLS-1$
-       public static final String MSG_BATT_STOP = "105"; //$NON-NLS-1$
-       public static final String MSG_ALIVE = "110"; //$NON-NLS-1$
-
        public static final int SNAPSHOT_OFF = 0;
        public static final int SNAPSHOT_ON = 1;
 
@@ -217,6 +233,7 @@ public class AnalyzerConstants {
        public final static int USER_CALL = 1;
        public final static int INTERNAL_CALL = 2;
        public final static int USER_CALL_CHECK_ERROR = -1;
+       public final static String VIRTUAL_THUNK = "virtual base override";
 
        // comparator type
        public final static int SORT_TYPE_NONE = 0;
index 1a08368..72ccb1d 100644 (file)
@@ -44,6 +44,7 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
 import org.tizen.dynamicanalyzer.theme.DATheme;
 import org.tizen.dynamicanalyzer.theme.DAThemeWhite;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.page.BaseView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
@@ -74,6 +75,7 @@ public class AnalyzerManager {
        private static FailedChecker failedChecker = new FailedChecker();
        private static FailedChecker calledChecker = new FailedChecker();
        private static WarningChecker warningChecker = new WarningChecker();
+       private static CallStackManager callstackManager = new CallStackManager();
 
        private static boolean appInfoArrived = false;
        private static boolean isHaveSampleThread = false;
@@ -119,9 +121,7 @@ public class AnalyzerManager {
                theme = t;
                ColorResources.initColors();
 
-               // TODO: redraw all widgets!
-               // AnalyzerUtil.getWorkbenchWindow().getWorkbench()
-               // .getActiveWorkbenchWindow();
+               // redraw all widgets!
        }
 
        public static boolean hasSampleThread() {
@@ -189,6 +189,7 @@ public class AnalyzerManager {
                failedChecker.clear();
                warningChecker.clear();
                calledChecker.clear();
+               callstackManager.clear();
                isHaveSampleThread = false;
                StopProcessManager.clear();
                UserFunctionManager.getInstance().clear();
@@ -379,6 +380,10 @@ public class AnalyzerManager {
                return warningChecker;
        }
 
+       public static CallStackManager getCallstackManager() {
+               return callstackManager;
+       }
+
        public static FailedChecker getCalledFunctionChecker() {
                return calledChecker;
        }
index 3760f88..4be1060 100644 (file)
@@ -42,11 +42,11 @@ public class AnalyzerPaths {
                        + File.separator + AnalyzerConstants.TEMP_FOLDER_NAME;
        public static final String CONFIG_FOLDER_PATH = PathManager
                        .getConfigFolderPath();
-       public static final String ABOUT_FILE_PATH = PathManager
-                       .getAboutPath();
+       public static final String ABOUT_FILE_PATH = PathManager.getAboutPath();
        public static final String SDB_PATH = PathManager.getSdbPath();
        public static final String READELF_PATH = DYNAMIC_ANALYZER_INSTALL_PATH
-                       + File.separator + AnalyzerConstants.TARGET_FOLDER_NAME + File.separator;
+                       + File.separator + AnalyzerConstants.TARGET_FOLDER_NAME
+                       + File.separator;
        public static final String TARGET_PATH = PathManager.getTargetPath();
 
        public static final String DA_SINGLETON_FILE_PATH = PathManager
@@ -63,11 +63,9 @@ public class AnalyzerPaths {
        public static final String WINDOW_ACTIVATOR_MACOS_PATH = TIZEN_ROOT_PATH
                        + "/tools/dynamic-analyzer/tool/macoswindowactivator.sh";//$NON-NLS-1$
 
-       public static final String DA_EMULATOR_SOUECE_PATH = TIZEN_ROOT_PATH
-                       + "/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include/osp"; //$NON-NLS-1$
-       public static final String DA_DEVICE_SOUECE_PATH = TIZEN_ROOT_PATH
-                       + "/platforms/tizen2.0/rootstraps/tizen-device-2.0.cpp/usr/include/osp"; //$NON-NLS-1$
-       
+       public static final String TIZEN_HEADER_SOUECE_PATH = PathManager
+                       .getTizenHeaderSouecePath();
+
        /* Name & Path */
        public static final String DA_REMOTE_PROBE_PATH = "/home/developer/sdk_tools/da/"; //$NON-NLS-1$
        public static final String DA_REMOTE_PATH = "/home/developer/sdk_tools/da/"; //$NON-NLS-1$
@@ -76,6 +74,6 @@ public class AnalyzerPaths {
        public static final String TOOL_REMOTE_RECORDER_BINARY_PATH = DA_REMOTE_PATH
                        + AnalyzerConstants.TOOL_RECORDER_NAME;
        public static final String APPLICATION_LIST_PATH = "/opt/share/applications/"; //$NON-NLS-1$
-       
+
        public static final String DA_DAEMON_LOG_PATH = "/tmp/da_daemon.log"; //$NON-NLS-1$
 }
index a6ad120..bbbb0c0 100644 (file)
@@ -30,6 +30,8 @@ import java.io.File;
 import java.util.List;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IPartService;
 import org.eclipse.ui.IWorkbench;
@@ -41,6 +43,8 @@ import org.osgi.framework.BundleContext;
 import org.tizen.dynamicanalyzer.listeners.AnalyzerPartListener;
 import org.tizen.dynamicanalyzer.listeners.AnalyzerPerspectiveListener;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class AnalyzerPlugin extends AbstractUIPlugin {
@@ -83,6 +87,7 @@ public class AnalyzerPlugin extends AbstractUIPlugin {
                                 * = false; break; } if (i + 1 == count) { delete = true; } } }
                                 **/
                                if (delete) {
+                                       SqlManager.getInstance().closeConnection();
                                        File tempDir = new File(AnalyzerPaths.TEMP_FOLDER_PATH);
                                        if (tempDir.isDirectory() && tempDir.exists()) {
                                                if (AnalyzerUtil.deleteFile(tempDir)) {
@@ -129,6 +134,16 @@ public class AnalyzerPlugin extends AbstractUIPlugin {
                AnalyzerPartListener partListener = new AnalyzerPartListener();
                partService.addPartListener(partListener);
 
+               AnalyzerUtil.getWorkbenchWindow().getShell().getDisplay()
+                               .addFilter(SWT.KeyUp, new Listener() {
+
+                                       @Override
+                                       public void handleEvent(Event event) {
+                                               ShortCutManager.getInstance()
+                                                               .handleShortCutEvent(event);
+                                       }
+                               });
+
        }
 
        @Override
index ef4e157..4c6a7b4 100644 (file)
@@ -29,50 +29,18 @@ package org.tizen.dynamicanalyzer.common;
 public class AnalyzerShellCommands {
 
        /* Commands */
-       public static final String CMD_GET_LIST = "ls -1 "; //$NON-NLS-1$
-       public static final String CMD_NO_LIST = "ls:"; //$NON-NLS-1$
-       public static final String CMD_CAT_PRINT = "cat "; //$NON-NLS-1$
-       public static final String CMD_NO_CAT_PRINT = "cat:"; //$NON-NLS-1$
        public static final String CMD_REMOVE = "rm -rf"; //$NON-NLS-1$
-       public static final String CMD_EXE_PERMISSION = "chmod +x "; //$NON-NLS-1$
-
-       public static final String CMD_APPLICATION_LIST = "ls -t " + //$NON-NLS-1$
-                       AnalyzerPaths.APPLICATION_LIST_PATH
-                       + "*.desktop | xargs egrep -Li \"Removable=False|Multiple=true|packagetype=wgt\" | xargs egrep -Hi \"pkgid|exec|name=\"";//$NON-NLS-1$
 
+       public static final String CMD_APPLICATION_LIST = "/usr/bin/pkginfo --listpkg";
        public static final String CMD_UPLOAD_FILE_LIST = "du -b " + //$NON-NLS-1$
-                       AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.READELF_BIN
-                       + CommonConstants.SPACE + AnalyzerPaths.DA_REMOTE_PATH
-                       + AnalyzerConstants.VERSION_NAME + CommonConstants.SPACE
-                       + AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH
-                       + CommonConstants.SPACE + AnalyzerPaths.DA_REMOTE_PROBE_PATH
-                       + AnalyzerConstants.PROBE_LIB_TIZEN + CommonConstants.SPACE
-                       + AnalyzerPaths.DA_REMOTE_PROBE_PATH
-                       + AnalyzerConstants.PROBE_LIB_OSP + CommonConstants.SPACE
-                       + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH;
-
-       public static final String CMD_DAEMON_EXE_PERMISSION = CMD_EXE_PERMISSION
-                       + AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH;
-
-       public static final String CMD_READELF_PERMISSION = CMD_EXE_PERMISSION
-                       + AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.READELF_BIN;
-
-       public static final String CMD_IS_DAEMON_EXIST = CMD_GET_LIST
-                       + AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH;
-
-       public static final String CMD_IS_DAEMON_LISTEN = "ps ax | grep " //$NON-NLS-1$
-                       + AnalyzerConstants.DA_DAEMON_NAME + " | grep -v grep"; //$NON-NLS-1$
-
-       public static final String CMD_LS_VERSION = CMD_GET_LIST
-                       + AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.VERSION_NAME;
-
-       public static final String CMD_CAT_VERSION = CMD_CAT_PRINT
-                       + AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.VERSION_NAME;
-
-       public static final String CMD_PIDOF_DAEMON = "pidof " //$NON-NLS-1$
-                       + AnalyzerConstants.DA_DAEMON_NAME;
-
-       public static final String CMD_KILL_DAEMON = "kill -9 "; //$NON-NLS-1$
+                       AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.READELF_BIN;
+
+       public static final String DACOMMAND_KILL_MANAGER = "/usr/bin/da_command killmanager";
+       public static final String DACOMMAND_KILL_APP = "/usr/bin/da_command killapp";
+       public static final String DACOMMAND_RUN_MANAGER = "/usr/bin/da_command runmanager";
+       public static final String DACOMMAND_RUN_EVENT = "/usr/bin/da_command runevent";
+       public static final String DACOMMAND_FIND_UNITTEST = "/usr/bin/da_command findunittest";
+       public static final String DACOMMAND_FIND_IME = "/usr/bin/pkginfo --arg-flt 10 http://tizen.org/category/ime";
        public static final String CMD_IS_ARM_ARCH = "uname -m"; //$NON-NLS-1$
-
+       public static final String CMD_CAT_PORT_FILE = "cat /tmp/port.da"; //$NON-NLS-1$
 }
index 0b6f2ce..de4b022 100644 (file)
@@ -35,6 +35,7 @@ import java.io.InputStreamReader;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
@@ -136,6 +137,42 @@ public class PathManager {
                return rootPath;
        }
 
+       public static String getTizenHeaderSouecePath() {
+               String tizenHeaderSouecePath = CommonConstants.EMPTY;
+               if (null != getPlatform()) {
+                       String tempPath = AnalyzerPaths.TIZEN_ROOT_PATH;
+                       if (null != tempPath) {
+                               tempPath += File.separator
+                                               + AnalyzerConstants.PLATFORM_FOLDER_NAME
+                                               + File.separator + getPlatform() + File.separator
+                                               + AnalyzerConstants.TIZEN_FOLDER_ROOTSTRAPS
+                                               + File.separator
+                                               + "%s-%s-%s" + File.separator//$NON-NLS-1$
+                                               + AnalyzerConstants.TIZEN_FOLDER_USR + File.separator
+                                               + AnalyzerConstants.TIZEN_FOLDER_INCLUDE
+                                               + File.separator + AnalyzerConstants.TIZEN_FOLDER_OSP;
+                       }
+                       String currentDevie = CommonConstants.EMPTY;
+                       if (DACommunicator.isCurrentDeviceArmArch()) {
+                               currentDevie = "device";//$NON-NLS-1$
+                       } else {
+                               currentDevie = "emulator";//$NON-NLS-1$
+                       }
+                       String platformName = getPlatform().replaceAll(
+                                       "[^A-Za-z]", CommonConstants.EMPTY);//$NON-NLS-1$
+                       String platformVersion = getPlatform().replaceAll(
+                                       "[A-Za-z]", CommonConstants.EMPTY);//$NON-NLS-1$
+                       if (Double.parseDouble(platformVersion) < 2.1) {
+                               tizenHeaderSouecePath = String.format(tempPath, platformName,
+                                               currentDevie, platformVersion + ".cpp");//$NON-NLS-1$
+                       } else {
+                               tizenHeaderSouecePath = String.format(tempPath, platformName,
+                                               currentDevie, platformVersion + ".native");//$NON-NLS-1$
+                       }
+               }
+               return tizenHeaderSouecePath;
+       }
+
        public static String getInstallPath() {
                String installPath = AnalyzerPaths.TIZEN_ROOT_PATH;
                if (null != installPath) {
index 6ce3c16..a0058d4 100644 (file)
@@ -29,15 +29,18 @@ package org.tizen.dynamicanalyzer.communicator;
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
 import java.net.Socket;
+import java.net.SocketException;
 import java.net.SocketTimeoutException;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.List;
 
 import org.eclipse.swt.widgets.Display;
@@ -47,7 +50,9 @@ import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.PathManager;
 import org.tizen.dynamicanalyzer.model.DeviceInfo;
-import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.project.AppInfo;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
@@ -56,7 +61,6 @@ import org.tizen.sdblib.IShellOutputReceiver;
 import org.tizen.sdblib.MultiLineReceiver;
 import org.tizen.sdblib.NullOutputReceiver;
 import org.tizen.sdblib.SdbCommandRejectedException;
-import org.tizen.sdblib.SdbShellProcess;
 import org.tizen.sdblib.ShellCommandUnresponsiveException;
 import org.tizen.sdblib.SmartDevelopmentBridge;
 import org.tizen.sdblib.SmartDevelopmentBridge.IDeviceChangeListener;
@@ -68,19 +72,33 @@ import org.tizen.sdblib.TimeoutException;
 public class DACommunicator {
        /* Port */
        public static final int LOCAL_PORT = 8000;
-       public static final int REMOTE_PORT = 8001;
+       protected static int remotePort = -1;
+       private static final int PORT_WAIT_TIME = 5;
+       private static List<String> portLines = new ArrayList<String>();
+
+       private static Socket controlSock = null;
+       private static BufferedWriter controlWriter = null;
+       private static BufferedReader controlReader = null;
 
        private static Socket sock = null;
-       private static SmartDevelopmentBridge sdbBridge = null;
-       private static AppDesktopInfo selectedApp = null;
-       private static DeviceInfo currentDevice = null;
        private static BufferedWriter writer = null;
        private static BufferedReader reader = null;
-       private static boolean isRunning = false;
+
+       private static SmartDevelopmentBridge sdbBridge = null;
+
+       private static List<String> packageInfoMultiLines = new ArrayList<String>();
+
+       private static AppInfo selectedApp = null;
+
        private static List<DeviceInfo> devices = null;
-       private static List<AppDesktopInfo> appDesktopList = null;
-       private static List<String> appDesktopString = null;
-       private static List<String> uploadDataResult = null;
+       private static DeviceInfo currentDevice = null;
+
+       private static List<String> filterMultiLines = new ArrayList<String>();
+       private static List<String> unittestList = new ArrayList<String>();
+       private static List<String> imeList = new ArrayList<String>();
+       private static List<String> uploadDataResult = new ArrayList<String>();
+
+       private static boolean isRunning = false;
 
        public static void init() {
                SmartDevelopmentBridge.init();
@@ -93,10 +111,181 @@ public class DACommunicator {
                isRunning = false;
                devices = null;
                isArch = false;
-               appDesktopList = null;
-               pidOfDaemon = null;
-               existVersion = false;
-               correctVersion = false;
+               packageInfoMultiLines.clear();
+               filterMultiLines.clear();
+               uploadDataResult.clear();
+               unittestList.clear();
+               remotePort = -1;
+       }
+
+       public static boolean connectionProcess() {
+               // step 1. kill da_manager if alive
+               execShellCommand(AnalyzerShellCommands.DACOMMAND_KILL_MANAGER);
+
+               // step 2. check readelf and upload
+               if (getReadelfSize() < 0) {
+                       System.out.println("upload readelf");
+                       if (!uploadReadElf()) {
+                               System.out.println("Failed to upload files..."); //$NON-NLS-1$
+                               return false;
+                       }
+               }
+
+               // step 3. run da_manager
+               execCommand(AnalyzerShellCommands.DACOMMAND_RUN_MANAGER);
+
+               // step 4. get remote port from /tmp/port.da in device or emul
+               initRemotePort();
+
+               // step 5. port foward
+               foward(LOCAL_PORT, remotePort);
+
+               // step 6. set da_communicator is running!
+               setRunning(true);
+
+               // step 7. create data socket
+               if (null == createControlSocket(LOCAL_PORT)) {
+                       System.out.println("control socket creation failed."); //$NON-NLS-1$
+                       return false;
+               }
+               return true;
+       }
+
+       protected static void initRemotePort() {
+               int count = 0;
+               // add error check
+               while (count < PORT_WAIT_TIME) {
+                       try {
+                               execShellCommand(AnalyzerShellCommands.CMD_CAT_PORT_FILE,
+                                               portReceiver);
+                               if (!portLines.isEmpty()) {
+                                       String line = portLines.get(0);
+                                       remotePort = Integer.parseInt(line);
+                                       break;
+                               }
+                               count++;
+                               Thread.sleep(1000);
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       } catch (NumberFormatException e) {
+                               // e.printStackTrace();
+                               System.out.println("wait for remote port get");
+                       }
+               }
+       }
+
+       private static MultiLineReceiver portReceiver = new MultiLineReceiver() {
+               @Override
+               public void processNewLines(String[] lines) {
+                       portLines.clear();
+                       for (int i = 0; i < lines.length; i++) {
+                               portLines.add(lines[i]);
+                       }
+               }
+       };
+
+       public static int getRemotePort() {
+               return remotePort;
+       }
+
+       public static boolean sendStartMessage() {
+               int isArm = 0;
+               int isEmul = 0;
+               int res = 0;
+
+               if (!isCurrentDeviceArmArch()) {
+                       isArm = 1;
+               }
+
+               DeviceInfo device = getSelectedDevice();
+               if (null != device
+                               && device.getIDevice().getSerialNumber()
+                                               .startsWith(CommonConstants.EMULATOR)) {
+                       isEmul = 1;
+               }
+
+               if (null == getSelectedApp()) {
+                       return false;
+               }
+               String rearMessage = CommonConstants.EMPTY + res + isEmul + isArm
+                               + CommonConstants.CMD_SPLIT + getConfiguration()
+                               + CommonConstants.CMD_SPLIT
+                               + getSelectedApp().getInfo(AppInfo.EXEC_INDEX);
+
+               String message = AnalyzerConstants.MSG_START
+                               + CommonConstants.CMD_SPLIT + rearMessage.length()
+                               + CommonConstants.CMD_SPLIT + rearMessage;
+               System.out.println("Send message :" + message); //$NON-NLS-1$
+
+               String result = handleControlMessage(message);
+               if (null != result) {
+                       System.out.println("start message ack :" + result);
+                       String[] splitResult = result.split(CommonConstants.CMD_SPLIT_READ);
+                       if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
+                               createSocket(LOCAL_PORT);
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public static boolean sendStopMessage() {
+               if (isRunning()) {
+                       String message = AnalyzerConstants.MSG_STOP
+                                       + CommonConstants.CMD_SPLIT + 0 + CommonConstants.CMD_SPLIT;
+                       System.out.println("stop send message :" + message);
+
+                       String result = handleControlMessage(message);
+                       if (null != result) {
+                               System.out.println("stop message ack :" + result);
+                               String[] splitResult = result
+                                               .split(CommonConstants.CMD_SPLIT_READ);
+                               if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
+                                       return true;
+                               }
+                       }
+               }
+               return false;
+       }
+
+       public static boolean sendSnapshotMessage(int state) {
+               String statestr = Integer.toString(state);
+               String message = AnalyzerConstants.MSG_OPTION
+                               + CommonConstants.CMD_SPLIT + statestr.length()
+                               + CommonConstants.CMD_SPLIT + statestr;
+
+               String result = handleControlMessage(message);
+               if (null != result) {
+                       System.out.println("snapshot message ack :" + result);
+                       String[] splitResult = result.split(CommonConstants.CMD_SPLIT_READ);
+                       if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public static int getConfiguration() {
+               int state = 0;
+
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.FUNCTIONPROFILING);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.ALLOCATION);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.FILE);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.THREAD);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.USERINTERFACE);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.SNAPSHOT);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.EVENT);
+               state |= ConfigureManager.getInstance().getValueInt(
+                               ConfigureLabels.RECORDING);
+
+               return state;
        }
 
        public static List<DeviceInfo> getDevices() {
@@ -125,11 +314,11 @@ public class DACommunicator {
                currentDevice = device;
        }
 
-       public static AppDesktopInfo getSelectedApp() {
+       public static AppInfo getSelectedApp() {
                return selectedApp;
        }
 
-       public static void setSelectedApp(AppDesktopInfo app) {
+       public static void setSelectedApp(AppInfo app) {
                selectedApp = app;
        }
 
@@ -173,7 +362,9 @@ public class DACommunicator {
                        int size = devices.length;
                        if (size > 0) {
                                for (int i = 0; i < size; i++) {
-                                       addDevice(devices[i]);
+                                       if (devices[i].isOnline()) {
+                                               addDevice(devices[i]);
+                                       }
                                }
                        }
                }
@@ -191,6 +382,8 @@ public class DACommunicator {
                public void processNewLines(String[] lines) {
                        if (lines[0].contains(CommonConstants.ARM_ARCH)) {
                                isArch = true;
+                       } else {
+                               isArch = false;
                        }
                }
        };
@@ -214,118 +407,195 @@ public class DACommunicator {
                return devNameList;
        }
 
-       private static MultiLineReceiver appListReceiver = new MultiLineReceiver() {
+       private static MultiLineReceiver packageInfoReceiver = new MultiLineReceiver() {
                @Override
                public void processNewLines(String[] appLines) {
                        for (int i = 0; i < appLines.length; i++) {
-                               appDesktopString.add(appLines[i]);
+                               packageInfoMultiLines.add(appLines[i]);
                        }
                }
        };
 
-       private static AppDesktopInfo findDesktopInfoByDesktopName(
-                       String desktopName) {
-               appDesktopList = getAppDesktopList();
-               int size = appDesktopList.size();
-               for (int i = 0; i < size; i++) {
-                       if (appDesktopList.get(i).getDesktopName().equals(desktopName)) {
-                               return appDesktopList.get(i);
+       private static MultiLineReceiver unittestInfoReceiver = new MultiLineReceiver() {
+               @Override
+               public void processNewLines(String[] appLines) {
+                       for (int i = 0; i < appLines.length; i++) {
+                               filterMultiLines.add(appLines[i]);
                        }
                }
-               return null;
-       }
+       };
+
+       private static MultiLineReceiver imeInfoReceiver = new MultiLineReceiver() {
+               @Override
+               public void processNewLines(String[] appLines) {
+                       for (int i = 0; i < appLines.length; i++) {
+                               filterMultiLines.add(appLines[i]);
+                       }
+               }
+       };
 
-       public static List<AppDesktopInfo> getAppListFromTarget() {
-               getAppDesktopList().clear();
-               getAppDesktopString().clear();
+       public static List<AppInfo> getAppListFromTarget() {
+               if (null == currentDevice) {
+                       return null;
+               }
+               List<AppInfo> appInfoList = currentDevice.getAppInfoList();
+               HashMap<String, AppInfo> appInfoHash = currentDevice.getAppInfoHash();
+               List<AppInfo> backList = new ArrayList<AppInfo>();
+               backList.addAll(appInfoHash.values());
+
+               packageInfoMultiLines.clear();
 
                execShellCommand(AnalyzerShellCommands.CMD_APPLICATION_LIST,
-                               appListReceiver);
+                               packageInfoReceiver);
+               checkUnittest();
+               checkIME();
 
-               int size = appDesktopString.size();
-               for (int i = 0; i < size; i++) {
-                       String line = appDesktopString.get(i);
-                       String[] splitLine = line.split(CommonConstants.COLON);
-                       String desktopName = splitLine[0];
+               int size = packageInfoMultiLines.size();
 
-                       AppDesktopInfo desktopInfo = findDesktopInfoByDesktopName(desktopName);
-                       if (null == desktopInfo) {
-                               desktopInfo = new AppDesktopInfo();
-                               desktopInfo.setDesktopName(desktopName);
-                               appDesktopList.add(desktopInfo);
+               for (int i = 0; i < size; i++) {
+                       String line = packageInfoMultiLines.get(i);
+                       if (line.contains("Appid")) {
+                               List<String> lines = new ArrayList<String>();
+                               for (int ii = 0; ii < AppInfo.PKGINFO_SIZE; ii++) {
+                                       lines.add(packageInfoMultiLines.get(ii + i));
+                               }
+                               AppInfo pkgInfo = makePackageInfo(lines);
+                               if (null != pkgInfo
+                                               && pkgInfo.getInfo(AppInfo.APPTYPE_INDEX).contains(
+                                                               AppInfo.APPTYPE_CPP)
+                                               && pkgInfo.getInfo(AppInfo.MULTIPLE_INDEX).equals(
+                                                               AppInfo.FLAG_ZERO)) {
+                                       String pkgId = pkgInfo.getInfo(AppInfo.PACKAGE_INDEX);
+                                       String appId = pkgInfo.getInfo(AppInfo.APPID_INDEX);
+                                       if (null == appInfoHash.get(pkgId)) {
+                                               if (!isUnittest(pkgId) && !isIME(appId)) {
+                                                       appInfoList.add(pkgInfo);
+                                                       appInfoHash.put(pkgId, pkgInfo);
+                                               }
+                                       } else {
+                                               backList.remove(appInfoHash.get(pkgId));
+                                       }
+                               }
+                               i += AppInfo.PKGINFO_SIZE - 1;
                        }
+               }
+               if (!backList.isEmpty()) {
+                       for (AppInfo pkg : backList) {
+                               appInfoList.remove(pkg);
+                               appInfoHash.remove(pkg);
+                       }
+               }
+               return appInfoList;
+       }
 
-                       System.out.println("message : " + splitLine[1]);
-                       String[] splitData = splitLine[1].split(CommonConstants.EQUAL);
-                       String strData = splitData[0];
-
-                       if (strData.toLowerCase().equals("name")) { //$NON-NLS-1$
-                               desktopInfo.setName(new String(splitData[1]));
-                       } else if (strData.toLowerCase().equals("exec")) { //$NON-NLS-1$
-                               desktopInfo.setExecPath(new String(splitData[1]));
-                       } else if (strData.toLowerCase().contains("pkgid")) {//$NON-NLS-1$
-                               desktopInfo.setPkgId(new String(splitData[1]));
+       private static boolean isUnittest(String pkgId) {
+               if (null != unittestList && !unittestList.isEmpty()) {
+                       for (String id : unittestList) {
+                               if (id.equals(pkgId)) {
+                                       return true;
+                               }
                        }
                }
+               return false;
+       }
 
-               // verification
-               size = appDesktopList.size();
-               for (int i = 0; i < size; i++) {
-                       AppDesktopInfo appInfo = appDesktopList.get(i);
-                       if (null == appInfo.getExecPath()
-                                       || appInfo.getExecPath().isEmpty()) {
-                               appDesktopList.remove(i);
-                       } else if (null == appInfo.getName() || appInfo.getName().isEmpty()) {
-                               String execPath = appInfo.getExecPath();
-                               String[] splitPath = execPath.split("\\/"); //$NON-NLS-1$
-                               String name = new String(splitPath[splitPath.length - 1]);
-                               appInfo.setName(name);
+       private static boolean isIME(String appId) {
+               if (null != imeList && !imeList.isEmpty()) {
+                       for (String id : imeList) {
+                               if (id.equals(appId)) {
+                                       return true;
+                               }
                        }
                }
+               return false;
+       }
+
+       private static void checkUnittest() {
+               unittestList.clear();
+               if (null == currentDevice) {
+                       return;
+               }
+               String appInstallPath = currentDevice.getIDevice().getAppInstallPath();
 
-               // /*** do not delete for debug ***/
-               // for (int i = 0; i < appDesktopList.size(); i++) {
-               // AppDesktopInfo info = appDesktopList.get(i);
-               // System.out.println("name " + info.getName() + "  path : "
-               // + info.getExecPath());
-               // }
+               filterMultiLines.clear();
+               execShellCommand(AnalyzerShellCommands.DACOMMAND_FIND_UNITTEST,
+                               unittestInfoReceiver);
+
+               if (filterMultiLines.isEmpty()) {
+                       return;
+               }
 
-               return appDesktopList;
+               for (String line : filterMultiLines) {
+                       if (line.contains(appInstallPath)) {
+                               line = line.replaceFirst(
+                                               appInstallPath + CommonConstants.SLASH,
+                                               CommonConstants.EMPTY);
+                               int index = line.indexOf(CommonConstants.SLASH);
+                               line = line.substring(0, index);
+                               unittestList.add(line);
+                       }
+               }
        }
 
-       private static List<AppDesktopInfo> getAppDesktopList() {
-               if (null == appDesktopList) {
-                       appDesktopList = new ArrayList<AppDesktopInfo>();
+       private static void checkIME() {
+               imeList.clear();
+               if (null == currentDevice) {
+                       return;
+               }
+
+               filterMultiLines.clear();
+               execShellCommand(AnalyzerShellCommands.DACOMMAND_FIND_IME,
+                               imeInfoReceiver);
+
+               if (filterMultiLines.isEmpty()) {
+                       return;
+               }
+
+               for (String line : filterMultiLines) {
+                       String appId = "appid";//$NON-NLS-1$
+                       if (line.contains("apptype") && line.contains("c++app")) {
+                               line = line.trim();
+                               int index = line.indexOf(appId);
+                               // 2 means length of String " ["
+                               line = line.substring(index + appId.length() + 2,
+                                               line.length() - 1);
+                               imeList.add(line);
+                       }
                }
-               return appDesktopList;
        }
 
-       private static List<String> getAppDesktopString() {
-               if (null == appDesktopString) {
-                       appDesktopString = new ArrayList<String>();
+       private static AppInfo makePackageInfo(List<String> lines) {
+               AppInfo pkgInfo = new AppInfo();
+               for (int i = 0; i < AppInfo.PKGINFO_SIZE; i++) {
+                       String line = lines.get(i);
+                       int index = line.indexOf(":");
+                       String data = line.substring(index + 1, line.length()).trim();
+                       pkgInfo.setInfo(i, data);
                }
-               return appDesktopString;
+               return pkgInfo;
        }
 
-       public static AppDesktopInfo getAppDesktopInfoByName(String name) {
-               List<AppDesktopInfo> appInfoList = getAppDesktopList();
-               int size = appInfoList.size();
-               for (int i = 0; i < size; i++) {
-                       AppDesktopInfo ai = appInfoList.get(i);
-                       if (ai.getName().equals(name)) {
-                               return ai;
+       public static AppInfo getPkgInfoByName(String appLabel) {
+               if (null != currentDevice) {
+                       int size = currentDevice.getAppInfoList().size();
+                       for (int i = 0; i < size; i++) {
+                               AppInfo pkgInfo = currentDevice.getAppInfoList().get(i);
+                               if (pkgInfo.getInfo(AppInfo.LABEL_INDEX).equals(appLabel)) {
+                                       return pkgInfo;
+                               }
                        }
                }
                return null;
        }
 
-       public static AppDesktopInfo getAppDesktopInfoByAppId(String id) {
-               List<AppDesktopInfo> appInfoList = getAppDesktopList();
-               int size = appInfoList.size();
-               for (int i = 0; i < size; i++) {
-                       AppDesktopInfo ai = appInfoList.get(i);
-                       if (ai.getPkgId().equals(id)) {
-                               return ai;
+       public static AppInfo getPkgInfoByAppPkgId(String pkgid) {
+               if (null != currentDevice) {
+                       int size = currentDevice.getAppInfoList().size();
+                       for (int i = 0; i < size; i++) {
+                               AppInfo ai = currentDevice.getAppInfoList().get(i);
+                               if (ai.getInfo(AppInfo.PACKAGE_INDEX).equals(pkgid)) {
+                                       return ai;
+                               }
                        }
                }
                return null;
@@ -363,8 +633,38 @@ public class DACommunicator {
                return sock;
        }
 
+       public static Socket createControlSocket(int port) {
+               try {
+
+                       controlSock = new Socket(CommonConstants.LOCAL_HOST, port);
+                       if (null == controlSock) {
+                               System.out.println("failed to create a control socket"); //$NON-NLS-1$
+                               return null;
+                       }
+
+                       controlSock.setSoTimeout(AnalyzerConstants.SOCKET_TIMEOUT);
+                       controlSock.setReuseAddress(true);
+                       controlSock.setTcpNoDelay(true);
+
+                       controlReader = new BufferedReader(new InputStreamReader(
+                                       controlSock.getInputStream()));
+                       controlWriter = new BufferedWriter(new OutputStreamWriter(
+                                       controlSock.getOutputStream()));
+               } catch (SocketTimeoutException e) {
+                       System.out.println("socket timeout."); //$NON-NLS-1$
+                       e.printStackTrace();
+               } catch (UnknownHostException e) {
+                       e.printStackTrace();
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+
+               return controlSock;
+       }
+
        public static void closeSocket() {
-               AnalyzerUtil.tryClose(reader, writer, sock);
+               AnalyzerUtil.tryClose(reader, writer, sock, controlReader,
+                               controlWriter, controlSock);
        }
 
        public static BufferedReader getSockBufferedReader() {
@@ -395,6 +695,7 @@ public class DACommunicator {
        public static void unfoward(int local, int remote) {
                if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
                        try {
+                               System.out.println("unfoward!!");
                                currentDevice.getIDevice().removeForward(local, remote);
                                Thread.sleep(AnalyzerConstants.SOCKET_FORWARD_INTERVAL);
                        } catch (TimeoutException e) {
@@ -409,31 +710,8 @@ public class DACommunicator {
                }
        }
 
-       private static String pidOfDaemon = null;
-
-       private static MultiLineReceiver pidofDaemon = new MultiLineReceiver() {
-               @Override
-               public void processNewLines(String[] lines) {
-                       if (0 != lines.length && !lines[0].isEmpty()) {
-                               pidOfDaemon = lines[0];
-                       }
-               }
-       };
-
-       public static boolean isDaemonAlive() {
-               execShellCommand(AnalyzerShellCommands.CMD_PIDOF_DAEMON, pidofDaemon);
-               if (null != pidOfDaemon) {
-                       return true;
-               }
-               return false;
-       }
-
        public static void killDaemon() {
-               if (null != pidOfDaemon) {
-                       System.out.println("kill daemon : " + pidOfDaemon); //$NON-NLS-1$
-                       execShellCommand(AnalyzerShellCommands.CMD_KILL_DAEMON
-                                       + CommonConstants.SPACE + pidOfDaemon);
-               }
+               execShellCommand(AnalyzerShellCommands.DACOMMAND_KILL_MANAGER);
        }
 
        public static void execShellCommand(String command) {
@@ -458,10 +736,11 @@ public class DACommunicator {
                }
        }
 
-       public static SdbShellProcess execCommand(String command) {
+       public static Process execCommand(String command) {
                if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
                        try {
-                               return currentDevice.getIDevice().executeShellCommand(command);
+                               return currentDevice.getIDevice().executeShellCommand(command,
+                                               false);
                        } catch (IOException e) {
                                e.printStackTrace();
                        }
@@ -482,6 +761,34 @@ public class DACommunicator {
                }
        }
 
+       public static String handleControlMessage(String message) {
+               String result = null;
+               try {
+                       if (null != controlSock && !controlSock.isClosed()) {
+                               controlWriter.write(message);
+                               controlWriter.flush();
+                       }
+
+                       System.out.println("wait for ack...");
+                       while (isRunning) {
+                               char cbuf[] = new char[64];
+                               int readsize = controlReader.read(cbuf);
+
+                               if (readsize > 0) {
+                                       result = String.copyValueOf(cbuf, 0, readsize);
+
+                                       if (null != result && !result.isEmpty()) {
+                                               break;
+                                       }
+                               }
+                       }
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       return null;
+               }
+               return result;
+       }
+
        public static SyncResult push(String local, String remote) {
                return push(local, remote, SyncService.getNullProgressMonitor());
        }
@@ -564,119 +871,68 @@ public class DACommunicator {
                return false;
        }
 
-       private static long uploadFile(String source, String targetPath) {
+       private static boolean uploadFile(String source, String targetPath) {
+
                SyncResult result = push(source, targetPath);
                if (null == result || SyncService.RESULT_OK != result.getCode()) {
-                       System.out
-                                       .println("upload " + targetPath + " is failed : " + source); //$NON-NLS-1$ //$NON-NLS-2$
+                       System.out.println("upload to" + targetPath + " is failed! "); //$NON-NLS-1$ //$NON-NLS-2$
                        System.out.println("Error : " + result.getMessage()); //$NON-NLS-1$
-                       return -1;
-               }
-
-               File file = new File(source);
-               if (file.exists()) {
-                       return file.length();
-               } else {
-                       System.out.println("upload error! file is not exist : " + source); //$NON-NLS-1$
-                       return -1;
+                       return false;
                }
+               return true;
        }
 
-       public static boolean upload() {
+       public static boolean uploadReadElf() {
                long readelfSize = -1;
-               long probeTizenSize = -1;
-               long probeOspSize = -1;
-               long versionSize = -1;
-               long daemonSize = -1;
-               long daeventSize = -1;
-               String target = AnalyzerPaths.TARGET_PATH;
-
-               if (isCurrentDeviceArmArch()) {
-                       target += CommonConstants.ARM_ARCH;
-               } else {
-                       target += CommonConstants.X86_ARCH;
-               }
-
-               String source = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
-                               + File.separator + AnalyzerConstants.VERSION_NAME;
-               versionSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PATH
-                               + AnalyzerConstants.VERSION_NAME);
-
-               source = target + File.separator + AnalyzerConstants.DA_DAEMON_NAME;
-               daemonSize = uploadFile(source,
-                               AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH);
-
-               source = target + File.separator + AnalyzerConstants.PROBE_LIB_TIZEN;
-               probeTizenSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PROBE_PATH
-                               + AnalyzerConstants.PROBE_LIB_TIZEN);
-
-               source = target + File.separator + AnalyzerConstants.PROBE_LIB_OSP;
-               probeOspSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PROBE_PATH
-                               + AnalyzerConstants.PROBE_LIB_OSP);
-
-               source = target + File.separator + AnalyzerConstants.TOOL_RECORDER_NAME;
-               daeventSize = uploadFile(source,
-                               AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH);
-
                String readelf = AnalyzerPaths.READELF_PATH;
 
-               // for readelf
                if (isCurrentDeviceArmArch()) {
                        readelf += CommonConstants.ARM_ARCH;
                } else {
                        readelf += CommonConstants.X86_ARCH;
                }
-               source = readelf + File.separator + AnalyzerConstants.READELF_BIN;
-               readelfSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PATH
-                               + AnalyzerConstants.READELF_BIN);
-
-               if (readelfSize < 0 || probeTizenSize < 0 || probeOspSize < 0
-                               || versionSize < 0 || daemonSize < 0 || daeventSize < 0) {
-                       return false;
+               String source = readelf + File.separator
+                               + AnalyzerConstants.READELF_BIN;
+               File file = new File(source);
+               if (file.exists()) {
+                       readelfSize = file.length();
                } else {
-                       execShellCommand(AnalyzerShellCommands.CMD_UPLOAD_FILE_LIST,
-                                       uploadDataReceiver);
-                       int size = getUploadDataResult().size();
-                       List<String> resultString = new ArrayList<String>();
-                       for (int i = 0; i < size; i++) {
-                               String[] splitResult = uploadDataResult.get(i).split("\\/"); //$NON-NLS-1$
-                               resultString.add(new String(splitResult[0].trim()));
-                       }
+                       System.out.println("upload error! file is not exist : " + source); //$NON-NLS-1$
+                       return false;
+               }
+               if (!uploadFile(source, AnalyzerPaths.DA_REMOTE_PATH
+                               + AnalyzerConstants.READELF_BIN)) {
+                       return false;
+               }
 
-                       boolean ret = true;
-                       // readelf
-                       if (readelfSize != Long.parseLong(resultString.get(0))) {
-                               System.out.println("readelf file size is different!! "); //$NON-NLS-1$
-                               ret = false;
-                       }
-                       // version
-                       if (versionSize != Long.parseLong(resultString.get(1))) {
-                               System.out.println("version file size is different!! "); //$NON-NLS-1$
-                               ret = false;
-                       }
-                       // daemon
-                       if (daemonSize != Long.parseLong(resultString.get(2))) {
-                               System.out.println("da_manager file size is different!! "); //$NON-NLS-1$
-                               ret = false;
-                       }
-                       // probe tizen
-                       if (probeTizenSize != Long.parseLong(resultString.get(3))) {
-                               System.out.println("probe tizen file size is different!! "); //$NON-NLS-1$
-                               ret = false;
-                       }
-                       // probe osp
-                       if (probeOspSize != Long.parseLong(resultString.get(4))) {
-                               System.out.println("probe osp file size is different!! "); //$NON-NLS-1$
-                               ret = false;
-                       }
+               // readelf
+               long uploadSize = getReadelfSize();
+               if (uploadSize < 0) {
+                       return false;
+               }
+               if (readelfSize != uploadSize) {
+                       System.out.println("readelf file size is different!! "); //$NON-NLS-1$
+                       return false;
+               }
+               return true;
+       }
 
-                       // da_event
-                       if (daeventSize != Long.parseLong(resultString.get(5))) {
-                               System.out.println("da_event file size is different!! "); //$NON-NLS-1$
-                               ret = false;
-                       }
+       private static long getReadelfSize() {
+               long ret = -1;
+               getUploadDataResult().clear();
+               execShellCommand(AnalyzerShellCommands.CMD_UPLOAD_FILE_LIST,
+                               uploadDataReceiver);
+               if (getUploadDataResult().isEmpty()) {
                        return ret;
                }
+
+               String duResult = getUploadDataResult().get(0);
+               if (!duResult.contains("cannot access")) {
+                       String[] splitResult = duResult.split("\\/"); //$NON-NLS-1$
+                       duResult = new String(splitResult[0].trim());
+                       ret = Long.parseLong(duResult);
+               }
+               return ret;
        }
 
        private static MultiLineReceiver uploadDataReceiver = new MultiLineReceiver() {
@@ -695,71 +951,6 @@ public class DACommunicator {
                return uploadDataResult;
        }
 
-       private static boolean existVersion = false;
-
-       private static MultiLineReceiver lsVersion = new MultiLineReceiver() {
-               @Override
-               public void processNewLines(String[] lines) {
-                       existVersion = false;
-                       if (0 != lines.length && !lines[0].isEmpty()
-                                       && !lines[0].startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
-                               existVersion = true;
-                       }
-               }
-       };
-
-       private static boolean isVersionExist() {
-               execShellCommand(AnalyzerShellCommands.CMD_LS_VERSION, lsVersion);
-               return existVersion;
-       }
-
-       private static String getDAVersion() {
-               File version = new File(AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
-                               + File.separator + AnalyzerConstants.VERSION_NAME);
-               if (version.exists()) {
-                       BufferedReader br;
-                       try {
-                               br = new BufferedReader(new FileReader(version));
-                               return br.readLine();
-                       } catch (FileNotFoundException e) {
-                               e.printStackTrace();
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                       }
-               }
-               return null;
-       }
-
-       private static boolean correctVersion = false;
-
-       private static MultiLineReceiver catVersion = new MultiLineReceiver() {
-               @Override
-               public void processNewLines(String[] lines) {
-                       correctVersion = false;
-                       if (0 != lines.length && !lines[0].isEmpty()
-                                       && !lines[0].startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
-
-                               String daVersion = getDAVersion();
-                               if (null != daVersion && daVersion.equals(lines[0])) {
-                                       correctVersion = true;
-                                       return;
-                               }
-                       }
-               }
-       };
-
-       private static boolean isCorrectVersion() {
-               execShellCommand(AnalyzerShellCommands.CMD_CAT_VERSION, catVersion);
-               return correctVersion;
-       }
-
-       public static boolean needUpdateVersion() {
-               if (!isVersionExist() || !isCorrectVersion()) {
-                       return true;
-               }
-               return false;
-       }
-
        public static void addDeviceListener() {
                SmartDevelopmentBridge.addDeviceChangeListener(deviceChanged);
        }
@@ -786,12 +977,14 @@ public class DACommunicator {
                        System.out.println("device disconnected : "
                                        + device.getSerialNumber());
                        DeviceInfo deviceInfo = getDeviceByName(device.getSerialNumber());
-                       devices.remove(deviceInfo);
-                       checkDevices();
-                       if (isRunning()) {
-                               System.out.println("Disconnected while DA is running."); //$NON-NLS-1$
-                               UIRecorderTool.getInstance().stop();
-                               DACommunicator.setRunning(false);
+                       if (null != devices && !devices.isEmpty()) {
+                               devices.remove(deviceInfo);
+                               checkDevices();
+                               if (isRunning()) {
+                                       System.out.println("Disconnected while DA is running."); //$NON-NLS-1$
+                                       UIRecorderTool.getInstance().stop();
+                                       DACommunicator.setRunning(false);
+                               }
                        }
                }
 
@@ -817,6 +1010,8 @@ public class DACommunicator {
                                                public void run() {
                                                        ToolbarArea.getInstance().setStartButtonEnablement(
                                                                        true);
+                                                       ToolbarArea.getInstance().setStartButtonEnablement(
+                                                                       true);
                                                }
                                        });
                                }
@@ -854,8 +1049,7 @@ public class DACommunicator {
        private static void clearDeviceAppInfo() {
                setSelectedDevice(null);
                setSelectedApp(null);
-               getAppDesktopList().clear();
-               getAppDesktopString().clear();
+               packageInfoMultiLines.clear();
        }
 
        public static void setSelectedDeviceBySerial(String serial) {
@@ -881,4 +1075,32 @@ public class DACommunicator {
                        System.out.println("Failed to get " + from); //$NON-NLS-1$ 
                }
        }
+
+       public static String getLocalhost() {
+               NetworkInterface ni;
+               InetAddress i;
+
+               Enumeration<NetworkInterface> ne;
+               try {
+                       ne = NetworkInterface.getNetworkInterfaces();
+               } catch (SocketException e1) {
+                       e1.printStackTrace();
+                       return null;
+               }
+               while (ne.hasMoreElements()) {
+                       ni = (NetworkInterface) ne.nextElement();
+                       if (ni.getName().contains("lo")) {//$NON-NLS-1$ 
+                               Enumeration<InetAddress> e = ni.getInetAddresses();
+                               while (e.hasMoreElements()) {
+                                       i = (InetAddress) e.nextElement();
+                                       if (!i.getHostAddress().contains(CommonConstants.PERCENT)
+                                                       && !i.getHostAddress().contains(
+                                                                       CommonConstants.COLON)) {
+                                               return i.getHostAddress();
+                                       }
+                               }
+                       }
+               }
+               return null;
+       }
 }
index c68b4c4..ff157a5 100644 (file)
@@ -50,7 +50,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DASingletonFocusManager;
 import org.tizen.dynamicanalyzer.model.DeviceInfo;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
+import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
@@ -64,6 +64,14 @@ public class IDECommunicator implements Runnable {
        private final static String IDE_DA_COMMUNICATION_TYPE_3 = "SOURCE";//$NON-NLS-1$
        private final String IDE_DA_COMMUNICATION_TYPE_1_RECORD = "record";//$NON-NLS-1$
        private final String IDE_DA_COMMUNICATION_TYPE_1_STOP = "stop";//$NON-NLS-1$
+
+       // private final int MSG_INDEX_CMD = 0;
+       private final int MSG_INDEX_DEVICE = 1;
+       private final int MSG_INDEX_APPID = 2;
+       private final int MSG_INDEX_APPNAME = 3;
+       private final int MSG_LENGTH = 4;
+       private final int APPNAME_LENGTH = 20;
+
        private static Socket socket = null;
        private int port = 0;
        private static BufferedWriter writer = null;
@@ -72,7 +80,12 @@ public class IDECommunicator implements Runnable {
        private File file = null;
        private FileLock fileLock = null;
        private FileChannel fchannel = null;
-       
+
+       private static boolean openWelcomeDlg = false;
+       private static Boolean waitingWelcomeDlg = false;
+
+       DADialog warning = null;
+
        public void run() {
                while (true) {
                        try {
@@ -214,7 +227,7 @@ public class IDECommunicator implements Runnable {
                String[] strMsg = msg.split(AnalyzerConstants.DATA_PARSING_TOKEN);
                if (strMsg[0].equals(IDE_DA_COMMUNICATION_TYPE_1)) {
                        sendDAStatus();
-               } else if (strMsg[0].equals(IDE_DA_COMMUNICATION_TYPE_2)) {                     
+               } else if (strMsg[0].equals(IDE_DA_COMMUNICATION_TYPE_2)) {
                        if (isDAReadyStatus()) {
                                autoStartApplication(strMsg);
                        }
@@ -262,30 +275,64 @@ public class IDECommunicator implements Runnable {
 
        // trace Application
        private void autoStartApplication(String[] strMsg) {
+               if (strMsg.length < MSG_LENGTH) {
+                       System.out.println("wrong message format!!");
+                       return;
+               }
+               ToolbarArea.getInstance().setToolbarStartStopState(false);
+               final String deviceName = new String(strMsg[MSG_INDEX_DEVICE].trim());
+               final String appid = new String(strMsg[MSG_INDEX_APPID].trim());
+               final String appName = new String(strMsg[MSG_INDEX_APPNAME].trim());
 
-               final String deviceName = new String(strMsg[1].trim());
-               final String appid = new String(strMsg[2].trim());
+               if (isOpenWelcomeDlg()) {
+                       System.out.println("Start -AutoRun Waiting...");
+                       synchronized (getWaitingWelcomeDlg()) {
+                               try {
+                                       getWaitingWelcomeDlg().wait();
+                               } catch (InterruptedException e) {
+                                       e.printStackTrace();
+                               }
+                       }
+                       System.out.println("End - AutoRun Waiting");
+               }
 
-               System.out.println("auto start : "  + appid);
+               System.out.println("auto start : " + appid);
                DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
                DACommunicator.setSelectedDevice(device);
 
                DACommunicator.getAppListFromTarget();
-               AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByAppId(appid);
+               AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(appid);
                if (null == appInfo) {
+                       Display.getDefault().syncExec(new Runnable() {
+                               public void run() {
+                                       Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+                                       DADialog warning = new DADialog(shell, SWT.NONE);
+                                       String name = appName;
+                                       if (name.length() > APPNAME_LENGTH) {
+                                               name = appName.substring(0, APPNAME_LENGTH - 1) + "...";//$NON-NLS-1$ 
+                                       }
+                                       warning.setMessage(name + " is not supported application");
+                                       warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
+                                       warning.open();
+
+                                       ToolbarArea.getInstance().setToolbarStartStopState(true);
+                               }
+                       });
                        System.out.println("invalid application name :" + appid);
                        return;
                }
-               final String appName = appInfo.getName();
+               final String appLabel = appInfo.getInfo(AppInfo.LABEL_INDEX);
                System.out.println("IDE recv - deviceName: " + deviceName
-                               + " appName : " + appName);
+                               + " appName : " + appLabel);
+
                Display.getDefault().syncExec(new Runnable() {
                        public void run() {
                                ToolbarArea.getInstance().setDeviceComboText(deviceName);
-                               ToolbarArea.getInstance().setAppComboText(appName);
+                               ToolbarArea.getInstance().setAppComboText(appLabel);
                                ToolbarArea.getInstance().startTrace();
                        }
                });
+
                DASingletonFocusManager.setFocusDA();
        }
 
@@ -337,4 +384,16 @@ public class IDECommunicator implements Runnable {
                }
                return true;
        }
+
+       public static boolean isOpenWelcomeDlg() {
+               return openWelcomeDlg;
+       }
+
+       public static void setOpenWelcomeDlg(boolean data) {
+               openWelcomeDlg = data;
+       }
+
+       public static Boolean getWaitingWelcomeDlg() {
+               return waitingWelcomeDlg;
+       }
 }
index 836d712..4a615f7 100644 (file)
@@ -32,7 +32,7 @@ public class ReceiveCommunicator implements Runnable {
 
        @Override
        public void run() {
-               MessageProcess.getInstance().run(
-                               ResourceCommunicator.getSockBufferedReader());
+               MessageProcess.getInstance()
+                               .run(DACommunicator.getSockBufferedReader());
        }
 }
index 87f995f..dce43ab 100644 (file)
@@ -34,7 +34,6 @@ import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.logparser.LogInserter;
 import org.tizen.dynamicanalyzer.logparser.LogParser;
 import org.tizen.dynamicanalyzer.sql.SqlManager;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.page.BaseView;
 import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
@@ -51,7 +50,7 @@ public class ClearHandler extends AbstractHandler {
                AnalyzerManager.clear();
                LogParser.clear();
                LogInserter.clear();
-               CallStackManager.clear();
+//             CallStackManager.clear();
                AnalyzerManager.getWarningChecker().clear();
                StopLogProcessor.clear();
                SqlManager.getInstance().clear();
index 9c3498d..78b96c6 100644 (file)
@@ -30,6 +30,7 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
 import org.tizen.dynamicanalyzer.logparser.LogInserter;
@@ -53,9 +54,8 @@ public class ExitHandler extends AbstractHandler {
                IDECommunicator.stopIDEcommunicatorThread();
                OpenTraceInputReader.stopOpenTraceInputReader();
                LogInserter.stopInsertLogThread();
-               if (DACommunicator.isDaemonAlive()) {
-                       DACommunicator.killDaemon();
-               }
+               DACommunicator
+                               .execShellCommand(AnalyzerShellCommands.DACOMMAND_KILL_MANAGER);
                DACommunicator.pullDaemonLog();
                return null;
        }
index f3eb0ee..4ab0040 100644 (file)
@@ -26,8 +26,6 @@
 
 package org.tizen.dynamicanalyzer.handlers;
 
-import java.sql.ResultSet;
-import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -48,10 +46,8 @@ import org.tizen.dynamicanalyzer.model.LogCenter;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.sql.DBTableInfo;
-import org.tizen.dynamicanalyzer.sql.DBTableManager;
 import org.tizen.dynamicanalyzer.sql.SqlManager;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
@@ -85,9 +81,7 @@ public class OpenTraceHandler extends AbstractHandler {
                List<String> pInfo = SqlManager.getInstance().getDetailsInfo(
                                p.getSavePath());
 
-               if (pInfo.isEmpty()) {
-                       // TODO: message box
-                       // TODO: valid check
+               if (null == pInfo || pInfo.isEmpty()) {
                        System.out.println("The trace file is invalid."); //$NON-NLS-1$
                        AnalyzerUtil.executeCommand(ClearHandler.ID);
                        return null;
@@ -120,27 +114,35 @@ public class OpenTraceHandler extends AbstractHandler {
                                        long stopTime = Long.parseLong(pInfo.get(i));
                                        p.setStopTime(stopTime);
                                } catch (NumberFormatException e) {
-                                       OpenTraceProgressManager.getInstance()
-                                                       .closeOpenTraceDialog(
-                                                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);
-                                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);
-                                       AnalyzerUtil.executeCommand(ClearHandler.ID);
+                                       invalidProgress();
                                        return null;
                                }
                        } else if (i == AnalyzerConstants.PROJECT_DEVICE_INDEX) {
                                p.setDevice(pInfo.get(i));
                        } else if (i == AnalyzerConstants.PROJECT_LAST_DATA_INDEX) {
-                               p.setLastLogNum(pInfo.get(i));
+                               String lastNum = pInfo.get(i);
+                               String[] splitLastNum = lastNum
+                                               .split(CommonConstants.CMD_SPLIT_READ);
+                               try {
+                                       p.setLastLogNum(Long.parseLong(splitLastNum[0]),
+                                                       LogCenterConstants.LOG_RESOURCE);
+                                       p.setLastLogNum(Long.parseLong(splitLastNum[1]),
+                                                       LogCenterConstants.LOG_DEVICE);
+                                       p.setLastLogNum(Long.parseLong(splitLastNum[2]),
+                                                       LogCenterConstants.LOG_PROFILING);
+                               } catch (NumberFormatException e) {
+                                       invalidProgress();
+                                       return null;
+                               } catch (ArrayIndexOutOfBoundsException e) {
+                                       invalidProgress();
+                                       return null;
+                               }
                        } else if (i == AnalyzerConstants.PROJECT_LAST_TIME_INDEX) {
                                try {
                                        long lastTime = Long.parseLong(pInfo.get(i));
                                        p.setLastTime(lastTime);
                                } catch (NumberFormatException e) {
-                                       OpenTraceProgressManager.getInstance()
-                                                       .closeOpenTraceDialog(
-                                                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);
-                                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);
-                                       AnalyzerUtil.executeCommand(ClearHandler.ID);
+                                       invalidProgress();
                                        return null;
                                }
                        } else if (i == AnalyzerConstants.PROJECT_TOTAL_SAMPLE_COUNT) {
@@ -148,11 +150,7 @@ public class OpenTraceHandler extends AbstractHandler {
                                        int totalSampleCount = Integer.parseInt(pInfo.get(i));
                                        p.setTotalProfilingSampleCount(totalSampleCount);
                                } catch (NumberFormatException e) {
-                                       OpenTraceProgressManager.getInstance()
-                                                       .closeOpenTraceDialog(
-                                                                       AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);
-                                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);
-                                       AnalyzerUtil.executeCommand(ClearHandler.ID);
+                                       invalidProgress();
                                        return null;
                                }
                        } else {
@@ -232,69 +230,82 @@ public class OpenTraceHandler extends AbstractHandler {
                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() {
-               if (SqlManager.getInstance().setCallStackDataFromTable(
-                               DBTableManager.TABLE_INDEX_CALLSTACK_DATA,
-                               CallStackManager.getInstance().getCallStackDataBySeqMap())) {
-                       return true;
-               } else {
-                       return false;
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .getCallStackDataFromTable();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadCallStackData");
+                       isSuccess = false;
                }
+               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() {
-               ResultSet rs = SqlManager.getInstance().selectAllFromTable(
-                               DBTableManager.TABLE_INDEX_CALLSTACK_UNITS);
-               if (null == rs) {
-                       return false;
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadCallStackApis();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadCallStackApis");
+                       isSuccess = false;
                }
 
-               HashMap<Long, CallStackUnit> apiHash = CallStackManager.getInstance()
-                               .getCallStackApiByAddrMap();
-               try {
-                       while (rs.next()) {
-                               long addr = rs.getLong("addr"); //$NON-NLS-1$
-                               String api = rs.getString("api"); //$NON-NLS-1$
-                               CallStackUnit csa = new CallStackUnit(addr, api);
-                               apiHash.put(addr, csa);
-                       }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-                       return false;
-               } finally {
-                       SqlManager.getInstance().closeConnection();
+               HashMap<Long, CallStackUnit> apiHash = AnalyzerManager
+                               .getCallstackManager().getCallStackApiByAddrMap();
+               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);
+                       CallStackUnit csa = new CallStackUnit(addr, api);
+                       apiHash.put(addr, csa);
+
                }
-               return true;
+               return isSuccess;
        }
 
        private boolean loadAppInfo() {
-               ResultSet rs = SqlManager.getInstance().selectAllFromTable(
-                               DBTableManager.TABLE_INDEX_APP_INFO);
-               if (null == rs) {
-                       return false;
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance().setloadAppInfo();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadAppInfo");
+                       isSuccess = false;
                }
-
                List<String> info = p.getAppInfo();
-               try {
-                       int index = 0;
-                       while (rs.next()) {
-                               info.set(index++, rs.getString("info")); //$NON-NLS-1$
-                       }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-                       return false;
-               } finally {
-                       SqlManager.getInstance().closeConnection();
+               for (int i = 0; i < dbInfo.size(); i++) {
+                       List<String> pInfo = dbInfo.get(i);
+                       info.set(i, pInfo.get(0));
                }
-               return true;
+               return isSuccess;
+
        }
 
        private boolean loadImageSet() {
-               String query = "select SeqNumber, Time from screenshot;";//$NON-NLS-1$
-               List<List<String>> input = SqlManager.getInstance()
-                               .executeSelectQueryFD(query, 2);
+               List<List<String>> input = SqlManager.getInstance().getloadImageSet(2);
                if (null == input) {
                        return false;
                }
@@ -314,120 +325,82 @@ public class OpenTraceHandler extends AbstractHandler {
        }
 
        private boolean loadLeakData() {
-               ResultSet rs = SqlManager.getInstance().selectAllFromTable(
-                               DBTableManager.TABLE_INDEX_LEAK_DATA);
-               LeakDetector leakDectector = AnalyzerManager.getLeakDetector();
-               if (null == rs || leakDectector == null) {
-                       return false;
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance().setloadLeakData();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadLeakData");
+                       isSuccess = false;
                }
-
-               int size = DBTableManager.commonColumns.length;
-
-               try {
-                       while (rs.next()) {
-                               List<String> data = new ArrayList<String>();
-                               for (int i = 1; i <= size; i++) {
-                                       data.add(rs.getString(i));
-                               }
-                               LeakData leakData = new LeakData(data);
-                               if (null != leakData.getParentKey()
-                                               && !leakData.getParentKey().isEmpty()) {
-                                       LeakData parent = leakDectector.getLeakHash().get(
-                                                       leakData.getParentKey());
-                                       if (null == parent) {
-                                               continue;
-                                       } else {
-                                               parent.getChildren().add(leakData);
-                                       }
+               LeakDetector leakDectector = AnalyzerManager.getLeakDetector();
+               for (int i = 0; i < dbInfo.size(); i++) {
+                       List<String> pInfo = dbInfo.get(i);
+                       LeakData leakData = new LeakData(pInfo);
+                       if (null != leakData.getParentKey()
+                                       && !leakData.getParentKey().isEmpty()) {
+                               LeakData parent = leakDectector.getLeakHash().get(
+                                               leakData.getParentKey());
+                               if (null == parent) {
+                                       continue;
                                } else {
-                                       leakDectector.getLeakHash()
-                                                       .put(leakData.getKey(), leakData);
+                                       parent.getChildren().add(leakData);
                                }
+                       } else {
+                               leakDectector.getLeakHash().put(leakData.getKey(), leakData);
                        }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-                       return false;
-               } finally {
-                       SqlManager.getInstance().closeConnection();
                }
-               return true;
+               return isSuccess;
        }
 
        private boolean loadFailedData() {
-               ResultSet rs = SqlManager.getInstance().selectAllFromTable(
-                               DBTableManager.TABLE_INDEX_FAILED_DATA);
-               FailedChecker failedChecker = AnalyzerManager.getFailedChecker();
-               if (null == rs || failedChecker == null) {
-                       return false;
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadFailedData();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadFailedData");
+                       isSuccess = false;
                }
 
-               int size = DBTableManager.commonColumns.length;
-
-               try {
-                       while (rs.next()) {
-                               List<String> data = new ArrayList<String>();
-                               for (int i = 1; i <= size; i++) {
-                                       data.add(rs.getString(i));
-                               }
-                               // possibility of extensions - network, efl, db, etc...
-                               int id = Integer
-                                               .parseInt(data.get(LogCenterConstants.ID_INDEX));
-                               if (id == LogCenterConstants.LOG_RESOURCE) {
-                                       // if file failed api data is skip - file chart make it!
-                                       int type = Integer.parseInt(data
-                                                       .get(LogCenterConstants.RESOURCE_FDTYPE_INDEX));
-                                       if (type == LogCenterConstants.FD_TYPE_FILE) {
-                                               continue;
-                                       }
+               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 == LogCenterConstants.LOG_RESOURCE) {
+                               // 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(data);
-                               failedChecker.getFailedList().add(failedData);
                        }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-                       return false;
-               } finally {
-                       SqlManager.getInstance().closeConnection();
+                       FailedData failedData = new FailedData(pInfo);
+                       failedChecker.getFailedList().add(failedData);
+
                }
-               return true;
+               return isSuccess;
        }
 
        private boolean loadProfilingData() {
-               DBTableInfo profilingData = DBTableManager.getInstance().getTableInfo(
-                               DBTableManager.TABLE_INDEX_PROFILING_DATA);
-               ResultSet rs = SqlManager.getInstance().selectAllFromTable(
-                               DBTableManager.TABLE_INDEX_PROFILING_DATA);
-               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
-                               .getProfileDataMaker();
-               if (null == rs || profiler == null) {
-                       return false;
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadProfilingData();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadProfilingData");
+                       isSuccess = false;
                }
 
-               int size = profilingData.getColumnNames().length;
-
-               try {
-                       while (rs.next()) {
-                               List<String> data = new ArrayList<String>();
-                               for (int i = 1; i <= size; i++) {
-                                       data.add(rs.getString(i));
-                               }
-                               // possibility of extensions - network, efl, db, etc...
-                               ProfilingData fupData = new ProfilingData(data, profiler);
-                               String seq = data.get(ProfilingData.SEQUENCE_INDEX);
-                               profiler.getProfilingDataMap().put(seq, fupData);
-                               String symbol = data.get(ProfilingData.KEY_INDEX);
-                               FunctionUsageProfiler.getSymbolSeqHash().put(symbol, seq);
-                               UIDataManager.getInstance().getfunctionProfilingDataChecker()
-                                               .addProfilingData(fupData);
-                       }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-                       return false;
-               } finally {
-                       SqlManager.getInstance().closeConnection();
+               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                               .getProfileDataMaker();
+               for (int i = 0; i < dbInfo.size(); i++) {
+                       List<String> pInfo = dbInfo.get(i);
+                       // possibility of extensions - network, efl, db, etc...
+                       ProfilingData fupData = new ProfilingData(pInfo, profiler);
+                       String seq = pInfo.get(ProfilingData.SEQUENCE_INDEX);
+                       profiler.getProfilingDataMap().put(seq, fupData);
+                       String symbol = pInfo.get(ProfilingData.KEY_INDEX);
+                       profiler.getSymbolSeqHash().put(symbol, seq);
+                       UIDataManager.getInstance().getfunctionProfilingDataChecker()
+                                       .addProfilingData(fupData);
                }
 
                ProfilingData ab = profiler
@@ -436,54 +409,38 @@ public class OpenTraceHandler extends AbstractHandler {
                ProfilingData dl = profiler
                                .getProfilingDataByKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);
                profiler.setDependentLib(dl);
-               return true;
+
+               return isSuccess;
        }
 
        private boolean loadProfilingChildData() {
-               DBTableInfo profilingChildData = DBTableManager.getInstance()
-                               .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
-               ResultSet rs = SqlManager.getInstance().selectAllFromTable(
-                               DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
+               boolean isSuccess = true;
+               List<List<String>> dbInfo = SqlManager.getInstance()
+                               .setloadProfilingChildData();
+               if (null == dbInfo) {
+                       System.out.println("failed - loadProfilingChildData");
+                       isSuccess = false;
+               }
                ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
                                .getProfileDataMaker();
-               if (null == rs || profiler == null) {
-                       return false;
-               }
-
-               int size = profilingChildData.getColumnNames().length;
-
-               try {
-                       while (rs.next()) {
-                               List<String> data = new ArrayList<String>();
-                               for (int i = 1; i <= size; i++) {
-                                       data.add(rs.getString(i));
-                               }
-
-                               if (data.size() < 2) {
-                                       continue;
-                               }
-
-                               String seqs = data.get(1);
-                               String[] splitSeqs = seqs.split(CommonConstants.SLASH);
-                               List<String> childData = new ArrayList<String>();
-                               for (int ii = 0; ii < splitSeqs.length; ii++) {
-                                       childData.add(new String(splitSeqs[ii]));
-                               }
-                               ProfilingData parent = profiler.getProfilingDataMap().get(
-                                               data.get(0));
-                               ProfilingChildData child = parent.getChildData();
-                               child.getChildren().addAll(childData);
-                               profiler.getChildListMap().put(data.get(0), child);
+               for (int i = 0; i < dbInfo.size(); i++) {
+                       List<String> data = dbInfo.get(i);
+                       if (data.size() < 2) {
+                               continue;
                        }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-                       return false;
-               } finally {
-                       SqlManager.getInstance().closeConnection();
+                       String seqs = data.get(1);
+                       String[] splitSeqs = seqs.split(CommonConstants.SLASH);
+                       List<String> childData = new ArrayList<String>();
+                       for (int ii = 0; ii < splitSeqs.length; ii++) {
+                               childData.add(new String(splitSeqs[ii]));
+                       }
+                       ProfilingData parent = profiler.getProfilingDataMap().get(
+                                       data.get(0));
+                       ProfilingChildData child = parent.getChildData();
+                       child.getChildren().addAll(childData);
+                       profiler.getChildListMap().put(data.get(0), child);
                }
-
-               return true;
+               return isSuccess;
        }
 
        private void createWarningDialog(String message) {
index 5552b44..11b4e05 100644 (file)
@@ -32,6 +32,7 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogValues;
 import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
 import org.tizen.dynamicanalyzer.widgets.timer.IAlarm;
 import org.tizen.dynamicanalyzer.widgets.timer.TimerClock;
@@ -62,15 +63,17 @@ public class ReplayTraceHandler extends AbstractHandler {
        }
 
        public static void setStopAlarm() {
-               TimerClock timer = ToolbarArea.getInstance().getTimer();
-               timer.setAlarm(stopTime, new IAlarm() {
+               if (ConfigurationDialogValues.getInstance().isAutoStop()) {
+                       TimerClock timer = ToolbarArea.getInstance().getTimer();
+                       timer.setAlarm(stopTime, new IAlarm() {
 
-                       @Override
-                       public void action() {
-                               ToolbarArea.getInstance().stopTrace();
-                               isReplay = false;
-                               stopTime = -1;
-                       }
-               });
+                               @Override
+                               public void action() {
+                                       ToolbarArea.getInstance().stopTrace();
+                                       isReplay = false;
+                                       stopTime = -1;
+                               }
+                       });
+               }
        }
 }
index 770d0c9..8c42576 100644 (file)
@@ -32,7 +32,6 @@ import org.eclipse.ui.PerspectiveAdapter;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 
-
 public class AnalyzerPerspectiveListener extends PerspectiveAdapter {
 
        @Override
@@ -45,7 +44,6 @@ public class AnalyzerPerspectiveListener extends PerspectiveAdapter {
                DACommunicator.addDeviceListener();
                DACommunicator.loadDevices();
                DACommunicator.checkDevices();
-
        }
 
        @Override
index 67bd02a..6898c8f 100644 (file)
@@ -90,7 +90,7 @@ public class SummaryMouseDoubleClickListener implements MouseListener {
                        pageId = FilePage.ID;
                        // }
                        // else {
-                       // TODO: pageId = NetworkPage.ID;
+                       // pageId = NetworkPage.ID;
                        // }
                } else if (id == LogCenterConstants.LOG_THREAD) {
                        pageId = ThreadPage.ID;
index 01431ea..89d045c 100644 (file)
@@ -54,7 +54,6 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
@@ -105,13 +104,7 @@ public class TableTooltipListener implements Listener {
                case SWT.KeyDown:
                        break;
                case SWT.KeyUp:
-                       if (SWT.F2 == event.keyCode) {
-                               isToggled = !isToggled;
-                               if (enabled && !isHeader) {
-                                       setViewCursor(isToggled);
-                               }
-                               ToolbarArea.getInstance().setSourceViewState(isToggled);
-                       }
+                       setViewCursor(isToggled);
                        break;
                case SWT.MouseEnter:
                        grid.setFocus();
@@ -370,7 +363,7 @@ public class TableTooltipListener implements Listener {
                                sl.setError(AnalyzerConstants.SOURCELINE_NO_SOURCELINE_DATA);
                                return sl;
                        }
-                       addr = CallStackManager.getInstance().getPCAddrBySeq(seqNum);
+                       addr = AnalyzerManager.getCallstackManager().getPCAddrBySeq(seqNum);
                }
                boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
                String baseAddr = AnalyzerManager.getProject().getBaseAddress();
index fe33a65..b925cb8 100644 (file)
@@ -107,23 +107,23 @@ public class LogCenterConstants {
        public static final int FD_TYPE_FILE = 0;
        public static final int FD_TYPE_SOCKET = 1;
        public static final int FD_TYPE_THREAD = 2;
-
-       public static final String FD_API_TYPE_OPEN = "0"; //$NON-NLS-1$
-       public static final String FD_API_TYPE_CLOSE = "1"; //$NON-NLS-1$
-       public static final String FD_API_TYPE_READ = "2"; //$NON-NLS-1$
-       public static final String FD_API_TYPE_WRITE = "3"; //$NON-NLS-1$
-       public static final String FD_API_TYPE_OTHERS = "4"; //$NON-NLS-1$
-       public static final String FD_API_INTERNAL_START = "11"; //$NON-NLS-1$
-       public static final String FD_API_INTERNAL_CLOSE = "12"; //$NON-NLS-1$
-       public static final String FD_API_WAIT = "13"; //$NON-NLS-1$
-       public static final String FD_API_INTERNAL_USE = "14"; //$NON-NLS-1$
-
-       public static final int FD_API_TYPE_NUMBER_OPEN = 0;
-       public static final int FD_API_TYPE_NUMBER_CLOSE = 1;
-       public static final int FD_API_TYPE_NUMBER_READ = 2;
-       public static final int FD_API_TYPE_NUMBER_WRITE = 3;
-       public static final int FD_API_TYPE_NUMBER_OTHERS = 4;
-       public static final int FD_API_TYPE_NUMBER_FAILED = 5;
+       
+       /* Log File */
+//     public static final int FD_API_TYPE_OPEN = 0;
+//     public static final int FD_API_TYPE_CLOSE = 1;
+//     public static final int FD_API_TYPE_READ_START = 2;
+//     public static final int FD_API_TYPE_READ_END = 3;
+//     public static final int FD_API_TYPE_WRITE_START = 4;
+//     public static final int FD_API_TYPE_WRITE_END = 5;
+//     public static final int FD_API_TYPE_OTHERS = 6;
+       
+       public static final int FD_API_TYPE_OPEN = 0;
+       public static final int FD_API_TYPE_CLOSE = 1;
+       public static final int FD_API_TYPE_READ_START = 2;
+       public static final int FD_API_TYPE_READ_END = 23;
+       public static final int FD_API_TYPE_WRITE_START = 3;
+       public static final int FD_API_TYPE_WRITE_END = 35;
+       public static final int FD_API_TYPE_OTHERS = 4;
        
        /* Log snapshot */
        public static final int SNAPSHOT_IMAGE_PATH_INDEX = 12;
index 0d22c18..73d43af 100644 (file)
@@ -38,7 +38,6 @@ import org.tizen.dynamicanalyzer.model.ImageInfo;
 import org.tizen.dynamicanalyzer.model.LogCenter;
 import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
 import org.tizen.dynamicanalyzer.project.Project;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.page.BaseView;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
@@ -64,7 +63,6 @@ public class LogParser implements Runnable {
 
        /** thread **/
        private String pid = null;
-       private String lastLogSeqNumber = CommonConstants.ZERO;
 
        public static void clear() {
                stopLogParser();
@@ -194,10 +192,6 @@ public class LogParser implements Runnable {
 
                        String seq = slicedLog[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
                        long seqNum = Long.parseLong(seq);
-                       long lastSeqNum = Long.parseLong(lastLogSeqNumber);
-                       if (lastSeqNum < seqNum) {
-                               lastLogSeqNumber = slicedLog[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
-                       }
 
                        if (id == LogCenterConstants.LOG_USER_FUNCTION) {
                                String apiName = slicedLog[LogCenterConstants.APINAME_INDEX];
@@ -220,13 +214,13 @@ public class LogParser implements Runnable {
                                        AnalyzerManager.setBinaryStartEndAddr(start, end);
                                }
 
-                               if (CallStackManager.getInstance().isIrregularUserCall(
+                               if (AnalyzerManager.getCallstackManager().isIrregularUserCall(
                                                slicedLog)) {
                                        continue;
                                }
                                pushLog(logId, slicedLog, logPack);
                                /* user callstack create by entry and exit */
-                               CallStackManager.getInstance().makeUserCallstack(
+                               AnalyzerManager.getCallstackManager().makeUserCallstack(
                                                slicedLog,
                                                FunctionUsageProfiler.getInstance()
                                                                .getProfileDataMaker());
@@ -242,17 +236,20 @@ public class LogParser implements Runnable {
                                        processImage(remoteImgPath, rotate);
                                }
                                pushLog(logId, slicedLog, logPack);
-                               CallStackManager.getInstance().makeCallstackWithoutBacktrace(
-                                               slicedLog);
+                               AnalyzerManager.getCallstackManager()
+                                               .makeCallstackWithoutBacktrace(slicedLog);
                                if (id == LogCenterConstants.LOG_RESOURCE
                                                || id == LogCenterConstants.LOG_MEMORY) {
                                        AnalyzerManager.getLeakDetector().runLeakDectect(slicedLog);
                                }
 
-                               AnalyzerManager.getFailedChecker().check(slicedLog);
+                               AnalyzerManager.getFailedChecker().check(slicedLog,
+                                               AnalyzerManager.getCallstackManager());
                        }
+
+                       // set last log number
+                       AnalyzerManager.getProject().setLastLogNum(seqNum, id);
                }
-               AnalyzerManager.getProject().setLastLogNum(lastLogSeqNumber);
 
                updateLog(logPack);
        }
index 75a1b61..1942b74 100644 (file)
@@ -53,6 +53,11 @@ import org.tizen.sdblib.SyncService.SyncResult;
 
 public class MessageProcess {
 
+       final int MSG_ID_INDEX = 0;
+       final int MSG_LENGTH_INDEX = 1;
+       final int MSG_PAYLOAD_INDEX = 2;
+       final int MSG_SPLIT_SIZE = 3;
+       
        /* Message Buffer max length */
        final int MSG_BUFFER_MAX = 100;
        final int MSG_BUFFER_TIMER_DELAY = 5;
@@ -115,13 +120,13 @@ public class MessageProcess {
                // System.out.println("count " + messageCount + ": " + message);
                try {
                        String[] messages = message
-                                       .split(CommonConstants.CMD_SPLIT_READ, 2);
-                       int messageIndex = Integer.parseInt(messages[0]);
+                                       .split(CommonConstants.CMD_SPLIT_READ, MSG_SPLIT_SIZE);
+                       int messageIndex = Integer.parseInt(messages[MSG_ID_INDEX]);
 
                        switch (messageIndex) {
                        case AnalyzerConstants.MSG_APP_INFO: /* app info : 1 */
                                if (!AnalyzerManager.isAppInfoArrived()) {
-                                       processAppInfo(messages[1]);
+                                       processAppInfo(messages[MSG_PAYLOAD_INDEX]);
                                        AnalyzerManager.setAppInfoArrived(true);
                                }
                                break;
@@ -136,11 +141,11 @@ public class MessageProcess {
                                // System.out
                                // .println("count " + messageCount + ": " + message);
                                // }
-                               buffer.add(messages[1]);
+                               buffer.add(messages[MSG_PAYLOAD_INDEX]);
                                messageCount += 1;
                                break;
                        case AnalyzerConstants.MSG_IMAGE: /* screenshot : 6 */
-                               processImage(messages[1]);
+                               processImage(messages[MSG_PAYLOAD_INDEX]);
                                break;
                        case AnalyzerConstants.MSG_TERMINATE: /* terminate : 7 */
                                processTerminate();
@@ -290,7 +295,7 @@ public class MessageProcess {
                                        }
                                }
                        } // end while()
-                       Display.getDefault().syncExec(new Runnable() {
+                       Display.getDefault().asyncExec(new Runnable() {
                                @Override
                                public void run() {
                                        StopProcessManager.getInstance().stopProcessStart(
@@ -303,7 +308,7 @@ public class MessageProcess {
                        System.out
                                        .println("### socket timeout - TODO: show this as a dialog."); //$NON-NLS-1$
 
-                       Display.getDefault().syncExec(new Runnable() {
+                       Display.getDefault().asyncExec(new Runnable() {
                                @Override
                                public void run() {
                                        StopProcessManager
@@ -335,7 +340,7 @@ public class MessageProcess {
                StopLogProcessor.runStopLogProcessThread();
                DACommunicator.closeSocket();
                DACommunicator.unfoward(DACommunicator.LOCAL_PORT,
-                               DACommunicator.REMOTE_PORT);
+                               DACommunicator.getRemotePort());
 
                AnalyzerUtil.executeCommand(StopHandler.ID);
        }
index cb74eab..898e613 100644 (file)
@@ -1,13 +1,23 @@
 package org.tizen.dynamicanalyzer.model;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.sdblib.IDevice;
 
 public class DeviceInfo {
        private IDevice device;
        private String selectedApplication;
 
+       private List<AppInfo> appInfoList = null;
+       private HashMap<String, AppInfo> appInfoHash = null;
+
        public DeviceInfo(IDevice device) {
                this.device = device;
+               appInfoList = new ArrayList<AppInfo>();
+               appInfoHash = new HashMap<String, AppInfo>();
        }
 
        public void setSelectedAppName(String name) {
@@ -21,4 +31,12 @@ public class DeviceInfo {
        public IDevice getIDevice() {
                return device;
        }
+
+       public List<AppInfo> getAppInfoList() {
+               return appInfoList;
+       }
+
+       public HashMap<String, AppInfo> getAppInfoHash() {
+               return appInfoHash;
+       }
 }
index f6aef58..1a4c9b2 100644 (file)
@@ -51,6 +51,13 @@ public class AnalyzerLabels extends NLS {
        public static String SAVE_TRACE;
        public static String OPEN_TRACE;
        public static String REPLAY;
+       
+       public static String START_TRACE_MAC;
+       public static String STOP_TRACE_MAC;
+       public static String SAVE_TRACE_MAC;
+       public static String OPEN_TRACE_MAC;
+       public static String REPLAY_MAC;
+       
        public static String RANGE_PAGE;
        public static String VIEW_SOURCE;
        public static String SNAPSHOT_ENABLE;
@@ -60,6 +67,7 @@ public class AnalyzerLabels extends NLS {
        public static String ABOUT;
        public static String LICENSE;
        public static String CONFIGURATION;
+       public static String WELCOME;
 
        // SingletonInfoDlg.
        public static String DA_WARNING;
@@ -97,6 +105,21 @@ public class AnalyzerLabels extends NLS {
        public static String COOLBAR_AREA_UI;
        public static String COOLBAR_AREA_TIMELINE;
        public static String COOLBAR_AREA_RANGE;
+       
+       public static String COOLBAR_AREA_FILE_TOOLTIP;
+       public static String COOLBAR_AREA_SUMMARY_TOOLTIP;
+       public static String COOLBAR_AREA_THREAD_TOOLTIP;
+       public static String COOLBAR_AREA_UI_TOOLTIP;
+       public static String COOLBAR_AREA_TIMELINE_TOOLTIP;
+       public static String COOLBAR_AREA_RANGE_TOOLTIP;
+       
+       public static String COOLBAR_AREA_FILE_TOOLTIP_MAC;
+       public static String COOLBAR_AREA_SUMMARY_TOOLTIP_MAC;
+       public static String COOLBAR_AREA_THREAD_TOOLTIP_MAC;
+       public static String COOLBAR_AREA_UI_TOOLTIP_MAC;
+       public static String COOLBAR_AREA_TIMELINE_TOOLTIP_MAC;
+       public static String COOLBAR_AREA_RANGE_TOOLTIP_MAC;
+       
        public static String COOLBAR_AREA_CONFIGURATION_FEATURES;
        public static String COOLBAR_AREA_CONFIGURATION_SETTING;
 
index 1e6dc58..42ff35a 100644 (file)
@@ -13,21 +13,28 @@ OPEN=Open
 CLOSE=Close
 
 #Toolbar button
-START_TRACE=Start trace
-STOP_TRACE=Stop trace
-SAVE_TRACE=Save trace
-OPEN_TRACE=Open trace
-REPLAY=Replay
+START_TRACE=Start trace [Ctrl + g]
+STOP_TRACE=Stop trace [Ctrl + g]
+SAVE_TRACE=Save trace [Ctrl + s]
+OPEN_TRACE=Open trace [Ctrl + o]
+REPLAY=Replay [Ctrl + r]
+
+START_TRACE_MAC=Start trace [Command + g]
+STOP_TRACE_MAC=Stop trace [Command + g]
+SAVE_TRACE_MAC=Save trace [Command + s]
+OPEN_TRACE_MAC=Open trace [Command + o]
+REPLAY_MAC=Replay [Command + r]
+
 RANGE_PAGE=Range page
-VIEW_SOURCE=View source
-SNAPSHOT_ENABLE=Take snapshot
-SETTING=Settings
+VIEW_SOURCE=View source [F2]
+SNAPSHOT_ENABLE=Take snapshot [F3]
+SETTING=Settings [F6]
 
 #Setting menu
-ABOUT=About Tizen Dynamic Analyzer
+ABOUT=About Tizen Dynamic Analyzer [F1]
 LICENSE=License
 CONFIGURATION=Configuration
-
+WELCOME=Welcome
 # SingletonInfoDlg.
 DA_WARNING=Warning
 
@@ -64,6 +71,20 @@ COOLBAR_AREA_UI=UI
 COOLBAR_AREA_TIMELINE=Timeline
 COOLBAR_AREA_RANGE=Range
 
+COOLBAR_AREA_TIMELINE_TOOLTIP=Timeline [Ctrl + 1]
+COOLBAR_AREA_FILE_TOOLTIP=File [Ctrl + 2]
+COOLBAR_AREA_THREAD_TOOLTIP=Thread [Ctrl + 3]
+COOLBAR_AREA_UI_TOOLTIP=UI [Ctrl + 4]
+COOLBAR_AREA_SUMMARY_TOOLTIP=Summary  [Ctrl + 5]
+COOLBAR_AREA_RANGE_TOOLTIP=Range [Ctrl + 6]
+
+COOLBAR_AREA_TIMELINE_TOOLTIP_MAC=Timeline [Command + 1]
+COOLBAR_AREA_FILE_TOOLTIP_MAC=File [Command + 2]
+COOLBAR_AREA_THREAD_TOOLTIP_MAC=Thread [Command + 3]
+COOLBAR_AREA_UI_TOOLTIP_MAC=UI [Command + 4]
+COOLBAR_AREA_SUMMARY_TOOLTIP_MAC=Summary  [Command + 5]
+COOLBAR_AREA_RANGE_TOOLTIP_MAC=Range [Command + 6]
+
 COOLBAR_AREA_CONFIGURATION_FEATURES=Features
 COOLBAR_AREA_CONFIGURATION_SETTING=Configuration
 
index eddcee6..3d6fdbc 100644 (file)
@@ -11,6 +11,7 @@ PROCESSSIZE=Process size
 SINGLETON_FOCUS_DA_PID=Singleton focus DA PID
 CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST=Available chart list
 CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST=Selected chart list
+
 FUNCTIONPROFILING=FunctionProfiling
 ALLOCATION=Allocation
 FILE=File
@@ -18,24 +19,25 @@ THREAD=Thread
 USERINTERFACE=UserInterface
 SNAPSHOT=Snapshot
 EVENT=Event
-RECORDING=Recording
-DETAIL_FUNCTIONPROFILING=Shows profile of Function.
-DETAIL_ALLOCATION=Shows heap memory allocation.
-DETAIL_FILE=Shows an analysis of the file usage on the File tab and file chart in the timeLine Page 
-DETAIL_THREAD=The Thread tab shows information about thread and synchronization.
-DETAIL_USERINTERFACE=The UI tab shows UI component hierarchy and UI-related function profiling.
-DETAIL_SNAPSHOT=Shows screenShots of application.
+RECORDING=Recording <always on>
+
+DETAIL_FUNCTIONPROFILING=Shows the function profile.
+DETAIL_ALLOCATION=Shows the heap memory allocation.
+DETAIL_FILE=Shows the file usage analysis on the File tab and the file chart on the Timeline tab.
+DETAIL_THREAD=Shows information about thread and synchronization.
+DETAIL_USERINTERFACE=Shows the UI component hierarchy and UI-related function profiling.
+DETAIL_SNAPSHOT=Shows application screenshots.
 DETAIL_EVENT=Shows UI events that occur on the device.
-DETAIL_RECORDING= Save profiling information for RePlay.
+DETAIL_RECORDING= Record profiling information for playback.
 THEME=theme
-FEATURE_TABLE_TITLE=Default Analysis Features Settings
+FEATURE_TABLE_TITLE=Default Settings for Analysis Features
 FEATURE_TABLE_FEATURE_EMPTY=
 FEATURE_TABLE_FEATURE_NAME=Name
 FEATURE_DETAIL_TITLE=Details
-SETTING_TABLE_TITLE=Appearance Setting
+SETTING_TABLE_TITLE=Appearance Settings
 SETTING_WHITE=White
 SETTING_BLACK=Black
-SETTING_CONFIGURATION_TITLE=Configuration Setting
-SHOW_INITIAL=Not show initial feature setting
-AUTO_STOP=Auto stop while replaying
+SETTING_CONFIGURATION_TITLE=Configuration Settings
+SHOW_INITIAL=Do not show the configuration at start-up.
+AUTO_STOP=Auto-stop while replaying
 WELCONE_ASK_USE_AGAIN=Use this as the default and do not ask again.
\ No newline at end of file
index 9c38e34..7574fc7 100644 (file)
@@ -55,18 +55,13 @@ public class FilePageLabels extends NLS {
        public static String FILE_DETAILS_WRITE_SIZE;
        public static String FILE_DETAILS_TOTAL_SIZE;
        
-       public static String FILE_CHART_SERIES_FILE;
-       public static String FILE_CHART_API_FILE;
+       public static String FILE_CHART_SERIES;
+       public static String FILE_CHART_API;
+       public static String FILE_CHART_ACCESS;
        
        public static String FILE_CHART_TOOLTIP_CLOSED;
        public static String FILE_CHART_TOOLTIP_OPEND;
-       public static String FILE_CHART_TOOLTIP_USED;
-       public static String FILE_CHART_TOOLTIP_UNUSED;
-       public static String FILE_CHART_TOOLTIP_FAILED;
-       
-       
-       
-       
+       public static String FILE_CHART_TOOLTIP_USED;   
        static {
                // initialize resource bundle
                NLS.initializeMessages(BUNDLE_NAME, FilePageLabels.class);
index c8cd6bb..f031f7f 100644 (file)
@@ -21,13 +21,12 @@ FILE_DETAILS_API_COUNT=API count :
 FILE_DETAILS_FAILED_API_COUNT=Failed API count :
 FILE_DETAILS_FILE_NAME_NEWLINE=File name : \n 
  
-FILE_CHART_SERIES_FILE=STATE
-FILE_CHART_API_FILE=API
+FILE_CHART_SERIES=STATE
+FILE_CHART_API=API
+FILE_CHART_ACCESS=ACCESS
 
 FILE_CHART_TOOLTIP_CLOSED=CLOSED
 FILE_CHART_TOOLTIP_OPEND=OPEND
 FILE_CHART_TOOLTIP_USED=USED
-FILE_CHART_TOOLTIP_UNUSED=UNUSED
-FILE_CHART_TOOLTIP_FAILED=FAILED
        
 
index 2e789f7..60cd2da 100644 (file)
@@ -59,6 +59,7 @@ public class ThreadPageLabels extends NLS {
        public static String SYNC_ATTR_TYPE_DEFAULT;
 
        public static String THREAD_API_TIZEN_JOIN;
+       public static String THREAD_API_PTHREAD_JOIN;
        public static String SYNC_API_PTHREAD_MUTEX_INIT;
        public static String SYNC_API_PTHREAD_MUTEXATTR_INIT;
        public static String SYNC_API_PTHREAD_MUTEXATTR_SETTYPE;
index 9733a37..46e7c86 100644 (file)
@@ -27,6 +27,7 @@ SYNC_ATTR_TYPE_RECURSIVE=PTHREAD_MUTEX_RECURSIVE
 SYNC_ATTR_TYPE_DEFAULT=PTHREAD_MUTEX_DEFAULT
 
 THREAD_API_TIZEN_JOIN=Thread::Join
+THREAD_API_PTHREAD_JOIN=pthread_join
 SYNC_API_PTHREAD_MUTEX_INIT=pthread_mutex_init
 SYNC_API_PTHREAD_MUTEXATTR_INIT=pthread_mutexattr_init
 SYNC_API_PTHREAD_MUTEXATTR_SETTYPE=pthread_mutexattr_settype
index 005f88d..d6e01db 100644 (file)
@@ -75,8 +75,10 @@ public class TimelineChartLabels extends NLS {
        
        public static String EDIT_CHART_DLG_TITLE;
        
+       public static String RANGE_CONTEXT_TITLE;
        public static String RANGE_CONTEXT_SET_START;
        public static String RANGE_CONTEXT_SET_END;
+       public static String RANGE_CONTEXT_SET_FROM_SELECTION;
        public static String RANGE_CONTEXT_ANALYSIS;
        public static String RANGE_CONTEXT_CLEAR;
        public static String RANGE_CONTEXT_EVENT_LIST;
index c088536..73020c9 100644 (file)
@@ -50,10 +50,12 @@ TIMELINE_TICK_ADD=Add
 
 EDIT_CHART_DLG_TITLE=Edit chart
 
+RANGE_CONTEXT_TITLE=Range setting
 RANGE_CONTEXT_SET_START=Set range start
 RANGE_CONTEXT_SET_END=Set range end
-RANGE_CONTEXT_ANALYSIS=Analyze
-RANGE_CONTEXT_CLEAR=Clear range
+RANGE_CONTEXT_SET_FROM_SELECTION=Set range from selection
+RANGE_CONTEXT_ANALYSIS=Analyze range
+RANGE_CONTEXT_CLEAR=Clear Analyze range
 RANGE_CONTEXT_EVENT_LIST=Event list
 
 UIEVENT_ORIENTATION=Orientation
index 779dad3..ad6bfd6 100644 (file)
@@ -36,6 +36,10 @@ public class TimelinePageLabels extends NLS {
        public static String CALL_TRACE_VIEW_TIME;
        public static String CALL_TRACE_VIEW_TID;
        public static String CALL_TRACE_VIEW_TITLE;
+       
+       public static String UI_EVENT_LIST_NAME;
+       public static String UI_EVENT_LIST_TIME;
+       public static String UI_EVENT_LIST_SET_RANGE;
        static {
                // initialize resource bundle
                NLS.initializeMessages(BUNDLE_NAME, TimelinePageLabels.class);
index cdabcd4..e816b51 100644 (file)
@@ -3,3 +3,6 @@ CALL_TRACE_VIEW_TIME=Time
 CALL_TRACE_VIEW_TID=Thread id
 CALL_TRACE_VIEW_TITLE=Call Trace
 
+UI_EVENT_LIST_NAME=Event name
+UI_EVENT_LIST_TIME=Time
+UI_EVENT_LIST_SET_RANGE=Set range
\ No newline at end of file
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java
new file mode 100644 (file)
index 0000000..86a83d2
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ *  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.project;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+
+public class AppInfo {
+
+       public static final int APPID_INDEX = 0;
+       public static final int PACKAGE_INDEX = 1;
+       public static final int EXEC_INDEX = 2;
+       public static final int ICON_INDEX = 3;
+       public static final int LABEL_INDEX = 4;
+       public static final int APPTYPE_INDEX = 5;
+       public static final int COMPONENT_INDEX = 6;
+       public static final int MULTIPLE_INDEX = 7;
+       public static final int NODISPLAY_INDEX = 8;
+       public static final int TASKMANAGE_INDEX = 9;
+       public static final int HW_ACCELERATION_INDEX = 10;
+       public static final int USER_DATA_INDEX = 11;
+       public static final int PKGINFO_SIZE = 12;
+
+       public static final String APPTYPE_CPP = "c++";//$NON-NLS-1$
+       public static final String FLAG_ZERO = "0";//$NON-NLS-1$
+       public static final String FLAG_ONE = "1";//$NON-NLS-1$
+
+       private String installTime = null;
+       public String getInstallTime() {
+               return installTime;
+       }
+
+       public void setInstallTime(String installTime) {
+               this.installTime = installTime;
+       }
+
+       private List<String> appInfo = new ArrayList<String>();
+
+       public AppInfo() {
+               for (int i = 0; i < PKGINFO_SIZE; i++) {
+                       appInfo.add(CommonConstants.EMPTY);
+               }
+       }
+
+       public void setInfo(int index, String data) {
+               appInfo.set(index, data);
+       }
+
+       public String getInfo(int index) {
+               return appInfo.get(index);
+       }
+}
index fd90189..15dc9c3 100644 (file)
@@ -38,6 +38,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.BaseLogCenter;
 import org.tizen.dynamicanalyzer.model.DeviceInfo;
 import org.tizen.dynamicanalyzer.model.LogCenter;
@@ -45,15 +46,17 @@ import org.tizen.dynamicanalyzer.sql.SqlManager;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 
 public class Project {
+       private final static int MAX_FILENAME_LENGTH = 50;
        private final String DEFAULT_TIME_FORMAT = "_yyyy-MM-dd-HH-mm-ss";//$NON-NLS-1$
        private final String PIE_BUILD_FLAG = "1";//$NON-NLS-1$
-       private final static int MAX_FILENAME_LENGTH = 50;
        private String appName = null;
        private String pkgId = null;
        private String createTime = null;
        private List<LogCenter> logCenters;
        private String savePath;
-       private String lastLogNum = CommonConstants.ZERO;
+       private long lastLogNum = 0;
+       private long lastDeviceLogNum = 0;
+       private long lastProfileLogNum = 0;
        private String version = null;
        private String device = null;
        private List<String> appInfo = null;
@@ -146,8 +149,25 @@ public class Project {
                return version;
        }
 
-       public String getLastLogNum() {
-               return lastLogNum;
+       public long getLastLogNum(int type) {
+               if (type == LogCenterConstants.LOG_DEVICE) {
+                       return lastDeviceLogNum;
+               } else if (type == LogCenterConstants.LOG_PROFILING) {
+                       return lastProfileLogNum;
+               } else {
+                       return lastLogNum;
+               }
+       }
+
+       // for save
+       public String getLastLogNumbers() {
+               StringBuffer buffer = new StringBuffer();
+               buffer.append(lastLogNum);
+               buffer.append("|");
+               buffer.append(lastDeviceLogNum);
+               buffer.append("|");
+               buffer.append(lastProfileLogNum);
+               return buffer.toString();
        }
 
        public String getCreateTime() {
@@ -158,17 +178,19 @@ public class Project {
                this.createTime = createTime;
        }
 
-       public void setLastLogNum(String last) {
-               long prev = 0, current = 0;
-               try {
-                       prev = Long.parseLong(lastLogNum);
-                       current = Long.parseLong(last);
-               } catch (NumberFormatException e) {
-                       e.printStackTrace();
-                       return;
-               }
-               if (prev < current) {
-                       lastLogNum = last;
+       public void setLastLogNum(long last, int type) {
+               if (type == LogCenterConstants.LOG_DEVICE) {
+                       if (last > lastDeviceLogNum) {
+                               lastDeviceLogNum = last;
+                       }
+               } else if (type == LogCenterConstants.LOG_PROFILING) {
+                       if (last > lastProfileLogNum) {
+                               lastProfileLogNum = last;
+                       }
+               } else {
+                       if (last > lastLogNum) {
+                               lastLogNum = last;
+                       }
                }
        }
 
@@ -181,8 +203,8 @@ public class Project {
        }
 
        public void init() {
-               appName = DACommunicator.getSelectedApp().getName();
-               pkgId = DACommunicator.getSelectedApp().getPkgId();
+               appName = DACommunicator.getSelectedApp().getInfo(AppInfo.LABEL_INDEX);
+               pkgId = DACommunicator.getSelectedApp().getInfo(AppInfo.PACKAGE_INDEX);
                DeviceInfo deviceName = DACommunicator.getSelectedDevice();
                if (null != deviceName
                                && null != deviceName.getIDevice().getSerialNumber()
@@ -313,8 +335,7 @@ public class Project {
 
        public boolean isValid() {
                if (null == version || null == appName || null == pkgId
-                               || null == device || null == lastLogNum || null == logCenters
-                               || logCenters.isEmpty()) {
+                               || null == device || null == logCenters || logCenters.isEmpty()) {
                        return false;
                }
                return true;
index e0e1b47..db1d470 100644 (file)
@@ -416,6 +416,12 @@ public class ColorResources {
        public static Color CONFIGURATION_SUNKEN_LINE_UP_COLOR = getColor("configufation_sunken_line_up_color"); //$NON-NLS-1$
        public static Color CONFIGURATION_SUNKEN_LINE_DOWN_COLOR = getColor("configufation_sunken_line_down_color"); //$NON-NLS-1$
 
+       // contextMenu
+       public static Color CONTEXT_MENU_TITLE_BACKGROUND_COLOR = getColor("context_menu_title_background_color"); //$NON-NLS-1$
+       public static Color CONTEXT_MENU_TITLE_FONT_COLOR = getColor("context_menu_title_font_color"); //$NON-NLS-1$
+       
+       
+       
        
        public static void initColors() {
                WINDOW_BG_COLOR = getColor("window_bg_color"); //$NON-NLS-1$
@@ -736,6 +742,10 @@ public class ColorResources {
                CONFIGURATION_SUNKEN_LINE_UP_COLOR = getColor("configufation_sunken_line_up_color"); //$NON-NLS-1$
                CONFIGURATION_SUNKEN_LINE_DOWN_COLOR = getColor("configufation_sunken_line_down_color"); //$NON-NLS-1$
                
+               // contextMenu
+               CONTEXT_MENU_TITLE_BACKGROUND_COLOR = getColor("context_menu_title_background_color"); //$NON-NLS-1$
+               CONTEXT_MENU_TITLE_FONT_COLOR = getColor("context_menu_title_font_color"); //$NON-NLS-1$                
+               
        }
 
        private static Color getColor(String colorName, RGB rgb) {
index ce0c357..fda41e6 100644 (file)
@@ -57,18 +57,11 @@ public class FontResources {
        // mac 11
 
        // * Time-Line Layout
-       // Time-line
-       public static final Font TIMELINE_TICK_FONT = getFont(
-                       "time_tick", resizeDefaultFont(6, 0));//$NON-NLS-1$
        // Edit Chart Dlg.
        public static final Font ADDITEM_BUTTON_FONT = getFont(
                        "additem_button_font", resizeDefaultFont(8, 3));//$NON-NLS-1$
        // mac 11
 
-       // Chart Name
-       public static final Font TIMELINE_FONT = getFont(
-                       "table_font", resizeDefaultFont(8, 0));//$NON-NLS-1$
-
        // View title text font
        public static final Font VIEW_TITLE = getFont(
                        "view_title", resizeDefaultFont(10, 1));//$NON-NLS-1$
@@ -76,7 +69,7 @@ public class FontResources {
 
        // ui event text font
        public static final Font TIMELINE_UIEVENT_FONT = getFont(
-                       "timeline_uievent_font", resizeDefaultFont(7, 0));//$NON-NLS-1$
+                       "timeline_uievent_font", resizeDefaultFont(7, 3));//$NON-NLS-1$
 
        // * Open Trace
        // Inner title : saved file and temporary file
@@ -169,6 +162,10 @@ public class FontResources {
        public static final Font CHART_NAME_FONT = getFont(
                        "chart_name_font", resizeDefaultFont(8, 3));//$NON-NLS-1$
 
+       // * context menu
+       public static final Font CONTEXT_MENU_TITLE_FONT = getFont(
+                       "context_menu_title_font", resizeDefaultFont(9, 3));//$NON-NLS-1$
+       
        public static final Font CONTEXT_MENU_ITEM_FONT = getFont(
                        "context_menu_item_font", resizeDefaultFont(9, 3));//$NON-NLS-1$
 
@@ -176,6 +173,15 @@ public class FontResources {
        public static final Font CONFIGURATION_TABLE_TITLE_FONT = getFont(
                        "configuration_table_title_font", resizeDefaultFont(9, 3));//$NON-NLS-1$
 
+       // timeline
+       public static final Font TIMELINE_FONT = getFont(
+                       "timeline_font", resizeDefaultFont(8, 3)); //$NON-NLS-1$
+
+       public static final Font TIMELINE_TICK_FONT = getFont(
+                       "time_tick", resizeDefaultFont(6, 3));//$NON-NLS-1$
+       public static final Font TIMELINE_BALLOON_FONT = getFont(
+                       "time_balloon", resizeDefaultFont(8, 3));//$NON-NLS-1$
+
        private static Font getFont(String fontName, FontData[] fontData) {
                if (!fontRegistry.hasValueFor(fontName)) {
                        fontRegistry.put(fontName, fontData);
index bce3542..12e3653 100644 (file)
@@ -224,13 +224,13 @@ public class ImageResources {
        public static final Image DYNANMIC_ANALYZER_ICON = getPngImage("64_DA_icon"); //$NON-NLS-1$ 
        public static final Image ABOUT_TIZEN_SDK = getPngImage("about_Tizen_SDK");//$NON-NLS-1$
        public static final Image LICENSE_TIZEN_SDK = getPngImage("license_banner");//$NON-NLS-1$
-       
+
        /* configuration */
        public static final Image WELCONE_BANNER_IMAGE = getPngImage("welcome_banner"); //$NON-NLS-1$
        public static final Image CONFIGURATION_BANNER_IMAGE = getPngImage("settings_banner"); //$NON-NLS-1$
        public static final Image CONFIGURATION_WHITE_IMAGE = getPngImage("theme_white"); //$NON-NLS-1$
        public static final Image CONFIGURATION_BLACK_IMAGE = getPngImage("theme_black"); //$NON-NLS-1$
-       
+
        /* Timeline */
        public static final Image CHART_CPU = getPngImage("time_line_icon_cpu"); //$NON-NLS-1$
        public static final Image CHART_CPU_CORE = getPngImage("time_line_icon_cpu_core"); //$NON-NLS-1$
@@ -250,11 +250,11 @@ public class ImageResources {
        public static final Image MIN_ITEMS = getPngImage("MinItems"); //$NON-NLS-1$
        public static final Image BG_GRADIENT = getPngImage("timeline_right_bg_normal"); //$NON-NLS-1$
        public static final Image BG_CHILD_GRADIENT = getPngImage("timeline_right_child_bg_normal"); //$NON-NLS-1$
-       public static final Image TIMLINE_FULL = getPngImage("timeline_left_full_nor"); //$NON-NLS-1$
-       public static final Image TIMLINE_RESTORE = getPngImage("timeline_left_restore_nor"); //$NON-NLS-1$
-       public static final Image TIMLINE_SIZE_MIN_NORMAL = getPngImage("time_line_size_min_normal"); //$NON-NLS-1$
-       public static final Image TIMLINE_SIZE_MIN_HOVER = getPngImage("time_line_size_min_hover"); //$NON-NLS-1$
-       public static final Image TIMLINE_SIZE_MIN_PUSH = getPngImage("time_line_size_min_push"); //$NON-NLS-1$
+       public static final Image TIMELINE_FULL = getPngImage("timeline_left_full_nor"); //$NON-NLS-1$
+       public static final Image TIMELINE_RESTORE = getPngImage("timeline_left_restore_nor"); //$NON-NLS-1$
+       public static final Image TIMELINE_SIZE_MIN_NORMAL = getPngImage("time_line_size_min_normal"); //$NON-NLS-1$
+       public static final Image TIMELINE_SIZE_MIN_HOVER = getPngImage("time_line_size_min_hover"); //$NON-NLS-1$
+       public static final Image TIMELINE_SIZE_MIN_PUSH = getPngImage("time_line_size_min_push"); //$NON-NLS-1$
        public static final Image ENERGY = getPngImage("time_line_icon_electric_current"); //$NON-NLS-1$
        public static final Image CHART_DEVICES = getPngImage("time_line_icon_devices"); //$NON-NLS-1$
        public static final Image UI_EVENT = getPngImage("time_line_icon_UI_events"); //$NON-NLS-1$
@@ -339,21 +339,23 @@ public class ImageResources {
        public static final Image SCALE_CONTROL_PLUS = getPngImage("scale_control_plus"); //$NON-NLS-1$
        public static final Image SCALE_CONTROL_THUMB = getPngImage("scale_control_thumb"); //$NON-NLS-1$
 
-       /*** stop progress dialog ***/
-//     public static final Image STOP_PROGRESS_LOADING_01 = getPngImage("loading_icon_01"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_02 = getPngImage("loading_icon_02"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_03 = getPngImage("loading_icon_03"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_04 = getPngImage("loading_icon_04"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_05 = getPngImage("loading_icon_05"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_06 = getPngImage("loading_icon_06"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_07 = getPngImage("loading_icon_07"); //$NON-NLS-1$
-//     public static final Image STOP_PROGRESS_LOADING_08 = getPngImage("loading_icon_08"); //$NON-NLS-1$
-
        /*** thread page ***/
        public static final Image TIMELINE_DROPDOWN_NORMAL = getPngImage("time_line_dropdown_normal"); //$NON-NLS-1$
        public static final Image TIMELINE_DROPDOWN_HOVER = getPngImage("time_line_dropdown_hover"); //$NON-NLS-1$
        public static final Image TIMELINE_DROPDOWN_PUSH = getPngImage("time_line_dropdown_push"); //$NON-NLS-1$
 
+       public static final Image CLOSE_BOX_NORMAL = getPngImage("close_box_normal"); //$NON-NLS-1$
+       public static final Image CLOSE_BOX_PUSH = getPngImage("close_box_push"); //$NON-NLS-1$
+       public static final Image CLOSE_BOX_HOVER = getPngImage("close_box_hover"); //$NON-NLS-1$
+       public static final Image CLOSE_BOX_DISABLE = getPngImage("close_box_disable"); //$NON-NLS-1$
+
+       public static final Image TAB_ICON_TIMELINE = getPngImage("tab_icon_timeline"); //$NON-NLS-1$
+       public static final Image TAB_ICON_FILE = getPngImage("tab_icon_file"); //$NON-NLS-1$
+       public static final Image TAB_ICON_THREAD = getPngImage("tab_icon_thread"); //$NON-NLS-1$
+       public static final Image TAB_ICON_UI = getPngImage("tab_icon_userinterface"); //$NON-NLS-1$
+       public static final Image TAB_ICON_SUMMARY = getPngImage("tab_icon_summary"); //$NON-NLS-1$
+       public static final Image TAB_ICON_RANGE = getPngImage("tab_icon_range"); //$NON-NLS-1$
+
        private static Image getImage(String pluginId, String folderName,
                        String imageName, String extension) {
                if (null == imageRegistry.get(imageName)
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java
new file mode 100644 (file)
index 0000000..f83d131
--- /dev/null
@@ -0,0 +1,189 @@
+package org.tizen.dynamicanalyzer.shortcut;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangePage;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.toolbar.AboutDialog;
+import org.tizen.dynamicanalyzer.ui.toolbar.SaveAsDialog;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialog;
+import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
+
+public class ShortCutManager {
+       private static ShortCutManager instance = null;
+       private boolean enabled = true;
+       private int CTRL_STATE_MASK = SWT.CTRL;
+
+       public static String START_TRACE = null;
+       public static String STOP_TRACE = null;
+       public static String SAVE_TRACE = null;
+       public static String OPEN_TRACE = null;
+       public static String REPLAY = null;
+       public static String COOLBAR_AREA_FILE_TOOLTIP = null;
+       public static String COOLBAR_AREA_SUMMARY_TOOLTIP = null;
+       public static String COOLBAR_AREA_THREAD_TOOLTIP = null;
+       public static String COOLBAR_AREA_UI_TOOLTIP = null;
+       public static String COOLBAR_AREA_TIMELINE_TOOLTIP = null;
+       public static String COOLBAR_AREA_RANGE_TOOLTIP = null;
+
+       static {
+               if (AnalyzerUtil.isMac()) {
+                       START_TRACE = AnalyzerLabels.START_TRACE_MAC;
+                       STOP_TRACE = AnalyzerLabels.STOP_TRACE_MAC;
+                       SAVE_TRACE = AnalyzerLabels.SAVE_TRACE_MAC;
+                       OPEN_TRACE = AnalyzerLabels.OPEN_TRACE_MAC;
+                       REPLAY = AnalyzerLabels.REPLAY_MAC;
+                       COOLBAR_AREA_FILE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_FILE_TOOLTIP_MAC;
+                       COOLBAR_AREA_SUMMARY_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_SUMMARY_TOOLTIP_MAC;
+                       COOLBAR_AREA_THREAD_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_THREAD_TOOLTIP_MAC;
+                       COOLBAR_AREA_UI_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_UI_TOOLTIP_MAC;
+                       COOLBAR_AREA_TIMELINE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_TIMELINE_TOOLTIP_MAC;
+                       COOLBAR_AREA_RANGE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_RANGE_TOOLTIP_MAC;
+               } else {
+                       START_TRACE = AnalyzerLabels.START_TRACE;
+                       STOP_TRACE = AnalyzerLabels.STOP_TRACE;
+                       SAVE_TRACE = AnalyzerLabels.SAVE_TRACE;
+                       OPEN_TRACE = AnalyzerLabels.OPEN_TRACE;
+                       REPLAY = AnalyzerLabels.REPLAY;
+                       COOLBAR_AREA_FILE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_FILE_TOOLTIP;
+                       COOLBAR_AREA_SUMMARY_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_SUMMARY_TOOLTIP;
+                       COOLBAR_AREA_THREAD_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_THREAD_TOOLTIP;
+                       COOLBAR_AREA_UI_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_UI_TOOLTIP;
+                       COOLBAR_AREA_TIMELINE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_TIMELINE_TOOLTIP;
+                       COOLBAR_AREA_RANGE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_RANGE_TOOLTIP;
+               }
+       }
+
+       public static ShortCutManager getInstance() {
+               if (null == instance) {
+                       instance = new ShortCutManager();
+               }
+               return instance;
+       }
+
+       private ShortCutManager() {
+               if (AnalyzerUtil.isMac()) {
+                       CTRL_STATE_MASK = SWT.COMMAND;
+               }
+       }
+
+       // for normal listener
+       public void handleShortCutEvent(Event event) {
+               if (!enabled) {
+                       return;
+               }
+               if (event.keyCode == SWT.F1) {
+                       System.out.println("about");
+                       Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+                       AboutDialog dialog = new AboutDialog(shell, SWT.NONE); // FIXME
+                       dialog.open();
+               } else if (event.keyCode == SWT.F2) {
+                       System.out.println("configuration");
+                       Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+                       ConfigurationDialog dialog = new ConfigurationDialog(shell,
+                                       SWT.NONE); // FIXME
+                       dialog.open();
+               } else if (event.keyCode == SWT.F3) {
+                       System.out.println("view source toggle");
+                       DACustomToggleButton button = (DACustomToggleButton) ToolbarArea
+                                       .getInstance().getButton(ToolbarArea.SOURCE_BUTTON);
+                       button.setToggled(!button.isToggled());
+               }
+               // ctrl + number 1 ~ 6 page
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 49) {
+                       System.out.println("timeline page");
+                       AnalyzerUtil.changePage(TimelinePage.ID);
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 50) {
+                       System.out.println("file page");
+                       AnalyzerUtil.changePage(FilePage.ID);
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 51) {
+                       System.out.println("thread page");
+                       AnalyzerUtil.changePage(ThreadPage.ID);
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 52) {
+                       System.out.println("ui page");
+                       AnalyzerUtil.changePage(UIPage.ID);
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 53) {
+                       System.out.println("summary page");
+                       AnalyzerUtil.changePage(SummaryPage.ID);
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 54) {
+                       System.out.println("range page");
+                       AnalyzerUtil.changePage(RangePage.ID);
+               }
+               // ctrl + t = 116
+               // 103 -> g
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 103) {
+                       System.out.println("start trace");
+                       if (!AnalyzerManager.isRunning()) {
+                               ToolbarArea.getInstance().startTrace();
+                       } else {
+                               ToolbarArea.getInstance().stopTrace();
+                       }
+               }
+               // o
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 111) {
+                       System.out.println("open trace");
+                       if (!AnalyzerManager.isRunning()) {
+                               Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+                               OpenTraceDialog dialog = new OpenTraceDialog(shell);
+                               dialog.open();
+                       }
+               }
+               // s
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 115) {
+                       System.out.println("save trace");
+                       if (ToolbarArea.getInstance().getButton(ToolbarArea.SAVE_BUTTON)
+                                       .isButtonEnabled()) {
+                               Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+                               SaveAsDialog dialog = new SaveAsDialog(shell);
+                               int result = dialog.open();
+                               if (AnalyzerConstants.SUCCESS == result) {
+                                       ToolbarArea.getInstance()
+                                                       .getButton(ToolbarArea.SAVE_BUTTON)
+                                                       .setButtonEnabled(false);
+                               }
+                       }
+               }
+               // p
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 112) {
+                       System.out.println("replay ");
+                       if (!AnalyzerManager.isRunning()) {
+                               DACustomButton button = (DACustomButton) ToolbarArea
+                                               .getInstance().getButton(ToolbarArea.REPLAY_BUTTON);
+                               if (button.isButtonEnabled()) {
+                                       if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != ReplayTraceHandler.FAILED) {
+                                               ToolbarArea.getInstance().startTrace();
+                                       }
+                               }
+                       }
+               }
+               // r
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 114) {
+                       System.out.println("range ");
+                       if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+                               RangeDataManager.getInstance().initRange();
+                       } else {
+                               if (RangeDataManager.getInstance().isAnalyzable()) {
+                                       RangeDataManager.getInstance().startRangeAnalysis();
+                               }
+                       }
+               }
+       }
+
+       public void setEnabled(boolean enabled) {
+               this.enabled = enabled;
+       }
+}
index 153900f..d965a22 100644 (file)
@@ -6,6 +6,7 @@
  * Contact: 
  * Jooyoul Lee <jy.exe.lee@samsung.com>
  * SangHyun Lee <sanghyunnim.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");
@@ -42,11 +43,10 @@ import java.util.concurrent.Semaphore;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
-import org.tizen.dynamicanalyzer.handlers.ClearHandler;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.LogCenter;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
 import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
@@ -62,7 +62,7 @@ public class SqlManager {
        private final int PERMIT = 1;
        private Semaphore semaphore = new Semaphore(PERMIT);
        private static SqlManager instance = null;
-       private Connection connection;
+       private Connection connection = null;
 
        private Connection getConnection() {
                Project project = AnalyzerManager.getProject();
@@ -74,7 +74,9 @@ public class SqlManager {
 
        public Connection getConnection(String path) {
                try {
-                       semaphore.acquire();
+                       if (null != connection) {
+                               return connection;
+                       }
                        Class.forName("org.sqlite.JDBC"); //$NON-NLS-1$
                        connection = DriverManager.getConnection("jdbc:sqlite:" //$NON-NLS-1$
                                        + path + File.separator + AnalyzerConstants.DATABASE_NAME);
@@ -82,24 +84,40 @@ public class SqlManager {
                        e.printStackTrace();
                } catch (SQLException e) {
                        e.printStackTrace();
-               } catch (InterruptedException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
                }
                return connection;
        }
 
+       public void semaphoreAcquire() {
+               if (connection != null) {
+                       try {
+                               semaphore.acquire();
+                       } catch (InterruptedException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
+               }
+       }
+
+       public void semaphoreRelease() {
+               if (connection == null) {
+                       return;
+               } else {
+                       semaphore.release();
+               }
+       }
+
        public void closeConnection() {
-               try {
-                       if (connection == null) {
-                               return;
-                       } else {
+               if (connection == null) {
+                       return;
+               } else {
+                       try {
                                connection.close();
-                               connection = null;
-                               semaphore.release();
+                       } catch (SQLException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
                        }
-               } catch (SQLException e) {
-                       e.printStackTrace();
+                       connection = null;
                }
        }
 
@@ -111,103 +129,26 @@ public class SqlManager {
        }
 
        public void clear() {
+               closeConnection();
                semaphore = new Semaphore(PERMIT);
+               instance = null;
        }
 
+       // create query
        public synchronized void createTable(LogCenter lcenter) {
                try {
                        Connection conn = getConnection();
                        if (null == conn) {
                                return;
                        }
-
+                       semaphoreAcquire();
                        Statement stat = conn.createStatement();
                        stat.executeUpdate(createDropTableQuery(lcenter.getName()));
                        stat.executeUpdate(createTableQuery(lcenter));
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
-                       closeConnection();
-               }
-       }
-
-       public void createProjectTable(Project project) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-
-                       Statement stat = conn.createStatement();
-                       stat.executeUpdate(createDropTableQuery("project")); //$NON-NLS-1$
-                       String query = "create table project (info TEXT not null)"; //$NON-NLS-1$
-                       stat.executeUpdate(query);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-       }
-
-       public void insertProject() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-
-                       String query = "insert into project values ( ? );"; //$NON-NLS-1$
-                       List<LogCenter> logcs = AnalyzerManager.getLogCenters();
-
-                       PreparedStatement prep = conn.prepareStatement(query);
-                       int size = logcs.size();
-                       Project project = AnalyzerManager.getProject();
-
-                       /* project version index = 0 */
-                       prep.setString(1, project.getVersion());
-                       prep.addBatch();
-                       /* project create time index = 1 */
-                       prep.setString(1, project.getCreateTime());
-                       prep.addBatch();
-                       /* project application name index = 2 */
-                       prep.setString(1, project.getAppName());
-                       prep.addBatch();
-                       /* project device index = 3 */
-                       prep.setString(1, project.getDevice());
-                       prep.addBatch();
-                       /* project last log number index = 4 */
-                       prep.setString(1, project.getLastLogNum());
-                       prep.addBatch();
-                       /* project last recording time index = 5 */
-                       prep.setLong(1, project.getLastTime());
-                       prep.addBatch();
-                       /* project total sample count index = 6 */
-                       prep.setInt(1, project.getTotalProfilingSampleCount());
-                       prep.addBatch();
-                       /* project package id index = 7 */
-                       prep.setString(1, project.getPkgId());
-                       prep.addBatch();
-                       /* project stop time id index = 8 */
-                       prep.setLong(1, project.getStopTime());
-                       prep.addBatch();
-
-                       /* project logcenters index = reminders */
-                       for (int i = 0; i < size; i++) {
-                               try {
-                                       prep.setString(1, logcs.get(i).getName());
-                                       prep.addBatch();
-                               } catch (ArrayIndexOutOfBoundsException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
+                       semaphoreRelease();
                }
        }
 
@@ -233,511 +174,39 @@ public class SqlManager {
                return query.toString();
        }
 
-       public String createDropTableQuery(String target) {
-               StringBuffer query = new StringBuffer();
-               query.append("drop table if exists "); //$NON-NLS-1$
-               query.append(target);
-               query.append(CommonConstants.SEMICOLON);
-               return query.toString();
-       }
-
-       public void insert(LogCenter logc, List<List<String>> input)
-                       throws InterruptedException {
-
-               try {
-
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               System.out.println("failed sql inset : " + input);
-                               return;
-                       }
-
-                       String query = logc.getInsertQuery();
-                       PreparedStatement prep = conn.prepareStatement(query);
-                       int dataSize = input.size();
-                       ;
-                       for (int inputIndex = 0; inputIndex < dataSize; inputIndex++) {
-                               List<String> log = input.get(inputIndex);
-                               int size = logc.getTotalColumnCount();
-                               prep.setInt(1, logc.getIndex());
-                               for (int i = 0; i < size; i++) {
-                                       try {
-                                               if (i + 2 > size) {
-                                                       break;
-                                               }
-                                               prep.setString(i + 2, log.get(i));
-                                       } catch (ArrayIndexOutOfBoundsException e) {
-                                               System.out.println("sql insert exception : index " + i); //$NON-NLS-1$
-                                               e.printStackTrace();
-                                       }
-                               }
-                               prep.addBatch();
-                               logc.addIndex();
-                       }
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-                       // conn.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-       }
-
-       public String createInsertQuery(LogCenter logcs) {
-               StringBuffer query = new StringBuffer();
-               query.append("insert into "); //$NON-NLS-1$
-               query.append(logcs.getName());
-               query.append(" values ("); //$NON-NLS-1$
-
-               int size = logcs.getTotalColumnCount();
-               for (int i = 0; i < size; i++) {
-                       query.append("?"); //$NON-NLS-1$
-                       if (i + 1 == size) {
-                               query.append(CommonConstants.CLOSE_BRACKET
-                                               + CommonConstants.SEMICOLON);
-                               break;
-                       } else {
-                               query.append(CommonConstants.COMMA);
-                       }
-               }
-               return query.toString();
-       }
-
-       public ResultSet selectAllFromProject(String path) {
-               try {
-                       Connection conn = getConnection(path);
-                       if (null == conn) {
-                               return null;
-                       }
-                       Statement stat = conn.createStatement();
-                       /** column name : info **/
-                       String query = "select info from project"; //$NON-NLS-1$
-                       ResultSet rs = stat.executeQuery(query);
-
-                       List<String> pInfo = new ArrayList<String>();
-                       try {
-                               while (rs.next()) {
-                                       pInfo.add(rs.getString("info")); //$NON-NLS-1$
-                               }
-                               rs.close();
-                       } catch (SQLException e) {
-                               AnalyzerUtil.executeCommand(ClearHandler.ID);
-                               e.printStackTrace();
-                               return null;
-                       }
-
-                       return rs;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return null;
-       }
-
-       private String getAllColumnsString(LogCenter center) {
-               StringBuffer retStr = new StringBuffer();
-               List<String> columnNames = center.getColumnName();
-               if (null == columnNames || columnNames.isEmpty()) {
-                       return null;
-               }
-               int columnSize = columnNames.size();
-               for (int i = 0; i < columnSize; i++) {
-                       retStr.append(columnNames.get(i));
-                       if (i + 1 != columnSize) {
-                               retStr.append(CommonConstants.COMMA);
-                       }
-               }
-               return retStr.toString();
-       }
-
-       public List<List<String>> selectArea(LogCenter center, int from, int to) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return null;
-                       }
-                       StringBuffer query = new StringBuffer();
-                       query.append("select ");//$NON-NLS-1$
-
-                       String allColumns = getAllColumnsString(center);
-                       if (null == allColumns || allColumns.isEmpty()) {
-                               return null;
-                       }
-                       query.append(allColumns);
-                       query.append(" from "); //$NON-NLS-1$
-                       query.append(center.getName());
-                       query.append(" where SeqNumber >= "); //$NON-NLS-1$
-                       query.append(from);
-                       query.append(" and SeqNumber <= "); //$NON-NLS-1$
-                       query.append(to);
-                       query.append(CommonConstants.SEMICOLON);
-
-                       List<List<String>> output = new ArrayList<List<String>>();
-                       Statement stmt = conn.createStatement();
-                       ResultSet rs = stmt.executeQuery(query.toString());
-                       if (null != rs) {
-                               try {
-                                       while (rs.next()) {
-                                               List<String> inner = new ArrayList<String>();
-                                               int size = center.getTotalColumnCount();
-                                               for (int i = 1; i <= size; i++) {
-                                                       if (i + 1 > size) {
-                                                               break;
-                                                       }
-                                                       inner.add(rs.getString(i + 1));
-                                               }
-                                               output.add(inner);
-                                       }
-                               } catch (SQLException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-                       if (!rs.isClosed()) {
-                               rs.close();
-                       }
-                       return output;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return null;
-       }
-
-       public synchronized List<List<String>> selectRowId(LogCenter center,
-                       int from, int to) {
-               try {
-
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return null;
-                       }
-
-                       StringBuffer query = new StringBuffer();
-
-                       query.append("select ");//$NON-NLS-1$
-                       String allColumns = getAllColumnsString(center);
-                       if (null == allColumns || allColumns.isEmpty()) {
-                               return null;
-                       }
-                       query.append(allColumns);
-                       query.append(" from "); //$NON-NLS-1$
-                       query.append(center.getName());
-                       query.append(" where rid >= "); //$NON-NLS-1$
-                       query.append(from);
-                       query.append(" and rid < "); //$NON-NLS-1$
-                       query.append(to);
-                       query.append(CommonConstants.COMMA);
-
-                       List<List<String>> output = new ArrayList<List<String>>();
-                       Statement stmt = conn.createStatement();
-                       ResultSet rs = stmt.executeQuery(query.toString());
-                       if (null != rs) {
-                               try {
-                                       while (rs.next()) {
-                                               List<String> inner = new ArrayList<String>();
-                                               int size = center.getTotalColumnCount();
-                                               for (int i = 1; i <= size; i++) {
-                                                       inner.add(rs.getString(i));
-                                               }
-                                               output.add(inner);
-                                       }
-                               } catch (SQLException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-                       if (!rs.isClosed()) {
-                               rs.close();
-                       }
-                       return output;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return null;
-       }
-
-       public int selectCount(LogCenter logCenter) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return 0;
-                       }
-
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(logCenter.getSelectCountQuery());
-                       if (rs.next()) {
-                               int ret = Integer.parseInt(rs.getString(1));
-                               if (!rs.isClosed()) {
-                                       rs.close();
-                               }
-                               return ret;
-                       }
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return 0;
-       }
-
-       public int executeQueryMinMax(String query) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return 0;
-                       }
-
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-
-                       if (rs.next()) {
-                               if (null != rs.getString(1)) {
-                                       int ret = Integer.parseInt(rs.getString(1));
-                                       if (!rs.isClosed()) {
-                                               rs.close();
-                                       }
-                                       return ret;
-                               }
-                       }
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return -1;
-       }
-
-       public int executeSelectOperation(String query) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return 0;
-                       }
-
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-                       if (rs.next()) {
-                               String value = AnalyzerUtil.dotCutter(rs.getString(1));
-                               int ret = 0;
-                               if (null != value && !value.isEmpty()) {
-                                       ret = Integer.parseInt(value);
-                               }
-                               if (!rs.isClosed()) {
-                                       rs.close();
-                               }
-                               return ret;
-                       }
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return 0;
-       }
-
-       public void saveLeakData() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-                       LeakDetector leakDectector = AnalyzerManager.getLeakDetector();
-
-                       DBTableInfo leakTableInfo = DBTableManager.getInstance()
-                                       .getTableInfo(DBTableManager.TABLE_INDEX_LEAK_DATA);
-                       String insertQuery = leakTableInfo.insertQuery();
-                       int size = leakTableInfo.getColumnNames().length;
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-
-                       List<LeakData> leakList = leakDectector.getLeakDataList();
-                       for (LeakData leakData : leakList) {
-                               for (int ii = 0; ii < size; ii++) {
-                                       prep.setString(ii + 1, leakData.getData().get(ii));
-                               }
-                               prep.addBatch();
-
-                               if (!leakData.getChildren().isEmpty()) {
-                                       List<LeakData> children = leakData.getChildren();
-                                       for (LeakData child : children) {
-                                               for (int ii = 0; ii < size; ii++) {
-                                                       prep.setString(ii + 1, child.getData().get(ii));
-                                               }
-                                               prep.addBatch();
-                                       }
-                               }
-                       }
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-       }
-
-       public void saveFailedData() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-                       FailedChecker failedChecker = AnalyzerManager.getFailedChecker();
-
-                       List<FailedData> failedList = failedChecker.getFailedList();
-                       DBTableInfo failedTableInfo = DBTableManager.getInstance()
-                                       .getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA);
-                       String insertQuery = failedTableInfo.insertQuery();
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-                       String[] columns = DBTableManager.commonColumns;
-
-                       int size = columns.length;
-                       int count = failedList.size();
-                       for (int i = 0; i < count; i++) {
-                               FailedData failedData = failedList.get(i);
-                               int dataSize = failedData.getData().size();
-                               for (int ii = 0; ii < size; ii++) {
-                                       if (ii >= dataSize) {
-                                               prep.setString(ii + 1, CommonConstants.EMPTY);
-                                       } else {
-                                               prep.setString(ii + 1, failedData.getData().get(ii));
-                                       }
-                               }
-                               prep.addBatch();
-                       }
-
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-       }
-
-       public void saveCallStackUnits() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-
-                       DBTableInfo unitTableInfo = DBTableManager.getInstance()
-                                       .getTableInfo(DBTableManager.TABLE_INDEX_CALLSTACK_UNITS);
-                       String insertQuery = unitTableInfo.insertQuery();
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-
-                       HashMap<Long, CallStackUnit> callstackMap = CallStackManager
-                                       .getInstance().getCallStackApiByAddrMap();
-                       List<CallStackUnit> callstackUnits = new ArrayList<CallStackUnit>();
-                       callstackUnits.addAll(callstackMap.values());
-                       int size = callstackUnits.size();
-                       for (int i = 0; i < size; i++) {
-                               try {
-                                       CallStackUnit saveData = callstackUnits.get(i);
-                                       prep.setLong(1, saveData.getAddr());
-                                       prep.setString(2, saveData.getSymbol());
-                                       // FIXME : do not delete !! to catch bug
-                                       // System.out.println("addr " + saveData.getAddr() +
-                                       // "  api "
-                                       // + saveData.getSymbol());
-                                       prep.addBatch();
-                               } catch (ArrayIndexOutOfBoundsException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-       }
-
-       public void saveCallStackData() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-
-                       DBTableInfo callstackData = DBTableManager.getInstance()
-                                       .getTableInfo(DBTableManager.TABLE_INDEX_CALLSTACK_DATA);
-                       String insertQuery = callstackData.insertQuery();
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-                       Collection<CallStackData> col = CallStackManager.getInstance()
-                                       .getCallStackDataBySeqMap().values();
-                       List<CallStackData> callstackDataList = new ArrayList<CallStackData>();
-                       callstackDataList.addAll(col);
-                       int size = callstackDataList.size();
-                       for (int i = 0; i < size; i++) {
-                               int seq = callstackDataList.get(i).getSeq();
-                               String addrs = AnalyzerUtil
-                                               .makeLongList2String(callstackDataList.get(i)
-                                                               .getAddrs());
-                               try {
-                                       prep.setInt(1, seq);
-                                       prep.setString(2, addrs);
-                                       prep.addBatch();
-                               } catch (ArrayIndexOutOfBoundsException e) {
-                                       e.printStackTrace();
-                               }
-                       }
-
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-       }
-
-       public void saveAppInfo() {
+       public void createProjectTable(Project project) {
                try {
                        Connection conn = getConnection();
                        if (null == conn) {
                                return;
                        }
-
-                       DBTableInfo appInfoData = DBTableManager.getInstance()
-                                       .getTableInfo(DBTableManager.TABLE_INDEX_APP_INFO);
-                       String insertQuery = appInfoData.insertQuery();
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-                       List<String> info = AnalyzerManager.getProject().getAppInfo();
-                       int size = info.size();
-                       for (int i = 0; i < size; i++) {
-                               prep.setString(1, info.get(i));
-                               prep.addBatch();
-                       }
-
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
+                       semaphoreAcquire();
+                       Statement stat = conn.createStatement();
+                       stat.executeUpdate(createDropTableQuery("project")); //$NON-NLS-1$
+                       String query = "create table project (info TEXT not null)"; //$NON-NLS-1$
+                       stat.executeUpdate(query);
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
-                       closeConnection();
+                       semaphoreRelease();
                }
        }
 
+       public String createDropTableQuery(String target) {
+               StringBuffer query = new StringBuffer();
+               query.append("drop table if exists "); //$NON-NLS-1$
+               query.append(target);
+               query.append(CommonConstants.SEMICOLON);
+               return query.toString();
+       }
+
        public void createTables() {
                try {
-
                        Connection conn = getConnection();
                        if (null == conn) {
                                return;
                        }
-
+                       semaphoreAcquire();
                        DBTableManager dbManager = DBTableManager.getInstance();
                        Statement stat = conn.createStatement();
                        if (!executeUpdateCreateTable(stat,
@@ -789,7 +258,7 @@ public class SqlManager {
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
-                       closeConnection();
+                       semaphoreRelease();
                }
        }
 
@@ -803,312 +272,659 @@ public class SqlManager {
                }
        }
 
-       public ResultSet selectAllFromTable(int tableIndex) {
+       /**
+        * Insert query function
+        * 
+        * @param query
+        *            insert query
+        * @param input
+        *            insert data
+        * @return success/failed
+        */
+       public boolean insertQuery(String query, List<List<String>> input) {
+               PreparedStatement prep = null;
                try {
                        Connection conn = getConnection();
-                       if (null == conn) {
-                               return null;
+                       if (null == conn || null == query || null == input) {
+                               System.out.println("failed sql inset : " + input);
+                               return false;
                        }
-
-                       Statement stat = conn.createStatement();
-                       DBTableManager dbManager = DBTableManager.getInstance();
-                       String query = dbManager.getTableInfo(tableIndex).selectAllQuery();
-                       ResultSet rs = stat.executeQuery(query);
-                       return rs;
+                       semaphoreAcquire();
+                       prep = conn.prepareStatement(query);
+                       int dataRowSize = input.size();
+                       for (int i = 0; i < dataRowSize; i++) {
+                               List<String> rowData = input.get(i);
+                               int columnSize = rowData.size();
+                               for (int j = 0; j < columnSize; j++) {
+                                       prep.setString(j + 1, rowData.get(j));
+                               }
+                               prep.addBatch();
+                       }
+                       conn.setAutoCommit(false);
+                       prep.executeBatch();
+                       conn.setAutoCommit(true);
                } catch (SQLException e) {
                        e.printStackTrace();
                } finally {
-                       // closeConnection();
+                       if (null != prep) {
+                               try {
+                                       prep.close();
+                               } catch (SQLException e) {
+                                       e.printStackTrace();
+                               }
+                       }
+                       semaphoreRelease();
                }
-               return null;
+               return true;
        }
 
-       public boolean setCallStackDataFromTable(int tableIndex,
-                       HashMap<Integer, CallStackData> putData) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return false;
+       public String createInsertQuery(LogCenter logcs) {
+               StringBuffer query = new StringBuffer();
+               query.append("insert into "); //$NON-NLS-1$
+               query.append(logcs.getName());
+               query.append(" values ("); //$NON-NLS-1$
+
+               int size = logcs.getTotalColumnCount();
+               for (int i = 0; i < size; i++) {
+                       query.append("?"); //$NON-NLS-1$
+                       if (i + 1 == size) {
+                               query.append(CommonConstants.CLOSE_BRACKET
+                                               + CommonConstants.SEMICOLON);
+                               break;
+                       } else {
+                               query.append(CommonConstants.COMMA);
                        }
+               }
+               return query.toString();
+       }
 
-                       Statement stat = conn.createStatement();
-                       DBTableManager dbManager = DBTableManager.getInstance();
-                       String query = dbManager.getTableInfo(tableIndex).selectAllQuery();
-                       ResultSet rs = stat.executeQuery(query);
+       public void insertProject() {
+               String insertQuery = "insert into project values ( ? );"; //$NON-NLS-1$
 
-                       while (rs.next()) {
-                               int seq = rs.getInt("seq"); //$NON-NLS-1$
-                               String addrs = rs.getString("callstack"); //$NON-NLS-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 i = 0; i < size; i++) {
-                                       long addr = Long.parseLong(splitAddrs[i]);
-                                       addrList.add(addr);
-                               }
-                               putData.put(seq, csd);
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               List<LogCenter> logcs = AnalyzerManager.getLogCenters();
+
+               Project project = AnalyzerManager.getProject();
+               /* project version index = 0 */
+               List<String> insetRowData = new ArrayList<String>();
+               insetRowData.add(project.getVersion());
+               insetData.add(insetRowData);
+               /* project create time index = 1 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(project.getCreateTime());
+               insetData.add(insetRowData);
+               /* project application name index = 2 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(project.getAppName());
+               insetData.add(insetRowData);
+               /* project device index = 3 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(project.getDevice());
+               insetData.add(insetRowData);
+               /* project last log number index = 4 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(project.getLastLogNumbers());
+               insetData.add(insetRowData);
+               /* project last recording time index = 5 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(Long.toString(project.getLastTime()));
+               insetData.add(insetRowData);
+               /* project total sample count index = 6 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(Integer.toString(project
+                               .getTotalProfilingSampleCount()));
+               insetData.add(insetRowData);
+               /* project package id index = 7 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(project.getPkgId());
+               insetData.add(insetRowData);
+               /* project stop time id index = 8 */
+               insetRowData = new ArrayList<String>();
+               insetRowData.add(Long.toString(project.getStopTime()));
+               insetData.add(insetRowData);
+
+               /* project logcenters index = reminders */
+               int size = logcs.size();
+               for (int i = 0; i < size; i++) {
+                       insetRowData = new ArrayList<String>();
+                       try {
+                               insetRowData.add(logcs.get(i).getName());
+                               insetData.add(insetRowData);
+                       } catch (ArrayIndexOutOfBoundsException e) {
+                               e.printStackTrace();
                        }
-                       rs.close();
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
                }
-               return true;
+               insertQuery(insertQuery, insetData);
        }
 
-       public List<String> executeSelectQuery(String query, int columnCount) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return null;
+       public void insert(LogCenter logc, List<List<String>> input)
+                       throws InterruptedException {
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               String insertQuery = logc.getInsertQuery();
+               int dataSize = input.size();
+               for (int inputIndex = 0; inputIndex < dataSize; inputIndex++) {
+                       List<String> insetRowData = new ArrayList<String>();
+                       List<String> log = input.get(inputIndex);
+                       int size = logc.getTotalColumnCount();
+                       insetRowData.add(Integer.toString(logc.getIndex()));
+                       for (int i = 0; i < size; i++) {
+                               try {
+                                       if (i + 2 > size) {
+                                               break;
+                                       }
+                                       insetRowData.add(log.get(i));
+                               } catch (ArrayIndexOutOfBoundsException e) {
+                                       System.out.println("sql insert exception : index " + i); //$NON-NLS-1$
+                                       e.printStackTrace();
+                               }
                        }
+                       insetData.add(insetRowData);
+                       logc.addIndex();
+               }
+               insertQuery(insertQuery, insetData);
 
-                       List<String> output = null;
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-                       if (rs.next()) {
-                               output = new ArrayList<String>();
-                               for (int i = 0; i < columnCount; i++) {
-                                       output.add(rs.getString(i + 1));
+       }
+
+       public void saveLeakData() {
+               LeakDetector leakDectector = AnalyzerManager.getLeakDetector();
+               DBTableInfo leakTableInfo = DBTableManager.getInstance().getTableInfo(
+                               DBTableManager.TABLE_INDEX_LEAK_DATA);
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               String insertQuery = leakTableInfo.insertQuery();
+               int size = leakTableInfo.getColumnNames().length;
+
+               List<LeakData> leakList = leakDectector.getLeakDataList();
+               for (LeakData leakData : leakList) {
+                       List<String> insetRowData = new ArrayList<String>();
+                       for (int ii = 0; ii < size; ii++) {
+                               insetRowData.add(leakData.getData().get(ii));
+                       }
+                       insetData.add(insetRowData);
+                       if (!leakData.getChildren().isEmpty()) {
+                               List<LeakData> children = leakData.getChildren();
+                               for (LeakData child : children) {
+                                       for (int ii = 0; ii < size; ii++) {
+                                               insetRowData.add(child.getData().get(ii));
+                                       }
+                                       insetData.add(insetRowData);
                                }
                        }
-                       if (!rs.isClosed()) {
-                               rs.close();
-                       }
-                       return output;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
                }
-               return null;
+               insertQuery(insertQuery, insetData);
        }
 
-       public String executeSelectQuery(String query) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return null;
+       public void saveFailedData() {
+               FailedChecker failedChecker = AnalyzerManager.getFailedChecker();
+
+               List<FailedData> failedList = failedChecker.getFailedList();
+               DBTableInfo failedTableInfo = DBTableManager.getInstance()
+                               .getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA);
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               String insertQuery = failedTableInfo.insertQuery();
+               String[] columns = DBTableManager.commonColumns;
+               int size = columns.length;
+               int count = failedList.size();
+               for (int i = 0; i < count; i++) {
+                       List<String> insetRowData = new ArrayList<String>();
+                       FailedData failedData = failedList.get(i);
+                       int dataSize = failedData.getData().size();
+                       for (int ii = 0; ii < size; ii++) {
+                               if (ii >= dataSize) {
+                                       insetRowData.add(CommonConstants.EMPTY);
+                               } else {
+                                       insetRowData.add(failedData.getData().get(ii));
+                               }
+                               insetData.add(insetRowData);
                        }
+               }
+               insertQuery(insertQuery, insetData);
+       }
 
-                       String output = null;
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-                       if (rs.next()) {
-                               output = rs.getString(1);
-                       }
-                       if (!rs.isClosed()) {
-                               rs.close();
+       public void saveCallStackUnits() {
+               DBTableInfo unitTableInfo = DBTableManager.getInstance().getTableInfo(
+                               DBTableManager.TABLE_INDEX_CALLSTACK_UNITS);
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               String insertQuery = unitTableInfo.insertQuery();
+               HashMap<Long, CallStackUnit> callstackMap = AnalyzerManager
+                               .getCallstackManager().getCallStackApiByAddrMap();
+               // HashMap<Long, CallStackUnit> callstackMap = CallStackManager
+               // .getInstance().getCallStackApiByAddrMap();
+               List<CallStackUnit> callstackUnits = new ArrayList<CallStackUnit>();
+               callstackUnits.addAll(callstackMap.values());
+               int size = callstackUnits.size();
+               for (int i = 0; i < size; i++) {
+                       List<String> insetRowData = new ArrayList<String>();
+                       try {
+                               CallStackUnit saveData = callstackUnits.get(i);
+                               insetRowData.add(Long.toString(saveData.getAddr()));
+                               insetRowData.add(saveData.getSymbol());
+                       } catch (ArrayIndexOutOfBoundsException e) {
+                               e.printStackTrace();
                        }
-                       return output;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
+                       insetData.add(insetRowData);
                }
-               return null;
+               insertQuery(insertQuery, insetData);
        }
 
-       public List<List<String>> executeSelectQueryFD(String query, int size) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return null;
+       public void saveCallStackData() {
+               DBTableInfo callstackData = DBTableManager.getInstance().getTableInfo(
+                               DBTableManager.TABLE_INDEX_CALLSTACK_DATA);
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               String insertQuery = callstackData.insertQuery();
+               // Collection<CallStackData> col = CallStackManager.getInstance()
+               // .getCallStackDataBySeqMap().values();
+               Collection<CallStackData> col = AnalyzerManager.getCallstackManager()
+                               .getCallStackDataBySeqMap().values();
+               List<CallStackData> callstackDataList = new ArrayList<CallStackData>();
+               callstackDataList.addAll(col);
+               int size = callstackDataList.size();
+               for (int i = 0; i < size; i++) {
+                       List<String> insetRowData = new ArrayList<String>();
+                       int seq = callstackDataList.get(i).getSeq();
+                       String addrs = AnalyzerUtil.makeLongList2String(callstackDataList
+                                       .get(i).getAddrs());
+                       try {
+                               insetRowData.add(Integer.toString(seq));
+                               insetRowData.add(addrs);
+                       } catch (ArrayIndexOutOfBoundsException e) {
+                               e.printStackTrace();
                        }
+                       insetData.add(insetRowData);
+               }
+               insertQuery(insertQuery, insetData);
+       }
 
-                       List<String> output = null;
-                       List<List<String>> outputList = new ArrayList<List<String>>();
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-                       while (rs.next()) {
-                               output = new ArrayList<String>();
-                               for (int i = 0; i < size; i++) {
-                                       output.add(rs.getString(i + 1));
+       public void saveAppInfo() {
+               DBTableInfo appInfoData = DBTableManager.getInstance().getTableInfo(
+                               DBTableManager.TABLE_INDEX_APP_INFO);
+               String insertQuery = appInfoData.insertQuery();
+               List<String> info = AnalyzerManager.getProject().getAppInfo();
+               int size = info.size();
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               for (int i = 0; i < size; i++) {
+                       List<String> insetRowData = new ArrayList<String>();
+                       insetRowData.add(info.get(i));
+                       insetData.add(insetRowData);
+               }
+               insertQuery(insertQuery, insetData);
+       }
+
+       public void saveProfilingData() {
+               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                               .getProfileDataMaker();
+               HashMap<String, ProfilingData> profilingDataMap = profiler
+                               .getProfilingDataMap();
+               List<ProfilingData> pDataList = new ArrayList<ProfilingData>();
+               pDataList.addAll(profilingDataMap.values());
+
+               DBTableInfo profilingData = DBTableManager.getInstance().getTableInfo(
+                               DBTableManager.TABLE_INDEX_PROFILING_DATA);
+               String insertQuery = profilingData.insertQuery();
+
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               int size = profilingData.getColumnNames().length;
+               int count = pDataList.size();
+               for (int i = 0; i < count; i++) {
+                       List<String> input = pDataList.get(i).getSaveData();
+                       List<String> insetRowData = new ArrayList<String>();
+                       int dataSize = input.size();
+                       for (int ii = 0; ii < size; ii++) {
+                               if (ii >= dataSize) {
+                                       insetRowData.add(CommonConstants.EMPTY);
+                               } else {
+                                       insetRowData.add(input.get(ii));
                                }
-                               outputList.add(output);
                        }
-                       if (!rs.isClosed()) {
-                               rs.close();
-                       }
-                       return outputList;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
+                       insetData.add(insetRowData);
                }
-               return null;
+               insertQuery(insertQuery, insetData);
        }
 
-       public List<List<String>> executeDeviceInfoQuery(String query) {
+       public void saveProfilingChildData() {
+               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                               .getProfileDataMaker();
+               HashMap<String, ProfilingChildData> profilingDataMap = profiler
+                               .getChildListMap();
+               List<ProfilingChildData> pDataList = new ArrayList<ProfilingChildData>();
+               pDataList.addAll(profilingDataMap.values());
+
+               DBTableInfo profilingChildData = DBTableManager.getInstance()
+                               .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
+
+               List<List<String>> insetData = new ArrayList<List<String>>();
+               int count = pDataList.size();
+               for (int i = 0; i < count; i++) {
+                       ProfilingChildData data = pDataList.get(i);
+                       String seqStr = AnalyzerUtil.makeStringList2String(data
+                                       .getChildren());
+                       List<String> insetRowData = new ArrayList<String>();
+                       if (null == seqStr || seqStr.isEmpty()) {
+                               continue;
+                       }
+                       insetRowData.add(data.getSeq());
+                       insetRowData.add(seqStr);
+                       insetData.add(insetRowData);
+               }
+               insertQuery(profilingChildData.insertQuery(), insetData);
+       }
+
+       /**
+        * select query function
+        * 
+        * @param dbFilePath
+        *            DB File path
+        * @param columnName
+        *            column name list
+        * @param tableName
+        *            table name
+        * @param option
+        *            Condition statements
+        * @return List<List<String>> row of columns data
+        */
+       public List<List<String>> selectQuery(String dbFilePath,
+                       String[] columnName, String tableName, String option) {
+               List<List<String>> dbInfo = null;
+               String query = null;
+               Statement stat = null;
+               ResultSet rs = null;
+               Connection conn = null;
                try {
-                       Connection conn = getConnection();
+                       if (null == dbFilePath) {
+                               conn = getConnection();
+                       } else {
+                               conn = getConnection(dbFilePath);
+                       }
                        if (null == conn) {
                                return null;
                        }
+                       semaphoreAcquire();
+                       if (null == tableName || tableName.length() < 1) {
+                               System.out.println("tableName is null");
+                               return null;
+                       }
 
-                       List<String> output = null;
-                       List<List<String>> outputList = new ArrayList<List<String>>();
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-                       while (rs.next()) {
-                               output = new ArrayList<String>();
-                               for (int i = 0; i < 2; i++) {
-                                       output.add(rs.getString(i + 1));
+                       StringBuilder columns = new StringBuilder();
+                       if (null == columnName || columnName.length < 1) {
+                               System.out.println("tableName is null");
+                               return null;
+                       } else {
+                               for (int i = 0; i < columnName.length; i++) {
+                                       if ((0 < i) && (i < columnName.length)) {
+                                               columns.append(", ");//$NON-NLS-1$
+                                       }
+                                       columns.append(columnName[i]);
                                }
-                               outputList.add(output);
                        }
-                       if (!rs.isClosed()) {
-                               rs.close();
+                       String queryOption = CommonConstants.EMPTY;
+                       if (null != option) {
+                               queryOption = option;
                        }
-                       return outputList;
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
-               }
-               return null;
-       }
+                       query = String.format("select %s from %s %s;",//$NON-NLS-1$
+                                       columns.toString(), tableName, queryOption);
 
-       public List<List<String>> executeSelectQueryImage(String query,
-                       LogCenter logc) {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
+                       stat = conn.createStatement();
+                       rs = stat.executeQuery(query);
+                       if (null == rs) {
                                return null;
                        }
-
-                       List<String> output = null;
-                       List<List<String>> outputList = new ArrayList<List<String>>();
-                       Statement stat = conn.createStatement();
-                       ResultSet rs = stat.executeQuery(query);
-                       int size = logc.getTotalColumnCount();
+                       dbInfo = new ArrayList<List<String>>();
                        while (rs.next()) {
-                               output = new ArrayList<String>();
-                               for (int i = 0; i < size; i++) {
-                                       output.add(rs.getString(i + 1));
+                               List<String> rowData = new ArrayList<String>();
+                               for (String name : columnName) {
+                                       rowData.add(rs.getString(name));
                                }
-                               outputList.add(output);
+                               dbInfo.add(rowData);
                        }
-                       if (!rs.isClosed()) {
-                               rs.close();
-                       }
-                       return outputList;
                } catch (SQLException e) {
-                       e.printStackTrace();
+                       System.out.println("SQLException - selecte : " + query);
                } finally {
-                       closeConnection();
-               }
-               return null;
+                       try {
+                               if (null != rs) {
+                                       rs.close();
+                               }
+                               if (null != stat) {
+                                       stat.close();
+                               }
+                       } catch (SQLException e) {
+                               System.out.println("Finally SQLException - selecte : " + query);
+                       }
+                       if (null != conn) {
+                               semaphoreRelease();
+                       }
+                       if (null != dbFilePath) {
+                               closeConnection();
+                       }
+
+               }
+               return dbInfo;
+       }
+
+       // openTraceHandler
+       public List<List<String>> getCallStackDataFromTable() {
+               return selectQuery(
+                               null,
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_CALLSTACK_DATA)
+                                               .getColumnNames(),
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_CALLSTACK_DATA)
+                                               .getTableName(), null);
+       }
+
+       public List<List<String>> setloadCallStackApis() {
+               return selectQuery(
+                               null,
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(
+                                                               DBTableManager.TABLE_INDEX_CALLSTACK_UNITS)
+                                               .getColumnNames(),
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(
+                                                               DBTableManager.TABLE_INDEX_CALLSTACK_UNITS)
+                                               .getTableName(), null);
+       }
+
+       public List<List<String>> setloadAppInfo() {
+               return selectQuery(
+                               null,
+                               DBTableManager.getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_APP_INFO)
+                                               .getColumnNames(), DBTableManager.getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_APP_INFO)
+                                               .getTableName(), null);
+       }
+
+       public List<List<String>> setloadLeakData() {
+               return selectQuery(
+                               null,
+                               DBTableManager.getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_LEAK_DATA)
+                                               .getColumnNames(), DBTableManager.getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_LEAK_DATA)
+                                               .getTableName(), null);
+       }
+
+       public List<List<String>> setloadFailedData() {
+               return selectQuery(
+                               null,
+                               DBTableManager.getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA)
+                                               .getColumnNames(), DBTableManager.getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA)
+                                               .getTableName(), null);
+       }
+
+       public List<List<String>> setloadProfilingData() {
+               return selectQuery(
+                               null,
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_DATA)
+                                               .getColumnNames(),
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_DATA)
+                                               .getTableName(), null);
+       }
+
+       public List<List<String>> setloadProfilingChildData() {
+               return selectQuery(
+                               null,
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(
+                                                               DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA)
+                                               .getColumnNames(),
+                               DBTableManager
+                                               .getInstance()
+                                               .getTableInfo(
+                                                               DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA)
+                                               .getTableName(), null);
        }
 
-       public void saveProfilingData() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-                       ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
-                                       .getProfileDataMaker();
-                       HashMap<String, ProfilingData> profilingDataMap = profiler
-                                       .getProfilingDataMap();
-                       List<ProfilingData> pDataList = new ArrayList<ProfilingData>();
-                       pDataList.addAll(profilingDataMap.values());
-
-                       DBTableInfo profilingData = DBTableManager.getInstance()
-                                       .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_DATA);
-                       String insertQuery = profilingData.insertQuery();
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-
-                       int size = profilingData.getColumnNames().length;
-                       int count = pDataList.size();
-                       for (int i = 0; i < count; i++) {
-                               List<String> input = pDataList.get(i).getSaveData();
-                               int dataSize = input.size();
-                               for (int ii = 0; ii < size; ii++) {
-                                       if (ii >= dataSize) {
-                                               prep.setString(ii + 1, CommonConstants.EMPTY);
-                                       } else {
-                                               prep.setString(ii + 1, input.get(ii));
-                                       }
-                               }
-                               prep.addBatch();
-                       }
+       public List<String> getDetailsInfo(String path) {
+               List<List<String>> dbInfo = new ArrayList<List<String>>();
+               dbInfo = selectQuery(path, new String[] { "info" }, "project", null);//$NON-NLS-1$//$NON-NLS-2$
+               if (dbInfo == null) {
+                       return null;
+               }
+               List<String> pInfo = new ArrayList<String>();
+               for (int i = 0; i < dbInfo.size(); i++) {
+                       pInfo.add(dbInfo.get(i).get(0));
+               }
+               return pInfo;
+       }
 
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
+       public synchronized List<List<String>> selectRowId(LogCenter center,
+                       int from, int to) {
 
+               String[] columnName = center.getColumnName().toArray(
+                               new String[center.getColumnName().size()]);
+               if (null == columnName || columnName.length < 1) {
+                       return null;
                }
+               String queryOption = " where rid >= " + from + " and rid < " + to;//$NON-NLS-1$ //$NON-NLS-2$
+               List<List<String>> dbInfo = selectQuery(null, columnName,
+                               center.getName(), queryOption.toString());
+               return dbInfo;
        }
 
-       public void saveProfilingChildData() {
-               try {
-                       Connection conn = getConnection();
-                       if (null == conn) {
-                               return;
-                       }
-                       ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
-                                       .getProfileDataMaker();
-                       HashMap<String, ProfilingChildData> profilingDataMap = profiler
-                                       .getChildListMap();
-                       List<ProfilingChildData> pDataList = new ArrayList<ProfilingChildData>();
-                       pDataList.addAll(profilingDataMap.values());
-
-                       DBTableInfo profilingChildData = DBTableManager.getInstance()
-                                       .getTableInfo(
-                                                       DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
-                       String insertQuery = profilingChildData.insertQuery();
-                       PreparedStatement prep = conn.prepareStatement(insertQuery);
-
-                       int count = pDataList.size();
-                       for (int i = 0; i < count; i++) {
-                               ProfilingChildData data = pDataList.get(i);
-                               String seqStr = AnalyzerUtil.makeStringList2String(data
-                                               .getChildren());
-                               if (null == seqStr || seqStr.isEmpty()) {
-                                       continue;
-                               }
-                               prep.setString(1, data.getSeq());
-                               prep.setString(2, seqStr);
-                               prep.addBatch();
-                       }
+       public int selectCount(LogCenter logCenter) {
+               List<List<String>> dbInfo = selectQuery(null,
+                               new String[] { "count(SeqNumber)" }, logCenter.getName(), null);
+               if (null == dbInfo || null == dbInfo.get(0).get(0)) {
+                       return 0;
+               }
+               return Integer.parseInt(dbInfo.get(0).get(0));
+       }
 
-                       conn.setAutoCommit(false);
-                       prep.executeBatch();
-                       conn.setAutoCommit(true);
+       public int executeSelectIndexOperation(long time) {
+               String queryOptin = " where time < " + time + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER; //$NON-NLS-1$ //$NON-NLS-2$
+               List<List<String>> dbInfo = selectQuery(null,
+                               new String[] { "count(time)" }, "user_function", queryOptin);
+               if (null == dbInfo || null == dbInfo.get(0).get(0)) {
+                       return 0;
+               }
+               return Integer.parseInt(dbInfo.get(0).get(0));
+       }
 
-               } catch (SQLException e) {
-                       e.printStackTrace();
-               } finally {
-                       closeConnection();
+       public int executeSelectCountOperation(long StartTime, long endTime) {
+               String countQuery = " where time >" + StartTime + " and time <= " + endTime + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+               List<List<String>> dbInfo = selectQuery(null,
+                               new String[] { "count(time)" }, "user_function", countQuery); //$NON-NLS-1$ //$NON-NLS-2$
+               if (null == dbInfo || null == dbInfo.get(0).get(0)) {
+                       return 0;
                }
+               return Integer.parseInt(dbInfo.get(0).get(0));
        }
 
-       public List<String> getDetailsInfo(String path) {
+       public List<String> getCpuRates(long startTime, int type) {
+               String queryOption = null;
+               if (type == 1) {
+                       queryOption = "where time = (select max(time) from system where time <= " + startTime + ")"; //$NON-NLS-1$
+               } else {
+                       queryOption = "where time = (select min(time) from system)"; //$NON-NLS-1$
+               }
+               List<List<String>> dbInfo = selectQuery(null, new String[] {
+                               "SystemCpuUsage", "ResidentMemory" }, "system", queryOption); //$NON-NLS-1$ //$NON-NLS-2$
+               if (null == dbInfo || dbInfo.size() == 0) {
+                       return null;
+               }
                List<String> pInfo = new ArrayList<String>();
-               try {
-                       Connection conn = getConnection(path);
-                       Statement stat = conn.createStatement();
-                       String query = "select info from project"; //$NON-NLS-1$
-                       ResultSet rs = stat.executeQuery(query);
-                       while (rs.next()) {
-                               pInfo.add(rs.getString("info")); //$NON-NLS-1$
-                       }
-                       rs.close();
-               } catch (SQLException e) {
-                       System.out.println(path + " save file is invalid...");
-               } finally {
-                       closeConnection();
+               for (int i = 0; i < 2; i++) {
+                       pInfo.add(dbInfo.get(0).get(i));
                }
                return pInfo;
        }
+
+       public String getLastSnapshotTime(String time) {
+
+               String queryOption = "where time >=" + time;//$NON-NLS-1$
+               List<List<String>> dbInfo = selectQuery(null,
+                               new String[] { "min(time)" }, "screenshot", queryOption); //$NON-NLS-1$ //$NON-NLS-2$
+               if (null == dbInfo || dbInfo.isEmpty()) {
+                       return null;
+               }
+               return dbInfo.get(0).get(0);
+       }
+
+       public List<List<String>> getloadImageSet(int size) {
+               List<List<String>> dbInfo = selectQuery(null, new String[] {
+                               "SeqNumber", "Time" }, "screenshot", null); //$NON-NLS-1$ //$NON-NLS-2$
+               return dbInfo;
+       }
+
+       public int getRangeMinSeq(String tableName, long time) {
+               String queryOption = " where time >= " + time; //$NON-NLS-1$
+               List<List<String>> dbInfo = selectQuery(null,
+                               new String[] { "min(seqnumber)" }, tableName, queryOption); //$NON-NLS-1$ //$NON-NLS-2$
+               if (null == dbInfo || null == dbInfo.get(0).get(0)) {
+                       return 0;
+               }
+               return Integer.parseInt(dbInfo.get(0).get(0));
+       }
+
+       public int getRangeMaxSeq(String tableName, long time) {
+               String queryOption = " where time <= " + time; //$NON-NLS-1$
+               List<List<String>> dbInfo = selectQuery(null,
+                               new String[] { "max(seqnumber)" }, tableName, queryOption); //$NON-NLS-1$ //$NON-NLS-2$
+               if (null == dbInfo || null == dbInfo.get(0).get(0)) {
+                       return 0;
+               }
+               return Integer.parseInt(dbInfo.get(0).get(0));
+       }
+
+       public List<List<String>> selectArea(LogCenter center, long from, long to) {
+
+               StringBuffer queryOption = new StringBuffer();
+               queryOption.append(" where SeqNumber >= "); //$NON-NLS-1$
+               queryOption.append(from);
+               queryOption.append(" and SeqNumber <= "); //$NON-NLS-1$
+               queryOption.append(to);
+
+               String[] columnNames = center.getColumnName().toArray(
+                               new String[center.getColumnName().size()]);
+               List<List<String>> dbInfo = selectQuery(null, columnNames,
+                               center.getName(), queryOption.toString()); //$NON-NLS-1$ //$NON-NLS-2$
+
+               List<List<String>> output = new ArrayList<List<String>>();
+
+               for (int i = 0; i < dbInfo.size(); i++) {
+                       List<String> pInfo = dbInfo.get(i);
+                       List<String> inner = new ArrayList<String>();
+                       int size = pInfo.size();
+                       for (int j = 0; j < size; j++) {
+                               if (j + 1 >= size) {
+                                       break;
+                               }
+                               inner.add(pInfo.get(j + 1));
+                       }
+                       output.add(inner);
+               }
+               return output;
+       }
 }
index 0f13231..9c7b54c 100644 (file)
@@ -382,6 +382,10 @@ public class DAThemeBlack extends DATheme {
                setColor("configufation_table_contentsbackground_color", new RGB(206, 206, 206)); //$NON-NLS-1$
                setColor("configufation_sunken_line_up_color", new RGB(160, 160, 160)); //$NON-NLS-1$
                setColor("configufation_sunken_line_down_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+               
+               /*** contextMenu ***/
+               setColor("context_menu_title_background_color", new RGB(247, 247, 247)); //$NON-NLS-1$
+               setColor("context_menu_title_font_color", new RGB(0, 45, 96)); //$NON-NLS-1$
        }
 
        public Color getColor(String colorName, RGB rgb) {
index 8384c08..fab9d4b 100644 (file)
@@ -428,6 +428,10 @@ public class DAThemeWhite extends DATheme {
                setColor("configufation_table_contentsbackground_color", new RGB(206, 206, 206)); //$NON-NLS-1$
                setColor("configufation_sunken_line_up_color", new RGB(160, 160, 160)); //$NON-NLS-1$
                setColor("configufation_sunken_line_down_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+               
+               /*** contextMenu ***/
+               setColor("context_menu_title_background_color", new RGB(247, 247, 247)); //$NON-NLS-1$
+               setColor("context_menu_title_font_color", new RGB(0, 45, 96)); //$NON-NLS-1$
        }
 
        public Color getColor(String colorName, RGB rgb) {
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextAnalysisMenuItemClickListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextAnalysisMenuItemClickListener.java
new file mode 100644 (file)
index 0000000..a19954f
--- /dev/null
@@ -0,0 +1,13 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ContextAnalysisMenuItemClickListener extends DAContextMenuListener {
+
+       @Override
+       public void widgetSelected(DAContextMenuItem menuItem) {
+               RangeDataManager.getInstance().startRangeAnalysis();
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextClearMenuItemClickListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextClearMenuItemClickListener.java
new file mode 100644 (file)
index 0000000..8777668
--- /dev/null
@@ -0,0 +1,22 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ContextClearMenuItemClickListener extends DAContextMenuListener {
+//     private DAChartBoard chartBoard;
+
+       public ContextClearMenuItemClickListener(DAChartBoard board) {
+//             chartBoard = board;
+       }
+
+       @Override
+       public void widgetSelected(DAContextMenuItem menuItem) {
+//             chartBoard.setTimelineMarkerStartTime(0);
+//             chartBoard.setTimelineMarkerEndTime(0);
+
+               RangeDataManager.getInstance().initRange();
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextEndMenuItemClickListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextEndMenuItemClickListener.java
new file mode 100644 (file)
index 0000000..a131a42
--- /dev/null
@@ -0,0 +1,39 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ContextEndMenuItemClickListener extends DAContextMenuListener {
+       private DAContextMenuItem endItem;
+       private DAChartBoard chartBoard;
+       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+       public ContextEndMenuItemClickListener(DAContextMenuItem item,
+                       DAChartBoard board) {
+               endItem = item;
+               chartBoard = board;
+       }
+
+       @Override
+       public void widgetSelected(DAContextMenuItem menuItem) {
+               double endTime = endItem.getDoubleData();
+               rangeDataManager
+                               .setMarkerEndTime((long) (endTime * TimelineConstants.MEGA));
+
+               double startTime = rangeDataManager.getMarkerStartTime()
+                               / TimelineConstants.MEGA;
+
+
+               chartBoard.setTimelineMarkerStartTime(startTime);
+               chartBoard.setTimelineMarkerEndTime(endTime);
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setStartVal(startTime);
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setEndVal(endTime);
+               
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextFromSelectionMenuItemClickListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextFromSelectionMenuItemClickListener.java
new file mode 100644 (file)
index 0000000..2b6ff83
--- /dev/null
@@ -0,0 +1,46 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ContextFromSelectionMenuItemClickListener extends
+               DAContextMenuListener {
+       private DAChartBoard chartBoard;
+       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+       public ContextFromSelectionMenuItemClickListener(DAContextMenuItem item,
+                       DAChartBoard board) {
+               chartBoard = board;
+       }
+
+       @Override
+       public void widgetSelected(DAContextMenuItem menuItem) {
+               // TODO Auto-generated method stub
+               double startTime = ((DAChartPlotIntervalMarker) chartBoard.getMarkers()
+                               .get(UICommonConstants.SELECTION_MARKER_INDEX)).getStartVal();
+               double endTime = ((DAChartPlotIntervalMarker) chartBoard.getMarkers()
+                               .get(UICommonConstants.SELECTION_MARKER_INDEX)).getEndVal();
+               double temp;
+
+               if (startTime > endTime) {
+                       temp = startTime;
+                       startTime = endTime;
+                       endTime = temp;
+               }
+               rangeDataManager
+                               .setMarkerStartTime((long) (startTime * TimelineConstants.MEGA));
+               rangeDataManager
+                               .setMarkerEndTime((long) (endTime * TimelineConstants.MEGA));
+               chartBoard.setTimelineMarkerStartTime(startTime);
+               chartBoard.setTimelineMarkerEndTime(endTime);
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setStartVal(startTime);
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setEndVal(endTime);
+       }
+
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextStartMenuItemClickListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextStartMenuItemClickListener.java
new file mode 100644 (file)
index 0000000..986ff05
--- /dev/null
@@ -0,0 +1,37 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ContextStartMenuItemClickListener extends DAContextMenuListener {
+       private DAContextMenuItem startItem;
+       private DAChartBoard chartBoard;
+       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+       public ContextStartMenuItemClickListener(DAContextMenuItem item,
+                       DAChartBoard board) {
+               startItem = item;
+               chartBoard = board;
+       }
+
+       public void widgetSelected(DAContextMenuItem menuItem) {
+               double startTime = startItem.getDoubleData();
+               rangeDataManager
+                               .setMarkerStartTime((long) (startTime * TimelineConstants.MEGA));
+
+               double endTime = rangeDataManager.getMarkerEndTime()
+                               / TimelineConstants.MEGA;
+
+               chartBoard.setTimelineMarkerStartTime(startTime);
+               chartBoard.setTimelineMarkerEndTime(endTime);
+
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setStartVal(startTime);
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setEndVal(endTime);
+       }
+}
index a5592a0..39aa703 100644 (file)
@@ -4,17 +4,18 @@ import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseMoveListener;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimelineRangeMarker;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimelineMarker;
 
 public class SetRangeMarkerMouseMoveListener implements MouseMoveListener {
        private RangeDataManager rangeDataManager;
        private DAChartBoard chartBoard;
-       private DACustomTimeline timeline;
+       private DATimeline timeline;
 
        public SetRangeMarkerMouseMoveListener(RangeDataManager rangeDataManager,
-                       DAChartBoard chartBoard, DACustomTimeline timeline) {
+                       DAChartBoard chartBoard, DATimeline timeline) {
                this.rangeDataManager = rangeDataManager;
                this.chartBoard = chartBoard;
                this.timeline = timeline;
@@ -22,25 +23,39 @@ public class SetRangeMarkerMouseMoveListener implements MouseMoveListener {
 
        @Override
        public void mouseMove(MouseEvent e) {
-               DACustomTimelineRangeMarker startMarker = timeline
-                               .getStartRangeMarker();
-               DACustomTimelineRangeMarker endMarker = timeline.getEndRangeMarker();
+               DATimelineMarker startMarker = timeline.getStartRangeMarker();
+               DATimelineMarker endMarker = timeline.getEndRangeMarker();
 
                if (startMarker.isPushed()) {
                        double startTime = startMarker.getTime();
-                       double endTime = endMarker.getTime();
-
                        rangeDataManager
                                        .setMarkerStartTime((long) (startTime * TimelineConstants.MEGA));
-                       chartBoard.setHighlight(startTime, endTime, 1);
+
+                       double endTime = rangeDataManager.getMarkerEndTime()
+                                       / TimelineConstants.MEGA;
+
+                       chartBoard.setTimelineMarkerStartTime(startTime);
+                       chartBoard.setTimelineMarkerEndTime(endTime);
+                       
+                       ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                       UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
+                                       rangeDataManager.getMarkerStartTime() / TimelineConstants.MEGA,
+                                       rangeDataManager.getMarkerEndTime() / TimelineConstants.MEGA);
                } else if (endMarker.isPushed()) {
-                       double startTime = startMarker.getTime();
                        double endTime = endMarker.getTime();
-
                        rangeDataManager
                                        .setMarkerEndTime((long) (endTime * TimelineConstants.MEGA));
-                       chartBoard.setHighlight(startTime, endTime, 1);
+
+                       double startTime = rangeDataManager.getMarkerStartTime()
+                                       / TimelineConstants.MEGA;
+
+                       chartBoard.setTimelineMarkerStartTime(startTime);
+                       chartBoard.setTimelineMarkerEndTime(endTime);
+                       
+                       ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                       UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
+                                       rangeDataManager.getMarkerStartTime() / TimelineConstants.MEGA,
+                                       rangeDataManager.getMarkerEndTime() / TimelineConstants.MEGA);
                }
        }
-
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseEventListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseEventListener.java
new file mode 100644 (file)
index 0000000..b383282
--- /dev/null
@@ -0,0 +1,431 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chart.DAScreenshotChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAUIEventChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
+
+public class TimelineChartMouseEventListener extends MouseAdapter implements
+               MouseMoveListener {
+       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+       private DAContextMenu menu;
+       private DATimeline timeline;
+       private double baseTime = TimelineConstants.NOT_INITED;
+
+       private final int SELECTION_MARKER_INDEX = 0; // FIXME
+
+       public TimelineChartMouseEventListener(DAContextMenu menu,
+                       DATimeline timeline) {
+               this.menu = menu;
+               this.timeline = timeline;
+       }
+
+       @Override
+       public void mouseDown(MouseEvent e) {
+               DAChart chart = (DAChart) e.widget;
+               DAChartPlot plot = chart.getPlot();
+               DAChartPlotMarker marker = plot.getMarkers()
+                               .get(SELECTION_MARKER_INDEX);
+               if (!(marker instanceof DAChartPlotIntervalMarker)) {
+                       return;
+               }
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker;
+
+               double eventTime = plot.getXFromXPixcel(e.x);
+
+               if (e.button == 3) {
+                       List<DAContextMenuItem> itemList = menu.getItems();
+                       DAContextMenuItem startItem = itemList.get(0);
+                       DAContextMenuItem endItem = itemList.get(1);
+                       DAContextMenuItem fromSelectionItem = itemList.get(2);
+                       DAContextMenuItem analysisItem = itemList.get(3);
+                       DAContextMenuItem clearItem = itemList.get(4);
+
+                       if (eventTime * TimelineConstants.MEGA <= ToolbarArea.getInstance()
+                                       .getTime()) {
+                               startItem.setButtonEnabled(true);
+                               endItem.setButtonEnabled(true);
+                               analysisItem.setButtonEnabled(rangeDataManager.isAnalyzable());
+                               clearItem.setButtonEnabled(rangeDataManager.isBeingAnalyzed());
+
+                               startItem.setDoubleData(eventTime);
+                               endItem.setDoubleData(eventTime);
+                       } else {
+                               startItem.setButtonEnabled(false);
+                               endItem.setButtonEnabled(false);
+                               analysisItem.setButtonEnabled(rangeDataManager.isAnalyzable());
+                               clearItem.setButtonEnabled(rangeDataManager.isBeingAnalyzed());
+                       }
+
+                       if (intervalMarker.getStartVal() != intervalMarker.getEndVal()) {
+                               fromSelectionItem.setButtonEnabled(true);
+                       } else {
+                               fromSelectionItem.setButtonEnabled(false);
+                       }
+
+                       if (plot instanceof DAUIEventChartPlot) {
+                               double newYPosRatio = (double) e.y
+                                               / ((Canvas) e.widget).getSize().y;
+                               int seriesIndex = (int) (newYPosRatio * chart.getSeriesList()
+                                               .size());
+                               int startIndex = chart.getSeriesList().get(seriesIndex)
+                                               .getNextIndexByXvalue(intervalMarker.getStartVal());
+                               int endIndex = chart.getSeriesList().get(seriesIndex)
+                                               .getPrevIndexByXvalue(intervalMarker.getEndVal());
+
+                               DAContextMenuItem eventListItem = menu.getItems().get(
+                                               menu.getItems().size() - 1);
+                               ((UIEventChartContextMenuItem) eventListItem)
+                                               .setSeriesIndex(seriesIndex);
+                               ((UIEventChartContextMenuItem) eventListItem)
+                                               .setEventListStartIndex(startIndex);
+                               ((UIEventChartContextMenuItem) eventListItem)
+                                               .setEventListEndIndex(endIndex);
+
+                               eventListItem.setEnabled(true);
+                       }
+
+                       return;
+               }
+               boolean bShift = false;
+               if ((e.stateMask & SWT.SHIFT) != 0) {
+                       bShift = true;
+               }
+
+               if (plot instanceof DAScreenshotChartPlot) {
+                       DAChartSeries series = chart.getSeries(0);
+                       int index = series.getPrevIndexByXvalue(eventTime);
+                       if (index >= 0 && index < series.getSeriesItemList().size()) {
+                               DAChartSeriesItem item = series.getSeriesItemList().get(index);
+                               double itemTime = item.getX();
+                               int imageWidth = item.getImage().getBounds().width;
+                               double imageRightTime = itemTime
+                                               + plot.getXFromXPixcel(imageWidth)
+                                               - plot.getVisibleStartX();
+
+                               if (eventTime > itemTime && eventTime < imageRightTime) {
+                                       if (bShift == true && intervalMarker.getStartVal() != -1) {
+                                               if (baseTime > eventTime) {
+                                                       intervalMarker.setStartVal(eventTime);
+                                                       intervalMarker.setEndVal(baseTime);
+                                               } else {
+                                                       intervalMarker.setStartVal(baseTime);
+                                                       intervalMarker.setEndVal(eventTime);
+                                               }
+                                       } else {
+                                               intervalMarker.setInterval(itemTime, eventTime);
+                                               baseTime = itemTime;
+                                       }
+                               } else {
+                                       if (bShift == true && intervalMarker.getStartVal() != -1) {
+                                               if (baseTime > eventTime) {
+                                                       intervalMarker.setStartVal(eventTime);
+                                                       intervalMarker.setEndVal(baseTime);
+                                               } else {
+                                                       intervalMarker.setStartVal(baseTime);
+                                                       intervalMarker.setEndVal(eventTime);
+                                               }
+                                       } else {
+                                               intervalMarker.setInterval(eventTime, eventTime);
+                                               baseTime = eventTime;
+                                       }
+                               }
+                       } else {
+                               if (bShift == true && intervalMarker.getStartVal() != -1) {
+                                       if (baseTime > eventTime) {
+                                               intervalMarker.setStartVal(eventTime);
+                                               intervalMarker.setEndVal(baseTime);
+                                       } else {
+                                               intervalMarker.setStartVal(baseTime);
+                                               intervalMarker.setEndVal(eventTime);
+                                       }
+                               } else {
+                                       intervalMarker.setInterval(eventTime, eventTime);
+                                       baseTime = eventTime;
+                               }
+                       }
+                       DAChart chartWidget = ScreenshotChart.getInstance().getChart();
+                       DAScreenshotChartPlot screenshotChartPlot = (DAScreenshotChartPlot) chartWidget
+                                       .getPlot();
+                       screenshotChartPlot.setSelectedImageIndex(getHighlightedImageIndex(
+                                       screenshotChartPlot, chartWidget.getSeriesList(), e.x));
+               } else {
+                       if (bShift == true && intervalMarker.getStartVal() != -1) {
+                               if (baseTime > eventTime) {
+                                       intervalMarker.setStartVal(eventTime);
+                                       intervalMarker.setEndVal(baseTime);
+                               } else {
+                                       intervalMarker.setStartVal(baseTime);
+                                       intervalMarker.setEndVal(eventTime);
+                               }
+                       } else {
+                               intervalMarker.setInterval(eventTime, eventTime);
+                               baseTime = eventTime;
+                       }
+               }
+
+               chart.redraw();
+       }
+
+       @Override
+       public void mouseUp(MouseEvent e) {
+               if (e.button == 3) {
+                       return;
+               }
+
+               DAChart chart = (DAChart) e.widget;
+               DAChartPlot plot = chart.getPlot();
+               DAChartPlotMarker marker = plot.getMarkers()
+                               .get(SELECTION_MARKER_INDEX);
+               if (!(marker instanceof DAChartPlotIntervalMarker)) {
+                       return;
+               }
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker;
+
+               double eventTime = plot.getXFromXPixcel(e.x);
+               double markerStartTime;
+               double markerEndTime;
+
+               if (intervalMarker.getStartVal() >= eventTime) {
+                       markerStartTime = eventTime;
+                       markerEndTime = intervalMarker.getEndVal();
+               } else {
+                       markerStartTime = intervalMarker.getStartVal();
+                       markerEndTime = eventTime;
+               }
+
+               double toolbarTime = TimelineChartManager.getInstance().getChartBoard()
+                               .getLifecycleEndTime();
+
+               if (markerStartTime < 0) {
+                       markerStartTime = 0;
+               } else if (markerStartTime > toolbarTime) {
+                       markerStartTime = toolbarTime;
+               }
+
+               if (markerEndTime > toolbarTime) {
+                       markerEndTime = toolbarTime;
+               } else if (markerEndTime < 0) {
+                       markerEndTime = 0;
+               }
+
+               if (plot instanceof DAScreenshotChartPlot) {
+                       DAChartSeries series = chart.getSeries(0);
+                       int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(e.x));
+                       if (index >= 0 && index < series.getSeriesItemList().size()) {
+                               DAChartSeriesItem item = series.getSeriesItemList().get(index);
+                               double itemTime = item.getX();
+                               int imageWidth = item.getImage().getBounds().width;
+                               double imageRightTime = itemTime
+                                               + plot.getXFromXPixcel(imageWidth)
+                                               - plot.getVisibleStartX();
+
+                               if (markerEndTime > itemTime && markerEndTime < imageRightTime) {
+                                       intervalMarker.setInterval(markerStartTime, itemTime);
+                               } else {
+                                       if (markerEndTime <= plot.getVisibleEndX()) {
+                                               intervalMarker.setInterval(markerStartTime,
+                                                               markerEndTime);
+                                       } else {
+                                               intervalMarker.setInterval(markerStartTime,
+                                                               plot.getVisibleEndX());
+                                       }
+                               }
+                       } else {
+                               if (markerEndTime <= plot.getVisibleEndX()) {
+                                       intervalMarker.setInterval(markerStartTime, markerEndTime);
+                               } else {
+                                       intervalMarker.setInterval(markerStartTime,
+                                                       plot.getVisibleEndX());
+                               }
+                       }
+               } else {
+                       if (markerEndTime <= plot.getVisibleEndX()) {
+                               intervalMarker.setInterval(markerStartTime, markerEndTime);
+                       } else {
+                               intervalMarker.setInterval(markerStartTime,
+                                               plot.getVisibleEndX());
+                       }
+               }
+
+               sendSelectionTimes(intervalMarker.getStartVal(),
+                               intervalMarker.getEndVal());
+       }
+
+       @Override
+       public void mouseMove(MouseEvent e) {
+               DAChart chart = (DAChart) e.widget;
+               DAChartPlot plot = chart.getPlot();
+               DAChartPlotMarker marker = plot.getMarkers()
+                               .get(SELECTION_MARKER_INDEX);
+               if (!(marker instanceof DAChartPlotIntervalMarker)) {
+                       System.out.println("mouseMove !IntervalMarker");
+                       return;
+               }
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker;
+               DAChartPlotTooltip tooltip;
+
+               if ((e.stateMask & SWT.BUTTON1) != 0) {
+                       double eventTime = plot.getXFromXPixcel(e.x);
+
+                       if (baseTime > eventTime) {
+                               intervalMarker.setStartVal(eventTime);
+                               intervalMarker.setEndVal(baseTime);
+                       } else {
+                               intervalMarker.setStartVal(baseTime);
+                               intervalMarker.setEndVal(eventTime);
+                       }
+               }
+               tooltip = plot.getTooltip();
+               if (null == tooltip) {
+                       return;
+               }
+
+               double oldYPosRatio = tooltip.getYPosRatio();
+               double newYPosRatio = (double) e.y / ((Canvas) e.widget).getSize().y;
+
+               if (oldYPosRatio != newYPosRatio) {
+                       if (newYPosRatio < 0) {
+                               newYPosRatio = 0.01;
+                       } else if (newYPosRatio >= 1) {
+                               newYPosRatio = 0.99;
+                       }
+
+                       tooltip.setYPosRatio(newYPosRatio);
+               }
+
+               double oldStartVal = tooltip.getStartVal();
+               double newStartVal = getTooltipStartX(plot, chart.getSeriesList(), e.x,
+                               newYPosRatio);
+
+               if (oldStartVal != newStartVal) {
+                       tooltip.setStartVal(newStartVal);
+               }
+
+               if (plot instanceof DAScreenshotChartPlot) {
+                       ((DAScreenshotChartPlot) plot)
+                                       .setHighlightedImageIndex(getHighlightedImageIndex(e));
+                       chart.redraw();
+               } else if (plot instanceof DAUIEventChartPlot) {
+                       DAUIEventChartPlot uiEventChartPlot = (DAUIEventChartPlot) plot;
+                       int seriesIndex = (int) (newYPosRatio * chart.getSeriesList()
+                                       .size());
+
+                       uiEventChartPlot.setHighlightedEventIndexX(chart.getSeriesList()
+                                       .get(seriesIndex)
+                                       .getPrevIndexByXvalue(plot.getXFromXPixcel(e.x)));
+                       uiEventChartPlot.setHighlightedEventIndexY(seriesIndex);
+                       chart.redraw();
+               }
+
+               timeline.setDetailedTime(plot.getXFromXPixcel(e.x));
+               timeline.setDetailedTimePosition(e.x);
+               timeline.setDrawDetailedTime(true);
+               timeline.redraw();
+       }
+
+       private void sendSelectionTimes(double start, double end) {
+               long startTime = (long) (start * TimelineConstants.MEGA);
+               long endTime = (long) (end * TimelineConstants.MEGA);
+               if (endTime < startTime) {
+                       long temp = startTime;
+                       startTime = endTime;
+                       endTime = temp;
+               }
+               if (startTime < 0) {
+                       startTime = 0;
+               }
+               AnalyzerManager.getCurrentPage().updatePage(
+                               new DASelectionData(TimelineView.ID, startTime, endTime, null,
+                                               null));
+       }
+
+       private int getHighlightedImageIndex(DAChartPlot plot,
+                       List<DAChartSeries> seriesList, int x) {
+               if (plot instanceof DAScreenshotChartPlot) {
+                       DAChartSeries series = seriesList.get(0);
+
+                       return series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+               } else {
+                       return TimelineConstants.NOT_INITED;
+               }
+       }
+
+       private double getTooltipStartX(DAChartPlot plot,
+                       List<DAChartSeries> seriesList, int x, double yPosRatio) {
+               double ret = -1;
+               for (int i = 0; i < seriesList.size(); i++) {
+                       if (plot instanceof DAUIEventChartPlot) {
+                               i = (int) (seriesList.size() * yPosRatio);
+                               if (i < 0 || i > 4) {
+                                       System.out.println(yPosRatio + " " + i);//$NON-NLS-1$
+                               }
+                       }
+                       DAChartSeries series = seriesList.get(i);
+                       int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+                       if (-1 == index) {
+                               if (plot instanceof DAUIEventChartPlot) {
+                                       break;
+                               }
+                               continue;
+                       }
+                       double startVal = series.getSeriesItemList().get(index).getX();
+                       if (ret < startVal) {
+                               ret = startVal;
+                       }
+
+                       if (plot instanceof DAUIEventChartPlot) {
+                               break;
+                       }
+               }
+               return ret;
+       }
+
+       private int getHighlightedImageIndex(MouseEvent e) {
+               DAChart chart = (DAChart) e.widget;
+               DAChartPlot plot = chart.getPlot();
+               DAChartSeries series = chart.getSeriesList().get(0);
+
+               int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(e.x));
+               if (index < 0) {
+                       return -1;
+               }
+
+               DAChartSeriesItem item = series.getSeriesItemList().get(index);
+               int screenshotWidth = item.getImage().getBounds().width;
+               if (chart.getBounds().height != DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT - 1) {
+                       screenshotWidth /= 2;
+               }
+
+               if (e.x < plot.getXPixcelFromX(item.getX()) + screenshotWidth
+                               && e.x >= plot.getXPixcelFromX(item.getX())) {
+                       return index;
+               } else {
+                       return -1;
+               }
+       }
+}
index defd943..c33fb8c 100644 (file)
@@ -38,12 +38,12 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAScreenshotChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAUIEventChartPlot;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
 
 public class TimelineChartMouseTrackAdapter extends MouseTrackAdapter {
-       private DACustomTimeline timeline;
+       private DATimeline timeline;
 
-       public TimelineChartMouseTrackAdapter(DACustomTimeline timeline) {
+       public TimelineChartMouseTrackAdapter(DATimeline timeline) {
                this.timeline = timeline;
        }
 
index 43acdf3..31d9280 100644 (file)
@@ -34,4 +34,8 @@ public class UICommonConstants {
        public static int RANGE_MARKING_ALPHA = 20;
        public static Color RANGE_ANALYSIS_COLOR = ColorResources.YELLOW;
        public static Color RANGE_MARKING_COLOR = ColorResources.YELLOW;
+       
+       public final static int SELECTION_MARKER_INDEX = 0;
+       public final static int RANGE_ANALYSIS_MARKER_INDEX = 1;
+       public final static int RANGE_MARKER_INDEX = 2;
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/UIEventChartContextMenuItem.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/UIEventChartContextMenuItem.java
new file mode 100644 (file)
index 0000000..3fd33bc
--- /dev/null
@@ -0,0 +1,38 @@
+package org.tizen.dynamicanalyzer.ui.common;
+
+import org.tizen.dynamicanalyzer.widgets.contextMenu.ContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+
+public class UIEventChartContextMenuItem extends DAContextMenuItem {
+       private int seriesIndex = -1;
+       private int eventListStartIndex = -1;
+       private int eventListEndIndex = -1;
+
+       public UIEventChartContextMenuItem(ContextMenu menu) {
+               super(menu);
+       }
+
+       public int getSeriesIndex() {
+               return seriesIndex;
+       }
+
+       public void setSeriesIndex(int seriesIndex) {
+               this.seriesIndex = seriesIndex;
+       }
+
+       public int getEventListStartIndex() {
+               return eventListStartIndex;
+       }
+
+       public void setEventListStartIndex(int startIndex) {
+               eventListStartIndex = startIndex;
+       }
+
+       public int getEventListEndIndex() {
+               return eventListEndIndex;
+       }
+
+       public void setEventListEndIndex(int endIndex) {
+               eventListEndIndex = endIndex;
+       }
+}
\ No newline at end of file
index fb1a0b0..c4e9859 100644 (file)
@@ -39,11 +39,16 @@ import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.error.ErrorCodeManager;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadChartView;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 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.widgets.chartBoard.DAChartBoard;
 
 public class FileApiListTable extends DAApiListTableComposite {
+       private DAChartBoard chartBoard = null;
+       
        public FileApiListTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
                table.addSelectionListener(new SelectionListener() {
@@ -150,4 +155,36 @@ public class FileApiListTable extends DAApiListTableComposite {
 
                return input;
        }
+       
+       private DAChartBoard getChartBoard() {
+               if (chartBoard == null) {
+                       return (DAChartBoard) (AnalyzerManager.getCurrentPage().getView(
+                                       ThreadChartView.ID).getControl());
+               }
+               return chartBoard;
+       }
+
+       protected void actionSetStartEnd(int type) {
+               GridItem item = table.getItem(mousePoint);
+               if (null != item) {
+                       List<String> data = ((DATableDataFormat) item.getData()).getData();
+                       String time = data.get(LogCenterConstants.TIME_INDEX);
+                       long inputTime = -1;
+                       try {
+                               inputTime = Long.parseLong(time);
+                       } catch (NumberFormatException e) {
+                               e.printStackTrace();
+                               return;
+                       }
+                       if (type == START_TIME) {
+                               rangeDataManager.setMarkerStartTime(inputTime);
+                               getChartBoard().setTimelineMarkerStartTime(
+                                               inputTime / TimelineConstants.MEGA);
+                       } else if (type == END_TIME) {
+                               rangeDataManager.setMarkerEndTime(inputTime);
+                               getChartBoard().setTimelineMarkerEndTime(
+                                               inputTime / TimelineConstants.MEGA);
+                       }
+               }
+       }
 }
index cc7afd9..4e13905 100644 (file)
@@ -43,7 +43,6 @@ import org.tizen.dynamicanalyzer.nl.FilePageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
 import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
 
 public class FileApiListView extends DAView {
@@ -96,7 +95,6 @@ public class FileApiListView extends DAView {
                contents.setLayout(new FillLayout());
                tableComp = new FileApiListTable(contents, SWT.NONE, SWT.MULTI
                                | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
-               tableComp.setComparator(new DefaultTableComparator());
                tableComp.setSortTypes(sortTypes);
                tableComp.setSourceColumns(sourceColumns);
                tableComp.setColumns(columnNames);
index bc2c0cc..c36e137 100644 (file)
@@ -47,6 +47,7 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 public class FileChartData {
        private List<FileChartData> children = new ArrayList<FileChartData>();
        private DAChartSeries apiSeries;
+       private DAChartSeries accessSeries;
        private DAChartSeries statueSeries;
 
        private String fd = AnalyzerLabels.EMPTY_STRING;
@@ -70,6 +71,8 @@ public class FileChartData {
        protected DAChart chart;
        protected boolean hasUpdate = false;
 
+       private int lastAccessIndexForParent = 0;
+
        public FileChartData(String filePath, String Fd, boolean isRoot) {
                setFilePath(filePath);
                setFD(Fd);
@@ -193,7 +196,17 @@ public class FileChartData {
        }
 
        public boolean isFileOpenFailed() {
-               return isFailedAPI;
+               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) {
@@ -274,8 +287,10 @@ public class FileChartData {
        public void setItem(DAChartBoardItem item) {
                this.item = item;
                setChart(item.getChart());
-               apiSeries = chart.getSeries(FilePageLabels.FILE_CHART_API_FILE);
-               statueSeries = chart.getSeries(FilePageLabels.FILE_CHART_SERIES_FILE);
+               apiSeries = chart.getSeries(FilePageLabels.FILE_CHART_API);
+               accessSeries = chart.getSeries(FilePageLabels.FILE_CHART_ACCESS);
+               statueSeries = chart.getSeries(FilePageLabels.FILE_CHART_SERIES);
+
        }
 
        public void checkUpdate() {
@@ -315,13 +330,13 @@ public class FileChartData {
                                for (int i = 0; i < size; i++) {
                                        if ((!children.get(i).isClosed(null))
                                                        && (!children.get(i).getFD().contains("-1"))) {
-                                               setNotAccessFileStatus();
+                                               setNotClosedFileStatus();
                                                break;
                                        }
                                }
                        } else {
                                if (!isClosed(event)) {
-                                       setNotAccessFileStatus();
+                                       setNotClosedFileStatus();
                                }
                        }
                }
@@ -331,7 +346,7 @@ public class FileChartData {
                if ((isFileOpenFailed()) == true || (event.isFailedAPI() == true)) {
                        return;
                }
-               if (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN) {
+               if (event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN) {
                        if (isParent()) {
                                if (isClosed(event)) {
                                        setOpendFileStatus(event);
@@ -339,7 +354,7 @@ public class FileChartData {
                        } else {
                                setOpendFileStatus(event);
                        }
-               } else if (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE) {
+               } else if (event.getApiType() == LogCenterConstants.FD_API_TYPE_CLOSE) {
                        if (isParent()) {
                                if (isClosed(event)) {
                                        setClosedFileStatus(event);
@@ -383,7 +398,7 @@ public class FileChartData {
                }
        }
 
-       private void setNotAccessFileStatus() {
+       private void setNotClosedFileStatus() {
                int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1;
                if (nStatusLastIndex > -1) {
                        statueSeries.getSeriesItemList().get(nStatusLastIndex)
@@ -394,12 +409,13 @@ public class FileChartData {
                                        .setEventGradationForegroundColor(
                                                        ColorResources.FILE_AREA_NOT_ACCESS_START);
                        statueSeries.getSeriesItemList().get(nStatusLastIndex)
-                                       .setTooltipText(FilePageLabels.FILE_CHART_TOOLTIP_CLOSED);
+                                       .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(),
@@ -409,27 +425,42 @@ public class FileChartData {
                        return apiType;
                }
                switch (apiType) {
-               case LogCenterConstants.FD_API_TYPE_NUMBER_OPEN:
+               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_NUMBER_CLOSE:
+               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_NUMBER_READ:
+               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_NUMBER_WRITE:
+               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_NUMBER_OTHERS:
+
+               case LogCenterConstants.FD_API_TYPE_OTHERS:
                        seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
                                        DAChartSeriesItem.SERIES_STATE_BAR,
                                        ColorResources.FILE_API_USED, event.getTooltipContent());
@@ -438,11 +469,31 @@ public class FileChartData {
                        System.out.println("createChartItem : no case FileChartDataEvent");
                        return -1;
                }
-               apiSeries.addSeriesItem(seriesItem);
+               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;
+               }
+               if (isParent()) {
+                       for (int i = lastAccessIndexForParent; i < lastIndex; i++) {
+                               accessSeries.getSeriesItemList().get(i).setY(endTime);
+
+                       }
+                       lastAccessIndexForParent = lastIndex;
+               } else {
+                       accessSeries.getSeriesItemList().get(lastIndex).setY(endTime);
+               }
+       }
+
        public void setFileOpendTime(double data) {
                this.fileOpendTime = data;
        }
@@ -478,7 +529,6 @@ public class FileChartData {
 
        private double parentTotalUsedTime() {
                List<String> totalUsedTimeList = new ArrayList<String>();
-               ;
                boolean firstInputData = false;
                double fileTotalUsedTime = 0;
                FileChartData fileData;
index a52efeb..1c634b0 100644 (file)
@@ -44,8 +44,8 @@ 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.ui.common.SetRangeMarkerMouseAdapter;
 import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
@@ -59,7 +59,7 @@ 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.combo.DACustomCombo;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
 
 public class FileChartView extends DAView {
        public static final String ID = FileChartView.class.getName();
@@ -69,8 +69,6 @@ public class FileChartView extends DAView {
        private DAChartBoard fileChart;
        private DACustomCombo fileCombo;
        private final StackLayout stackLayout;
-       private long analysisStartTime = -1;
-       private long analysisEndTime = -1;
 
        private final RangeDataManager rangeDataManager = RangeDataManager
                        .getInstance();
@@ -88,20 +86,29 @@ public class FileChartView extends DAView {
                contents.setLayout(stackLayout);
                fileChart = new DAChartBoard(contents, FilePageLabels.FILE_CHART_FILE);
                fileChart.setNameFont(FontResources.CHART_NAME_FONT);
-
                fileChart.addSelectionListener(new DAChartBoardSelectionListener() {
 
                        @Override
                        public void handleSelectionEvent(DAChartBoardItem item) {
-                               AnalyzerManager.getCurrentPage().updatePage(
-                               new DASelectionData(
-                                               FileChartView.ID,
-                                               (long) (fileChart.getSelectionStartTime() * TimelineConstants.MEGA),
-                                               (long) (fileChart.getSelectionEndTime() * TimelineConstants.MEGA),
-                                               item.getData(), null));
+                               AnalyzerManager
+                                               .getCurrentPage()
+                                               .updatePage(
+                                                               new DASelectionData(
+                                                                               FileChartView.ID,
+                                                                               (long) (((DAChartPlotIntervalMarker) fileChart
+                                                                                               .getMarkers()
+                                                                                               .get(UICommonConstants.SELECTION_MARKER_INDEX))
+                                                                                               .getStartVal() * TimelineConstants.MEGA),
+                                                                               (long) (((DAChartPlotIntervalMarker) fileChart
+                                                                                               .getMarkers()
+                                                                                               .get(UICommonConstants.SELECTION_MARKER_INDEX))
+                                                                                               .getEndVal() * TimelineConstants.MEGA),
+                                                                               item.getData(), null));
                        }
                });
 
+               initIntervalMarkers(fileChart);
+
                stackLayout.topControl = fileChart;
                fileCombo = new DACustomCombo(fileChart.getTitleComp(), SWT.NONE);
                fileCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL,
@@ -109,19 +116,22 @@ public class FileChartView extends DAView {
                                ImageResources.TIMELINE_DROPDOWN_PUSH,
                                ImageResources.TIMELINE_DROPDOWN_NORMAL);
                fileCombo.add(FilePageLabels.FILE_CHART_FILE);
+               fileCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
                fileCombo.select(0);
                fileCombo.setEnabled(false);
                fileCombo.setComboRender(new TitleComboRenderer());
                fileCombo.setComboPopupRender(new TitleComboPopupRenderer());
                fileCombo.setButtonRenderer(new DACustomButtonRenderer());
+
+               DATimeline timeline = fileChart.getTimeline();
+
+               timeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT);
+               timeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT);
+
                LifecycleLogParser.getInstance().registerLifecycleBar(
                                fileChart.getLifecycleBar());
-               LifecycleLogParser.getInstance().registerTimeline(
-                               fileChart.getTimeline());
+               LifecycleLogParser.getInstance().registerTimeline(timeline);
 
-               DACustomTimeline timeline = fileChart.getTimeline();
-               timeline.addMouseListener(new SetRangeMarkerMouseAdapter(
-                               rangeDataManager, fileChart, timeline));
                timeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener(
                                rangeDataManager, fileChart, timeline));
        }
@@ -131,26 +141,29 @@ public class FileChartView extends DAView {
                FileChartManager.getInstance().getFileDataMaker().checkUpdate();
                fileChart.setTotalEndTime(ToolbarArea.getInstance().getTime());
 
-               fileChart.setMarkerStartTime(rangeDataManager.getMarkerStartTime()
+               fileChart.setTimelineMarkerStartTime(rangeDataManager
+                               .getMarkerStartTime() / TimelineConstants.MEGA);
+               fileChart.setTimelineMarkerEndTime(rangeDataManager.getMarkerEndTime()
                                / TimelineConstants.MEGA);
-               fileChart.setMarkerEndTime(rangeDataManager.getMarkerEndTime()
-                               / TimelineConstants.MEGA);
-
-               long newAnalysisStartTime = -1;
-               long newAnalysisEndTime = -1;
 
                if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                       newAnalysisStartTime = rangeDataManager.getAnalysisStartTime();
-                       newAnalysisEndTime = rangeDataManager.getAnalysisEndTime();
+                       ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(rangeDataManager.getAnalysisStartTime()
+                                                       / TimelineConstants.MEGA,
+                                                       rangeDataManager.getAnalysisEndTime()
+                                                                       / TimelineConstants.MEGA);
+               } else {
+                       ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(-1, -1);
                }
 
-               if (newAnalysisStartTime != analysisStartTime
-                               || newAnalysisEndTime != analysisEndTime) {
-                       analysisStartTime = newAnalysisStartTime;
-                       analysisEndTime = newAnalysisEndTime;
-                       fileChart.setHighlight(analysisStartTime / TimelineConstants.MEGA,
-                                       analysisEndTime / TimelineConstants.MEGA, 0);
-               }
+               ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
+                               rangeDataManager.getMarkerStartTime() / TimelineConstants.MEGA,
+                               rangeDataManager.getMarkerEndTime() / TimelineConstants.MEGA);
+
        }
 
        @Override
@@ -168,8 +181,8 @@ public class FileChartView extends DAView {
                DAChartBoard chartBoard = (DAChartBoard) stackLayout.topControl;
 
                chartBoard.setVisibleMiddleTime(middleTime);
-               DAChartPlotIntervalMarker intervalMarker = chartBoard
-                               .getIntervalMarker();
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) chartBoard
+                               .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
                intervalMarker.setStartVal(startTime);
                intervalMarker.setEndVal(endTime);
        }
@@ -199,6 +212,7 @@ public class FileChartView extends DAView {
        @Override
        public void clear() {
                fileChart.clear();
+               initIntervalMarkers(fileChart);
                FileChartManager.getInstance().getFileDataMaker().clear();
                FileChartManager.getInstance().getFileDataMaker().setBoard(fileChart);
        }
@@ -208,4 +222,27 @@ public class FileChartView extends DAView {
                return fileChart;
        }
 
+       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);
+       }
+
 }
index e7ff66e..3c789ed 100644 (file)
@@ -42,11 +42,13 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseAdapter;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextClearMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextEndMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextFromSelectionMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextStartMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
-import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
 import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
 import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
@@ -54,17 +56,15 @@ 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.widgets.DAContextMenu;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartHighlightInfo;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 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.contextMenu.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
-import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 
 public class FileDataMaker {
        private DAChartBoard board;
@@ -78,8 +78,6 @@ public class FileDataMaker {
        private LeakDetector leakDetector = null;
        private WarningChecker warningChecker = null;
 
-       private RangeDataManager rangeDataManager = null;
-
        public FileDataMaker(FailedChecker failedChecker,
                        LeakDetector leakDetector, WarningChecker warningChecker) {
                this.failedChecker = failedChecker;
@@ -166,6 +164,10 @@ public class FileDataMaker {
                                // System.out.println("wrong fd : " + fd + " input : " + input);
                                continue;
                        }
+                       if (!fdApiType.equals(Integer
+                                       .toString(LogCenterConstants.FD_API_TYPE_OPEN))) {
+                               path = AnalyzerLabels.EMPTY_STRING;
+                       }
                        FileChartDataEvent event = new FileChartDataEvent(path, fd, time,
                                        name, input);
 
@@ -180,15 +182,17 @@ public class FileDataMaker {
                                continue;
                        }
 
-                       if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_OPEN)) {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_OPEN);
+                       if (fdApiType.equals(Integer
+                                       .toString(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.equals(LogCenterConstants.FD_API_TYPE_CLOSE)) {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE);
+                       } else if (fdApiType.equals(Integer
+                                       .toString(LogCenterConstants.FD_API_TYPE_CLOSE))) {
+                               event.setApiType(LogCenterConstants.FD_API_TYPE_CLOSE);
                                if (errno == 0) {
                                        timeLineFileChartFDCount--;
                                        if (timeLineFileChartFDCount >= 0) {
@@ -198,21 +202,25 @@ public class FileDataMaker {
                                        }
                                }
 
-                       } else if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_READ)
-                                       || fdApiType.equals(LogCenterConstants.FD_API_TYPE_WRITE)) {
+                       } else if (fdApiType.equals(Integer
+                                       .toString(LogCenterConstants.FD_API_TYPE_READ_START))
+                                       || fdApiType
+                                                       .equals(Integer
+                                                                       .toString(LogCenterConstants.FD_API_TYPE_WRITE_START))) {
                                String rwRetuenSize = input
                                                .get(LogCenterConstants.RETURN_INDEX);
                                long rwRetrun = Long.parseLong(rwRetuenSize);
                                if (rwRetrun < 0) {
                                        rwRetrun = 0;
                                }
-                               if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_READ)) {
+                               if (fdApiType.equals(Integer
+                                               .toString(LogCenterConstants.FD_API_TYPE_READ_START))) {
                                        event.setReadSize(rwRetrun);
-                                       event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_READ);
+                                       event.setApiType(LogCenterConstants.FD_API_TYPE_READ_START);
                                        FileChart.getInstance().setReadByte((int) rwRetrun, time);
 
-                               } else if (fdApiType
-                                               .equals(LogCenterConstants.FD_API_TYPE_WRITE)) {
+                               } else if (fdApiType.equals(Integer
+                                               .toString(LogCenterConstants.FD_API_TYPE_WRITE_START))) {
 
                                        String strFileSize = input
                                                        .get(LogCenterConstants.RESOURCE_FILE_SIZE_INDEX);
@@ -222,16 +230,24 @@ public class FileDataMaker {
                                        }
                                        event.setFileSize(rwRetrun);
                                        event.setWriteSize(rwRetrun);
-                                       event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_WRITE);
+                                       event.setApiType(LogCenterConstants.FD_API_TYPE_WRITE_START);
                                        FileChart.getInstance().setWriteByte((int) rwRetrun, time);
                                }
+                       } else if (fdApiType.equals(Integer
+                                       .toString(LogCenterConstants.FD_API_TYPE_READ_END))) {
+                               event.setApiType(LogCenterConstants.FD_API_TYPE_READ_END);
+
+                       } else if (fdApiType.equals(Integer
+                                       .toString(LogCenterConstants.FD_API_TYPE_WRITE_END))) {
+                               event.setApiType(LogCenterConstants.FD_API_TYPE_WRITE_END);
 
                        } else {
-                               event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_OTHERS);
+                               event.setApiType(LogCenterConstants.FD_API_TYPE_OTHERS);
                        }
                        fileEventQueue.add(event);
                        fileEventWarningQueue.add(event);
-                       if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_CLOSE)) {
+                       if (fdApiType.equals(Integer
+                                       .toString(LogCenterConstants.FD_API_TYPE_CLOSE))) {
                                checkWithoutUsing(event);
                        }
                }
@@ -244,7 +260,7 @@ public class FileDataMaker {
                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_NUMBER_OPEN)) {
+                                       && (event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN)) {
                                if (!warningChecker.isChecked(data.getFilePath(),
                                                WarningCase.DUPLICATE_OPEN.getType())) {
                                        WarningData wData = new WarningData(
@@ -263,7 +279,7 @@ public class FileDataMaker {
                        FileChartDataEvent event = fileEventWarningQueue.get(i);
                        if ((event.getFd().equals(data.getFd()))) {
                                nAPICount++;
-                               if (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN) {
+                               if (event.getApiType() == LogCenterConstants.FD_API_TYPE_OPEN) {
                                        data.setFilePath(event.getFilePath());
                                }
                                fileEventWarningQueue.remove(i--);
@@ -287,20 +303,24 @@ public class FileDataMaker {
                if (null == chart) {
                        return;
                }
-               rangeDataManager = RangeDataManager.getInstance();
 
                DAChartSeries apiSeries = new DAChartSeries(
-                               FilePageLabels.FILE_CHART_API_FILE,
+                               FilePageLabels.FILE_CHART_API,
                                DAChartSeries.SERIES_STYLE_EVENT, ColorResources.YELLOW);
 
                DAChartSeries stateSeries = new DAChartSeries(
-                               FilePageLabels.FILE_CHART_SERIES_FILE,
+                               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) {
@@ -321,59 +341,41 @@ public class FileDataMaker {
                plot.setTooltip(tooltip);
 
                DAContextMenu popupMenu = new DAContextMenu(chart);
-               final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+               popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
                startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-               startItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double startTime = startItem.getDoubleData();
-                               board.setMarkerStartTime(startTime);
-
-                               rangeDataManager
-                                               .setMarkerStartTime((long) (startTime * 1000000));
-                       }
-               });
+               startItem.addClickListener(new ContextStartMenuItemClickListener(
+                               startItem, board));
 
-               final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+               DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
                endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-               endItem.addClickListener(new DAContextMenuListener() {
+               endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
+                               board));
 
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double endTime = endItem.getDoubleData();
-                               board.setMarkerEndTime(endTime);
-
-                               rangeDataManager.setMarkerEndTime((long) (endTime * 1000000));
-                       }
-               });
+               DAContextMenuItem fromSelectionItem = new DAContextMenuItem(popupMenu);
+               fromSelectionItem
+                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+               fromSelectionItem
+                               .addClickListener(new ContextFromSelectionMenuItemClickListener(
+                                               fromSelectionItem, board));
 
                DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
                analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-               analysisItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               rangeDataManager.startRangeAnalysis();
-                       }
-               });
+               analysisItem
+                               .addClickListener(new ContextAnalysisMenuItemClickListener());
 
                DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-               clearItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               board.setMarkerStartTime(-1);
-                               board.setMarkerEndTime(-1);
-
-                               rangeDataManager.initRange();
-                       }
-               });
+               clearItem
+                               .addClickListener(new ContextClearMenuItemClickListener(board));
 
-               chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
-               chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
-                               .getTimeline()));
+               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                               popupMenu, board.getTimeline());
+               chart.addMouseListener(timelineChartMouseEventListener);
+               chart.addMouseMoveListener(timelineChartMouseEventListener);
                chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
                                .getTimeline()));
-               plot.setIntervalMarker(board.getIntervalMarker());
+               plot.setMarkers(board.getMarkers());
        }
 
        private boolean createFileBoardItem(FileChartData parent, FileChartData sync) {
@@ -381,27 +383,14 @@ public class FileDataMaker {
                DAChart chart;
                if (null == parent) {
                        item = new DAChartBoardItem(board, sync.getFileName());
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       UICommonConstants.RANGE_ANALYSIS_COLOR,
-                                       UICommonConstants.RANGE_ANALYSIS_ALPHA));
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       UICommonConstants.RANGE_MARKING_COLOR,
-                                       UICommonConstants.RANGE_MARKING_ALPHA));
                        chart = item.getChart();
                        initFileChart(chart, true);
                } else {
                        DAChartBoardItem parentItem = parent.getItem();
                        item = new DAChartBoardItem(parentItem, sync.getFD());
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       UICommonConstants.RANGE_ANALYSIS_COLOR,
-                                       UICommonConstants.RANGE_ANALYSIS_ALPHA));
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       UICommonConstants.RANGE_MARKING_COLOR,
-                                       UICommonConstants.RANGE_MARKING_ALPHA));
                        chart = item.getChart();
                        initFileChart(chart, false);
                }
-               setChartStyle(chart);
                sync.setItem(item);
                item.setData(sync);
                chart.setData(sync);
@@ -409,29 +398,6 @@ public class FileDataMaker {
                return true;
        }
 
-       protected void setChartStyle(DAChart chart) {
-               if (null == chart) {
-                       return;
-               }
-               DAChartPlot plot = chart.getPlot();
-               if (null == plot) {
-                       return;
-               }
-               plot.setBackgroundImage(ImageResources.BG_GRADIENT);
-               plot.setAutoHeightRange(false);
-               DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
-               tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
-               plot.setTooltip(tooltip);
-               plot.setAxisFont(FontResources.CHART_AXIS_FONT);
-               plot.setAxisRangeY(0, 101);
-               plot.setAxisRangeX(board.getVisibleStartTime(),
-                               board.getVisibleEndTime());
-               chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
-                               .getTimeline()));
-               chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
-                               .getTimeline()));
-       }
-
        private FileChartData findParent(String filePath, String fd) {
                filePath = findPathHashMap.get(fd);
                int size = rows.size();
@@ -475,7 +441,7 @@ public class FileDataMaker {
                                } else {
                                        filePath = event.getFilePath();
                                }
-                               if (apiType == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN) {
+                               if (apiType == LogCenterConstants.FD_API_TYPE_OPEN) {
                                        findPathHashMap.put(event.getFd(), filePath);
                                }
                                parentChart = findParent(event.getFilePath(), event.getFd());
@@ -485,8 +451,11 @@ public class FileDataMaker {
                                                        true);
                                        childChart = new FileChartData(filePath, event.getFd(),
                                                        false);
-                                       parentChart.setClosed(false);
-                                       childChart.setClosed(false);
+                                       if (!event.isFailedAPI()) {
+                                               parentChart.setClosed(false);
+                                               childChart.setClosed(false);
+                                       }
+
                                        if (event.isFailedAPI()) {
                                                childChart.setFileOpenFailed(true);
                                                parentChart.setFileOpenFailed(true);
@@ -518,7 +487,9 @@ public class FileDataMaker {
                                        if (null == childChart) {
                                                childChart = new FileChartData(filePath, event.getFd(),
                                                                false);
-                                               childChart.setClosed(false);
+                                               if (!event.isFailedAPI()) {
+                                                       childChart.setClosed(false);
+                                               }
                                                if (event.isFailedAPI()) {
                                                        childChart.setFileOpenFailed(true);
                                                        parentChart.setFileOpenFailed(true);
@@ -541,7 +512,7 @@ public class FileDataMaker {
                                                }
                                                childChart.pushEvent(event);
                                        } else if (null != childChart) {
-                                               if (apiType == LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE) {
+                                               if (apiType == LogCenterConstants.FD_API_TYPE_CLOSE) {
                                                        if (!event.isFailedAPI()) {
                                                                childChart.setClosed(true);
                                                                childChart.setFileClosedTime((long) event
index 7e2e0c5..371ba50 100644 (file)
@@ -32,6 +32,7 @@ import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -46,6 +47,7 @@ public class FilePage extends DAPageComposite {
        public FilePage(Composite parent, int style) {
                super(parent, style);
                name = AnalyzerLabels.COOLBAR_AREA_FILE;
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_FILE_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.HORIZONTAL);
index 444ff35..58dccd5 100644 (file)
@@ -37,6 +37,7 @@ import org.tizen.dynamicanalyzer.common.SymbolManager;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
 
 public class CallStackManager {
@@ -66,19 +67,11 @@ public class CallStackManager {
                }
        }
 
-       private static CallStackManager instance;
-       private HashMap<Long, CallStackUnit> callstackApiByAddrMap;
-       private HashMap<Integer, CallStackData> callstackDataBySeqMap;
+       private HashMap<Long, CallStackUnit> callstackApiByAddrMap = new HashMap<Long, CallStackUnit>();
+       private HashMap<Integer, CallStackData> callstackDataBySeqMap = new HashMap<Integer, CallStackData>();
        private String userFunctionBin = null;
-       private HashMap<Integer, List<CallStackUnit>> userCallstackByTidMap;
-       private HashMap<Integer, DuplicateUserCall> dupUserCallByTidMap;
-
-       public static CallStackManager getInstance() {
-               if (null == instance) {
-                       instance = new CallStackManager();
-               }
-               return instance;
-       }
+       private HashMap<Integer, List<CallStackUnit>> userCallstackByTidMap = new HashMap<Integer, List<CallStackUnit>>();
+       private HashMap<Integer, DuplicateUserCall> dupUserCallByTidMap = new HashMap<Integer, CallStackManager.DuplicateUserCall>();
 
        public void makeUserCallstack(String[] input, ProfileDataMaker profiler) {
                HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
@@ -150,6 +143,22 @@ public class CallStackManager {
                                                                LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
                                                                defaultCallstackUnit);
                                        }
+                               } else if (callerCallstackUnit.getFunctionName().contains(
+                                               AnalyzerConstants.VIRTUAL_THUNK)) {
+                                       CallStackUnit callbackApi = new CallStackUnit(
+                                                       LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+                                                       LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
+                                       userCallstack.add(callbackApi);
+                                       if (addrMap
+                                                       .get(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR) == null) {
+                                               CallStackUnit defaultCallstackUnit = new CallStackUnit(
+                                                               LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+                                                               LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
+                                               addrMap.put(
+                                                               LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+                                                               defaultCallstackUnit);
+                                       }
+                                       userCallstack.add(callerCallstackUnit);
                                } else {
                                        CallStackUnit callerCsa = addrMap.get(callerAddr);
                                        if (null == callerCsa) {
@@ -171,8 +180,7 @@ public class CallStackManager {
                        getCallStackDataBySeqMap().put(seq, callstackData);
                } else if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
                        if (size == 0) {
-                               // TODO: drop log : only exit apis..
-                               // only range profiling case
+                               // this case only range profiling, other time is bug
                                return;
                        }
                        CallStackUnit removeCallStackUnit = userCallstack.get(size - 1);
@@ -180,11 +188,25 @@ public class CallStackManager {
                                        removeCallStackUnit.getFunctionName())) {
                                userCallstack.remove(size - 1);
                                if (size - 2 > 0) {
+                                       if (callerCallstackUnit.getFunctionName().contains(
+                                                       AnalyzerConstants.VIRTUAL_THUNK)) {
+                                               if (callerCallstackUnit.getFunctionName().equals(
+                                                               userCallstack.get(size - 2).getFunctionName())) {
+                                                       userCallstack.remove(size - 2);
+                                               } else {
+                                                       System.out
+                                                                       .println("makeUserCallstack : [virtual thunk] EXIT caller is not the same"
+                                                                                       + "as top of user callstack after remove EXIT self");
+                                               }
+                                       }
+                               }
+                               size = userCallstack.size();
+                               if (size - 1 > 0) {
                                        CallStackUnit checkCallStackUnit = userCallstack
-                                                       .get(size - 2);
+                                                       .get(size - 1);
                                        if (checkCallStackUnit.getFunctionName().equals(
                                                        LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC)) {
-                                               userCallstack.remove(size - 2);
+                                               userCallstack.remove(size - 1);
                                        }
                                }
                                size = userCallstack.size();
@@ -200,6 +222,9 @@ public class CallStackManager {
                                                userCallstack.set(size - 1, callerCsa);
                                        }
                                }
+                       } else {
+                               System.out
+                                               .println("makeUserCallstack : EXIT self is not the same as top of user callstack");
                        }
                        if (AnalyzerManager.isOsp()) {
                                String apiName = input[LogCenterConstants.APINAME_INDEX];
@@ -334,7 +359,7 @@ public class CallStackManager {
                                                        dupUserCall.increaseDupCallCount();
                                                } else {
                                                        System.out
-                                                                       .println("makeUserCallstack : dup callstack check error"); //$NON-NLS-1$
+                                                                       .println("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
                                                }
                                        }
                                        return true;
@@ -350,7 +375,7 @@ public class CallStackManager {
                                                }
                                        } else {
                                                System.out
-                                                               .println("makeUserCallstack : dup callstack check error"); //$NON-NLS-1$
+                                                               .println("isIrregularUserCall : dup callstack check error"); //$NON-NLS-1$
                                        }
                                        return true;
                                }
@@ -384,10 +409,10 @@ public class CallStackManager {
                if (userFunctionBin == null || userFunctionBin.isEmpty()) {
                        if (AnalyzerManager.isOsp()) {
                                userFunctionBin = new String(DACommunicator.getSelectedApp()
-                                               .getExecPath() + ".exe"); //$NON-NLS-1$
+                                               .getInfo(AppInfo.EXEC_INDEX) + ".exe"); //$NON-NLS-1$
                        } else {
                                userFunctionBin = new String(DACommunicator.getSelectedApp()
-                                               .getExecPath());
+                                               .getInfo(AppInfo.EXEC_INDEX));
                        }
                }
                return userFunctionBin;
@@ -440,7 +465,11 @@ public class CallStackManager {
                return Long.toString(addrs.get(0));
        }
 
-       public static void clear() {
-               instance = null;
+       public void clear() {
+               callstackApiByAddrMap.clear();
+               callstackDataBySeqMap.clear();
+               userFunctionBin = null;
+               userCallstackByTidMap.clear();
+               dupUserCallByTidMap.clear();
        }
 }
index dda7baf..a29fc31 100644 (file)
@@ -32,6 +32,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.SymbolManager;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 
 public class CallStackUnit {
@@ -84,7 +85,7 @@ public class CallStackUnit {
                } else {
                        if (DACommunicator.isDeviceConnected()
                                        && path.equals(DACommunicator.getSelectedApp()
-                                                       .getExecPath()) && AnalyzerManager.isOsp()) {
+                                                       .getInfo(AppInfo.EXEC_INDEX)) && AnalyzerManager.isOsp()) {
                                path += ".exe"; //$NON-NLS-1$
                        }
 
index adfa8e4..9eb3354 100644 (file)
@@ -59,7 +59,7 @@ public class CallstackTable extends DATableComposite {
                        public void widgetSelected(SelectionEvent e) {
                                AnalyzerManager.getCurrentPage().controlSelection(
                                                DATabComposite.ID);
-                                               GridItem[] sels = table.getSelection();
+                               GridItem[] sels = table.getSelection();
                                if (sels.length < 0) {
                                        return;
                                }
@@ -107,10 +107,10 @@ public class CallstackTable extends DATableComposite {
                        String seq = logData.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
                        if (null != seq && !seq.isEmpty()) {
                                int seqNum = Integer.parseInt(seq);
-                               HashMap<Integer, CallStackData> cdMap = CallStackManager.getInstance()
-                                               .getCallStackDataBySeqMap();
-                               HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
-                                               .getCallStackApiByAddrMap();
+                               HashMap<Integer, CallStackData> cdMap = AnalyzerManager
+                                               .getCallstackManager().getCallStackDataBySeqMap();
+                               HashMap<Long, CallStackUnit> addrMap = AnalyzerManager
+                                               .getCallstackManager().getCallStackApiByAddrMap();
                                if (null == cdMap || null == addrMap) {
                                        return;
                                }
@@ -120,7 +120,7 @@ public class CallstackTable extends DATableComposite {
                                }
 
                                List<Long> addrs = csd.getAddrs();
-                               int size = addrs.size(); 
+                               int size = addrs.size();
                                for (int i = 0; i < size; i++) {
                                        CallStackUnit api = addrMap.get(addrs.get(i));
 
@@ -150,32 +150,10 @@ public class CallstackTable extends DATableComposite {
                                        String addrInput = (addrs.get(i) == 0) ? "" : addr; //$NON-NLS-1$
                                        gridItem.setText(1, addrInput);
 
-//                                     String fName = InformationViewLables.CALLSTACK_TABLE_UNKNOWN;
                                        String fName = api.getFunctionName();
-//                                     if (apiData.length > 1) {
-//                                             fName = new String(apiData[1]);
-//                                     } else {
-//                                             String binPath = AnalyzerManager.getProject()
-//                                                             .getBinaryPath();
-//                                             boolean isPieBuild = AnalyzerManager.getProject()
-//                                                             .isPieBuild();
-//                                             String baseAddr = AnalyzerManager.getProject()
-//                                                             .getBaseAddress();
-//                                             String addrStr = Long.toString(addrs.get(i));
-//                                             if (AnalyzerManager.isInBinaryRange(addrStr)) {
-//                                                     fName = SymbolManager.addr2func(binPath, addrStr,
-//                                                                     isPieBuild, baseAddr);
-//                                                     fName = SymbolNameDemangler.nameDemangle(fName);
-//                                             }
-//                                     }
-
-//                                     if (CallStackManager.getInstance().checkUserCall(path)) {
-//                                             gridItem.setForeground(ColorResources.TITLEBAR_TEXT_COLOR);
-//                                     }
 
                                        gridItem.setText(0, fName);
                                        gridItem.setText(2, path);
-//                                     apiData = null;
                                }
                        }
                }
index 99f8df7..38ff9a3 100644 (file)
@@ -27,7 +27,6 @@
 package org.tizen.dynamicanalyzer.ui.info.snapshot;
 
 import java.io.File;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
@@ -111,7 +110,6 @@ public class ImageViewer extends Composite {
        private Image image;
        private Canvas canvas;
        private Canvas popup;
-       private HashMap<String, ImageSelectionListener> listeners;
        private Shell childShell;
        private Composite parent;
        int childShellWidth = 0;
@@ -184,13 +182,6 @@ public class ImageViewer extends Composite {
                canvas.setEnabled(enabled);
        }
 
-       public HashMap<String, ImageSelectionListener> getSelectionListeners() {
-               if (null == listeners) {
-                       listeners = new HashMap<String, ImageSelectionListener>();
-               }
-               return listeners;
-       }
-
        private void setImage(Image input) {
                if (input == null) {
                        image = null;
index 69441ce..e6dea39 100644 (file)
@@ -66,6 +66,7 @@ import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 import org.tizen.dynamicanalyzer.widgets.graph.bar.FourBarGraph;
 import org.tizen.dynamicanalyzer.widgets.graph.circular.CircularGraph;
@@ -75,6 +76,7 @@ public class SnapshotView extends DAView {
        public static final String ID = SnapshotView.class.getName();
 
        private final int SNAPSHOT_SIZE = 218;
+       public final static int SELECTION_MARKER_INDEX = 0;
        ImageViewer snapshot;
        CircularGraph processGraph;
        FourBarGraph cpuGrp;
@@ -266,17 +268,16 @@ public class SnapshotView extends DAView {
        }
 
        private void computeData() {
-               String query = "select SystemCpuUsage, ResidentMemory from system where time = (select max(time) from system where time <= " //$NON-NLS-1$
-                               + startTime + ");"; //$NON-NLS-1$
-               List<String> input = SqlManager.getInstance().executeSelectQuery(query, 2);
-
-               if (null == input) {
-                       query = "select SystemCpuUsage, ResidentMemory from system where time = (select min(time) from system);"; //$NON-NLS-1$
-                       input = SqlManager.getInstance().executeSelectQuery(query, 2);
-                       if (null == input) {
+               List<String> input = SqlManager.getInstance().getCpuRates(startTime, 1);
+               if (null == input || input.size() < 0) {
+                       input = SqlManager.getInstance().getCpuRates(startTime, 2);
+                       if (null == input || input.size() < 0) {
                                return;
                        }
                }
+               if( input.get(0).length() < 1){
+                       return;
+               }
                String[] cpuRates = input.get(0).split(CommonConstants.COMMA);
                cpuUsage.clear();
                for (int i = 0; i < cpuRates.length - 1; i++) {
@@ -331,7 +332,7 @@ public class SnapshotView extends DAView {
        @Override
        public void updateView() {
                if (!AnalyzerManager.isRunning() && latestButton.isButtonEnabled()) {
-                       latestButton.setEnabled(false);
+                       latestButton.setButtonEnabled(false);
                } else if (latestButton.isButtonEnabled()) {
                        setStartTime(selectTime);
                }
@@ -360,7 +361,8 @@ public class SnapshotView extends DAView {
 
                        if (control instanceof DAChartBoard) {
                                DAChartBoard board = (DAChartBoard) control;
-                               long time = (long) (board.getSelectionStartTime() * 1000000);
+                               long time = (long) (((DAChartPlotIntervalMarker) board.getMarkers()
+                                               .get(SELECTION_MARKER_INDEX)).getStartVal() * 1000000);
                                if (time < 0) {
                                        continue;
                                }
@@ -440,9 +442,9 @@ public class SnapshotView extends DAView {
 
        public void setLatestButtonEnable(boolean enabled) {
                if (AnalyzerManager.isRunning()) {
-                       latestButton.setEnabled(enabled);
+                       latestButton.setButtonEnabled(enabled);
                } else {
-                       latestButton.setEnabled(false);
+                       latestButton.setButtonEnabled(false);
                }
        }
 }
index 39d260c..468ecbb 100644 (file)
@@ -56,6 +56,7 @@ public class BaseView extends ViewPart {
                        Composite timelinePage = new TimelinePage(
                                        tabView.getContentComposite(), SWT.NONE);
                        tabView.addView(timelinePage, false);
+
                        Composite filePage = new FilePage(tabView.getContentComposite(),
                                        SWT.NONE);
                        tabView.addView(filePage, false);
@@ -67,7 +68,7 @@ public class BaseView extends ViewPart {
                        Composite uiPage = new UIPage(tabView.getContentComposite(),
                                        SWT.NONE);
                        tabView.addView(uiPage, false);
-                       
+
                        Composite summaryPage = new SummaryPage(
                                        tabView.getContentComposite(), SWT.NONE);
                        tabView.addView(summaryPage, false);
index 4f43459..c3eb5af 100644 (file)
@@ -41,6 +41,7 @@ import org.tizen.dynamicanalyzer.logparser.LogPackage;
 
 public class DAPageComposite extends Composite implements ViewAction {
 
+       public static final String KEY_TOOLTIP = "tooltip";
        private HashMap<String, ViewAction> viewMap = null;
        private List<ViewAction> views = null;
        protected String name = null;
index 5677592..e46d4b8 100644 (file)
@@ -46,8 +46,11 @@ import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
 import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabButton;
 import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
 public class RangeDataManager implements Runnable {
        private static RangeDataManager instance = null;
@@ -57,11 +60,12 @@ public class RangeDataManager implements Runnable {
        private WarningChecker warningChecker = null;
        private FileDataMaker fileDataMaker = null;
        private ProfileDataMaker profileDataMaker = null;
+       private CallStackManager callstackManager = null;
 
-       private long markerStartTime = -1;
-       private long markerEndTime = -1;
-       private long analysisStartTime = -1;
-       private long analysisEndTime = -1;
+       private long markerStartTime = 0;
+       private long markerEndTime = 0;
+       private long analysisStartTime = 0;
+       private long analysisEndTime = 0;
 
        private boolean isBeingAnalyzed = false;
 
@@ -69,7 +73,8 @@ public class RangeDataManager implements Runnable {
                failedChecker = new FailedChecker();
                leakDetector = new LeakDetector();
                warningChecker = new WarningChecker();
-               profileDataMaker = new ProfileDataMaker();
+               callstackManager = new CallStackManager();
+               profileDataMaker = new ProfileDataMaker(callstackManager);
 
                fileDataMaker = new FileDataMaker(failedChecker, leakDetector,
                                warningChecker);
@@ -80,14 +85,13 @@ public class RangeDataManager implements Runnable {
                leakDetector.clear();
                warningChecker.clear();
                profileDataMaker.clear();
+               callstackManager.clear();
        }
 
        public void initRange() {
                clearRange();
-               markerStartTime = -1;
-               markerEndTime = -1;
-               analysisStartTime = -1;
-               analysisEndTime = -1;
+               analysisStartTime = 0;
+               analysisEndTime = 0;
                Display.getDefault().syncExec(new Runnable() {
                        @Override
                        public void run() {
@@ -125,7 +129,13 @@ public class RangeDataManager implements Runnable {
                        DATabComposite mainTab = AnalyzerUtil.getMainTab();
                        Composite rangePage = new RangePage(mainTab.getContentComposite(),
                                        SWT.NONE);
-                       mainTab.addView(rangePage, true);
+                       DATabButton rangeTab = mainTab.addView(rangePage, true, true);
+                       rangeTab.addCloseButtonListener(new DACustomButtonClickEventListener() {
+                               @Override
+                               public void handleClickEvent(DACustomButton button) {
+                                       RangeDataManager.getInstance().initRange();
+                               }
+                       });
                        startRangeThread();
                } else {
                        startRangeThread();
@@ -178,16 +188,16 @@ public class RangeDataManager implements Runnable {
        }
 
        public void setMarkerStartTime(long startTime) {
-               this.markerStartTime = startTime;
-               if (markerEndTime >= 0 && startTime >= markerEndTime) {
-                       markerEndTime = -1;
+               markerStartTime = startTime;
+               if (startTime > markerEndTime) {
+                       markerEndTime = startTime;
                }
        }
 
        public void setMarkerEndTime(long endTime) {
-               this.markerEndTime = endTime;
-               if (endTime >= 0 && endTime <= markerStartTime) {
-                       markerStartTime = -1;
+               markerEndTime = endTime;
+               if (endTime < markerStartTime) {
+                       markerStartTime = endTime;
                }
        }
 
@@ -238,26 +248,19 @@ public class RangeDataManager implements Runnable {
                List<List<String>> input = null;
                LogPackage logPackage = new LogPackage();
                int size = logCenters.size();
-               String query = null;
                int from = -1;
                int last = -1;
                for (int i = 0; i < size; i++) {
                        /* !! sample db table is null.. */
                        if (logCenters.get(i).getId() != LogCenterConstants.LOG_DEVICE
                                        && logCenters.get(i).getId() != LogCenterConstants.LOG_PROFILING) {
-                               query = "select min(seqnumber) from " //$NON-NLS-1$
-                                               + logCenters.get(i).getName() + " where time >= " //$NON-NLS-1$
-                                               + markerStartTime;
-                               int ret = SqlManager.getInstance().executeQueryMinMax(query);
-
+                               int ret = SqlManager.getInstance().getRangeMinSeq(
+                                               logCenters.get(i).getName(), markerStartTime);
                                if (ret >= 0) {
                                        from = (from > 0 && from < ret) ? from : ret;
                                }
-
-                               query = "select max(seqnumber) from " //$NON-NLS-1$
-                                               + logCenters.get(i).getName() + " where time <= " //$NON-NLS-1$
-                                               + markerEndTime;
-                               ret = SqlManager.getInstance().executeQueryMinMax(query);
+                               ret = SqlManager.getInstance().getRangeMaxSeq(
+                                               logCenters.get(i).getName(), markerEndTime);
                                if (ret >= 0) {
                                        last = (last > 0 && last > ret) ? last : ret;
                                }
@@ -295,18 +298,13 @@ public class RangeDataManager implements Runnable {
                last = -1;
                for (int i = 0; i < size; i++) {
                        if (logCenters.get(i).getId() == LogCenterConstants.LOG_PROFILING) {
-                               query = "select min(seqnumber) from " //$NON-NLS-1$
-                                               + logCenters.get(i).getName() + " where time >= " //$NON-NLS-1$
-                                               + markerStartTime;
-                               int ret = SqlManager.getInstance().executeQueryMinMax(query);
+                               int ret = SqlManager.getInstance().getRangeMinSeq(
+                                               logCenters.get(i).getName(), markerStartTime);
                                if (ret >= 0) {
                                        from = (from > 0 && from < ret) ? from : ret;
                                }
-
-                               query = "select max(seqnumber) from " //$NON-NLS-1$
-                                               + logCenters.get(i).getName() + " where time <= " //$NON-NLS-1$
-                                               + markerEndTime;
-                               ret = SqlManager.getInstance().executeQueryMinMax(query);
+                               ret = SqlManager.getInstance().getRangeMaxSeq(
+                                               logCenters.get(i).getName(), markerEndTime);
                                if (ret >= 0) {
                                        last = (last > 0 && last > ret) ? last : ret;
                                }
@@ -403,8 +401,7 @@ public class RangeDataManager implements Runnable {
                                                && !AnalyzerManager.isBinStartEndSet()) {
                                        AnalyzerManager.setBinaryStartEndAddr(start, end);
                                }
-                               CallStackManager.getInstance().makeUserCallstack(input,
-                                               profileDataMaker);
+                               callstackManager.makeUserCallstack(input, profileDataMaker);
                        }
                }
                /* created failed and warning/leak data */
index 128a326..4c49963 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -48,6 +49,7 @@ public class RangePage extends DAPageComposite {
        public RangePage(Composite parent, int style) {
                super(parent, style);
                name = AnalyzerLabels.COOLBAR_AREA_RANGE;
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_RANGE_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.VERTICAL);
index 6a11911..90a97aa 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -58,6 +59,7 @@ public class SummaryPage extends DAPageComposite {
        public SummaryPage(Composite parent, int style) {
                super(parent, style);
                name = AnalyzerLabels.COOLBAR_AREA_SUMMARY;
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_SUMMARY_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.VERTICAL);
index 9415947..0ca0150 100644 (file)
@@ -31,13 +31,14 @@ import java.util.List;
 
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class FailedChecker {
 
        List<FailedData> failedList;
 
-       public void check(String[] log) {
+       public void check(String[] log, CallStackManager cm) {
                String logcId = log[LogCenterConstants.ID_INDEX];
                int cid = Integer.parseInt(logcId);
                if (cid == LogCenterConstants.LOG_MEMORY) {
@@ -48,7 +49,7 @@ public class FailedChecker {
                        if (!addr.equals("0") && !addr.equals("0x0")) { //$NON-NLS-1$ //$NON-NLS-2$
                                return;
                        }
-                       checkUserDefinedFunc(log);
+                       checkUserDefinedFunc(log, cm);
                }
                if (cid == LogCenterConstants.LOG_RESOURCE) {
                        if (AnalyzerUtil.isInternal(log)) {
@@ -62,7 +63,7 @@ public class FailedChecker {
                        if (fdType == 0 || errno == 0) {
                                return;
                        }
-                       checkUserDefinedFunc(log);
+                       checkUserDefinedFunc(log, cm);
                }
                if (cid == LogCenterConstants.LOG_USER_FUNCTION) {
                        // TODO : check user function error???
@@ -70,7 +71,7 @@ public class FailedChecker {
                }
        }
 
-       private void checkUserDefinedFunc(String[] input) {
+       private void checkUserDefinedFunc(String[] input, CallStackManager cm) {
                if (AnalyzerConstants.USER_CALL == AnalyzerUtil.checkUserCall(input)) {
                        FailedData fd = new FailedData(input);
                        getFailedList().add(fd);
index 26057d0..d415643 100644 (file)
@@ -35,7 +35,6 @@ import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.Check;
 import org.tizen.dynamicanalyzer.model.LeakCheckList;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 
 public class LeakDetector {
@@ -172,10 +171,10 @@ public class LeakDetector {
        }
 
        private void checkUserFuncLeakData(String[] input, Check chk) {
-               HashMap<Integer, CallStackData> cdMap = CallStackManager.getInstance()
+               HashMap<Integer, CallStackData> cdMap = AnalyzerManager.getCallstackManager()
                                .getCallStackDataBySeqMap();
                // HashMap<Long, String> apiMap = LogSpliter.getCallStackApiByAddrMap();
-               HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+               HashMap<Long, CallStackUnit> addrMap = AnalyzerManager.getCallstackManager()
                                .getCallStackApiByAddrMap();
 
                if (null == cdMap || null == addrMap) {
@@ -187,9 +186,11 @@ public class LeakDetector {
                CallStackData csd = cdMap.get(seqNum);
                if (null == csd) {
                        System.out.println("no callstack : "); //$NON-NLS-1$
-                       for (int i = 0; i < input.length; i++)
-                               System.out.print(input[i] + "  "); //$NON-NLS-1$
-                       System.out.println();
+//                     for (int i = 0; i < input.length; i++)
+//                     {
+//                             System.out.print(input[i] + "  "); //$NON-NLS-1$
+//                     }
+//                     System.out.println();
                        return;
                }
                List<Long> addrs = null;
@@ -202,7 +203,7 @@ public class LeakDetector {
                CallStackUnit callerFunc = addrMap.get(addrs.get(0));
 
                // user call
-               if (CallStackManager.getInstance().isUserCall(
+               if (AnalyzerManager.getCallstackManager().isUserCall(
                                callerFunc.getFunctionName())) {
                        HashMap<String, LeakData> leaks = getLeakHash();
                        LeakData newLeak = new LeakData(input[chk.getKeyIndex()], input,
index 0999ef6..cc9c22d 100644 (file)
@@ -28,7 +28,6 @@
 package org.tizen.dynamicanalyzer.ui.summary.profiling;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
@@ -53,12 +52,12 @@ public class FunctionUsageProfiler implements Runnable {
         * key: symbol(child) or file path (parent) - value : sequence num of
         * profiling data. all parent and child data is in
         */
-       private static HashMap<String, String> symbolSeqHash = null;
        private List<List<List<String>>> sampleInputs = null;
        private static Thread profiler = null;
 
        public FunctionUsageProfiler() {
-               profileDataMaker = new ProfileDataMaker();
+               profileDataMaker = new ProfileDataMaker(
+                               AnalyzerManager.getCallstackManager());
        }
 
        public ProfileDataMaker getProfileDataMaker() {
@@ -72,13 +71,6 @@ public class FunctionUsageProfiler implements Runnable {
                return instance;
        }
 
-       public static HashMap<String, String> getSymbolSeqHash() {
-               if (null == symbolSeqHash) {
-                       symbolSeqHash = new HashMap<String, String>();
-               }
-               return symbolSeqHash;
-       }
-
        private List<List<List<String>>> getSampleInputs() {
                if (null == sampleInputs) {
                        sampleInputs = new ArrayList<List<List<String>>>();
index f5b488c..2c3ab73 100644 (file)
@@ -75,12 +75,14 @@ public class ProfileDataMaker {
 
        private CallstackTree current = null;
        private int totalSampleCount = 0;
+       private CallStackManager callstackManager = null;
 
        /**
         * key: seq - value : function usage profiling data hash map all function
         * usage profiling data are in this hash map
         **/
        private HashMap<String, ProfilingData> profilingDataMap = null;
+       private HashMap<String, String> symbolSeqHash = null;
 
        /**
         * key : seq - value : child seq list // all child lists are in this hash
@@ -91,6 +93,10 @@ public class ProfileDataMaker {
        private ProfilingData dependentLib = null;
        private String appBinName = null;
 
+       public ProfileDataMaker(CallStackManager callstackManager) {
+               this.callstackManager = callstackManager;
+       }
+
        public void clear() {
                getProfilingDataMap().clear();
                getChildListMap().clear();
@@ -98,6 +104,11 @@ public class ProfileDataMaker {
                dependentLib = null;
                appBinName = null;
                totalSampleCount = 0;
+               getSymbolSeqHash().clear();
+       }
+
+       public CallStackManager getCallstackManager() {
+               return callstackManager;
        }
 
        public String getAppBinName() {
@@ -129,7 +140,7 @@ public class ProfileDataMaker {
        }
 
        public ProfilingData getProfilingDataByKey(String key) {
-               String seq = FunctionUsageProfiler.getSymbolSeqHash().get(key);
+               String seq = getSymbolSeqHash().get(key);
                if (null == seq) {
                        return null;
                }
@@ -151,6 +162,13 @@ public class ProfileDataMaker {
                return childListMap;
        }
 
+       public HashMap<String, String> getSymbolSeqHash() {
+               if (null == symbolSeqHash) {
+                       symbolSeqHash = new HashMap<String, String>();
+               }
+               return symbolSeqHash;
+       }
+
        public String getCpuRate(ProfilingData data, boolean exclusive) {
                int count = 0;
                double rate = 0.;
@@ -178,7 +196,7 @@ public class ProfileDataMaker {
 
        private void checkUserCall(CallStackUnit csa, ProfilingData parent,
                        ProfilingData pp) {
-               if (CallStackManager.getInstance().checkUserCall(csa.getPath())) {
+               if (callstackManager.checkUserCall(csa.getPath())) {
                        if (null == appBin) {
                                CallStackUnit appBinCsa = new CallStackUnit(-1,
                                                FunctionUsageProfiler.APPLICATION);
@@ -220,7 +238,7 @@ public class ProfileDataMaker {
                }
 
                List<Long> addrs = makeCallstackHashAndList(sampleCallstack);
-               HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+               HashMap<Long, CallStackUnit> addrMap = callstackManager
                                .getCallStackApiByAddrMap();
                String selfAddrStr = sampleLog
                                .get(LogCenterConstants.PROFILING_LOG_PCADDR_INDEX);
@@ -270,8 +288,7 @@ public class ProfileDataMaker {
                for (int i = 0; i < addrs.size(); i++) {
                        CallStackUnit callstackCsa = addrMap.get(addrs.get(i));
                        // disable inclusive cpu time of dependent library
-                       if (!CallStackManager.getInstance().checkUserCall(
-                                       callstackCsa.getPath())) {
+                       if (!callstackManager.checkUserCall(callstackCsa.getPath())) {
                                continue;
                        }
 
@@ -309,7 +326,9 @@ public class ProfileDataMaker {
                                        if (null != inParent.getParent()) {
                                                String pInParentName = inParent.getParent();
                                                ProfilingData pp = getProfilingDataByKey(pInParentName);
-                                               pp.addInCount(totalSampleCount);
+                                               if (null != pp) {
+                                                       pp.addInCount(totalSampleCount);
+                                               }
                                        }
                                } else {
                                        String pName = fupData.getParent();
@@ -319,7 +338,9 @@ public class ProfileDataMaker {
                                        if (null != inParent.getParent()) {
                                                String pInParentName = inParent.getParent();
                                                ProfilingData ppData = getProfilingDataByKey(pInParentName);
-                                               ppData.addInCount(totalSampleCount);
+                                               if (null != ppData) {
+                                                       ppData.addInCount(totalSampleCount);
+                                               }
                                        }
                                }
                                fupData.addInCount(totalSampleCount);
@@ -328,7 +349,7 @@ public class ProfileDataMaker {
        }
 
        private List<Long> makeCallstackHashAndList(List<String> callstackLog) {
-               HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+               HashMap<Long, CallStackUnit> addrMap = callstackManager
                                .getCallStackApiByAddrMap();
                List<Long> addrs = new ArrayList<Long>();
                int size = callstackLog.size();
@@ -369,10 +390,10 @@ public class ProfileDataMaker {
                getProfilingDataMap().put(newProfilingData.getSequence(),
                                newProfilingData);
                if (isParent) {
-                       FunctionUsageProfiler.getSymbolSeqHash().put(inputData.getPath(),
+                       getSymbolSeqHash().put(inputData.getPath(),
                                        newProfilingData.getSequence());
                } else {
-                       FunctionUsageProfiler.getSymbolSeqHash().put(inputData.getSymbol(),
+                       getSymbolSeqHash().put(inputData.getSymbol(),
                                        newProfilingData.getSequence());
                }
                return newProfilingData;
index 17feab2..0380f3f 100644 (file)
@@ -37,11 +37,16 @@ import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.error.ErrorCodeManager;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.file.FileChartView;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 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.widgets.chartBoard.DAChartBoard;
 
 public class ThreadAPIListTable extends DAApiListTableComposite {
+       private DAChartBoard chartBoard = null;
+       
        public ThreadAPIListTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
                table.addSelectionListener(new SelectionListener() {
@@ -149,4 +154,36 @@ public class ThreadAPIListTable extends DAApiListTableComposite {
 
                return input;
        }
+
+       private DAChartBoard getChartBoard() {
+               if (chartBoard == null) {
+                       return (DAChartBoard) (AnalyzerManager.getCurrentPage().getView(
+                                       FileChartView.ID).getControl());
+               }
+               return chartBoard;
+       }
+
+       protected void actionSetStartEnd(int type) {
+               GridItem item = table.getItem(mousePoint);
+               if (null != item) {
+                       List<String> data = ((DATableDataFormat) item.getData()).getData();
+                       String time = data.get(LogCenterConstants.TIME_INDEX);
+                       long inputTime = -1;
+                       try {
+                               inputTime = Long.parseLong(time);
+                       } catch (NumberFormatException e) {
+                               e.printStackTrace();
+                               return;
+                       }
+                       if (type == START_TIME) {
+                               rangeDataManager.setMarkerStartTime(inputTime);
+                               getChartBoard().setTimelineMarkerStartTime(
+                                               inputTime / TimelineConstants.MEGA);
+                       } else if (type == END_TIME) {
+                               rangeDataManager.setMarkerEndTime(inputTime);
+                               getChartBoard().setTimelineMarkerEndTime(
+                                               inputTime / TimelineConstants.MEGA);
+                       }
+               }
+       }
 }
index 3f63c3e..088e3d2 100644 (file)
@@ -38,7 +38,6 @@ import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
 import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
 
 public class ThreadAPIListView extends DAView {
@@ -93,7 +92,6 @@ public class ThreadAPIListView extends DAView {
                tableComp = new ThreadAPIListTable(contents, SWT.NONE, SWT.MULTI
                                | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
                tableComp.setTableName("Thread API List");
-               tableComp.setComparator(new DefaultTableComparator());
                tableComp.setSortTypes(sortTypes);
                tableComp.setSourceColumns(sourceColumns);
                tableComp.setColumns(columnNames);
index 14942d8..e37f982 100644 (file)
@@ -41,8 +41,8 @@ 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.ui.common.SetRangeMarkerMouseAdapter;
 import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
@@ -57,7 +57,7 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardSelectionListener;
 import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
 import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
 
 public class ThreadChartView extends DAView {
        public static final String ID = ThreadChartView.class.getName();
@@ -71,9 +71,6 @@ public class ThreadChartView extends DAView {
        private DACustomCombo syncCombo;
        private final StackLayout stackLayout;
 
-       private long rangeStartTime = -1;
-       private long rangeEndTime = -1;
-
        ThreadChartManager manager;
 
        private final RangeDataManager rangeDataManager = RangeDataManager
@@ -101,6 +98,8 @@ public class ThreadChartView extends DAView {
                                callUpdatePage(item);
                        }
                });
+
+               initIntervalMarkers(threadChart);
                syncChart = new DAChartBoard(contents,
                                ThreadPageLabels.SYNC_CHART_TITLE);
                syncChart.setNameFont(FontResources.CHART_NAME_FONT);
@@ -112,6 +111,7 @@ public class ThreadChartView extends DAView {
 
                        }
                });
+               initIntervalMarkers(syncChart);
                stackLayout.topControl = threadChart;
 
                threadCombo = new DACustomCombo(threadChart.getTitleComp(), SWT.NONE);
@@ -122,6 +122,7 @@ public class ThreadChartView extends DAView {
                                ImageResources.TIMELINE_DROPDOWN_NORMAL);
                threadCombo.add("Thread");
                threadCombo.add("Sync");
+               threadCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
                threadCombo.select(0);
                threadCombo.setComboButtonGradation(
                                ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START,
@@ -163,6 +164,7 @@ public class ThreadChartView extends DAView {
                                ImageResources.TIMELINE_DROPDOWN_NORMAL);
                syncCombo.add("Thread");
                syncCombo.add("Sync");
+               syncCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
                syncCombo.select(1);
                syncCombo.setComboButtonGradation(
                                ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START,
@@ -196,17 +198,23 @@ public class ThreadChartView extends DAView {
                        }
                });
 
+               DATimeline threadTimeline = threadChart.getTimeline();
+               DATimeline syncTimeline = syncChart.getTimeline();
+
+               threadTimeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT);
+               threadTimeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT);
+               syncTimeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT);
+               syncTimeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT);
+
                LifecycleLogParser.getInstance().registerLifecycleBar(
                                threadChart.getLifecycleBar());
-               LifecycleLogParser.getInstance().registerTimeline(
-                               threadChart.getTimeline());
+               LifecycleLogParser.getInstance().registerTimeline(threadTimeline);
                LifecycleLogParser.getInstance().registerLifecycleBar(
                                syncChart.getLifecycleBar());
-               LifecycleLogParser.getInstance().registerTimeline(
-                               syncChart.getTimeline());
+               LifecycleLogParser.getInstance().registerTimeline(syncTimeline);
 
-               setTimelineMouseListener(threadChart.getTimeline(), threadChart);
-               setTimelineMouseListener(syncChart.getTimeline(), syncChart);
+               setTimelineMouseListener(threadTimeline, threadChart);
+               setTimelineMouseListener(syncTimeline, syncChart);
 
                manager = ThreadChartManager.getInstance();
                manager.setBoard(threadChart, syncChart);
@@ -220,8 +228,14 @@ public class ThreadChartView extends DAView {
                                        .updatePage(
                                                        new DASelectionData(
                                                                        ThreadChartView.ID,
-                                                                       (long) (threadChart.getSelectionStartTime() * TimelineConstants.MEGA),
-                                                                       (long) (threadChart.getSelectionEndTime() * TimelineConstants.MEGA),
+                                                                       (long) (((DAChartPlotIntervalMarker) threadChart
+                                                                                       .getMarkers()
+                                                                                       .get(UICommonConstants.SELECTION_MARKER_INDEX))
+                                                                                       .getStartVal() * TimelineConstants.MEGA),
+                                                                       (long) (((DAChartPlotIntervalMarker) threadChart
+                                                                                       .getMarkers()
+                                                                                       .get(UICommonConstants.SELECTION_MARKER_INDEX))
+                                                                                       .getEndVal() * TimelineConstants.MEGA),
                                                                        new Integer(0), null));
                } else {
                        AnalyzerManager
@@ -229,8 +243,14 @@ public class ThreadChartView extends DAView {
                                        .updatePage(
                                                        new DASelectionData(
                                                                        ThreadChartView.ID,
-                                                                       (long) (threadChart.getSelectionStartTime() * TimelineConstants.MEGA),
-                                                                       (long) (threadChart.getSelectionEndTime() * TimelineConstants.MEGA),
+                                                                       (long) (((DAChartPlotIntervalMarker) threadChart
+                                                                                       .getMarkers()
+                                                                                       .get(UICommonConstants.SELECTION_MARKER_INDEX))
+                                                                                       .getStartVal() * TimelineConstants.MEGA),
+                                                                       (long) (((DAChartPlotIntervalMarker) threadChart
+                                                                                       .getMarkers()
+                                                                                       .get(UICommonConstants.SELECTION_MARKER_INDEX))
+                                                                                       .getEndVal() * TimelineConstants.MEGA),
                                                                        selectItem.getData(), null));
                }
        }
@@ -255,10 +275,8 @@ public class ThreadChartView extends DAView {
                callUpdatePage(syncChart.getSelectItem());
        }
 
-       private void setTimelineMouseListener(final DACustomTimeline timeline,
+       private void setTimelineMouseListener(final DATimeline timeline,
                        DAChartBoard chartBoard) {
-               timeline.addMouseListener(new SetRangeMarkerMouseAdapter(
-                               rangeDataManager, chartBoard, timeline));
                timeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener(
                                rangeDataManager, chartBoard, timeline));
        }
@@ -269,33 +287,49 @@ public class ThreadChartView extends DAView {
                syncChart.setTotalEndTime(ToolbarArea.getInstance().getTime());
                manager.update();
 
-               threadChart.setMarkerStartTime(rangeDataManager.getMarkerStartTime()
-                               / TimelineConstants.MEGA);
-               threadChart.setMarkerEndTime(rangeDataManager.getMarkerEndTime()
-                               / TimelineConstants.MEGA);
-               syncChart.setMarkerStartTime(rangeDataManager.getMarkerStartTime()
-                               / TimelineConstants.MEGA);
-               syncChart.setMarkerEndTime(rangeDataManager.getMarkerEndTime()
+               threadChart.setTimelineMarkerStartTime(rangeDataManager
+                               .getMarkerStartTime() / TimelineConstants.MEGA);
+               threadChart.setTimelineMarkerEndTime(rangeDataManager
+                               .getMarkerEndTime() / TimelineConstants.MEGA);
+               syncChart.setTimelineMarkerStartTime(rangeDataManager
+                               .getMarkerStartTime() / TimelineConstants.MEGA);
+               syncChart.setTimelineMarkerEndTime(rangeDataManager.getMarkerEndTime()
                                / TimelineConstants.MEGA);
 
-               long newAnalysisStartTime = -1;
-               long newAnalysisEndTime = -1;
-
                if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                       newAnalysisStartTime = rangeDataManager.getAnalysisStartTime();
-                       newAnalysisEndTime = rangeDataManager.getAnalysisEndTime();
+                       ((DAChartPlotIntervalMarker) threadChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(rangeDataManager.getAnalysisStartTime()
+                                                       / TimelineConstants.MEGA,
+                                                       rangeDataManager.getAnalysisEndTime()
+                                                                       / TimelineConstants.MEGA);
+
+                       ((DAChartPlotIntervalMarker) syncChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(rangeDataManager.getAnalysisStartTime()
+                                                       / TimelineConstants.MEGA,
+                                                       rangeDataManager.getAnalysisEndTime()
+                                                                       / TimelineConstants.MEGA);
+               } else {
+                       ((DAChartPlotIntervalMarker) threadChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(-1, -1);
+
+                       ((DAChartPlotIntervalMarker) syncChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(-1, -1);
                }
 
-               if (newAnalysisStartTime != rangeStartTime
-                               || newAnalysisEndTime != rangeEndTime) {
-                       rangeStartTime = newAnalysisStartTime;
-                       rangeEndTime = newAnalysisEndTime;
+               ((DAChartPlotIntervalMarker) threadChart.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
+                               rangeDataManager.getMarkerStartTime() / TimelineConstants.MEGA,
+                               rangeDataManager.getMarkerEndTime() / TimelineConstants.MEGA);
+
+               ((DAChartPlotIntervalMarker) syncChart.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
+                               rangeDataManager.getMarkerStartTime() / TimelineConstants.MEGA,
+                               rangeDataManager.getMarkerEndTime() / TimelineConstants.MEGA);
 
-                       threadChart.setHighlight(rangeStartTime / TimelineConstants.MEGA,
-                                       rangeEndTime / TimelineConstants.MEGA, 0);
-                       syncChart.setHighlight(rangeStartTime / TimelineConstants.MEGA,
-                                       rangeEndTime / TimelineConstants.MEGA, 0);
-               }
        }
 
        @Override
@@ -313,8 +347,8 @@ public class ThreadChartView extends DAView {
                DAChartBoard chartBoard = (DAChartBoard) stackLayout.topControl;
 
                chartBoard.setVisibleMiddleTime(middleTime);
-               DAChartPlotIntervalMarker intervalMarker = chartBoard
-                               .getIntervalMarker();
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) chartBoard
+                               .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
                intervalMarker.setStartVal(startTime);
                intervalMarker.setEndVal(endTime);
        }
@@ -328,6 +362,8 @@ public class ThreadChartView extends DAView {
        public void clear() {
                threadChart.clear();
                syncChart.clear();
+               initIntervalMarkers(threadChart);
+               initIntervalMarkers(syncChart);
                manager.clear();
                manager.setBoard(threadChart, syncChart);
        }
@@ -346,4 +382,28 @@ public class ThreadChartView extends DAView {
                String selectTid = data.get(LogCenterConstants.THREAD_ID_INDEX);
                threadChart.selectItem(manager.getItemIndexByTid(selectTid));
        }
+
+       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);
+
+       }
 }
index 04ad81d..3d91305 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -46,6 +47,7 @@ public class ThreadPage extends DAPageComposite {
        public ThreadPage(Composite parent, int style) {
                super(parent, style);
                name = AnalyzerLabels.COOLBAR_AREA_THREAD;
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_THREAD_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.HORIZONTAL);
index 1430f08..52e9e4e 100644 (file)
@@ -38,22 +38,22 @@ 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.ui.common.TimelineChartMouseAdapter;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextClearMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextEndMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextFromSelectionMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextStartMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
-import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartHighlightInfo;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 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.contextMenu.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
-import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 
 public class ThreadPageSyncDataManager {
        private DAChartBoard board;
@@ -64,8 +64,6 @@ public class ThreadPageSyncDataManager {
        public static final int PTHREAD_MUTEX_RECURSIVE = 1;
        public static final int PTHREAD_MUTEX_ERRORCHECK = 2;
 
-       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
-
        public ThreadPageSyncDataManager(DAChartBoard board) {
                this.setBoard(board);
        }
@@ -367,56 +365,41 @@ public class ThreadPageSyncDataManager {
                plot.setTooltip(tooltip);
 
                DAContextMenu popupMenu = new DAContextMenu(chart);
-
-               final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+               popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
                startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-               startItem.addClickListener(new DAContextMenuListener() {
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double startTime = startItem.getDoubleData();
-                               board.setMarkerStartTime(startTime);
+               startItem.addClickListener(new ContextStartMenuItemClickListener(
+                               startItem, board));
 
-                               rangeDataManager
-                                               .setMarkerStartTime((long) (startTime * 1000000));
-                       }
-               });
-
-               final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+               DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
                endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-               endItem.addClickListener(new DAContextMenuListener() {
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double endTime = endItem.getDoubleData();
-                               board.setMarkerEndTime(endTime);
+               endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
+                               board));
 
-                               rangeDataManager.setMarkerEndTime((long) (endTime * 1000000));
-                       }
-               });
+               DAContextMenuItem fromSelectionItem = new DAContextMenuItem(popupMenu);
+               fromSelectionItem
+                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+               fromSelectionItem
+                               .addClickListener(new ContextFromSelectionMenuItemClickListener(
+                                               fromSelectionItem, board));
 
                DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
                analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-               analysisItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               rangeDataManager.startRangeAnalysis();
-                       }
-               });
+               analysisItem
+                               .addClickListener(new ContextAnalysisMenuItemClickListener());
 
                DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-               clearItem.addClickListener(new DAContextMenuListener() {
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               board.setMarkerStartTime(-1);
-                               board.setMarkerEndTime(-1);
-
-                               rangeDataManager.initRange();
-                       }
-               });
+               clearItem
+                               .addClickListener(new ContextClearMenuItemClickListener(board));
 
-               chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
-               chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
-                               .getTimeline()));
+               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                               popupMenu, board.getTimeline());
+               chart.addMouseListener(timelineChartMouseEventListener);
+               chart.addMouseMoveListener(timelineChartMouseEventListener);
                chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
                                .getTimeline()));
-               plot.setIntervalMarker(board.getIntervalMarker());
+               plot.setMarkers(board.getMarkers());
 
        }
 
@@ -430,12 +413,6 @@ public class ThreadPageSyncDataManager {
                                        + ThreadPageLabels.THREAD_CHART_NAME_PREFIX
                                        + ThreadPageLabels.THREAD_CHART_NAME_OBJ + sync.getKey()
                                        + ThreadPageLabels.THREAD_CHART_NAME_POSTFIX);
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       UICommonConstants.RANGE_ANALYSIS_COLOR,
-                                       UICommonConstants.RANGE_ANALYSIS_ALPHA));
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       UICommonConstants.RANGE_MARKING_COLOR,
-                                       UICommonConstants.RANGE_MARKING_ALPHA));
                        item.useExpand(true);
                        chart = item.getChart();
                        initSyncChart(chart, true);
@@ -443,11 +420,6 @@ public class ThreadPageSyncDataManager {
                        DAChartBoardItem parentItem = parent.getItem();
                        item = new DAChartBoardItem(parentItem,
                                        ThreadPageLabels.THREAD_CHART_NAME_TID + sync.getTid());
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       ColorResources.YELLOW,
-                                       UICommonConstants.RANGE_ANALYSIS_ALPHA));
-                       item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                                       ColorResources.RED, UICommonConstants.RANGE_MARKING_ALPHA));
                        item.useExpand(true);
                        chart = item.getChart();
                        initSyncChart(chart, false);
index 944db11..dbb2f11 100644 (file)
@@ -28,11 +28,8 @@ package org.tizen.dynamicanalyzer.ui.thread.thread;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
-import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
-import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
 import org.tizen.dynamicanalyzer.ui.thread.ThreadPageData;
 import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
 import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncData;
@@ -105,46 +102,25 @@ public class ThreadPageThreadData extends ThreadPageData {
                                if (threadEvent.getContents()
                                                .get(LogCenterConstants.APINAME_INDEX)
                                                .equals(ThreadPageLabels.THREAD_API_TIZEN_JOIN)) {
-                                       seriesItem = new DAChartSeriesItem(
-                                                       threadEvent.getTime(),
+                                       seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
                                                        DAChartSeriesItem.SERIES_ARROW_LEFT,
                                                        ThreadPageLabels.THREAD_CHART_ITEM_JOINED);
                                        seriesItem.setBarWidth(Double.parseDouble(threadEvent
                                                        .getCallerTid()));
-                                       // join, delete warning
-                                       AnalyzerManager.getWarningChecker().removeData(
-                                                       ThreadPageLabels.THREAD_CHART_NAME_TID
-                                                                       + threadEvent.getCallerTid(),
-                                                       WarningCase.JOINABLE_LEAK.getType());
                                } else {
-                                       seriesItem = new DAChartSeriesItem(
-                                                       threadEvent.getTime(),
+                                       seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
                                                        DAChartSeriesItem.SERIES_ARROW_NONE,
                                                        threadEvent.getTooltipContent());
                                }
                        } else if (eventApiType == LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP) {
                                if (null != threadEvent.getCallerTid()) {
-                                       seriesItem = new DAChartSeriesItem(
-                                                       threadEvent.getTime(),
+                                       seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
                                                        DAChartSeriesItem.SERIES_ARROW_RIGHT,
                                                        threadEvent.getTooltipContent());
                                        seriesItem.setBarWidth(Double.parseDouble(threadEvent
                                                        .getCallerTid()));
                                } else {
-                                       if (getAttrType().equals(
-                                                       ThreadPageLabels.THREAD_ATTR_TYPE_JOINABLE)) {
-                                               // warningData
-                                               WarningData wData = new WarningData(
-                                                               LogCenterConstants.LOG_THREAD,
-                                                               WarningCase.JOINABLE_LEAK.getType(),
-                                                               threadEvent.getContents(),
-                                                               ThreadPageLabels.THREAD_CHART_NAME_TID
-                                                                               + threadEvent.getTid());
-                                               AnalyzerManager.getWarningChecker().getWarningData()
-                                                               .add(wData);
-                                       }
-                                       seriesItem = new DAChartSeriesItem(
-                                                       threadEvent.getTime(),
+                                       seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
                                                        DAChartSeriesItem.SERIES_ARROW_NONE,
                                                        threadEvent.getTooltipContent());
                                }
index 3a8c4c3..71bf13a 100644 (file)
@@ -40,27 +40,28 @@ import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseAdapter;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextClearMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextEndMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextFromSelectionMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextStartMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
-import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
 import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncData;
 import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataEvent;
 import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartHighlightInfo;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
-import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
-import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 
 public class ThreadPageThreadDataManager {
        private DAChartBoard board;
@@ -69,13 +70,12 @@ public class ThreadPageThreadDataManager {
        private boolean hasUpdate = false;
        private List<ThreadPageThreadData> rows = new ArrayList<ThreadPageThreadData>();
        private List<ThreadPageThreadData> rowsQueue = new ArrayList<ThreadPageThreadData>();
+       private List<ThreadPageThreadData> callRowsQueue = new ArrayList<ThreadPageThreadData>();
        private List<ThreadPageSyncDataEvent> syncEventQueue = new ArrayList<ThreadPageSyncDataEvent>();
        private List<ThreadPageThreadDataEvent> eventQueue = new ArrayList<ThreadPageThreadDataEvent>();
        private List<ThreadPageThreadDataEvent> callEventQueue = new ArrayList<ThreadPageThreadDataEvent>();
        private HashMap<String, Integer> syncAttrMap = new HashMap<String, Integer>();
 
-       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
-
        public ThreadPageThreadDataManager(DAChartBoard board) {
                this.setBoard(board);
        }
@@ -85,6 +85,10 @@ public class ThreadPageThreadDataManager {
                hasUpdate = true;
        }
 
+       private void pushCallRow(ThreadPageThreadData data) { // FIXME
+               callRowsQueue.add(data);
+       }
+
        private void pushEvent(ThreadPageThreadDataEvent event) {
                eventQueue.add(event);
                hasUpdate = true;
@@ -107,12 +111,6 @@ public class ThreadPageThreadDataManager {
                                + ThreadPageLabels.THREAD_CHART_NAME_PREFIX
                                + ThreadPageLabels.THREAD_CHART_NAME_TID + data.getKey()
                                + ThreadPageLabels.THREAD_CHART_NAME_POSTFIX);
-               item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                               UICommonConstants.RANGE_ANALYSIS_COLOR,
-                               UICommonConstants.RANGE_ANALYSIS_ALPHA));
-               item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                               UICommonConstants.RANGE_MARKING_COLOR,
-                               UICommonConstants.RANGE_MARKING_ALPHA));
 
                item.useExpand(true);
                DAChart chart = item.getChart();
@@ -154,58 +152,42 @@ public class ThreadPageThreadDataManager {
                plot.setTooltip(tooltip);
 
                DAContextMenu popupMenu = new DAContextMenu(chart);
-               final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+               popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
                startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-               startItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double startTime = startItem.getDoubleData();
-                               board.setMarkerStartTime(startTime);
-
-                               rangeDataManager
-                                               .setMarkerStartTime((long) (startTime * 1000000));
-                       }
-               });
+               startItem.addClickListener(new ContextStartMenuItemClickListener(
+                               startItem, board));
 
-               final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+               DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
                endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-               endItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double endTime = endItem.getDoubleData();
-                               board.setMarkerEndTime(endTime);
+               endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
+                               board));
 
-                               rangeDataManager.setMarkerEndTime((long) (endTime * 1000000));
-                       }
-               });
+               DAContextMenuItem fromSelectionItem = new DAContextMenuItem(popupMenu);
+               fromSelectionItem
+                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+               fromSelectionItem
+                               .addClickListener(new ContextFromSelectionMenuItemClickListener(
+                                               fromSelectionItem, board));
 
                DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
                analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-               analysisItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               rangeDataManager.startRangeAnalysis();
-                       }
-               });
+               analysisItem
+                               .addClickListener(new ContextAnalysisMenuItemClickListener());
 
                DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-               clearItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               board.setMarkerStartTime(-1);
-                               board.setMarkerEndTime(-1);
-
-                               rangeDataManager.initRange();
-                       }
-               });
+               clearItem
+                               .addClickListener(new ContextClearMenuItemClickListener(board));
 
-               chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
-               chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
-                               .getTimeline()));
+               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                               popupMenu, board.getTimeline());
+               chart.addMouseListener(timelineChartMouseEventListener);
+               chart.addMouseMoveListener(timelineChartMouseEventListener);
                chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
                                .getTimeline()));
-               plot.setIntervalMarker(board.getIntervalMarker());
+
+               plot.setMarkers(board.getMarkers());
 
        }
 
@@ -220,12 +202,7 @@ public class ThreadPageThreadDataManager {
                                + ThreadPageLabels.THREAD_CHART_NAME_PREFIX
                                + ThreadPageLabels.THREAD_CHART_NAME_OBJ + sync.getKey()
                                + ThreadPageLabels.THREAD_CHART_NAME_POSTFIX);
-               item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                               UICommonConstants.RANGE_ANALYSIS_COLOR,
-                               UICommonConstants.RANGE_ANALYSIS_ALPHA));
-               item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                               UICommonConstants.RANGE_MARKING_COLOR,
-                               UICommonConstants.RANGE_MARKING_ALPHA));
+
                item.useExpand(true);
                DAChart chart = item.getChart();
                initSyncChart(chart);
@@ -257,58 +234,41 @@ public class ThreadPageThreadDataManager {
                                board.getVisibleEndTime());
 
                DAContextMenu popupMenu = new DAContextMenu(chart);
-               final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+               popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
                startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-               startItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double startTime = startItem.getDoubleData();
-
-                               board.setMarkerStartTime(startTime);
-                               rangeDataManager
-                                               .setMarkerStartTime((long) (startTime * 1000000));
-                       }
-               });
+               startItem.addClickListener(new ContextStartMenuItemClickListener(
+                               startItem, board));
 
-               final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+               DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
                endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-               endItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double endTime = endItem.getDoubleData();
+               endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
+                               board));
 
-                               board.setMarkerEndTime(endTime);
-                               rangeDataManager.setMarkerEndTime((long) (endTime * 1000000));
-                       }
-               });
+               DAContextMenuItem fromSelectionItem = new DAContextMenuItem(popupMenu);
+               fromSelectionItem
+                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+               fromSelectionItem
+                               .addClickListener(new ContextFromSelectionMenuItemClickListener(
+                                               fromSelectionItem, board));
 
                DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
                analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-               analysisItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               rangeDataManager.startRangeAnalysis();
-                       }
-               });
+               analysisItem
+                               .addClickListener(new ContextAnalysisMenuItemClickListener());
 
                DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-               clearItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               board.setMarkerStartTime(-1);
-                               board.setMarkerEndTime(-1);
-
-                               rangeDataManager.initRange();
-                       }
-               });
+               clearItem
+                               .addClickListener(new ContextClearMenuItemClickListener(board));
 
-               chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
-               chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
-                               .getTimeline()));
+               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                               popupMenu, board.getTimeline());
+               chart.addMouseListener(timelineChartMouseEventListener);
+               chart.addMouseMoveListener(timelineChartMouseEventListener);
                chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
                                .getTimeline()));
-               plot.setIntervalMarker(board.getIntervalMarker());
+               plot.setMarkers(board.getMarkers());
 
        }
 
@@ -495,6 +455,17 @@ public class ThreadPageThreadDataManager {
                                        LogCenterConstants.THREAD_TYPE_PTHREAD, apiType, time, tid,
                                        apiName, errorNum, input);
                        pushEvent(event);
+                       if (input.get(LogCenterConstants.APINAME_INDEX).equals(
+                                       ThreadPageLabels.THREAD_API_PTHREAD_JOIN)) {
+                               // join, delete warning
+                               AnalyzerManager
+                                               .getWarningChecker()
+                                               .removeData(
+                                                               ThreadPageLabels.THREAD_CHART_NAME_TID
+                                                                               + findCallerTid(input
+                                                                                               .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX)),
+                                                               WarningCase.JOINABLE_LEAK.getType());
+                       }
                        break;
                case LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP:
                        event = new ThreadPageThreadDataEvent(
@@ -505,6 +476,15 @@ public class ThreadPageThreadDataManager {
                                        .get(LogCenterConstants.THREAD_PTHREAD_ID_INDEX));
                        pushEvent(event);
                        pushCallEvent(event);
+                       if (true == isJoinableThread(tid)) {
+                               // warningData
+                               WarningData wData = new WarningData(
+                                               LogCenterConstants.LOG_THREAD,
+                                               WarningCase.JOINABLE_LEAK.getType(),
+                                               event.getContents(),
+                                               ThreadPageLabels.THREAD_CHART_NAME_TID + tid);
+                               AnalyzerManager.getWarningChecker().getWarningData().add(wData);
+                       }
                        break;
                case LogCenterConstants.THREAD_API_TYPE_INTERNAL_START:
                        ThreadPageThreadData data = new ThreadPageThreadData(
@@ -529,6 +509,9 @@ public class ThreadPageThreadDataManager {
                int apiType = Integer.parseInt(input
                                .get(LogCenterConstants.THREAD_API_TYPE_INDEX));
                String apiName = input.get(LogCenterConstants.APINAME_INDEX);
+               String callID = input
+                               .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX);
+               ThreadPageThreadData data;
                ThreadPageThreadDataEvent event;
                long errorNum = Long.parseLong(input
                                .get(LogCenterConstants.ERROR_INDEX));
@@ -550,8 +533,12 @@ public class ThreadPageThreadDataManager {
                                        ThreadPageThreadDataEvent.TYPE_API,
                                        LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time, tid,
                                        apiName, errorNum, input);
-                       event.setCallID(input
-                                       .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX));
+
+                       event.setCallID(callID);
+                       data = findCallQueue(callID);
+                       if (null != data) {
+                               pushRow(data);
+                       }
                        pushEvent(event);
                        pushCallEvent(event);
                        break;
@@ -563,6 +550,14 @@ public class ThreadPageThreadDataManager {
                                                LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time,
                                                tid, apiName, errorNum, input);
                                pushEvent(event);
+                               // join, delete warning
+                               AnalyzerManager
+                                               .getWarningChecker()
+                                               .removeData(
+                                                               ThreadPageLabels.THREAD_CHART_NAME_TID
+                                                                               + findCallerTid(input
+                                                                                               .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX)),
+                                                               WarningCase.JOINABLE_LEAK.getType());
                        } // FIXME : do not shows sleep's wait end
 
                        break;
@@ -575,12 +570,26 @@ public class ThreadPageThreadDataManager {
                                        .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX));
                        pushEvent(event);
                        pushCallEvent(event);
+                       if (true == isJoinableThread(tid)) {
+                               // warningData
+                               WarningData wData = new WarningData(
+                                               LogCenterConstants.LOG_THREAD,
+                                               WarningCase.JOINABLE_LEAK.getType(),
+                                               event.getContents(),
+                                               ThreadPageLabels.THREAD_CHART_NAME_TID + tid);
+                               AnalyzerManager.getWarningChecker().getWarningData().add(wData);
+                       }
                        break;
                case LogCenterConstants.THREAD_API_TYPE_INTERNAL_START:
-                       ThreadPageThreadData data = new ThreadPageThreadData(
+                       data = new ThreadPageThreadData(
                                        ThreadPageLabels.THREAD_ITEM_TYPE_TIZEN, tid,
                                        ThreadPageLabels.THREAD_ATTR_TYPE_JOINABLE);
-                       pushRow(data);
+                       // TIZEN thread includes the internal thread
+                       if (true == checkCalledThrerad(callID)) {
+                               pushRow(data);
+                       } else {
+                               pushCallRow(data);
+                       }
                        event = new ThreadPageThreadDataEvent(
                                        ThreadPageThreadDataEvent.TYPE_EVENT,
                                        LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time, tid,
@@ -793,6 +802,84 @@ public class ThreadPageThreadDataManager {
                hasUpdate = true;
        }
 
+       private boolean checkCalledThrerad(String callId) {
+               if (null == callId) {
+                       return false;
+               }
+               int callEventQueueSize = callEventQueue.size();
+               ThreadPageThreadDataEvent callEvent;
+               for (int i = 0; i < callEventQueueSize; i++) {
+                       callEvent = callEventQueue.get(i);
+                       if (callEvent.getApiType() != LogCenterConstants.THREAD_API_TYPE_START) {
+                               continue;
+                       }
+                       if (callId.equals(callEvent.getCallID())) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       private String getCallEventID(String callID) {
+               if (null == callID) {
+                       return null;
+               }
+               int eventQueueSize = eventQueue.size();
+               ThreadPageThreadDataEvent event;
+               for (int i = 0; i < eventQueueSize; i++) {
+                       event = eventQueue.get(i);
+                       if (event.getApiType() != LogCenterConstants.THREAD_API_TYPE_INTERNAL_START) {
+                               continue;
+                       }
+                       if (callID.equals(event.getCallID())) {
+                               return event.getTid();
+                       }
+               }
+               return null;
+       }
+
+       private ThreadPageThreadData findCallQueue(String callID) {
+               String tid = getCallEventID(callID);
+
+               int size;
+               size = callRowsQueue.size();
+               ThreadPageThreadData ret;
+               for (int i = 0; i < size; i++) {
+                       ret = callRowsQueue.get(i);
+
+                       if (ret.getTid().equals(tid)) {
+                               callRowsQueue.remove(i);
+                               return ret;
+                       }
+               }
+               return null;
+       }
+
+       private boolean isJoinableThreadFromQueue(List<ThreadPageThreadData> queue,
+                       String tid) {
+               int size;
+               size = queue.size();
+               for (int i = 0; i < size; i++) {
+                       if (true == queue.get(i).getTid().equals(tid)) {
+                               if (true == queue.get(i).getAttrType()
+                                               .equals(ThreadPageLabels.THREAD_ATTR_TYPE_JOINABLE)) {
+                                       return true;
+                               }
+                       }
+               }
+               return false;
+       }
+
+       private boolean isJoinableThread(String tid) {
+               boolean ret;
+
+               ret = isJoinableThreadFromQueue(rows, tid);
+               if (ret == false) {
+                       ret = isJoinableThreadFromQueue(rowsQueue, tid);
+               }
+               return ret;
+       }
+
        private void checkMutexAttrType(String input) {
                String[] temp = input.split(",");
                if (temp.length != 2) {
@@ -829,6 +916,23 @@ public class ThreadPageThreadDataManager {
                this.board = board;
        }
 
+       private String findCallerTid(String id) {
+               int callEventQueueSize = callEventQueue.size();
+               ThreadPageThreadDataEvent callEvent;
+               for (int i = 0; i < callEventQueueSize; i++) {
+                       callEvent = callEventQueue.get(i);
+                       if (callEvent.getApiType() != LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP) {
+                               continue;
+                       }
+                       String callerTID = callEvent.getCallID();
+
+                       if (callerTID != null && callerTID.equals(id)) {
+                               return callEvent.getTid();
+                       }
+               }
+               return null;
+       }
+
        private boolean checkPairEvent(ThreadPageThreadDataEvent event) {
                if (event.getEventType() != ThreadPageThreadDataEvent.TYPE_EVENT) {
                        return true;
@@ -994,8 +1098,10 @@ public class ThreadPageThreadDataManager {
                                        data = findParentData(event.getTid());
                                        if (null != data) {
                                                data.pushEvent(event);
+                                               eventQueue.remove(remainCalleeEventCount);
+                                       } else {
+                                               remainCalleeEventCount++;
                                        }
-                                       eventQueue.remove(remainCalleeEventCount);
                                }
                        }
                }
index af42331..8fa8f04 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -47,6 +48,7 @@ public class TimelinePage extends DAPageComposite {
        public TimelinePage(Composite parent, int style) {
                super(parent, style);
                name = AnalyzerLabels.COOLBAR_AREA_TIMELINE;
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_TIMELINE_TOOLTIP);
                this.setLayout(new FillLayout());
 
                leftForm = new SashForm(this, SWT.HORIZONTAL);
index 253c686..5b5486e 100644 (file)
@@ -39,11 +39,15 @@ import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 
 public class CallTraceTable extends DATableComposite {
+       private DAChartBoard chartBoard = null;
 
        public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
@@ -118,4 +122,36 @@ public class CallTraceTable extends DATableComposite {
                }
                return input;
        }
+
+       private DAChartBoard getChartBoard() {
+               if (chartBoard == null) {
+                       return (DAChartBoard) (AnalyzerManager.getCurrentPage().getView(
+                                       TimelineView.ID).getControl());
+               }
+               return chartBoard;
+       }
+       
+       protected void actionSetStartEnd(int type) {
+               GridItem item = table.getItem(mousePoint);
+               if (null != item) {
+                       List<String> data = ((DATableDataFormat) item.getData()).getData();
+                       String time = data.get(LogCenterConstants.TIME_INDEX);
+                       long inputTime = -1;
+                       try {
+                               inputTime = Long.parseLong(time);
+                       } catch (NumberFormatException e) {
+                               e.printStackTrace();
+                               return;
+                       }
+                       if (type == START_TIME) {
+                               rangeDataManager.setMarkerStartTime(inputTime);
+                               getChartBoard().setTimelineMarkerStartTime(
+                                               inputTime / TimelineConstants.MEGA);
+                       } else if (type == END_TIME) {
+                               rangeDataManager.setMarkerEndTime(inputTime);
+                               getChartBoard().setTimelineMarkerEndTime(
+                                               inputTime / TimelineConstants.MEGA);
+                       }
+               }
+       }
 }
index b69bead..8422dce 100644 (file)
@@ -97,15 +97,10 @@ public class CallTraceView extends DAView {
                long start = selData.getStartTime();
                long end = selData.getEndTime();
 
-               String query = "select count(time) from user_function where time < " //$NON-NLS-1$
-                               + start
-                               + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER + ";"; //$NON-NLS-1$ //$NON-NLS-2$
-               int selectionIndex = SqlManager.getInstance().executeSelectOperation(query);
-
-               String countQuery = "select count(time) from user_function where time >" //$NON-NLS-1$
-                               + start
-                               + " and time <= " + end + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER + ";"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-               int selectionCount = SqlManager.getInstance().executeSelectOperation(countQuery);
+               int selectionIndex = SqlManager.getInstance()
+                               .executeSelectIndexOperation(start);
+               int selectionCount = SqlManager.getInstance()
+                               .executeSelectCountOperation(start, end);
 
                selectionIndex = ((selectionIndex < 0) && (selectionCount > 0)) ? 0
                                : selectionIndex;
index 3c4e3d1..3de49c9 100644 (file)
@@ -56,6 +56,12 @@ public class CPUCoreChart extends TimelineChart {
                return instance;
        }
 
+       @Override
+       public void clear() {
+               super.clear();
+               coreSize = TimelineConstants.NOT_INITED;
+       }
+
        public CPUCoreChart() {
                chartType = TimelineConstants.CHART_TYPE_CPU_CORE;
                probeType = LogCenterConstants.LOG_DEVICE;
index 0700043..aec4bb4 100644 (file)
@@ -72,7 +72,7 @@ public class CPUFrequencyChart extends TimelineChart {
 
                chart.addSeries(frequencySeries);
                
-               chart.getPlot().setAxisUnit("GHz");
+               chart.getPlot().setAxisUnit("Hz");
                chart.getPlot().setShowAxis(true);
 
                return item;
index 5be6df2..2cad2c9 100644 (file)
@@ -98,10 +98,12 @@ public class FileChart extends TimelineChart {
                                TimelineChartLabels.FILE_CHART_SERIES_NAME_READ,
                                DAChartSeries.SERIES_STYLE_BAR,
                                ColorResources.SERIESE_COLOR_FILE_READ);
+               readSeries.setBarAlign(DAChartSeries.SERIES_BAR_ALIGN_CENTER);
                writeSeries = new DAChartSeries(
                                TimelineChartLabels.FILE_CHART_SERIES_NAME_WRITE,
                                DAChartSeries.SERIES_STYLE_BAR,
                                ColorResources.SERIESE_COLOR_FILE_WRITE);
+               writeSeries.setBarAlign(DAChartSeries.SERIES_BAR_ALIGN_CENTER);
                fdCountSeries = new DAChartSeries(
                                TimelineChartLabels.FILE_CHART_SERIES_NAME_FD_COUNT,
                                DAChartSeries.SERIES_STYLE_STEP,
@@ -119,8 +121,8 @@ public class FileChart extends TimelineChart {
 
                chart.getPlot().setAutoHeightRange(false);
                chart.getPlot().setSeriesHeightRange(true);
-               chart.getPlot().setShowAxis(true);      
-               
+               chart.getPlot().setShowAxis(true);
+
                fdCountSeries.setEndY(maxFDCount);
                readSeries.setEndY(maxReadWrite);
                writeSeries.setEndY(maxReadWrite);
@@ -235,6 +237,8 @@ public class FileChart extends TimelineChart {
                                                writeSeries.setEndY(maxReadWrite * 1.1);
                                        }
                                        break;
+                               default:
+                                       System.out.println("FileChart.java : wrong file api type");//$NON-NLS-1$
                                }
 
                                fileDataQ.remove(0);
index e00e074..8180b3d 100644 (file)
@@ -37,6 +37,7 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
@@ -87,8 +88,9 @@ public class HeapChart extends TimelineChart {
 
                chart.addSeries(totalAllocationSeries);
                chart.addSeries(userAllocationSeries);
-               
+
                chart.getPlot().setAxisUnit("B");
+               chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.BINARY);
                chart.getPlot().setShowAxis(true);
 
                return item;
@@ -164,8 +166,8 @@ public class HeapChart extends TimelineChart {
                                                                                        .get(LogCenterConstants.DEVICE_ALLOCATION_SIZE_INDEX))
                                                                        - allocByte;
                                                        totalAllocationSeries
-                                                                       .addSeriesItem(new DAChartSeriesItem(
-                                                                                       time, value, Formatter
+                                                                       .addSeriesItem(new DAChartSeriesItem(time,
+                                                                                       value, Formatter
                                                                                                        .toByteFormat(value)));
 
                                                        if (!isUserAllocUpdated) {
@@ -202,7 +204,7 @@ public class HeapChart extends TimelineChart {
                        try {
                                size = Double.parseDouble(log
                                                .get(LogCenterConstants.MEMORY_SIZE_INDEX));
-                               
+
                                allocByte += size;
                                allocationSeriesDataSetMap.put(addressString, size);
                        } catch (NumberFormatException ne) {
index 26f3bba..eb16d6a 100644 (file)
@@ -36,6 +36,7 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
@@ -84,8 +85,9 @@ public class ProcessMemoryChart extends TimelineChart {
                chart.addSeries(VSSMemorySeries);
                chart.addSeries(RSSMemorySeries);
                chart.addSeries(PSSMemorySeries);
-               
+
                chart.getPlot().setAxisUnit("B");
+               chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.BINARY);
                chart.getPlot().setShowAxis(true);
 
                return item;
index ba28691..44c33fa 100644 (file)
@@ -37,6 +37,7 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
@@ -85,8 +86,9 @@ public class SystemMemoryChart extends TimelineChart {
                chart.addSeries(totalSeries);
                chart.addSeries(systemSeries);
                chart.addSeries(processSeries);
-               
+
                chart.getPlot().setAxisUnit("B");
+               chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.BINARY);
                chart.getPlot().setShowAxis(true);
 
                return item;
index b0f8ed3..e188cf2 100644 (file)
@@ -33,19 +33,19 @@ import org.tizen.dynamicanalyzer.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextClearMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextEndMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextStartMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextFromSelectionMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartHighlightInfo;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
 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.contextMenu.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
-import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 
 public abstract class TimelineChart {
        protected DAChart chart;
@@ -57,70 +57,43 @@ public abstract class TimelineChart {
        protected Image addIcon;
        protected DAContextMenu popupMenu;
 
-       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
-
        public abstract void parseLogPackage(LogPackage logPack);
 
        public DAChartBoardItem createBoardItem(final DAChartBoard chartBoard) {
                DAChartBoardItem item = new DAChartBoardItem(chartBoard, chartName,
                                chartIcon, chartStyle);
                chart = item.getChart();
-               item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                               UICommonConstants.RANGE_ANALYSIS_COLOR,
-                               UICommonConstants.RANGE_ANALYSIS_ALPHA));
-               item.addHighlightInfo(new DAChartHighlightInfo(-1, -1,
-                               UICommonConstants.RANGE_MARKING_COLOR,
-                               UICommonConstants.RANGE_MARKING_ALPHA));
 
                setChartStyle();
 
                popupMenu = new DAContextMenu(chart);
-               final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+               popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
                startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
-               startItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double startTime = startItem.getDoubleData();
-
-                               chartBoard.setMarkerStartTime(startTime);
-                               rangeDataManager
-                                               .setMarkerStartTime((long) (startTime * TimelineConstants.MEGA));
-                       }
-               });
-
-               final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+               startItem.addClickListener(new ContextStartMenuItemClickListener(
+                               startItem, chartBoard));
+
+               DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
                endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
-               endItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               double endTime = endItem.getDoubleData();
+               endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
+                               chartBoard));
 
-                               chartBoard.setMarkerEndTime(endTime);
-                               rangeDataManager
-                                               .setMarkerEndTime((long) (endTime * TimelineConstants.MEGA));
-                       }
-               });
+               DAContextMenuItem fromSelectionItem = new DAContextMenuItem(popupMenu);
+               fromSelectionItem
+                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+               fromSelectionItem
+                               .addClickListener(new ContextFromSelectionMenuItemClickListener(
+                                               fromSelectionItem, chartBoard));
 
                DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
                analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-               analysisItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               rangeDataManager.startRangeAnalysis();
-                       }
-               });
+               analysisItem
+                               .addClickListener(new ContextAnalysisMenuItemClickListener());
 
                DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
-               clearItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               chartBoard.setMarkerStartTime(-1);
-                               chartBoard.setMarkerEndTime(-1);
-
-                               rangeDataManager.initRange();
-                       }
-               });
+               clearItem.addClickListener(new ContextClearMenuItemClickListener(
+                               chartBoard));
 
                return item;
        }
index 8607710..9d43dcd 100644 (file)
@@ -36,7 +36,10 @@ 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.ui.common.UIEventChartContextMenuItem;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.uievent.UIEventListDialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
@@ -69,6 +72,9 @@ public class UIEventChart extends TimelineChart {
        private final String KEY_UP = "up"; //$NON-NLS-1$
        private final String KEY_DOWN = "down"; //$NON-NLS-1$
 
+       private UIEventListDialog uiEventListDialog = new UIEventListDialog(
+                       AnalyzerUtil.getWorkbenchWindow().getShell());
+
        public static UIEventChart getInstance() {
                if (instance == null) {
                        instance = new UIEventChart();
@@ -112,22 +118,23 @@ public class UIEventChart extends TimelineChart {
        public DAChartBoardItem createBoardItem(DAChartBoard board) {
                DAChartBoardItem item = super.createBoardItem(board);
 
-               final DAContextMenuItem eventListItem = new DAContextMenuItem(popupMenu);
+               final UIEventChartContextMenuItem eventListItem = new UIEventChartContextMenuItem(
+                               popupMenu);
                eventListItem.setText(TimelineChartLabels.RANGE_CONTEXT_EVENT_LIST);
                eventListItem.addClickListener(new DAContextMenuListener() {
                        @Override
                        public void widgetSelected(DAContextMenuItem menuItem) {
-                               // TODO show eventList
-                               int startIndex = eventListItem.getEventListStartintdex();
-                               int endIndex = eventListItem.getEventListStartintdex();
-                               int seriseIndex = eventListItem.getSeriesIndex();
+                               int startIndex = eventListItem.getEventListStartIndex();
+                               int endIndex = eventListItem.getEventListEndIndex();
+                               int seriesIndex = eventListItem.getSeriesIndex();
 
-                               if (startIndex < 0 || endIndex < 0 || seriseIndex < 0) {
+                               if (startIndex < 0 || endIndex < 0 || seriesIndex < 0) {
                                        return;
                                }
 
-                               DAChartSeries series = chart.getSeries(seriseIndex);
-                               series.getSeriesItemList().subList(startIndex, endIndex);
+                               uiEventListDialog.setSeriesItemInfo(
+                                               chart.getSeries(seriesIndex), startIndex, endIndex + 1);
+                               uiEventListDialog.open();
                        }
                });
                item.useExpand(false);
index add3d7a..a541c7e 100644 (file)
@@ -31,8 +31,7 @@ import java.util.HashMap;
 import java.util.List;
 
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseAdapter;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
 import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUChart;
 import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUCoreChart;
@@ -47,7 +46,6 @@ import org.tizen.dynamicanalyzer.ui.timeline.chart.UIEventChart;
 import org.tizen.dynamicanalyzer.ui.timeline.chart.UserCustomChart;
 import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
-import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
@@ -147,6 +145,10 @@ public class TimelineChartManager {
                return selectedChartList;
        }
 
+       public DAChartBoard getChartBoard() {
+               return chartBoard;
+       }
+
        private int getChartType(String string) {
                if (string.equals(getChartName(TimelineConstants.CHART_TYPE_CPU))) {
                        return TimelineConstants.CHART_TYPE_CPU;
@@ -252,20 +254,18 @@ public class TimelineChartManager {
                        for (TimelineChart chart : newChartList) {
                                selectedChartList.add(chart);
                                DAChartBoardItem item = chart.createBoardItem(chartBoard);
-                               DAChartPlotIntervalMarker intervalMarker = chartBoard
-                                               .getIntervalMarker();
 
                                DAChart chartWidget = item.getChart();
                                chartWidget.getPlot().setAxisRangeX(
                                                chartBoard.getVisibleStartTime(),
                                                chartBoard.getVisibleEndTime());
 
-                               chartWidget.getPlot().setIntervalMarker(intervalMarker);
-                               chartWidget.addMouseListener(new TimelineChartMouseAdapter(
-                                               chart.getPopupMenu()));
+                               chartWidget.getPlot().setMarkers(chartBoard.getMarkers());
+                               TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                                               chart.getPopupMenu(), chartBoard.getTimeline());
+                               chartWidget.addMouseListener(timelineChartMouseEventListener);
                                chartWidget
-                                               .addMouseMoveListener(new TimelineChartMouseMoveListener(
-                                                               chartBoard.getTimeline()));
+                                               .addMouseMoveListener(timelineChartMouseEventListener);
                                chartWidget
                                                .addMouseTrackListener(new TimelineChartMouseTrackAdapter(
                                                                chartBoard.getTimeline()));
index 5baa0f0..2ca2fdf 100644 (file)
@@ -28,6 +28,7 @@ package org.tizen.dynamicanalyzer.ui.timeline.common;
 
 import java.util.List;
 
+import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -39,11 +40,10 @@ import org.tizen.dynamicanalyzer.model.DAView;
 import org.tizen.dynamicanalyzer.model.SnapshotData;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseAdapter;
 import org.tizen.dynamicanalyzer.ui.common.SetRangeMarkerMouseMoveListener;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseAdapter;
-import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
 import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
+import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
 import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
 import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart;
@@ -52,12 +52,13 @@ import org.tizen.dynamicanalyzer.ui.timeline.logparser.CustomLogParser;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.DeviceLogParser;
 import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
 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.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
 
 public class TimelineView extends DAView {
        public static final String ID = TimelineView.class.getName();
@@ -78,24 +79,34 @@ public class TimelineView extends DAView {
                super(parent, style);
                setLayout(new FillLayout());
 
-               chartBoard = new DAChartBoard(this, "Timeline"); //$NON-NLS-1$
+               ViewContainer viewContainer = new ViewContainer(this, false);
+
+               Composite contents = viewContainer.getContentArea();
+               contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+
+               chartBoard = new DAChartBoard(contents, "Timeline"); //$NON-NLS-1$
                chartBoard.setNameFont(FontResources.CHART_NAME_FONT);
                timelineChartManager.setChartTimelineChartBoard(chartBoard);
                chartBoard.setSelection(false);
 
+               StackLayout stackLayout = new StackLayout();
+               stackLayout.topControl = chartBoard;
+               contents.setLayout(stackLayout);
+
                initializeCharts();
 
                new AddChartMenuComposite(chartBoard.getTitleComp());
 
                setBackground(ColorResources.VIEW_BG_COLOR);
 
+               final DATimeline timeline = chartBoard.getTimeline();
+
                lifecycleLogParser.registerLifecycleBar(chartBoard.getLifecycleBar());
-               lifecycleLogParser.registerTimeline(chartBoard.getTimeline());
+               lifecycleLogParser.registerTimeline(timeline);
                AnalyzerUtil.setTimelineComposite(this);
 
-               final DACustomTimeline timeline = chartBoard.getTimeline();
-               timeline.addMouseListener(new SetRangeMarkerMouseAdapter(
-                               rangeDataManager, chartBoard, timeline));
+               timeline.setTimeTickFont(FontResources.TIMELINE_TICK_FONT);
+               timeline.setTimeBalloonFont(FontResources.TIMELINE_BALLOON_FONT);
                timeline.addMouseMoveListener(new SetRangeMarkerMouseMoveListener(
                                rangeDataManager, chartBoard, timeline));
        }
@@ -124,8 +135,8 @@ public class TimelineView extends DAView {
                }
 
                chartBoard.setVisibleMiddleTime(middleTime);
-               DAChartPlotIntervalMarker intervalMarker = chartBoard
-                               .getIntervalMarker();
+               DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) chartBoard
+                               .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
                intervalMarker.setStartVal(startTime);
                intervalMarker.setEndVal(endTime);
        }
@@ -135,27 +146,29 @@ public class TimelineView extends DAView {
                timelineChartManager.addNewCustomChart();
                chartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime());
 
-               double markerStartTime = rangeDataManager.getMarkerStartTime()
-                               / TimelineConstants.MEGA;
-               double markerEndTime = rangeDataManager.getMarkerEndTime()
-                               / TimelineConstants.MEGA;
-               chartBoard.setMarkerStartTime(markerStartTime);
-               chartBoard.setMarkerEndTime(markerEndTime);
-
-               if (markerStartTime >= 0 && markerEndTime >= 0) {
-                       chartBoard.setHighlight(markerStartTime, markerEndTime, 1);
-               } else {
-                       chartBoard.setHighlight(-1, -1, 1);
-               }
+               chartBoard.setTimelineMarkerStartTime(rangeDataManager
+                               .getMarkerStartTime() / TimelineConstants.MEGA);
+               chartBoard.setTimelineMarkerEndTime(rangeDataManager.getMarkerEndTime()
+                               / TimelineConstants.MEGA);
 
                if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                       chartBoard.setHighlight(rangeDataManager.getAnalysisStartTime()
-                                       / TimelineConstants.MEGA,
-                                       rangeDataManager.getAnalysisEndTime()
-                                                       / TimelineConstants.MEGA, 0);
+                       ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(rangeDataManager.getAnalysisStartTime()
+                                                       / TimelineConstants.MEGA,
+                                                       rangeDataManager.getAnalysisEndTime()
+                                                                       / TimelineConstants.MEGA);
                } else {
-                       chartBoard.setHighlight(-1, -1, 0);
+                       ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(-1, -1);
                }
+
+               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                               UICommonConstants.RANGE_MARKER_INDEX)).setInterval(
+                               rangeDataManager.getMarkerStartTime() / TimelineConstants.MEGA,
+                               rangeDataManager.getMarkerEndTime() / TimelineConstants.MEGA);
+
        }
 
        @Override
@@ -207,9 +220,7 @@ public class TimelineView extends DAView {
        }
 
        private void initializeCharts() {
-               DAChartPlotIntervalMarker intervalMarker = chartBoard
-                               .getIntervalMarker();
-
+               initIntervalMarkers(chartBoard);
                List<TimelineChart> chartList = timelineChartManager.getChartList();
                List<TimelineChart> selectedChartList = timelineChartManager
                                .getSelectedChartList();
@@ -224,12 +235,11 @@ public class TimelineView extends DAView {
                                        chartBoard.getVisibleStartTime(),
                                        chartBoard.getVisibleEndTime());
 
-                       chartWidget.getPlot().setIntervalMarker(intervalMarker);
-                       chartWidget.addMouseListener(new TimelineChartMouseAdapter(
-                                       timelineChart.getPopupMenu()));
-                       chartWidget
-                                       .addMouseMoveListener(new TimelineChartMouseMoveListener(
-                                                       chartBoard.getTimeline()));
+                       chartWidget.getPlot().setMarkers(chartBoard.getMarkers());
+                       TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                                       timelineChart.getPopupMenu(), chartBoard.getTimeline());
+                       chartWidget.addMouseListener(timelineChartMouseEventListener);
+                       chartWidget.addMouseMoveListener(timelineChartMouseEventListener);
                        chartWidget
                                        .addMouseTrackListener(new TimelineChartMouseTrackAdapter(
                                                        chartBoard.getTimeline()));
@@ -245,4 +255,27 @@ public class TimelineView extends DAView {
        public Control getControl() {
                return chartBoard;
        }
+
+       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);
+       }
 }
index 8a32990..81b1139 100644 (file)
@@ -38,7 +38,7 @@ import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
 import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleBar;
 import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleData;
-import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DATimeline;
 
 public class LifecycleLogParser {
        private static LifecycleLogParser instance = null;
@@ -49,7 +49,7 @@ public class LifecycleLogParser {
        private final String API_NAME_TERMINATING = "TERMINATING";//$NON-NLS-1$
 
        private List<LifecycleBar> lifecycleBarList = new ArrayList<LifecycleBar>();
-       private List<DACustomTimeline> timelineList = new ArrayList<DACustomTimeline>();
+       private List<DATimeline> timelineList = new ArrayList<DATimeline>();
 
        public static LifecycleLogParser getInstance() {
                if (instance == null) {
@@ -106,7 +106,7 @@ public class LifecycleLogParser {
                        lifecycleBar.addLifecycleData(lifecycleData);
                }
 
-               for (DACustomTimeline timeline : timelineList) {
+               for (DATimeline timeline : timelineList) {
                        timeline.addStickyTime(startTime);
                }
        }
@@ -115,7 +115,7 @@ public class LifecycleLogParser {
                lifecycleBarList.add(lifecycleBar);
        }
 
-       public void registerTimeline(DACustomTimeline timeline) {
+       public void registerTimeline(DATimeline timeline) {
                timelineList.add(timeline);
        }
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialog.java
new file mode 100644 (file)
index 0000000..15e1741
--- /dev/null
@@ -0,0 +1,260 @@
+package org.tizen.dynamicanalyzer.ui.timeline.uievent;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+
+public class UIEventListDialog extends Dialog {
+       static final String KEY_START_OLD_CHECKED_ITEM = "start_old_checked_item"; //$NON-NLS-1$
+       static final String KEY_END_OLD_CHECKED_ITEM = "end_old_checked_item"; //$NON-NLS-1$
+       static final String KEY_OLD_HOVERED_ITEM = "old_hovered_item"; //$NON-NLS-1$
+       static final String KEY_OLD_HOVERED_INDEX = "old_hovered_INDEX"; //$NON-NLS-1$
+       static final String KEY_START_TIME = "start_time"; //$NON-NLS-1$
+       static final String KEY_END_TIME = "end_time"; //$NON-NLS-1$
+
+       private Shell shell;
+       private Shell parent;
+       private UIEventListTable uiEventListTable;
+       private List<DAChartSeriesItem> seriesItemList;
+       private String eventType;
+
+       private String[] columnNames = { TimelinePageLabels.UI_EVENT_LIST_NAME,
+                       TimelinePageLabels.UI_EVENT_LIST_TIME,
+                       TimelinePageLabels.UI_EVENT_LIST_SET_RANGE };
+       private int[] columnSizes = { 180, 112, 140 };
+       private boolean[] columnVisibility = { true, true, true };
+
+       public UIEventListDialog(Shell parent) {
+               super(parent);
+               this.parent = parent;
+       }
+
+       public int open() {
+               shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+               shell.setText(eventType + " event list");
+               shell.setSize(446, 450);
+               shell.setLayout(new FormLayout());
+
+               Composite tableComp = new Composite(shell, SWT.NONE);
+               tableComp
+                               .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+               tableComp.setLayout(new FormLayout());
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 0);
+               data.bottom = new FormAttachment(100, -49);
+               data.left = new FormAttachment(0, 0);
+               data.right = new FormAttachment(100, 0);
+               tableComp.setLayoutData(data);
+
+               uiEventListTable = new UIEventListTable(tableComp, SWT.NONE,
+                               SWT.H_SCROLL | SWT.V_SCROLL);
+               uiEventListTable.setColumns(columnNames);
+               uiEventListTable.setColumnSize(columnSizes);
+               uiEventListTable.setColumnVisibility(columnVisibility);
+               uiEventListTable.getTable().setData(UIEventListDialog.KEY_START_TIME,
+                               -1.0);
+               uiEventListTable.getTable().setData(UIEventListDialog.KEY_END_TIME,
+                               -1.0);
+               data = new FormData();
+               data.top = new FormAttachment(tableComp, 15);
+               data.bottom = new FormAttachment(100, -15);
+               data.left = new FormAttachment(0, 6);
+               data.right = new FormAttachment(100, -6);
+               uiEventListTable.setLayoutData(data);
+
+               Composite buttonComp = new Composite(shell, SWT.NONE);
+               buttonComp
+                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+               buttonComp.setLayout(new FormLayout());
+               data = new FormData();
+               data.top = new FormAttachment(tableComp, 0);
+               data.bottom = new FormAttachment(100, 0);
+               data.left = new FormAttachment(0, 0);
+               data.right = new FormAttachment(100, 0);
+               buttonComp.setLayoutData(data);
+
+               DAButton okButton = new DAButton(buttonComp, SWT.PUSH);
+               okButton.addClickListener(okButtonListener);
+               okButton.setText(AnalyzerLabels.OK);
+               okButton.setFont(FontResources.EDIT_CHART_DLG_BUTTON);
+               data = new FormData();
+               data.top = new FormAttachment(0, 8);
+               data.left = new FormAttachment(0, 119);
+               data.width = DesignConstants.DA_BUTTON_WIDTH;
+               data.height = DesignConstants.DA_BUTTON_HEIGHT;
+               okButton.setLayoutData(data);
+
+               DAButton cancelButton = new DAButton(buttonComp, SWT.PUSH);
+               cancelButton.addClickListener(cancelButtonListener);
+               cancelButton.setText(AnalyzerLabels.CANCEL);
+               cancelButton.setFont(FontResources.EDIT_CHART_DLG_BUTTON);
+               data = new FormData();
+               data.top = new FormAttachment(0, 8);
+               data.left = new FormAttachment(okButton, 8);
+               data.width = DesignConstants.DA_BUTTON_WIDTH;
+               data.height = DesignConstants.DA_BUTTON_HEIGHT;
+               cancelButton.setLayoutData(data);
+
+               buttonComp.addPaintListener(new PaintListener() {
+                       @Override
+                       public void paintControl(PaintEvent e) {
+                               Composite comp = (Composite) e.widget;
+                               Rectangle rect = comp.getClientArea();
+                               e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+                               e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+                               e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+                               e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+                                               rect.y + 1);
+                       }
+               });
+
+               uiEventListTable.updateTable();
+               shell.open();
+
+               return 0;
+       }
+
+       public void setSeriesItemInfo(DAChartSeries series, int fromIndex,
+                       int toIndex) {
+               seriesItemList = series.getSeriesItemList().subList(fromIndex, toIndex);
+               eventType = series.getName();
+       }
+
+       private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+               @Override
+               public void handleClickEvent(DACustomButton button) {
+                       RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+                       DAChartBoard chartBoard = (DAChartBoard) AnalyzerManager
+                                       .getCurrentPage().getView(TimelineView.ID).getControl();
+
+                       double startTime = (Double) uiEventListTable.getTable().getData(
+                                       KEY_START_TIME);
+                       double endTime = (Double) uiEventListTable.getTable().getData(
+                                       KEY_END_TIME);
+
+                       if (startTime != -1 && endTime != -1 && startTime > endTime) {
+                               double temp = startTime;
+                               startTime = endTime;
+                               endTime = temp;
+                       }
+
+                       if (startTime != -1) {
+                               rangeDataManager
+                                               .setMarkerStartTime((long) (startTime * TimelineConstants.MEGA));
+                               double revisedEndTime = rangeDataManager.getMarkerEndTime();
+
+                               chartBoard.setTimelineMarkerStartTime(startTime);
+                               chartBoard.setTimelineMarkerEndTime(revisedEndTime
+                                               / TimelineConstants.MEGA);
+
+                               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                               UICommonConstants.RANGE_MARKER_INDEX))
+                                               .setStartVal(startTime);
+                               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                               UICommonConstants.RANGE_MARKER_INDEX))
+                                               .setEndVal(revisedEndTime / TimelineConstants.MEGA);
+                       }
+
+                       if (endTime != -1) {
+                               rangeDataManager
+                                               .setMarkerEndTime((long) (endTime * TimelineConstants.MEGA));
+
+                               double revisedStartTime = rangeDataManager.getMarkerStartTime();
+
+                               chartBoard.setTimelineMarkerStartTime(revisedStartTime
+                                               / TimelineConstants.MEGA);
+                               chartBoard.setTimelineMarkerEndTime(endTime);
+
+                               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                               UICommonConstants.RANGE_MARKER_INDEX))
+                                               .setStartVal(revisedStartTime / TimelineConstants.MEGA);
+                               ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                               UICommonConstants.RANGE_MARKER_INDEX))
+                                               .setEndVal(endTime);
+                       }
+
+                       shell.dispose();
+               }
+       };
+
+       private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
+               @Override
+               public void handleClickEvent(DACustomButton button) {
+                       uiEventListTable.getTable().setData(
+                                       UIEventListDialog.KEY_START_TIME, -1.0);
+                       uiEventListTable.getTable().setData(UIEventListDialog.KEY_END_TIME,
+                                       -1.0);
+                       shell.dispose();
+               }
+       };
+
+       private class UIEventListTable extends DATableComposite {
+               private UIEventListTable(Composite parent, int style, int tableStyle) {
+                       super(parent, style, tableStyle);
+               }
+
+               @Override
+               protected List<TableInput> makeTableInput() {
+                       List<TableInput> inputList = new ArrayList<TableInput>();
+                       for (DAChartSeriesItem item : seriesItemList) {
+                               List<String> columnTexts = new ArrayList<String>();
+                               columnTexts.add(item.getTooltipText().split("\n")[0]);//$NON-NLS-1$
+                               columnTexts.add(String.valueOf(item.getX()));
+
+                               TableInput tableInput = new TableInput();
+                               tableInput.setText(columnTexts);
+                               DATableDataFormat dataFormat = new DATableDataFormat(null);
+                               dataFormat.setObject(item.getX());
+                               tableInput.setData(dataFormat);
+
+                               inputList.add(tableInput);
+                       }
+
+                       return inputList;
+               }
+
+               @Override
+               public void setColumns(String[] columnNames) {
+                       int size = columnNames.length;
+                       for (int i = 0; i < size; i++) {
+                               GridColumn column = new GridColumn(table, SWT.NONE);
+                               column.setText(columnNames[i]);
+                               column.setCellRenderer(new UIEventListDialogTableCellRenderer());
+                               column.setHeaderRenderer(new DATableHeaderRenderer());
+                               column.pack();
+                       }
+               }
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialogTableCellRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialogTableCellRenderer.java
new file mode 100644 (file)
index 0000000..9a5bab0
--- /dev/null
@@ -0,0 +1,281 @@
+package org.tizen.dynamicanalyzer.ui.timeline.uievent;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.nebula.widgets.grid.IInternalWidget;
+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.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
+       private int leftMargin = 4;
+       private int rightMargin = 4;
+       private int textTopMargin = 1;
+       private int insideMargin = 3;
+
+       private int CHECK_INDEX = 2;
+
+       private final int buttonWidth = ImageResources.UIEVENT_DIALOG_START_SELECTED_NORMAL
+                       .getBounds().width;
+
+       @Override
+       public void paint(GC gc, Object value) {
+               GridItem item = (GridItem) value;
+               gc.setFont(item.getFont(getColumn()));
+
+               boolean drawAsSelected = isSelected();
+               boolean drawBackground = true;
+
+               if (isCellSelected()) {
+                       drawAsSelected = true;
+               }
+               if (drawAsSelected) {
+                       gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+                       gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+               } 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 && drawAsSelected) {
+                       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);
+               }
+
+               int x = leftMargin;
+               if (getColumn() == CHECK_INDEX) {
+                       Image buttonImage;
+                       Integer data = (Integer) item
+                                       .getData(UIEventListDialog.KEY_OLD_HOVERED_INDEX);
+                       if (item.getChecked(CHECK_INDEX)) {
+                               if (data != null && data == CHECK_INDEX) {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_START_SELECTED_HOVER;
+                               } else {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_START_SELECTED_NORMAL;
+                               }
+                       } else {
+                               if (data != null && data == CHECK_INDEX) {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_START_HOVER;
+                               } else {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_START_NORMAL;
+                               }
+                       }
+                       gc.drawImage(buttonImage, getStartButtonXPostion(),
+                                       getBounds().y + 1);
+
+                       if (item.getChecked(CHECK_INDEX - 1)) {
+                               if (data != null && data == CHECK_INDEX - 1) {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_END_SELECTED_HOVER;
+                               } else {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_END_SELECTED_NORMAL;
+                               }
+                       } else {
+                               if (data != null && data == CHECK_INDEX - 1) {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_END_HOVER;
+                               } else {
+                                       buttonImage = ImageResources.UIEVENT_DIALOG_END_NORMAL;
+                               }
+                       }
+                       gc.drawImage(buttonImage, getEndButtonXPosition(),
+                                       getBounds().y + 1);
+               }
+
+               Image image = item.getImage(getColumn());
+               if (image != null) {
+                       int y = getBounds().y;
+                       y += (getBounds().height - image.getBounds().height) / 2;
+                       gc.drawImage(image, getBounds().x + x, y);
+                       x += image.getBounds().width + insideMargin;
+               }
+
+               int width = getBounds().width - x - rightMargin;
+               String text = item.getText(getColumn());
+
+               if (getAlignment() == SWT.RIGHT) {
+                       int len = gc.stringExtent(text).x;
+                       if (len < width) {
+                               x += width - len;
+                       }
+               } else if (getAlignment() == SWT.CENTER) {
+                       int len = gc.stringExtent(text).x;
+                       if (len < width) {
+                               x += (width - len) / 2;
+                       }
+               }
+
+               if (drawAsSelected) {
+                       gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+               } else {
+                       Color fontColor = item.getForeground();
+                       if (null != fontColor) {
+                               gc.setForeground(item.getForeground());
+                       } else {
+                               gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+                       }
+               }
+
+               gc.setFont(FontResources.TABLE_CELL_FONT);
+
+               if (getColumn() != CHECK_INDEX) {
+                       gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin,
+                                       true);
+               }
+               if (item.getParent().getLinesVisible()) {
+                       if (isCellSelected()) {
+                               gc.setForeground(ColorResources.TABLE_LINE);
+                       } else {
+                               gc.setForeground(ColorResources.TABLE_LINE);
+                       }
+                       gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+                                       getBounds().x + getBounds().width - 1, getBounds().y
+                                                       + getBounds().height);
+                       gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+                                       getBounds().x + getBounds().width - 1, getBounds().y
+                                                       + getBounds().height);
+               }
+               if (isCellFocus()) {
+                       Rectangle focusRect = new Rectangle(getBounds().x - 1,
+                                       getBounds().y - 1, getBounds().width,
+                                       getBounds().height + 1);
+                       gc.setForeground(ColorResources.RED);
+                       gc.drawRectangle(focusRect);
+                       if (isFocus()) {
+                               focusRect.x++;
+                               focusRect.width -= 2;
+                               focusRect.y++;
+                               focusRect.height -= 2;
+                               gc.drawRectangle(focusRect);
+                       }
+               }
+       }
+
+       private int getStartButtonXPostion() {
+               return getBounds().x + getBounds().width / 2 - buttonWidth - 5;
+       }
+
+       private int getEndButtonXPosition() {
+               return getBounds().x + getBounds().width / 2 + 5;
+       }
+
+       private int getCheckBoxIndex(Point point) {
+               Image buttonImage;
+               if (point.x < getBounds().x + getBounds().width / 2) {
+                       buttonImage = ImageResources.UIEVENT_DIALOG_START_NORMAL;
+               } else {
+                       buttonImage = ImageResources.UIEVENT_DIALOG_END_NORMAL;
+               }
+
+               if (point.x >= getStartButtonXPostion()
+                               && point.x <= getStartButtonXPostion()
+                                               + buttonImage.getBounds().width) {
+                       return CHECK_INDEX;
+               } else if (point.x >= getEndButtonXPosition()
+                               && point.x <= getEndButtonXPosition()
+                                               + buttonImage.getBounds().width) {
+                       return CHECK_INDEX - 1;
+               } else {
+                       return -1;
+               }
+       }
+
+       public boolean notify(int event, Point point, Object value) {
+               if (getColumn() == CHECK_INDEX) {
+                       if (event == IInternalWidget.MouseMove) {
+                               GridItem item = (GridItem) value;
+                               int checkBoxIndex = getCheckBoxIndex(point);
+                               Grid parentGrid = item.getParent();
+                               GridItem oldHoveredItem = (GridItem) parentGrid
+                                               .getData(UIEventListDialog.KEY_OLD_HOVERED_ITEM);
+                               if (oldHoveredItem != null) {
+                                       oldHoveredItem.setData(
+                                                       UIEventListDialog.KEY_OLD_HOVERED_INDEX, null);
+                               }
+
+                               if (checkBoxIndex != -1) {
+                                       parentGrid.setData(UIEventListDialog.KEY_OLD_HOVERED_ITEM,
+                                                       item);
+                                       item.setData(UIEventListDialog.KEY_OLD_HOVERED_INDEX,
+                                                       checkBoxIndex);
+                               }
+
+                               parentGrid.redraw();
+                       } else if (event == IInternalWidget.LeftMouseButtonDown) {
+                               GridItem item = (GridItem) value;
+                               int checkBoxIndex = getCheckBoxIndex(point);
+                               if (checkBoxIndex != -1) {
+                                       boolean isCheckEvent = !item
+                                                       .getChecked(getCheckBoxIndex(point));
+
+                                       Grid parentGrid = item.getParent();
+                                       if (isCheckEvent) {
+                                               double data = (Double) ((DATableDataFormat) item
+                                                               .getData()).getObject();
+
+                                               if (checkBoxIndex == CHECK_INDEX) {
+                                                       GridItem oldCheckedItem = (GridItem) parentGrid
+                                                                       .getData(UIEventListDialog.KEY_START_OLD_CHECKED_ITEM);
+
+                                                       if (oldCheckedItem != null) {
+                                                               oldCheckedItem.setChecked(CHECK_INDEX, false);
+                                                       }
+                                                       parentGrid
+                                                                       .setData(
+                                                                                       UIEventListDialog.KEY_START_OLD_CHECKED_ITEM,
+                                                                                       item);
+
+                                                       parentGrid.setData(
+                                                                       UIEventListDialog.KEY_START_TIME, data);
+                                               } else {
+                                                       GridItem oldCheckedItem = (GridItem) parentGrid
+                                                                       .getData(UIEventListDialog.KEY_END_OLD_CHECKED_ITEM);
+
+                                                       if (oldCheckedItem != null) {
+                                                               oldCheckedItem.setChecked(CHECK_INDEX - 1,
+                                                                               false);
+                                                       }
+                                                       parentGrid.setData(
+                                                                       UIEventListDialog.KEY_END_OLD_CHECKED_ITEM,
+                                                                       item);
+
+                                                       parentGrid.setData(UIEventListDialog.KEY_END_TIME,
+                                                                       data);
+                                               }
+                                       } else {
+                                               if (checkBoxIndex == CHECK_INDEX) {
+                                                       parentGrid.setData(
+                                                                       UIEventListDialog.KEY_START_TIME, -1.0);
+                                               } else {
+                                                       parentGrid.setData(UIEventListDialog.KEY_END_TIME,
+                                                                       -1.0);
+                                               }
+                                       }
+
+                                       item.setChecked(checkBoxIndex, isCheckEvent);
+
+                                       return true;
+                               }
+                       }
+               }
+               return false;
+       }
+}
index af930bc..00c697c 100644 (file)
@@ -50,12 +50,14 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
 public class AboutDialog {
+       private static boolean opened = false;
        private Shell parent = null;
        private Shell shell = null;
        private DACustomButton licenseButton = null;
@@ -87,6 +89,9 @@ public class AboutDialog {
        };
 
        public int open() {
+               if (opened) {
+                       return -1;
+               }
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
                shell.setSize(446, 254);
                shell.setLayout(new FormLayout());
@@ -221,16 +226,21 @@ public class AboutDialog {
                licenceData.height = DesignConstants.DA_BUTTON_HEIGHT;
                licenseButton.setLayoutData(licenceData);
 
+               opened = true;
+               ShortCutManager.getInstance().setEnabled(!opened);
                shell.open();
 
                Display display = PlatformUI.createDisplay();
 
                while (!shell.isDisposed()) {
-                       if (!display.readAndDispatch())
+                       if (!display.readAndDispatch()) {
                                display.sleep();
+                       }
                }
 
                shell.dispose();
+               opened = false;
+               ShortCutManager.getInstance().setEnabled(!opened);
 
                return 0;
        }
index 1ec5ade..27f39c5 100644 (file)
@@ -48,21 +48,8 @@ import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 public class ConfigureManager {
 
        // default value
-       private static final String DEFAULT_INTERNALCALL = ConfigureLabels.OFF;
-       private static final String DEFAULT_RANGEAUTOSELECT = ConfigureLabels.ON;
-       private static final String DEFAULT_SNAPSHOT = ConfigureLabels.ON;
-       
-       private static final String DEFAULT_FUNCTIONPROFILING = ConfigureLabels.ON;
-       private static final String DEFAULT_ALLOCATION = ConfigureLabels.ON;
-       private static final String DEFAULT_FILE = ConfigureLabels.ON;
-       private static final String DEFAULT_THREAD = ConfigureLabels.ON;
-       private static final String DEFAULT_USERINTERFACE = ConfigureLabels.ON;
-       private static final String DEFAULT_EVENT = ConfigureLabels.ON;
-       private static final String DEFAULT_RECORDING = ConfigureLabels.ON;
        private static final String DEFAULT_THEME = ConfigureLabels.ON;
-       private static final String DEFAULT_SHOWWELCOME = ConfigureLabels.ON;
-       private static final String DEFAULT_AUTOREPLAY = ConfigureLabels.ON;
-       
+       private static final String DEFAULT_NOT_SHOWWELCOME = ConfigureLabels.OFF;
 
        // default value Chart
        public static final String CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LISTS = TimelineChartLabels.CPU_CHART_TITLE
@@ -116,13 +103,12 @@ public class ConfigureManager {
 
        private void setCheckDefaultConfigData() {
                if (null == data.get(ConfigureLabels.INTERNALCALL)) {
-                       data.put(ConfigureLabels.INTERNALCALL, DEFAULT_INTERNALCALL);
-               }
-               if (null == data.get(ConfigureLabels.RANGEAUTOSELECT)) {
-                       data.put(ConfigureLabels.RANGEAUTOSELECT, DEFAULT_RANGEAUTOSELECT);
+                       data.put(ConfigureLabels.INTERNALCALL,
+                                       Integer.toString(AnalyzerConstants.OPT_OFF));
                }
                if (null == data.get(ConfigureLabels.SNAPSHOT)) {
-                       data.put(ConfigureLabels.SNAPSHOT, DEFAULT_SNAPSHOT);
+                       data.put(ConfigureLabels.SNAPSHOT,
+                                       Integer.toString(AnalyzerConstants.OPT_OFF));
                }
                if (null == data
                                .get(ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST)) {
@@ -139,43 +125,51 @@ public class ConfigureManager {
                        data.put(ConfigureLabels.SINGLETON_FOCUS_DA_PID,
                                        CommonConstants.SPACE);
                }
-               
-               
+
                if (null == data.get(ConfigureLabels.FUNCTIONPROFILING)) {
-                       data.put(ConfigureLabels.FUNCTIONPROFILING, DEFAULT_FUNCTIONPROFILING);
+                       data.put(ConfigureLabels.FUNCTIONPROFILING,
+                                       Integer.toString(AnalyzerConstants.OPT_FUNC));
                }
                if (null == data.get(ConfigureLabels.ALLOCATION)) {
-                       data.put(ConfigureLabels.ALLOCATION, DEFAULT_ALLOCATION);
+                       data.put(ConfigureLabels.ALLOCATION,
+                                       Integer.toString(AnalyzerConstants.OPT_ALLOC));
                }
                if (null == data.get(ConfigureLabels.FILE)) {
-                       data.put(ConfigureLabels.FILE, DEFAULT_FILE);
+                       data.put(ConfigureLabels.FILE,
+                                       Integer.toString(AnalyzerConstants.OPT_FILE));
                }
                if (null == data.get(ConfigureLabels.THREAD)) {
-                       data.put(ConfigureLabels.THREAD, DEFAULT_THREAD);
+                       data.put(ConfigureLabels.THREAD,
+                                       Integer.toString(AnalyzerConstants.OPT_THREAD));
                }
                if (null == data.get(ConfigureLabels.USERINTERFACE)) {
-                       data.put(ConfigureLabels.USERINTERFACE, DEFAULT_USERINTERFACE);
+                       data.put(ConfigureLabels.USERINTERFACE,
+                                       Integer.toString(AnalyzerConstants.OPT_UI));
                }
                if (null == data.get(ConfigureLabels.SNAPSHOT)) {
-                       data.put(ConfigureLabels.SNAPSHOT, DEFAULT_SNAPSHOT);
+                       data.put(ConfigureLabels.SNAPSHOT,
+                                       Integer.toString(AnalyzerConstants.OPT_OFF));
                }
                if (null == data.get(ConfigureLabels.EVENT)) {
-                       data.put(ConfigureLabels.EVENT, DEFAULT_EVENT);
+                       data.put(ConfigureLabels.EVENT,
+                                       Integer.toString(AnalyzerConstants.OPT_EVENT));
                }
                if (null == data.get(ConfigureLabels.RECORDING)) {
-                       data.put(ConfigureLabels.RECORDING, DEFAULT_RECORDING);
+                       data.put(ConfigureLabels.RECORDING,
+                                       Integer.toString(AnalyzerConstants.OPT_RECORD));
                }
-               
+
                if (null == data.get(ConfigureLabels.THEME)) {
                        data.put(ConfigureLabels.THEME, DEFAULT_THEME);
                }
-               
+
                if (null == data.get(ConfigureLabels.SHOW_INITIAL)) {
-                       data.put(ConfigureLabels.SHOW_INITIAL, DEFAULT_SHOWWELCOME);
+                       data.put(ConfigureLabels.SHOW_INITIAL, DEFAULT_NOT_SHOWWELCOME);
                }
-               
+
                if (null == data.get(ConfigureLabels.AUTO_STOP)) {
-                       data.put(ConfigureLabels.AUTO_STOP, DEFAULT_AUTOREPLAY);
+                       data.put(ConfigureLabels.AUTO_STOP,
+                                       Integer.toString(AnalyzerConstants.OPT_OFF));
                }
 
        }
@@ -263,10 +257,15 @@ public class ConfigureManager {
                        data = new HashMap<String, String>();
                        return 0;
                }
-               String valuestr = data.get(key);
-               if (valuestr.equalsIgnoreCase(ConfigureLabels.ON)) {
-                       return 1;
-               } else {
+               String valueStr = data.get(key);
+               try {
+                       if (null == valueStr) {
+                               return 0;
+                       } else {
+                               return Integer.parseInt(valueStr);
+                       }
+               } catch (NumberFormatException e) {
+                       e.printStackTrace();
                        return 0;
                }
        }
index 53c8bc2..7ad14eb 100644 (file)
@@ -31,9 +31,8 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.PathManager;
-import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
 import org.tizen.dynamicanalyzer.logparser.LogParser;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
@@ -63,8 +62,7 @@ public class RecordStartStopThread implements Runnable {
 
        @Override
        public void run() {
-               String state = AnalyzerUtil.getRecordState();
-               if (state.equals(RecordStateSourceProvider.RECORD_RECORDING)) {
+               if (AnalyzerManager.isRunning()) {
                        boolean isStarted = recordStart();
                        if (isStarted) {
                                if (ReplayTraceHandler.isReplay) {
@@ -79,6 +77,7 @@ public class RecordStartStopThread implements Runnable {
                                                                AnalyzerLabels.STOP_TRACE);
                                                ToolbarArea.getInstance().setSnapshotButtonEnablement(
                                                                true);
+                                               ToolbarArea.getInstance().setSettingsButtonEnablement(true);
                                        }
                                });
                        } else {
@@ -99,6 +98,7 @@ public class RecordStartStopThread implements Runnable {
                                                                ToolbarArea.TOOLBAR_STATE_READY);
                                                ToolbarArea.getInstance()
                                                                .setStartButtonEnablement(true);
+                                               ToolbarArea.getInstance().setSettingsButtonEnablement(true);
                                        }
                                });
                        }
@@ -116,24 +116,26 @@ public class RecordStartStopThread implements Runnable {
                                ToolbarArea.getInstance().setToolbarState(
                                                ToolbarArea.TOOLBAR_STATE_RECORDING);
                                ToolbarArea.getInstance().setStartButtonEnablement(false);
+                               ToolbarArea.getInstance().setSettingsButtonEnablement(false);
                        }
                });
 
                AnalyzerManager.initRecordStart();
-               if (!ResourceCommunicator.connect()) {
+               if (!DACommunicator.connectionProcess()) {
                        System.out.println("failed to connect the device.");//$NON-NLS-1$
                        Display.getDefault().syncExec(new Runnable() {
                                @Override
                                public void run() {
                                        ToolbarArea.getInstance().setStartButtonEnablement(true);
-                                       ToolbarArea.getInstance().setSnapshotButtonEnablement(true);
+                                       ToolbarArea.getInstance().setSettingsButtonEnablement(true);
+//                                     ToolbarArea.getInstance().setSnapshotButtonEnablement(true);
                                }
                        });
                        return false;
                }
                if (!AnalyzerManager.isExit()) {
                        UIRecorderTool.getInstance().startRecorder();
-                       ResourceCommunicator.sendStartMessage();
+                       DACommunicator.sendStartMessage();
                        ToolbarArea.getInstance().startTimer();
                        LogParser.startLogParser();
                        FileChartManager.getInstance().startUpdateLogThread();
@@ -157,19 +159,12 @@ public class RecordStartStopThread implements Runnable {
                                ToolbarArea.getInstance().setToolbarState(
                                                ToolbarArea.TOOLBAR_STATE_READY);
                                ToolbarArea.getInstance().setStartButtonEnablement(false);
+                               ToolbarArea.getInstance().setSettingsButtonEnablement(false);
                                StopProcessManager.getInstance().stopProcessStart(
                                                AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA);
                        }
                });
 
-               if (ResourceCommunicator.isRunning()) {
-                       ResourceCommunicator
-                                       .sendMessage(AnalyzerConstants.MSG_STOP
-                                                       + CommonConstants.CMD_SPLIT + 0
-                                                       + CommonConstants.CMD_SPLIT);
-                       System.out.println("stop send message :"
-                                       + AnalyzerConstants.MSG_STOP + CommonConstants.CMD_SPLIT
-                                       + 0 + CommonConstants.CMD_SPLIT);
-               }
+               DACommunicator.sendStopMessage();
        }
 }
index d2eda72..9f80112 100644 (file)
@@ -50,6 +50,7 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
 import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
 import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
@@ -177,9 +178,9 @@ public class SaveAsDialog extends DAMessageBox {
                @Override
                public void keyReleased(KeyEvent e) {
                        if (!checkValidFileName(textBox.getText())) {
-                               okButton.setEnabled(false);
+                               okButton.setButtonEnabled(false);
                        } else {
-                               okButton.setEnabled(true);
+                               okButton.setButtonEnabled(true);
                        }
                }
 
@@ -244,6 +245,7 @@ public class SaveAsDialog extends DAMessageBox {
                        AnalyzerUtil.copyFile(sourceUIRecorderPath, targetUIRecorderPath);
                }
 
+               SqlManager.getInstance().closeConnection();
                project.setSavePath(targetPath);
 
                // delete source file and folder
index b946275..afbdfe2 100644 (file)
@@ -132,6 +132,7 @@ public class StopLogProcessor implements Runnable {
                        public void run() {
                                ToolbarArea.getInstance().setStartButtonEnablement(true);
                                ToolbarArea.getInstance().setMainControlEnablement(true);
+                               ToolbarArea.getInstance().setSettingsButtonEnablement(true);
                        }
                });
                count--;
index 6ad360b..032c41e 100644 (file)
@@ -27,6 +27,7 @@
 
 package org.tizen.dynamicanalyzer.ui.toolbar;
 
+import java.util.HashMap;
 import java.util.List;
 
 import org.eclipse.swt.SWT;
@@ -48,16 +49,16 @@ import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DesignConstants;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
+import org.tizen.dynamicanalyzer.project.AppInfo;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
 import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialog;
 import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog;
@@ -74,8 +75,17 @@ import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener;
 import org.tizen.dynamicanalyzer.widgets.timer.TimerClock;
 
 public class ToolbarArea {
+
+       public static final int START_BUTTON = 0;
+       public static final int SAVE_BUTTON = 1;
+       public static final int OPEN_BUTTON = 2;
+       public static final int REPLAY_BUTTON = 3;
+       public static final int SOURCE_BUTTON = 4;
+       public static final int ABOUT_BUTTON = 5;
+       public static final int SETTING_BUTTON = 6;
+
        String selectedDevice = null;
-       AppDesktopInfo selectedApp = null;
+       AppInfo selectedApp = null;
 
        private Shell shell;
        private static ToolbarArea coolbarArea;
@@ -88,6 +98,8 @@ public class ToolbarArea {
        private DACustomCombo deviceCombo;
        private DACustomCombo appCombo;
 
+       private HashMap<Integer, DACustomButton> buttons = new HashMap<Integer, DACustomButton>();
+
        private DACustomButton startButton;
        private TimerClock timerClock;
        private DACustomButton saveTraceButton;
@@ -118,11 +130,11 @@ public class ToolbarArea {
                this.selectedDevice = selectedDevice;
        }
 
-       public AppDesktopInfo getSelectedApp() {
+       public AppInfo getSelectedApp() {
                return selectedApp;
        }
 
-       public void setSelectedApp(AppDesktopInfo selectedApp) {
+       public void setSelectedApp(AppInfo selectedApp) {
                this.selectedApp = selectedApp;
        }
 
@@ -150,10 +162,12 @@ public class ToolbarArea {
        }
 
        public int setCursor(int oldStyle, int newStyle) {
-               if (oldStyle == newStyle)
+               if (oldStyle == newStyle) {
                        return newStyle;
-               if (null != cursor)
+               }
+               if (null != cursor) {
                        cursor.dispose();
+               }
                cursor = new Cursor(null, newStyle);
                shell.setCursor(cursor);
                return newStyle;
@@ -207,7 +221,7 @@ public class ToolbarArea {
                        public void run() {
                                Project p = AnalyzerManager.getProject();
                                if (null == p || !enabled) {
-                                       replayButton.setEnabled(false);
+                                       replayButton.setButtonEnabled(false);
                                        return;
                                }
 
@@ -215,11 +229,11 @@ public class ToolbarArea {
                                String text = appCombo.getText();
                                if (null != appName && !appName.isEmpty() && !text.isEmpty()
                                                && appName.equals(text)) {
-                                       replayButton.setEnabled(true);
+                                       replayButton.setButtonEnabled(true);
                                        return;
                                }
 
-                               replayButton.setEnabled(false);
+                               replayButton.setButtonEnabled(false);
                        }
                });
        }
@@ -245,24 +259,23 @@ public class ToolbarArea {
                        public void selectionEvent(DACustomCombo combo) {
                                String appName = combo.getText();
                                if (null != appName && !appName.isEmpty()) {
-                                       AppDesktopInfo selectedApp = DACommunicator
-                                                       .getAppDesktopInfoByName(appName);
+                                       AppInfo selectedApp = DACommunicator
+                                                       .getPkgInfoByName(appName);
 
                                        if (null != selectedApp) {
                                                DACommunicator.setSelectedApp(selectedApp);
                                                setSelectedApp(selectedApp);
                                                DACommunicator.getSelectedDevice().setSelectedAppName(
-                                                               selectedApp.getName());
+                                                               selectedApp.getInfo(AppInfo.LABEL_INDEX));
                                        }
 
                                        if (null != DACommunicator.getSelectedDevice()) {
                                                AnalyzerUtil
                                                                .setRecordState(RecordStateSourceProvider.RECORD_READY);
-                                               startButton.setEnabled(true);
+                                               startButton.setButtonEnabled(true);
                                                setRepalyButtonEnable(true);
                                        }
                                }
-
                        }
                });
 
@@ -271,8 +284,7 @@ public class ToolbarArea {
                        @Override
                        public void handleEvent(Event event) {
                                if (!appCombo.isChildShellOpened()) {
-                                       List<AppDesktopInfo> apps = DACommunicator
-                                                       .getAppListFromTarget();
+                                       List<AppInfo> apps = DACommunicator.getAppListFromTarget();
                                        if (apps.isEmpty()) {
                                                return;
                                        }
@@ -280,7 +292,7 @@ public class ToolbarArea {
                                        appCombo.initCombo();
                                        int size = apps.size();
                                        for (int i = 0; i < size; i++) {
-                                               appCombo.add(apps.get(i).getName());
+                                               appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX));
                                        }
                                        appCombo.setText(selectedApp);
                                }
@@ -309,7 +321,7 @@ public class ToolbarArea {
                                                SaveAsDialog dialog = new SaveAsDialog(shell);
                                                int result = dialog.open();
                                                if (AnalyzerConstants.SUCCESS == result) {
-                                                       button.setEnabled(false);
+                                                       button.setButtonEnabled(false);
                                                }
                                        }
                                });
@@ -330,8 +342,7 @@ public class ToolbarArea {
 
                        @Override
                        public void handleClickEvent(DACustomButton button) {
-                               String state = AnalyzerUtil.getRecordState();
-                               if (state.equals(RecordStateSourceProvider.RECORD_READY)) {
+                               if (!AnalyzerManager.isRunning()) {
                                        if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != ReplayTraceHandler.FAILED) {
                                                startTrace();
                                        }
@@ -366,6 +377,9 @@ public class ToolbarArea {
                                        public void handleClickEvent(DACustomButton button) {
                                                // TODO : use for test code...
 
+                                               // DACommunicator.getLocalhost();
+                                               // System.out.println(CommonConstants.LOCAL_HOST);
+
                                                /** for disconnect test **/
                                                // DACommunicator.testDisConnected();
 
@@ -389,12 +403,14 @@ public class ToolbarArea {
                        @Override
                        public void handleClickEvent(DACustomButton button) {
                                if (snapshotButton.isToggled()) {
-                                       ResourceCommunicator
+                                       DACommunicator
                                                        .sendSnapshotMessage(AnalyzerConstants.SNAPSHOT_ON);
                                        ConfigureManager.getInstance().setValue(
                                                        ConfigureLabels.SNAPSHOT, CommonConstants.ON);
                                } else {
-                                       ResourceCommunicator
+                                       DACommunicator
+                                                       .sendSnapshotMessage(AnalyzerConstants.OPT_OFF);
+                                       DACommunicator
                                                        .sendSnapshotMessage(AnalyzerConstants.SNAPSHOT_OFF);
                                        ConfigureManager.getInstance().setValue(
                                                        ConfigureLabels.SNAPSHOT, CommonConstants.OFF);
@@ -421,6 +437,8 @@ public class ToolbarArea {
                        warning.setMessage(AnalyzerLabels.INVALID_APPLICATION);
                        warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
                        warning.open();
+
+                       setToolbarStartStopState(true);
                        return;
                }
                AnalyzerUtil.changePage(TimelinePage.ID);
@@ -443,8 +461,9 @@ public class ToolbarArea {
                startButton = new DACustomButton(parent, ImageResources.START,
                                ImageResources.START_PUSH, ImageResources.START_HOVER,
                                ImageResources.START_DISABLE);
-               startButton.setEnabled(false);
-               startButton.setToolTipText(AnalyzerLabels.START_TRACE);
+               startButton.setButtonEnabled(false);
+               startButton.setToolTipText(ShortCutManager.START_TRACE);
+               buttons.put(START_BUTTON, startButton);
 
                // Creates TimerClock widget.
                timerClock = new TimerClock(parent, SWT.NONE);
@@ -455,32 +474,37 @@ public class ToolbarArea {
                saveTraceButton = new DACustomButton(parent, ImageResources.SAVE,
                                ImageResources.SAVE_PUSH, ImageResources.SAVE_HOVER,
                                ImageResources.SAVE_DISABLE);
-               saveTraceButton.setEnabled(false);
-               saveTraceButton.setToolTipText(AnalyzerLabels.SAVE_TRACE);
+               saveTraceButton.setButtonEnabled(false);
+               saveTraceButton.setToolTipText(ShortCutManager.SAVE_TRACE);
+               buttons.put(SAVE_BUTTON, saveTraceButton);
 
                // // Creates open trace button.
                openTraceButton = new DACustomButton(parent, ImageResources.OPEN,
                                ImageResources.OPEN_PUSH, ImageResources.OPEN_HOVER,
                                ImageResources.OPEN_DISABLE);
-               openTraceButton.setToolTipText(AnalyzerLabels.OPEN_TRACE);
+               openTraceButton.setToolTipText(ShortCutManager.OPEN_TRACE);
+               buttons.put(OPEN_BUTTON, openTraceButton);
 
                // Creates replay button.
                replayButton = new DACustomButton(parent, ImageResources.REPLAY,
                                ImageResources.REPLAY_PUSH, ImageResources.REPLAY_HOVER,
                                ImageResources.REPLAY_DISABLE);
-               replayButton.setToolTipText(AnalyzerLabels.REPLAY);
+               replayButton.setToolTipText(ShortCutManager.REPLAY);
+               buttons.put(REPLAY_BUTTON, replayButton);
 
                // Creates setting button
                settingsButton = new DACustomButton(parent, ImageResources.SETTINGS,
                                ImageResources.SETTINGS_PUSH, ImageResources.SETTINGS_HOVER,
                                ImageResources.SETTINGS_DISABLE);
                settingsButton.setToolTipText(AnalyzerLabels.SETTING);
+               buttons.put(SETTING_BUTTON, settingsButton);
 
                // Creates about button.
                aboutButton = new DACustomButton(parent, ImageResources.ABOUT,
                                ImageResources.ABOUT_PUSH, ImageResources.ABOUT_HOVER,
                                ImageResources.ABOUT_DISABLE);
                aboutButton.setToolTipText(AnalyzerLabels.ABOUT);
+               buttons.put(ABOUT_BUTTON, aboutButton);
 
                // Creates view source button.
                viewSourceButton = new DACustomToggleButton(parent,
@@ -492,6 +516,7 @@ public class ToolbarArea {
                                ImageResources.VIEW_SOURCE_TOGGLE_HOVER,
                                ImageResources.VIEW_SOURCE_TOGGLE_PUSH);
                viewSourceButton.setToolTipText(AnalyzerLabels.VIEW_SOURCE);
+               buttons.put(SOURCE_BUTTON, viewSourceButton);
 
                // Creates snapshot on/off button.
                snapshotButton = new DACustomToggleButton(parent,
@@ -550,23 +575,23 @@ public class ToolbarArea {
                data = new FormData();
                data.top = new FormAttachment(0, 4);
                data.right = new FormAttachment(aboutButton, 0);
-               data.width = 33;
+               data.width = 34;
                data.height = 30;
-               viewSourceButton.setLayoutData(data);
+               settingsButton.setLayoutData(data);
 
                data = new FormData();
                data.top = new FormAttachment(0, 4);
-               data.right = new FormAttachment(viewSourceButton, 0);
-               data.width = 31;
+               data.right = new FormAttachment(settingsButton, -5);
+               data.width = 32;
                data.height = 30;
-               snapshotButton.setLayoutData(data);
+               viewSourceButton.setLayoutData(data);
 
                data = new FormData();
                data.top = new FormAttachment(0, 4);
-               data.right = new FormAttachment(aboutButton, 0);
-               data.width = 0;
-               data.height = 0;
-               settingsButton.setLayoutData(data);
+               data.right = new FormAttachment(viewSourceButton, 0);
+               data.width = 0; // 31
+               data.height = 30;
+               snapshotButton.setLayoutData(data);
 
                /** device and application combo */
                // Creates device combo.
@@ -672,15 +697,12 @@ public class ToolbarArea {
                        return;
                }
                appCombo.setEnabled(true);
-               List<AppDesktopInfo> apps = DACommunicator.getAppListFromTarget();
-               if (apps.isEmpty()) {
-                       return;
-               }
+               List<AppInfo> apps = DACommunicator.getAppListFromTarget();
 
                appCombo.initCombo();
                int size = apps.size();
                for (int i = 0; i < size; i++) {
-                       appCombo.add(apps.get(i).getName());
+                       appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX));
                }
                if (size > 0) {
                        String appName = DACommunicator.getSelectedDevice()
@@ -690,27 +712,32 @@ public class ToolbarArea {
                                setSelectedApp(apps.get(0));
                                DACommunicator.setSelectedApp(apps.get(0));
                                DACommunicator.getSelectedDevice().setSelectedAppName(
-                                               apps.get(0).getName());
+                                               apps.get(0).getInfo(AppInfo.LABEL_INDEX));
                        } else {
-                               AppDesktopInfo appInfo = DACommunicator
-                                               .getAppDesktopInfoByName(appName);
+                               AppInfo appInfo = DACommunicator.getPkgInfoByName(appName);
                                appCombo.setText(appName);
                                setSelectedApp(appInfo);
                                DACommunicator.setSelectedApp(appInfo);
+                               DACommunicator.getSelectedDevice().setSelectedAppName(
+                                               appInfo.getInfo(AppInfo.LABEL_INDEX));
                        }
-                       startButton.setEnabled(true);
+                       startButton.setButtonEnabled(true);
 
                } else {
                        appCombo.add(CommonConstants.EMPTY);
+                       appCombo.select(0);
+                       setSelectedApp(null);
+                       DACommunicator.setSelectedApp(null);
+
                }
        }
 
        public void initToolbarEnablement() {
                deviceCombo.initCombo();
                appCombo.initCombo();
-               startButton.setEnabled(false);
-               replayButton.setEnabled(false);
-               saveTraceButton.setEnabled(false);
+               startButton.setButtonEnabled(false);
+               replayButton.setButtonEnabled(false);
+               saveTraceButton.setButtonEnabled(false);
        }
 
        public void setDeviceComboItems(List<String> items) {
@@ -740,6 +767,7 @@ public class ToolbarArea {
                        appCombo.setEnabled(true);
                        setRepalyButtonEnable(true);
                        setStartButtonEnablement(true);
+                       setSettingsButtonEnablement(true);
                }
        }
 
@@ -757,24 +785,23 @@ public class ToolbarArea {
                                appCombo.add(items.get(i));
                        }
                        appCombo.select(COMBO_FIRST_INDEX);
-                       AppDesktopInfo appInfo = DACommunicator
-                                       .getAppDesktopInfoByName(items.get(0));
+                       AppInfo appInfo = DACommunicator.getPkgInfoByName(items.get(0));
                        DACommunicator.setSelectedApp(appInfo);
                        DACommunicator.getSelectedDevice().setSelectedAppName(
-                                       appInfo.getName());
+                                       appInfo.getInfo(AppInfo.LABEL_INDEX));
                        appCombo.setToolTipText(appCombo.getItem(0));
-                       startButton.setEnabled(true);
+                       startButton.setButtonEnabled(true);
                } else {
                        appCombo.add(CommonConstants.EMPTY);
                }
        }
 
        public void setAppComboText(final String text) {
-               AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByName(text);
+               AppInfo appInfo = DACommunicator.getPkgInfoByName(text);
                if (null != appInfo) {
                        DACommunicator.setSelectedApp(appInfo);
                        DACommunicator.getSelectedDevice().setSelectedAppName(
-                                       appInfo.getName());
+                                       appInfo.getInfo(AppInfo.LABEL_INDEX));
                        Display.getDefault().syncExec(new Runnable() {
                                @Override
                                public void run() {
@@ -785,12 +812,12 @@ public class ToolbarArea {
        }
 
        public void setAppComboTextByAppId(String id) {
-               AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByAppId(id);
+               AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(id);
                if (null != appInfo) {
                        DACommunicator.setSelectedApp(appInfo);
                        DACommunicator.getSelectedDevice().setSelectedAppName(
-                                       appInfo.getName());
-                       appCombo.setText(appInfo.getName());
+                                       appInfo.getInfo(AppInfo.LABEL_INDEX));
+                       appCombo.setText(appInfo.getInfo(AppInfo.LABEL_INDEX));
                }
        }
 
@@ -805,7 +832,11 @@ public class ToolbarArea {
        }
 
        public void setStartButtonEnablement(boolean enabled) {
-               startButton.setEnabled(enabled);
+               startButton.setButtonEnabled(enabled);
+       }
+
+       public void setSettingsButtonEnablement(boolean enabled) {
+               settingsButton.setButtonEnabled(enabled);
        }
 
        private void setStartButtonImagesToStop(boolean isStarted) {
@@ -813,25 +844,25 @@ public class ToolbarArea {
                        startButton.setImages(ImageResources.STOP,
                                        ImageResources.STOP_PUSH, ImageResources.STOP_HOVER,
                                        ImageResources.START_DISABLE);
-                       startButton.setToolTipText(AnalyzerLabels.STOP_TRACE);
+                       startButton.setToolTipText(ShortCutManager.STOP_TRACE);
                } else {
                        startButton.setImages(ImageResources.START,
                                        ImageResources.START_PUSH, ImageResources.START_HOVER,
                                        ImageResources.START_DISABLE);
-                       startButton.setToolTipText(AnalyzerLabels.START_TRACE);
+                       startButton.setToolTipText(ShortCutManager.START_TRACE);
                }
        }
 
        public void setMainControlEnablement(boolean enabled) {
                deviceCombo.setEnabled(enabled);
                appCombo.setEnabled(enabled);
-               saveTraceButton.setEnabled(enabled);
-               openTraceButton.setEnabled(enabled);
+               saveTraceButton.setButtonEnabled(enabled);
+               openTraceButton.setButtonEnabled(enabled);
                setRepalyButtonEnable(enabled);
        }
 
        public void setSnapshotButtonEnablement(boolean enabled) {
-               snapshotButton.setEnabled(enabled);
+               snapshotButton.setButtonEnabled(enabled);
                if (enabled) {
                        String snapshotEnable = ConfigureManager.getInstance().getValue(
                                        ConfigureLabels.SNAPSHOT);
@@ -860,7 +891,7 @@ public class ToolbarArea {
                Display.getDefault().syncExec(new Runnable() {
                        @Override
                        public void run() {
-                               viewSourceButton.setEnabled(enabled);
+                               viewSourceButton.setButtonEnabled(enabled);
                        }
                });
        }
@@ -874,6 +905,10 @@ public class ToolbarArea {
                });
        }
 
+       public boolean getSourceViewState() {
+               return viewSourceButton.isToggled();
+       }
+
        public boolean getSourceViewEnable() {
                int state = viewSourceButton.getState();
                if (state == DACustomButton.STATE_DISABLE) {
@@ -883,7 +918,7 @@ public class ToolbarArea {
        }
 
        public void setSaveButtonEnable(boolean enabled) {
-               saveTraceButton.setEnabled(enabled);
+               saveTraceButton.setButtonEnabled(enabled);
        }
 
        public void setSourceViewTooltip(final String tooltip) {
@@ -899,17 +934,17 @@ public class ToolbarArea {
                if (state == TOOLBAR_STATE_RECORDING) {
                        setStartButtonImagesToStop(true);
                        setMainControlEnablement(false);
-                       startButton.setEnabled(false);
+                       startButton.setButtonEnabled(false);
                        setSnapshotButtonEnablement(false);
                } else {
                        setStartButtonImagesToStop(false);
                        setMainControlEnablement(true);
-                       startButton.setEnabled(true);
+                       startButton.setButtonEnabled(true);
                }
        }
 
        private boolean checkValidApplication() {
-               List<AppDesktopInfo> apps = DACommunicator.getAppListFromTarget();
+               List<AppInfo> apps = DACommunicator.getAppListFromTarget();
                if (apps.isEmpty()) {
                        return false;
                }
@@ -917,7 +952,7 @@ public class ToolbarArea {
                appCombo.initCombo();
                int size = apps.size();
                for (int i = 0; i < size; i++) {
-                       appCombo.add(apps.get(i).getName());
+                       appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX));
                }
                int index = appCombo.getItems().indexOf(selectedApp);
                if (index >= 0) {
@@ -928,4 +963,19 @@ public class ToolbarArea {
                        return false;
                }
        }
+
+       public DACustomButton getButton(int id) {
+               return buttons.get(id);
+       }
+
+       public void setToolbarStartStopState(final boolean isStop) {
+               Display.getDefault().syncExec(new Runnable() {
+                       @Override
+                       public void run() {
+                               ToolbarArea.getInstance().setStartButtonEnablement(isStop);
+                               ToolbarArea.getInstance().setMainControlEnablement(isStop);
+                               ToolbarArea.getInstance().setSettingsButtonEnablement(isStop);
+                       }
+               });
+       }
 }
index 0ae394e..3b57bcc 100644 (file)
@@ -26,6 +26,8 @@
 package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.Rectangle;
@@ -35,10 +37,12 @@ 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.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
 import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
@@ -46,6 +50,7 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
 public class ConfigurationDialog {
+       private static boolean opened = false;
        private Shell parent = null;
        private Shell window = null;
        private DACustomButton applyButton = null;
@@ -54,7 +59,6 @@ public class ConfigurationDialog {
        DAPageComposite topComposite = null;
        DATabComposite tabView = null;
 
-
        public ConfigurationDialog(Shell parent, int style) {
                this.parent = parent;
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
@@ -67,7 +71,7 @@ public class ConfigurationDialog {
                        doApply();
                }
        };
-       
+
        private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
@@ -84,22 +88,36 @@ public class ConfigurationDialog {
                        window.dispose();
                }
        };
-       
+
        private void doApply() {
                ConfigurationDialogValues.getInstance().applySettingValueToConfigFile();
+               DACommunicator.sendSnapshotMessage(DACommunicator.getConfiguration());
        }
-       
+
        private void doBack() {
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
        }
 
        public int open() {
+               if (opened) {
+                       return -1;
+               }
                window = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
                window.setSize(608, 480);
                window.setLayout(new FormLayout());
                window.setText(AnalyzerLabels.CONFIGURATION);
 
-               //banner
+               window.addDisposeListener(new DisposeListener() {
+
+                       @Override
+                       public void widgetDisposed(DisposeEvent e) {
+                               System.out.println("shell disposed!"); //$NON-NLS-1$
+                               opened = false;
+                               ShortCutManager.getInstance().setEnabled(!opened);
+                       }
+               });
+
+               // banner
                Label banner = new Label(window, SWT.TRANSPARENT);
                banner.setBackground(ColorResources.WINDOW_BG_COLOR);
                banner.setImage(ImageResources.CONFIGURATION_BANNER_IMAGE);
@@ -110,11 +128,12 @@ public class ConfigurationDialog {
                labelData.right = new FormAttachment(100, 0);
                labelData.height = 80;
                banner.setLayoutData(labelData);
-               
+
                Composite tabContentsComp = new Composite(window, SWT.NONE);
                FormLayout compLayout = new FormLayout();
                tabContentsComp.setLayout(compLayout);
-               tabContentsComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+               tabContentsComp
+                               .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
 
                FormData compData = new FormData();
                compData = new FormData();
@@ -123,8 +142,8 @@ public class ConfigurationDialog {
                compData.right = new FormAttachment(100, 0);
                compData.bottom = new FormAttachment(100, -50);
                tabContentsComp.setLayoutData(compData);
-               
-               //tab
+
+               // tab
                tabView = new DATabComposite(tabContentsComp, SWT.DOUBLE_BUFFERED);
                tabView.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
                tabView.setTabWidth(120);
@@ -135,13 +154,15 @@ public class ConfigurationDialog {
                compData.right = new FormAttachment(100, 0);
                compData.bottom = new FormAttachment(100, 0);
                tabView.setLayoutData(compData);
-       
-               Composite featuresPage = new ConfigurationDialogFeaturesPage(tabView.getContentComposite(), SWT.NONE);
+
+               Composite featuresPage = new ConfigurationDialogFeaturesPage(
+                               tabView.getContentComposite(), SWT.NONE);
                tabView.addView(featuresPage, false);
 
-               Composite settingPage = new ConfigurationDialogSettingPage(tabView.getContentComposite(), SWT.NONE);
+               Composite settingPage = new ConfigurationDialogSettingPage(
+                               tabView.getContentComposite(), SWT.NONE);
                tabView.addView(settingPage, false);
-               
+
                // button
                Composite buttonContentsComp = new Composite(window, SWT.NONE);
                buttonContentsComp.addPaintListener(new PaintListener() {
@@ -150,12 +171,13 @@ public class ConfigurationDialog {
                                Composite composite = (Composite) e.widget;
                                Rectangle rect = composite.getClientArea();
                                e.gc.setForeground(ColorResources.CONFIGURATION_SUNKEN_LINE_UP_COLOR);
-                               e.gc.drawLine(0, 0, rect.x+ rect.width, 0);
+                               e.gc.drawLine(0, 0, rect.x + rect.width, 0);
                        }
                });
                compLayout = new FormLayout();
                buttonContentsComp.setLayout(compLayout);
-               buttonContentsComp.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+               buttonContentsComp
+                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
 
                compData = new FormData();
                compData.top = new FormAttachment(tabContentsComp, 0);
@@ -185,7 +207,7 @@ public class ConfigurationDialog {
                buttonData.width = 100;
                buttonData.height = 28;
                okButton.setLayoutData(buttonData);
-               
+
                applyButton = new DAButton(buttonContentsComp, SWT.NONE);
                applyButton.addClickListener(applyButtonListener);
                applyButton.setText(AnalyzerLabels.APPLY);
@@ -196,7 +218,9 @@ public class ConfigurationDialog {
                buttonData.width = 100;
                buttonData.height = 28;
                applyButton.setLayoutData(buttonData);
-               
+
+               opened = true;
+               ShortCutManager.getInstance().setEnabled(!opened);
                window.open();
                return 0;
        }
index 2f9c355..e5f934b 100644 (file)
@@ -28,8 +28,6 @@ package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
 
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.PaintEvent;
@@ -93,6 +91,7 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                data = new FormData();
                data.top = new FormAttachment(0, 30);
                data.left= new FormAttachment(0, 5);
+               data.right= new FormAttachment(100, -5);
                data.height = 183;
                tableComp.setLayoutData(data);
                tableComp.setBackground(ColorResources.DIALOG_BG_UPPER);
@@ -109,10 +108,11 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                featuresTable.setTableToolTipEnable(false);
                featuresTable.getTable().addSelectionListener(featureTableSelectionListener);
                featuresTable.getTable().addMouseListener(mouseListener);
-               featuresTable.getTable().addKeyListener(keyListener);
+//             featuresTable.getTable().addKeyListener(keyListener);
                data = new FormData();
                data.top = new FormAttachment(0, 0);
                data.left = new FormAttachment(0, 0);
+               data.right = new FormAttachment(100, 0);
                data.bottom= new FormAttachment(100, 0);
                featuresTable.setLayoutData(data);
                
@@ -170,21 +170,6 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                }
        };
 
-       private KeyListener keyListener = new KeyListener() {
-
-               @Override
-               public void keyReleased(KeyEvent e) {
-                       if (e.keyCode == SWT.DEL) {
-                               // TODO Auto-generated method stub
-                       }
-               }
-
-               @Override
-               public void keyPressed(KeyEvent e) {
-                       // TODO Auto-generated method stub
-               }
-       };
-       
        private void updateDetails() {
                GridItem[] items = featuresTable.getTable().getSelection();
                if (items.length == 0) {
@@ -207,8 +192,6 @@ public class ConfigurationDialogFeaturesPage extends DAPageComposite {
                                        detaillMsg = ConfigureLabels.DETAIL_SNAPSHOT;
                                }else if( featueName.equals(ConfigureLabels.EVENT)){
                                        detaillMsg = ConfigureLabels.DETAIL_EVENT;
-                               }else if( featueName.equals(ConfigureLabels.RECORDING)){
-                                       detaillMsg = ConfigureLabels.DETAIL_RECORDING;
                                }else{
                                        System.out.println("failed undefine features");
                                }
index c0c4b5a..b85119d 100644 (file)
@@ -32,6 +32,7 @@ import org.eclipse.nebula.widgets.grid.GridColumn;
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
@@ -96,9 +97,15 @@ public class ConfigurationDialogFeaturesTable extends DATableComposite {
        }
        
        private String isCheckFeatue(String featueName){
-               if (ConfigurationDialogValues.getInstance().isFeaturesChecked(featueName)){
+               if (AnalyzerConstants.OPT_OFF != ConfigurationDialogValues
+                               .getInstance().featuresChecked(featueName)) {
                        return TRUE;
-               }else{
+               } else if (AnalyzerConstants.OPT_OFF == ConfigurationDialogValues
+                               .getInstance().featuresChecked(featueName)) {
+                       return FALSE;
+               } else // -1
+               {
+                       System.out.println(" check error!!");
                        return FALSE;
                }
        }
index 7bbac55..7d6295f 100644 (file)
@@ -35,6 +35,7 @@ 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.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
@@ -91,8 +92,12 @@ public class ConfigurationDialogFeaturesTableCellRenderer extends
                if (getColumn() == 0) {
                        if (item.getChecked(getColumn())) {
                                checkImg = ImageResources.CHECKBOX_SELECTED;
-                       } else
+                       } else {
                                checkImg = ImageResources.CHECKBOX_UNSELECTED;
+                       }
+                       if (item.getText(1).contains(ConfigureLabels.RECORDING)) { // the recording function determined to be always on.
+                               checkImg = ImageResources.CHECKBOX_SELECTED_DISABLE;
+                       }
                        gc.drawImage(checkImg, 6, getBounds().y + 1);
                }
 
@@ -172,7 +177,9 @@ public class ConfigurationDialogFeaturesTableCellRenderer extends
                GridItem item = (GridItem) value;
                if (event == IInternalWidget.LeftMouseButtonDown) {
                        if (overCheck(item, point)) {
-                               if (item.getChecked() == true) {
+                               if (item.getText(1).contains(ConfigureLabels.RECORDING)) { // the recording function determined to be always on.
+                                       item.setChecked(true);
+                               } else if (item.getChecked() == true) {
                                        item.setChecked(false);
                                } else {
                                        item.setChecked(true);
index 59f033a..821323e 100644 (file)
 package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
-import org.tizen.dynamicanalyzer.common.DesignConstants;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
 import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
 import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
 
 public class ConfigurationDialogSettingPage extends DAPageComposite {
-       public static final String ID = ConfigurationDialogSettingPage.class.getName();
+       public static final String ID = ConfigurationDialogSettingPage.class
+                       .getName();
 
-       private final Image whiteImage = ImageResources.CONFIGURATION_WHITE_IMAGE;
-       private final Image blackImage = ImageResources.CONFIGURATION_BLACK_IMAGE;
-       
-       private DACheckBox whiteRadioButton = null;
-       private DACheckBox blackRadioButton = null;
-       private DACheckBox showInitialRadioButton = null;
-       private DACheckBox autoStopRadioButton = null;
+       private DACheckBox showInitialCheckBox = null;
+       private DACheckBox autoStopCheckBox = null;
 
        public ConfigurationDialogSettingPage(Composite parent, int style) {
 
@@ -60,160 +53,87 @@ public class ConfigurationDialogSettingPage extends DAPageComposite {
                name = AnalyzerLabels.COOLBAR_AREA_CONFIGURATION_SETTING;
                this.setLayout(new FormLayout());
                this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-               
-               //Appearance
-               Label tableTitle = new Label(this, SWT.TRANSPARENT);
-               tableTitle.setText(ConfigureLabels.SETTING_TABLE_TITLE);
-               tableTitle.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-               tableTitle.setForeground(ColorResources.DEFAULT_FONT_COLOR);
-               tableTitle.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
-               
-               FormData data = new FormData();
-               data.top = new FormAttachment(0, 10);
-               data.left = new FormAttachment(0, 8);
-               tableTitle.setLayoutData(data);
-       
-               //white image
-               Label white = new Label(this, SWT.TRANSPARENT);
-               white.setBackground(ColorResources.WINDOW_BG_COLOR);
-               white.setImage(whiteImage);
-               data = new FormData();
-               data.top = new FormAttachment(0, 45);
-               data.left = new FormAttachment(0, 60);
-               data.width = 204;
-               data.height = 150;
-               white.setLayoutData(data);
-               
-               //black image
-               Label black = new Label(this, SWT.TRANSPARENT);
-               black.setBackground(ColorResources.WINDOW_BG_COLOR);
-               black.setImage(blackImage);
-               data = new FormData();
-               data.top = new FormAttachment(0, 45);
-               data.left = new FormAttachment(0, 325);
-               data.width = 204;
-               data.height = 150;
-               black.setLayoutData(data);
-               
-               // white image
-               whiteRadioButton = new DACheckBox(this, SWT.NONE);
-               data = new FormData();
-               data.top = new FormAttachment(0, 200);
-               data.left = new FormAttachment(0, 148);
-               data.height = 20;
-               data.width = DesignConstants.DA_BUTTON_WIDTH + 10;
-               whiteRadioButton.setLayoutData(data);
-               whiteRadioButton.setForeground(ColorResources.BLACK);
-               whiteRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
-               whiteRadioButton.setText(ConfigureLabels.SETTING_WHITE);
-               whiteRadioButton.addSelectionListener(whiteRadioButtonListener);
-               whiteRadioButton.setChecked(ConfigurationDialogValues.getInstance().isWhiteTheme());
-               
-               // black image
-               blackRadioButton = new DACheckBox(this, SWT.NONE);
-               data = new FormData();
-               data.top = new FormAttachment(0, 200);
-               data.left = new FormAttachment(0, 418);
-               data.height = 20;
-               data.width = DesignConstants.DA_BUTTON_WIDTH + 10;
-               blackRadioButton.setLayoutData(data);
-               blackRadioButton.setForeground(ColorResources.BLACK);
-               blackRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
-               blackRadioButton.setText(ConfigureLabels.SETTING_BLACK);
-               blackRadioButton.addSelectionListener(blackRadioButtonListener);
-               blackRadioButton.setChecked(ConfigurationDialogValues.getInstance().isBlackTheme());
-               blackRadioButton.setEnabled(false);
-                       
+
                // Configuration Setting
                Label settingLabel = new Label(this, SWT.TRANSPARENT);
                settingLabel.setText(ConfigureLabels.SETTING_CONFIGURATION_TITLE);
-               settingLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+               settingLabel
+                               .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
                settingLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
                settingLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
-               data = new FormData();
-               data.top = new FormAttachment(0, 230);
-               data.left = new FormAttachment(0, 5);
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 10);
+               data.left = new FormAttachment(0, 8);
                settingLabel.setLayoutData(data);
-               
+
                // SHOW_INITIAL_FEATURE_SETTING
-               showInitialRadioButton = new DACheckBox(this, SWT.NONE);
+               showInitialCheckBox = new DACheckBox(this, SWT.NONE);
                data = new FormData();
-               data.top = new FormAttachment(0, 250);
+               data.top = new FormAttachment(settingLabel, 15);
                data.left = new FormAttachment(0, 22);
                data.height = 20;
                data.width = 20;
-               showInitialRadioButton.setLayoutData(data);
-               showInitialRadioButton.setForeground(ColorResources.BLACK);
-               showInitialRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
-               showInitialRadioButton.setText(ConfigureLabels.SHOW_INITIAL);
-               showInitialRadioButton.addSelectionListener(showInitiaRadioButtonListener);
-               showInitialRadioButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
-               
+               showInitialCheckBox.setLayoutData(data);
+               showInitialCheckBox.setForeground(ColorResources.BLACK);
+               showInitialCheckBox.setBackground(ColorResources.DIALOG_BG_UPPER);
+               showInitialCheckBox.setText(ConfigureLabels.SHOW_INITIAL);
+               showInitialCheckBox.addSelectionListener(showInitiaRadioButtonListener);
+               showInitialCheckBox.setChecked(ConfigurationDialogValues.getInstance()
+                               .isShowInitia());
+
                Label showInitalLabel = new Label(this, SWT.TRANSPARENT);
                showInitalLabel.setText(ConfigureLabels.SHOW_INITIAL);
                showInitalLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
                showInitalLabel.setForeground(ColorResources.BLACK);
                showInitalLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                data = new FormData();
-               data.top = new FormAttachment(0, 252);
+               data.top = new FormAttachment(settingLabel, 17);
                data.left = new FormAttachment(0, 42);
                showInitalLabel.setLayoutData(data);
-                               
-                               
+
                // SHOW_INITIAL_FEATURE_SETTING
-               autoStopRadioButton = new DACheckBox(this, SWT.NONE);
+               autoStopCheckBox = new DACheckBox(this, SWT.NONE);
                data = new FormData();
-               data.top = new FormAttachment(0, 272);
+               data.top = new FormAttachment(settingLabel, 42);
                data.left = new FormAttachment(0, 22);
                data.height = 20;
                data.width = 20;
-               autoStopRadioButton.setLayoutData(data);
-               autoStopRadioButton.setForeground(ColorResources.BLACK);
-               autoStopRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
-               autoStopRadioButton.setText(ConfigureLabels.AUTO_STOP);
-               autoStopRadioButton.addSelectionListener(autoStopRadioButtonListener);
-               autoStopRadioButton.setChecked(ConfigurationDialogValues.getInstance().isAutoStop());
-               
+               autoStopCheckBox.setLayoutData(data);
+               autoStopCheckBox.setForeground(ColorResources.BLACK);
+               autoStopCheckBox.setBackground(ColorResources.DIALOG_BG_UPPER);
+               autoStopCheckBox.setText(ConfigureLabels.AUTO_STOP);
+               autoStopCheckBox.addSelectionListener(autoStopRadioButtonListener);
+               autoStopCheckBox.setChecked(ConfigurationDialogValues.getInstance()
+                               .isAutoStop());
+
                Label autoStopLabel = new Label(this, SWT.TRANSPARENT);
                autoStopLabel.setText(ConfigureLabels.AUTO_STOP);
                autoStopLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
                autoStopLabel.setForeground(ColorResources.BLACK);
                autoStopLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                data = new FormData();
-               data.top = new FormAttachment(0, 274);
+               data.top = new FormAttachment(settingLabel, 44);
                data.left = new FormAttachment(0, 42);
                autoStopLabel.setLayoutData(data);
        }
-       
-       private DACheckboxSelectionListener whiteRadioButtonListener = new DACheckboxSelectionListener() {
-
-               @Override
-               public void handleSelectionEvent(DACheckBox checkbox) {
-                       whiteRadioButton.setChecked(true);
-               }
-       };
-       
-       private DACheckboxSelectionListener blackRadioButtonListener = new DACheckboxSelectionListener() {
 
-               @Override
-               public void handleSelectionEvent(DACheckBox checkbox) {
-                       blackRadioButton.setChecked(false);
-               }
-       };
-       
        private DACheckboxSelectionListener showInitiaRadioButtonListener = new DACheckboxSelectionListener() {
                @Override
                public void handleSelectionEvent(DACheckBox checkbox) {
-                       ConfigurationDialogValues.getInstance().setShowInitia(!ConfigurationDialogValues.getInstance().isShowInitia());
-                       showInitialRadioButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
+                       ConfigurationDialogValues.getInstance().setShowInitia(
+                                       !ConfigurationDialogValues.getInstance().isShowInitia());
+                       showInitialCheckBox.setChecked(ConfigurationDialogValues
+                                       .getInstance().isShowInitia());
                }
        };
-       
+
        private DACheckboxSelectionListener autoStopRadioButtonListener = new DACheckboxSelectionListener() {
                @Override
                public void handleSelectionEvent(DACheckBox checkbox) {
-                       ConfigurationDialogValues.getInstance().setAutoStop(!ConfigurationDialogValues.getInstance().isAutoStop());
-                       autoStopRadioButton.setChecked(ConfigurationDialogValues.getInstance().isAutoStop());
+                       ConfigurationDialogValues.getInstance().setAutoStop(
+                                       !ConfigurationDialogValues.getInstance().isAutoStop());
+                       autoStopCheckBox.setChecked(ConfigurationDialogValues.getInstance()
+                                       .isAutoStop());
                }
        };
 }
\ No newline at end of file
index adb7345..745abdf 100644 (file)
  */
 package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
 
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
 
-
-
 public class ConfigurationDialogValues {
        private static ConfigurationDialogValues instance = null;
 
-       //Features
+       // Features
        private static String[] featuresName = null;
-       private boolean bFunctionProfilingCall = false;
-       private boolean bAllocationCall = true;
-       private boolean bFileCall = true;
-       private boolean bThreadCall = false;
-       private boolean bUserInterfaceCall = true;
-       private boolean bSnapshotCall = true;
-       private boolean bEventCall = true;
-       private boolean bRecordingCall = true;
-       
-       
-       //Configuration
-       private boolean whiteTheme = true;
-       private boolean blackTheme = false;
-
+       private int functionProfilingCall = AnalyzerConstants.OPT_OFF;
+       private int allocationCall = AnalyzerConstants.OPT_ALLOC;
+       private int fileCall = AnalyzerConstants.OPT_FILE;
+       private int threadCall = AnalyzerConstants.OPT_THREAD;
+       private int userInterfaceCall = AnalyzerConstants.OPT_UI;
+       private int snapshotCall = AnalyzerConstants.OPT_OFF;
+       private int eventCall = AnalyzerConstants.OPT_EVENT;
+       private int bRecordingCall = AnalyzerConstants.OPT_RECORD;
+
+       // Configuration
        private boolean showInitia = false;
        private boolean autoStop = false;
-       
+
        private static ConfigureManager mConfig;
        private static final String ON = ConfigureLabels.ON;
        private static final String OFF = ConfigureLabels.OFF;
-       
+
        String[] returnStr = null;
        String strPid = ConfigureManager.getInstance().getValue(
                        ConfigureLabels.SINGLETON_FOCUS_DA_PID);
 
-
        public static ConfigurationDialogValues getInstance() {
                if (null == instance) {
                        instance = new ConfigurationDialogValues();
                        featuresName = new String[] { ConfigureLabels.FUNCTIONPROFILING,
-                                       ConfigureLabels.ALLOCATION,
-                                       ConfigureLabels.FILE,
-                                       ConfigureLabels.THREAD,
-                                       ConfigureLabels.USERINTERFACE,
-                                       ConfigureLabels.SNAPSHOT,
-                                       ConfigureLabels.EVENT,
-                                       ConfigureLabels.RECORDING };
+                                       ConfigureLabels.ALLOCATION, ConfigureLabels.FILE,
+                                       ConfigureLabels.THREAD, ConfigureLabels.USERINTERFACE,
+                                       ConfigureLabels.SNAPSHOT, ConfigureLabels.EVENT };
                        mConfig = ConfigureManager.getInstance();
                }
                return instance;
        }
 
-       //Features
-       public String[] getFeature(){
+       // Features
+       public String[] getFeature() {
                return featuresName;
        }
-       
-       public Boolean isFeaturesChecked(String featues){
-               for (String featueName : ConfigurationDialogValues.getInstance().getFeature()) {
-                       if( featueName.equals(featues)){
-                               if( featueName.equals(ConfigureLabels.FUNCTIONPROFILING)){
-                                       return isbFunctionProfilingCall();
-                               }else if( featueName.equals(ConfigureLabels.ALLOCATION)){
-                                       return isbAllocationCall();
-                               }else if( featueName.equals(ConfigureLabels.FILE)){
-                                       return isbFileCall();
-                               }else if( featueName.equals(ConfigureLabels.THREAD)){
-                                       return isbThreadCall();
-                               }else if( featueName.equals(ConfigureLabels.USERINTERFACE)){
-                                       return isbUserInterfaceCall();
-                               }else if( featueName.equals(ConfigureLabels.SNAPSHOT)){
-                                       return isbSnapshotCall();
-                               }else if( featueName.equals(ConfigureLabels.EVENT)){
-                                       return isbEventCall();
-                               }else if( featueName.equals(ConfigureLabels.RECORDING)){
-                                       return isbRecordingCall();
-                               }else{
+
+       public int featuresChecked(String featues) {
+               for (String featueName : ConfigurationDialogValues.getInstance()
+                               .getFeature()) {
+                       if (featueName.equals(featues)) {
+                               if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+                                       return getFunctionProfilingCall();
+                               } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
+                                       return getAllocationCall();
+                               } else if (featueName.equals(ConfigureLabels.FILE)) {
+                                       return getFileCall();
+                               } else if (featueName.equals(ConfigureLabels.THREAD)) {
+                                       return getThreadCall();
+                               } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
+                                       return getUserInterfaceCall();
+                               } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
+                                       return getSnapshotCall();
+                               } else if (featueName.equals(ConfigureLabels.EVENT)) {
+                                       return getEventCall();
+                               } else {
                                        System.out.println("failed undefine features");
                                }
                        }
                }
-               return null;
+               return -1;
        }
-       
-       public Boolean setFeaturesChecked(String featues, boolean status){
-               for (String featueName : ConfigurationDialogValues.getInstance().getFeature()) {
-                       if( featueName.equals(featues)){
-                               if( featueName.equals(ConfigureLabels.FUNCTIONPROFILING)){
-                                       setbFunctionProfilingCall(status);
-                               }else if( featueName.equals(ConfigureLabels.ALLOCATION)){
-                                       setbAllocationCall(status);
-                               }else if( featueName.equals(ConfigureLabels.FILE)){
-                                       setbFileCall(status);
-                               }else if( featueName.equals(ConfigureLabels.THREAD)){
-                                       setbThreadCall(status);
-                               }else if( featueName.equals(ConfigureLabels.USERINTERFACE)){
-                                       setbUserInterfaceCall(status);
-                               }else if( featueName.equals(ConfigureLabels.SNAPSHOT)){
-                                       setbSnapshotCall(status);
-                               }else if( featueName.equals(ConfigureLabels.EVENT)){
-                                       setbEventCall(status);
-                               }else if( featueName.equals(ConfigureLabels.RECORDING)){
-                                       setbRecordingCall(status);
-                               }else{
+
+       public void setFeaturesChecked(String featues, boolean status) {
+               for (String featueName : ConfigurationDialogValues.getInstance()
+                               .getFeature()) {
+                       if (featueName.equals(featues)) {
+                               int value = AnalyzerConstants.OPT_OFF;
+                               if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_FUNC;
+                                       }
+                                       setFunctionProfilingCall(value);
+                               } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_ALLOC;
+                                       }
+                                       setAllocationCall(value);
+                               } else if (featueName.equals(ConfigureLabels.FILE)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_FILE;
+                                       }
+                                       setFileCall(value);
+                               } else if (featueName.equals(ConfigureLabels.THREAD)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_THREAD;
+                                       }
+                                       setThreadCall(value);
+                               } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_UI;
+                                       }
+                                       setUserInterfaceCall(value);
+                               } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_SNAPSHOT;
+                                       }
+                                       setSnapshotCall(value);
+                               } else if (featueName.equals(ConfigureLabels.EVENT)) {
+                                       if (status) {
+                                               value = AnalyzerConstants.OPT_EVENT;
+                                       }
+                                       setEventCall(value);
+                               } else {
                                        System.out.println("failed undefine features");
                                }
                        }
                }
-               return null;
        }
-       
+
        public void setSettingValueFromConfigFile() {
-               
-               //Table Feature
-               
-               for (String featueName : ConfigurationDialogValues.getInstance()
+
+               // Table Feature
+               for (String featureName : ConfigurationDialogValues.getInstance()
                                .getFeature()) {
-                       boolean featuresStatus = true;
-                       if (mConfig.getValue(featueName).equals(ON)) {
-                               featuresStatus = true;
-                       } else {
-                               featuresStatus = false;
+
+                       int featuresStatus = 0;
+                       try {
+                               featuresStatus = Integer
+                                               .parseInt(mConfig.getValue(featureName));
+                       } catch (NumberFormatException e) {
+                               e.printStackTrace();
                        }
-                       if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
-                               setbFunctionProfilingCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
-                               setbAllocationCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.FILE)) {
-                               setbFileCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.THREAD)) {
-                               setbThreadCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
-                               setbUserInterfaceCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
-                               setbSnapshotCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.EVENT)) {
-                               setbEventCall(featuresStatus);
-                       } else if (featueName.equals(ConfigureLabels.RECORDING)) {
+                       if (featureName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+                               setFunctionProfilingCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.ALLOCATION)) {
+                               setAllocationCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.FILE)) {
+                               setFileCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.THREAD)) {
+                               setThreadCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.USERINTERFACE)) {
+                               setUserInterfaceCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.SNAPSHOT)) {
+                               setSnapshotCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.EVENT)) {
+                               setEventCall(featuresStatus);
+                       } else if (featureName.equals(ConfigureLabels.RECORDING)) {
                                setbRecordingCall(featuresStatus);
                        } else {
                                System.out.println("failed undefine features");
                        }
                }
-               
-               //Setting
+
+               // Setting
                if (mConfig.getValue(ConfigureLabels.SHOW_INITIAL).equals(ON)) {
                        setShowInitia(true);
                } else {
@@ -182,13 +192,12 @@ public class ConfigurationDialogValues {
                        setAutoStop(false);
                }
        }
-       
-       
-       private void setConfig(boolean featureStatus, String featureName){
+
+       private void setConfig(boolean featureStatus, String featureName) {
                String applyStatus = CommonConstants.EMPTY;
-               if (featureStatus){
+               if (featureStatus) {
                        applyStatus = ON;
-               }else{
+               } else {
                        applyStatus = OFF;
                }
                String preStatus = mConfig.getValue(featureName);
@@ -200,205 +209,196 @@ public class ConfigurationDialogValues {
                        }
                }
        }
-       
+
+       private void setConfig(int featureStatus, String featureName) {
+               mConfig.setValue(featureName, Integer.toString(featureStatus));
+       }
 
        public void applySettingValueToConfigFile() {
 
                applySettingValueToDA();
-               
-               //Table Feature
+
+               // Table Feature
                for (String featueName : ConfigurationDialogValues.getInstance()
                                .getFeature()) {
                        if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
-                               setConfig(isbFunctionProfilingCall(),featueName);
+                               setConfig(getFunctionProfilingCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
-                               setConfig(isbAllocationCall(),featueName);
+                               setConfig(getAllocationCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.FILE)) {
-                               setConfig(isbFileCall(),featueName);
+                               setConfig(getFileCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.THREAD)) {
-                               setConfig(isbThreadCall(),featueName);
+                               setConfig(getThreadCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
-                               setConfig(isbUserInterfaceCall(),featueName);
+                               setConfig(getUserInterfaceCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
-                               setConfig(isbSnapshotCall(),featueName);
+                               setConfig(getSnapshotCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.EVENT)) {
-                               setConfig(isbEventCall(),featueName);
+                               setConfig(getEventCall(), featueName);
                        } else if (featueName.equals(ConfigureLabels.RECORDING)) {
-                               setConfig(isbRecordingCall(),featueName);
+                               setConfig(isbRecordingCall(), featueName);
                        } else {
                                System.out.println("failed undefine features");
                        }
                }
-               //Setting
+               // Setting
                setConfig(isShowInitia(), ConfigureLabels.SHOW_INITIAL);
                setConfig(isAutoStop(), ConfigureLabels.AUTO_STOP);
        }
-       
-       private boolean isChangeFeatuesValues(boolean featureStatus, String featureName){
+
+       private boolean isChangeFeatuesValues(int featureStatus, String featureName) {
+               String preStatus = mConfig.getValue(featureName);
+
+               if (featureStatus == Integer.parseInt(preStatus)) {
+                       return true;
+               }
+               return false;
+       }
+
+       private boolean isChangeFeatuesValues(boolean featureStatus,
+                       String featureName) {
                String applyStatus = CommonConstants.EMPTY;
-               if (featureStatus){
+               if (featureStatus) {
                        applyStatus = ON;
-               }else{
+               } else {
                        applyStatus = OFF;
                }
                String preStatus = mConfig.getValue(featureName);
                if (applyStatus.equals(preStatus) == false) {
                        return true;
-               }else{
+               } else {
                        return false;
                }
        }
-       
+
        public void applySettingValueToDA() {
-               
-               //Table Feature
-               for (String featueName : ConfigurationDialogValues.getInstance().getFeature()) {
+
+               // Table Feature
+               for (String featueName : ConfigurationDialogValues.getInstance()
+                               .getFeature()) {
                        if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
-                               if(isChangeFeatuesValues(isbFunctionProfilingCall(),featueName)){
+                               if (isChangeFeatuesValues(getFunctionProfilingCall(),
+                                               featueName)) {
                                        System.out.println("change valuse FUNCTIONPROFILING");
                                }
                        } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
-                               if(isChangeFeatuesValues(isbAllocationCall(),featueName)){
+                               if (isChangeFeatuesValues(getAllocationCall(), featueName)) {
                                        System.out.println("change valuse ALLOCATION");
                                }
                        } else if (featueName.equals(ConfigureLabels.FILE)) {
-                               if(isChangeFeatuesValues(isbFileCall(),featueName)){
+                               if (isChangeFeatuesValues(getFileCall(), featueName)) {
                                        System.out.println("change valuse FILE");
                                }
                        } else if (featueName.equals(ConfigureLabels.THREAD)) {
-                               if(isChangeFeatuesValues(isbThreadCall(),featueName)){
+                               if (isChangeFeatuesValues(getThreadCall(), featueName)) {
                                        System.out.println("change valuse THREAD");
                                }
                        } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
-                               if(isChangeFeatuesValues(isbUserInterfaceCall(),featueName)){
+                               if (isChangeFeatuesValues(getUserInterfaceCall(), featueName)) {
                                        System.out.println("change valuse USERINTERFACE");
                                }
                        } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
-                               if(isChangeFeatuesValues(isbSnapshotCall(),featueName)){
+                               if (isChangeFeatuesValues(getSnapshotCall(), featueName)) {
                                        System.out.println("change valuse SNAPSHOT");
                                }
                        } else if (featueName.equals(ConfigureLabels.EVENT)) {
-                               if(isChangeFeatuesValues(isbEventCall(),featueName)){
+                               if (isChangeFeatuesValues(getEventCall(), featueName)) {
                                        System.out.println("change valuse EVENT");
                                }
                        } else if (featueName.equals(ConfigureLabels.RECORDING)) {
-                               if(isChangeFeatuesValues(isbRecordingCall(),featueName)){
+                               if (isChangeFeatuesValues(isbRecordingCall(), featueName)) {
                                        System.out.println("change valuse RECORDING");
                                }
                        } else {
                                System.out.println("failed undefine features");
                        }
                }
-               //Setting
-               if(isChangeFeatuesValues(isShowInitia(), ConfigureLabels.SHOW_INITIAL)){
+               // Setting
+               if (isChangeFeatuesValues(isShowInitia(), ConfigureLabels.SHOW_INITIAL)) {
                        System.out.println("change valuse SHOW_INITIAL");
                }
-               if(isChangeFeatuesValues(isAutoStop(), ConfigureLabels.AUTO_STOP)){
+               if (isChangeFeatuesValues(isAutoStop(), ConfigureLabels.AUTO_STOP)) {
                        System.out.println("change valuse AUTO_STOP");
                }
        }
 
-       
-       public boolean isbFunctionProfilingCall() {
-               return bFunctionProfilingCall;
+       public int getFunctionProfilingCall() {
+               return functionProfilingCall;
        }
 
-       public void setbFunctionProfilingCall(boolean bFunctionProfilingCall) {
-               this.bFunctionProfilingCall = bFunctionProfilingCall;
+       public void setFunctionProfilingCall(int functionProfilingCall) {
+               this.functionProfilingCall = functionProfilingCall;
        }
 
-       public boolean isbAllocationCall() {
-               return bAllocationCall;
+       public int getAllocationCall() {
+               return allocationCall;
        }
 
-       public void setbAllocationCall(boolean bAllocationCall) {
-               this.bAllocationCall = bAllocationCall;
+       public void setAllocationCall(int allocationCall) {
+               this.allocationCall = allocationCall;
        }
 
-       public boolean isbFileCall() {
-               return bFileCall;
+       public int getFileCall() {
+               return fileCall;
        }
 
-       public void setbFileCall(boolean bFileCall) {
-               this.bFileCall = bFileCall;
+       public void setFileCall(int fileCall) {
+               this.fileCall = fileCall;
        }
 
-       public boolean isbThreadCall() {
-               return bThreadCall;
+       public int getThreadCall() {
+               return threadCall;
        }
 
-       public void setbThreadCall(boolean bThreadCall) {
-               this.bThreadCall = bThreadCall;
+       public void setThreadCall(int threadCall) {
+               this.threadCall = threadCall;
        }
 
-       public boolean isbUserInterfaceCall() {
-               return bUserInterfaceCall;
+       public int getUserInterfaceCall() {
+               return userInterfaceCall;
        }
 
-       public void setbUserInterfaceCall(boolean bUserInterfaceCall) {
-               this.bUserInterfaceCall = bUserInterfaceCall;
+       public void setUserInterfaceCall(int userInterfaceCall) {
+               this.userInterfaceCall = userInterfaceCall;
        }
 
-       public boolean isbSnapshotCall() {
-               return bSnapshotCall;
+       public int getSnapshotCall() {
+               return snapshotCall;
        }
 
-       public void setbSnapshotCall(boolean bSnapshotCall) {
-               this.bSnapshotCall = bSnapshotCall;
+       public void setSnapshotCall(int snapshotCall) {
+               this.snapshotCall = snapshotCall;
        }
 
-       public boolean isbEventCall() {
-               return bEventCall;
+       public int getEventCall() {
+               return eventCall;
        }
 
-       public void setbEventCall(boolean bEventCall) {
-               this.bEventCall = bEventCall;
+       public void setEventCall(int eventCall) {
+               this.eventCall = eventCall;
        }
 
-       public boolean isbRecordingCall() {
+       public int isbRecordingCall() {
                return bRecordingCall;
        }
 
-       public void setbRecordingCall(boolean bRecordingCall) {
+       public void setbRecordingCall(int bRecordingCall) {
                this.bRecordingCall = bRecordingCall;
        }
-       
-
-       //Configuration
-       public boolean isWhiteTheme() {
-               return whiteTheme;
-       }
-
-       public void setWhiteTheme(boolean whiteTheme) {
-               this.whiteTheme = whiteTheme;
-       }
-
-
-       public boolean isBlackTheme() {
-               return blackTheme;
-       }
-
-
-       public void setBlackTheme(boolean blackTheme) {
-               this.blackTheme = blackTheme;
-       }
-
 
+       // Configuration
        public boolean isShowInitia() {
                return showInitia;
        }
 
-
        public void setShowInitia(boolean showInitia) {
                this.showInitia = showInitia;
        }
 
-
        public boolean isAutoStop() {
                return autoStop;
        }
 
-
        public void setAutoStop(boolean autoStop) {
                this.autoStop = autoStop;
        }
index ab0d244..8054cb0 100644 (file)
@@ -28,15 +28,16 @@ package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.events.ShellListener;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
+import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
@@ -56,7 +57,7 @@ public class WelcomeDialog {
        private DACustomButton cancelButton = null;
        DAPageComposite topComposite = null;
        private DACheckBox useAgainCheckButton = null;
-       private boolean returnType = false;
+       private boolean returnType = true;
 
        public WelcomeDialog(Shell parent, int style) {
                this.parent = parent;
@@ -79,23 +80,25 @@ public class WelcomeDialog {
                        window.dispose();
                }
        };
-       
+
        private void doApply() {
-               returnType = true;
                ConfigurationDialogValues.getInstance().applySettingValueToConfigFile();
+               notifyAutoRun();
        }
-       
+
        private void doBack() {
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
+               notifyAutoRun();
        }
-
+       
        public boolean open() {
+               IDECommunicator.setOpenWelcomeDlg(true);
                window = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
                window.setSize(608, 460);
                window.setLayout(new FormLayout());
-               window.setText(AnalyzerLabels.CONFIGURATION);
+               window.setText(AnalyzerLabels.WELCOME);
 
-               //banner
+               // banner
                Label banner = new Label(window, SWT.TRANSPARENT);
                banner.setBackground(ColorResources.WINDOW_BG_COLOR);
                banner.setImage(ImageResources.WELCONE_BANNER_IMAGE);
@@ -107,11 +110,11 @@ public class WelcomeDialog {
                labelData.height = 80;
                banner.setLayoutData(labelData);
 
-               
                Composite contentsComp = new Composite(window, SWT.NONE);
                FormLayout compLayout = new FormLayout();
                contentsComp.setLayout(compLayout);
-               contentsComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+               contentsComp
+                               .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
 
                FormData compData = new FormData();
                compData = new FormData();
@@ -120,9 +123,9 @@ public class WelcomeDialog {
                compData.right = new FormAttachment(100, 0);
                compData.bottom = new FormAttachment(100, -51);
                contentsComp.setLayoutData(compData);
-               
+
                new ConfigurationDialogFeaturesPage(contentsComp, SWT.NONE);
-               
+
                // button
                Composite buttonContentsComp = new Composite(window, SWT.NONE);
                buttonContentsComp.addPaintListener(new PaintListener() {
@@ -131,12 +134,13 @@ public class WelcomeDialog {
                                Composite composite = (Composite) e.widget;
                                Rectangle rect = composite.getClientArea();
                                e.gc.setForeground(ColorResources.CONFIGURATION_SUNKEN_LINE_UP_COLOR);
-                               e.gc.drawLine(0, 0, rect.x+ rect.width, 0);
+                               e.gc.drawLine(0, 0, rect.x + rect.width, 0);
                        }
                });
                compLayout = new FormLayout();
                buttonContentsComp.setLayout(compLayout);
-               buttonContentsComp.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+               buttonContentsComp
+                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
 
                compData = new FormData();
                compData.top = new FormAttachment(contentsComp, 0);
@@ -144,7 +148,7 @@ public class WelcomeDialog {
                compData.right = new FormAttachment(100, 0);
                compData.bottom = new FormAttachment(100, 0);
                buttonContentsComp.setLayoutData(compData);
-               
+
                // ask use again image
                useAgainCheckButton = new DACheckBox(buttonContentsComp, SWT.NONE);
                FormData data = new FormData();
@@ -154,21 +158,24 @@ public class WelcomeDialog {
                data.width = 20;
                useAgainCheckButton.setLayoutData(data);
                useAgainCheckButton.setForeground(ColorResources.BLACK);
-               useAgainCheckButton.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+               useAgainCheckButton
+                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
                useAgainCheckButton.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
                useAgainCheckButton.addSelectionListener(useAgainCheckbuttonListener);
-               useAgainCheckButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
-               
+               useAgainCheckButton.setChecked(ConfigurationDialogValues.getInstance()
+                               .isShowInitia());
+
                Label useAgainLabel = new Label(buttonContentsComp, SWT.TRANSPARENT);
                useAgainLabel.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
-               useAgainLabel.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+               useAgainLabel
+                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
                useAgainLabel.setForeground(ColorResources.BLACK);
                useAgainLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                data = new FormData();
                data.top = new FormAttachment(0, 17);
                data.left = new FormAttachment(0, 30);
                useAgainLabel.setLayoutData(data);
-               
+
                cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
                cancelButton.addClickListener(cancelButtonListener);
                cancelButton.setText(AnalyzerLabels.CANCEL);
@@ -190,24 +197,59 @@ public class WelcomeDialog {
                buttonData.width = 100;
                buttonData.height = 28;
                okButton.setLayoutData(buttonData);
-
+               window.addShellListener(shellListener);
                window.open();
+               return returnType;
+       }
 
-               Display display = PlatformUI.createDisplay();
+       private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
+               @Override
+               public void handleSelectionEvent(DACheckBox checkbox) {
+                       ConfigurationDialogValues.getInstance().setShowInitia(
+                                       !ConfigurationDialogValues.getInstance().isShowInitia());
+                       useAgainCheckButton.setChecked(ConfigurationDialogValues
+                                       .getInstance().isShowInitia());
+               }
+       };
 
-               while (!window.isDisposed()) {
-                       if (!display.readAndDispatch())
-                               display.sleep();
+       private void notifyAutoRun() {
+               synchronized (IDECommunicator.getWaitingWelcomeDlg()) {
+                       IDECommunicator.getWaitingWelcomeDlg().notifyAll();
                }
-               window.dispose();
-               return returnType;
+               IDECommunicator.setOpenWelcomeDlg(false);
        }
        
-       private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
+       private ShellListener shellListener = new ShellListener() {
+
                @Override
-               public void handleSelectionEvent(DACheckBox checkbox) {
-                       ConfigurationDialogValues.getInstance().setShowInitia(!ConfigurationDialogValues.getInstance().isShowInitia());
-                       useAgainCheckButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
+               public void shellActivated(ShellEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               @Override
+               public void shellClosed(ShellEvent e) {
+                       // TODO Auto-generated method stub
+                       notifyAutoRun();
+               }
+
+               @Override
+               public void shellDeactivated(ShellEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               @Override
+               public void shellDeiconified(ShellEvent e) {
+                       // TODO Auto-generated method stub
+
                }
+
+               @Override
+               public void shellIconified(ShellEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
        };
 }
index 9348562..1341c66 100644 (file)
@@ -58,6 +58,7 @@ import org.tizen.dynamicanalyzer.common.DesignConstants;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.sql.SqlManager;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
 import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
@@ -122,6 +123,7 @@ public class OpenTraceDialog extends DAMessageBox {
                        public void widgetDisposed(DisposeEvent e) {
                                System.out.println("shell disposed!"); //$NON-NLS-1$
                                opened = false;
+                               ShortCutManager.getInstance().setEnabled(!opened);
                        }
                });
 
@@ -279,6 +281,7 @@ public class OpenTraceDialog extends DAMessageBox {
                saveTable.updateTable();
                tempTable.updateTable();
                opened = true;
+               ShortCutManager.getInstance().setEnabled(!opened);
                return result;
        }
 
@@ -506,7 +509,7 @@ public class OpenTraceDialog extends DAMessageBox {
        private boolean setDetailsInfo(String path) {
                boolean isSuccess = true;
                        List<String> pInfo = SqlManager.getInstance().getDetailsInfo(path);
-                       if( pInfo == null){
+                       if (null == pInfo || pInfo.isEmpty()) {
                                isSuccess = false;
                        }
                        createTime = pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
index 7946789..e3cd050 100644 (file)
@@ -30,6 +30,7 @@ import java.util.List;
 
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.logparser.LogParser;
 import org.tizen.dynamicanalyzer.logparser.Logs;
@@ -76,23 +77,53 @@ public class OpenTraceInputReader implements Runnable {
        public void run() {
                LogParser.setLogParsingComplete(false);
                Project p = AnalyzerManager.getProject();
+               long last = p.getLastLogNum(LogCenterConstants.LOG_RESOURCE);
+               createPackage(last, LogCenterConstants.LOG_RESOURCE);
+
+               last = p.getLastLogNum(LogCenterConstants.LOG_DEVICE);
+               createPackage(last, LogCenterConstants.LOG_DEVICE);
+
+               last = p.getLastLogNum(LogCenterConstants.LOG_PROFILING);
+               createPackage(last, LogCenterConstants.LOG_PROFILING);
+
+               System.out.println("input reader complete"); //$NON-NLS-1$
+               LogParser.setLogParsingComplete(true);
+               // end
+       }
+
+       private void createPackage(long last, int type) {
                List<LogCenter> logCenters = AnalyzerManager.getLogCenters();
                List<List<String>> input = null;
                LogPackage logPackage = new LogPackage();
-               int last = Integer.parseInt(p.getLastLogNum());
-               int from = 0;
-               int to = AnalyzerConstants.DATABASE_READ_SIZE;
+               long from = 0;
+               long to = AnalyzerConstants.DATABASE_READ_SIZE;
                while (!Thread.interrupted()) {
                        if (to >= last) {
                                to = last;
                        }
-                       int size = logCenters.size();
-                       for (int i = 0; i < size; i++) {
-                               Logs logs = new Logs(logCenters.get(i).getId());
-                               input = SqlManager.getInstance().selectArea(logCenters.get(i), from, to);
+                       if (type == LogCenterConstants.LOG_PROFILING
+                                       || type == LogCenterConstants.LOG_DEVICE) {
+                               Logs logs = new Logs(type);
+                               LogCenter logc = AnalyzerManager.getLogCenterById(type);
+                               input = SqlManager.getInstance().selectArea(logc, from, to);
                                logs.setLogs(input);
-                               logPackage.setLogs(logCenters.get(i).getId(), logs);
-                       } // for
+                               logPackage.setLogs(type, logs);
+                       } else {
+                               int size = logCenters.size();
+                               for (int i = 0; i < size; i++) {
+                                       int id = logCenters.get(i).getId();
+                                       if (id == LogCenterConstants.LOG_PROFILING
+                                                       || id == LogCenterConstants.LOG_DEVICE) {
+                                               continue;
+                                       }
+                                       Logs logs = new Logs(id);
+                                       input = SqlManager.getInstance().selectArea(
+                                                       logCenters.get(i), from, to);
+                                       logs.setLogs(input);
+                                       logPackage.setLogs(logCenters.get(i).getId(), logs);
+                               } // for
+                       }
+
                        updateLog(logPackage);
                        if (to == last) {
                                break;
@@ -100,9 +131,6 @@ public class OpenTraceInputReader implements Runnable {
                        from += AnalyzerConstants.DATABASE_READ_SIZE + 1;
                        to = from + AnalyzerConstants.DATABASE_READ_SIZE;
                }
-               System.out.println("input reader complete"); //$NON-NLS-1$
-               LogParser.setLogParsingComplete(true);
-               // end
        }
 
        private void updateLog(LogPackage logPack) {
index dc78549..5297d3e 100644 (file)
@@ -126,10 +126,10 @@ public class TempFilesTable extends DATableComposite {
 
        private String getCreateTime(String path) {
                List<String> pInfo = SqlManager.getInstance().getDetailsInfo(path);
-               if (!pInfo.isEmpty()) {
-                       return pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
-               }else{
+               if (null == pInfo || pInfo.isEmpty()) {
                        return null;
+               }else{
+                       return pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
                }
        }
 }
index c42d984..f6ce33e 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
 import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -48,6 +49,7 @@ public class UIPage extends DAPageComposite {
        public UIPage(Composite parent, int style) {
                super(parent, style);
                name = AnalyzerLabels.COOLBAR_AREA_UI;
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_UI_TOOLTIP);
                this.setLayout(new FillLayout());
                baseForm = new SashForm(this, SWT.VERTICAL);
                baseForm.setLayout(new FillLayout());
index 7224846..4852d50 100644 (file)
@@ -55,51 +55,7 @@ public class UIControlListDataChecker {
                                return;
                        }
 
-                       UIControlListData controlData = new UIControlListData(input);
-
-                       controlData.setSequence(input
-                                       .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
-
-                       controlData.setTime(input.get(LogCenterConstants.TIME_INDEX));
-
-                       controlData.setAPIName(stClassName);
-
-                       controlData.setInitializeTime(CommonConstants.DASH);
-                       controlData.setTerminateTime(CommonConstants.DASH);
-
-                       controlData
-                                       .setParentName(input
-                                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_NAME_INDEX));
-                       controlData
-                                       .setParentClassName(input
-                                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_CLASS_NAME_INDEX));
-                       controlData
-                                       .setParentPointer(input
-                                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_POINTER_INDEX));
-
-                       controlData
-                                       .setChildName(input
-                                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX));
-
-                       StringBuilder childClassNameDemangling = new StringBuilder(
-                                       input.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX));
-
-                       childClassNameDemangling.insert(0, "_Z");//$NON-NLS-1$
-                       String childClassName = SymbolManager
-                                       .demanglingFunctionName(childClassNameDemangling.toString());
-
-                       controlData.setChildClassName(childClassName);
-                       controlData
-                                       .setChildPointer(input
-                                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_POINTER_INDEX));
-
-                       controlData
-                                       .setControlType(input
-                                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX));
-
-                       controlData.setCalssKeyName(getClassName(input));
-
-                       addSortData(controlData);
+                       addSortData(makeUIControlListData(input));
                        setUIControlListTimeData();
 
                        preSeq = input.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
@@ -117,6 +73,54 @@ public class UIControlListDataChecker {
                }
        }
 
+       private UIControlListData makeUIControlListData(List<String> input) {
+               UIControlListData controlData = new UIControlListData(input);
+
+               controlData.setSequence(input
+                               .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+
+               controlData.setTime(input.get(LogCenterConstants.TIME_INDEX));
+
+               controlData.setAPIName(getClassName(
+                               input.get(LogCenterConstants.APINAME_INDEX)).trim());
+
+               controlData.setInitializeTime(CommonConstants.DASH);
+               controlData.setTerminateTime(CommonConstants.DASH);
+
+               controlData
+                               .setParentName(input
+                                               .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_NAME_INDEX));
+               controlData
+                               .setParentClassName(input
+                                               .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_CLASS_NAME_INDEX));
+               controlData
+                               .setParentPointer(input
+                                               .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_POINTER_INDEX));
+
+               controlData
+                               .setChildName(input
+                                               .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX));
+
+               StringBuilder childClassNameDemangling = new StringBuilder(
+                               input.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX));
+
+               childClassNameDemangling.insert(0, "_Z");//$NON-NLS-1$
+               String childClassName = SymbolManager
+                               .demanglingFunctionName(childClassNameDemangling.toString());
+
+               controlData.setChildClassName(childClassName);
+               controlData
+                               .setChildPointer(input
+                                               .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_POINTER_INDEX));
+
+               controlData
+                               .setControlType(input
+                                               .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX));
+
+               controlData.setCalssKeyName(getClassName(input));
+               return controlData;
+       }
+
        private boolean isExistData(String parentClassNam, String childClassName) {
                if (getRemoveCallControlList() == null) {
                        return false;
@@ -181,37 +185,42 @@ public class UIControlListDataChecker {
                                        splitProfilingList[0].trim());
                        String strProfilingAPIName = new String(
                                        splitProfilingList[splitProfilingList.length - 1].trim());
-                       for (int j = 0; j < getDataList().size(); j++) {
+                       int dataSize = getDataList().size();
+                       for (int j = 0; j < dataSize; j++) {
                                if (getDataList().get(j).getChildClassName().trim()
                                                .contains(strProfilingClassName)) {
-                                       if (strProfilingAPIName.trim().contains("OnInitializing")) { //$NON-NLS-1$
-                                               getDataList().get(j).setInitializeTime(
-                                                               controlList.get(i).getExclEsapsedTime());
-                                       } else if (strProfilingAPIName.trim().contains(
-                                                       "OnTerminating")) { //$NON-NLS-1${
-                                               getDataList().get(j).setTerminateTime(
-                                                               controlList.get(i).getExclEsapsedTime());
+                                       if (i < controlList.size()) {
+                                               if (strProfilingAPIName.trim().contains(
+                                                               "OnInitializing")) { //$NON-NLS-1$
+                                                       getDataList().get(j).setInitializeTime(
+                                                                       controlList.get(i).getExclEsapsedTime());
+                                               } else if (strProfilingAPIName.trim().contains(
+                                                               "OnTerminating")) { //$NON-NLS-1${
+                                                       getDataList().get(j).setTerminateTime(
+                                                                       controlList.get(i).getExclEsapsedTime());
+                                               }
                                        }
                                }
                        }
                }
        }
 
-       private String getDemanglingName(String uiClassName){
+       private String getDemanglingName(String uiClassName) {
                String demangleName = CommonConstants.EMPTY;
                StringBuilder childClassNameDemangling = new StringBuilder(uiClassName);
-               if (childClassNameDemangling.indexOf("_Z") != 0){//$NON-NLS-1$
+               if (childClassNameDemangling.indexOf("_Z") != 0) {//$NON-NLS-1$
                        childClassNameDemangling.insert(0, "_Z");//$NON-NLS-1$
                        demangleName = SymbolManager
                                        .demanglingFunctionName(childClassNameDemangling.toString());
                }
                return demangleName;
        }
-       
+
        private String getClassName(List<String> dataFormat) {
                String apiName = dataFormat.get(LogCenterConstants.APINAME_INDEX);
                if (apiName.contains("AddFrame")) {//$NON-NLS-1$
-                       String className = dataFormat.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX);
+                       String className = dataFormat
+                                       .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX);
                        return getDemanglingName(className);
                }
                String controlTyp = dataFormat
index aeec6d4..e958e36 100644 (file)
@@ -153,10 +153,7 @@ public class UIControlListTable extends DATreeComposite {
                if (time == null) {
                        time = strTime;
                }
-               String query = "select min(time) from screenshot where time >="//$NON-NLS-1$
-                               + time + ";";//$NON-NLS-1$
-               System.out.println("getSnapsotForScene");
-               String result = SqlManager.getInstance().executeSelectQuery(query);
+               String result = SqlManager.getInstance().getLastSnapshotTime(time);
                if (result == null) {
                        result = strTime;
                }
@@ -272,9 +269,9 @@ public class UIControlListTable extends DATreeComposite {
                int size = controlList.size();
                int nNodeDepth = 0;
                for (int i = 0; i < size; i++) {
-                       // System.out.println("sort "+i+" "+controlList.get(i).getData());
+//                     System.out.println("sort " + i + " " + controlList.get(i).getData());
                        TreeInput currentNode = makeInput(controlList.get(i));
-                       if (i == 0) {
+                       if (isRootNode(controlList, i)) {
                                output.add(currentNode);
                        } else { // first Parent Node, Last Child Node
                                for (int j = 0; j < output.size(); j++) {
@@ -283,11 +280,29 @@ public class UIControlListTable extends DATreeComposite {
                                        }
                                }
                        }
+
                }
                return output;
 
        }
 
+       public boolean isRootNode(List<UIControlListData> controlList, int index) {
+               boolean isRootNode = true;
+               if (!controlList.get(index).getChildName().equals("Frame")//$NON-NLS-1$
+                               && !controlList.get(index).getChildName().equals("Form")) {//$NON-NLS-1$
+                       return false;
+               }
+               for (int i = 0; i < index; i++) {
+                       if (controlList.get(i).getChildPointer()
+                                       .equals(controlList.get(index).getParentPointer())) {
+
+                               isRootNode = false;
+                               break;
+                       }
+               }
+               return isRootNode;
+       }
+
        public boolean isSelfUpdate() {
                return selfUpdate;
        }
index 0fcaae4..eb669c8 100644 (file)
@@ -38,7 +38,6 @@ import java.util.TreeSet;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
@@ -67,7 +66,7 @@ public class UIFunctionProfilingDataChecker {
                        int nChangedIndex = 0;
                        boolean bUpdateData = false;
 
-                       if (getDataList().size() == 0) {
+                       if (!existRootData(input)) {
                                makeRootParentData(input);
                        }
 
@@ -202,6 +201,17 @@ public class UIFunctionProfilingDataChecker {
                return strRetrun;
        }
 
+       public boolean existRootData(ProfilingData input) {
+               boolean exitRootData = false;
+               for (UIFunctionProfilingData data : getDataList()) {
+                       if (data.getAPIName().equals(input.getParent())) {
+                               exitRootData = true;
+                               break;
+                       }
+               }
+               return exitRootData;
+       }
+
        private void makeRootParentData(ProfilingData input) {
                UIFunctionProfilingData pd = new UIFunctionProfilingData();
                String exTime = CommonConstants.DASH, inTime = CommonConstants.DASH, exeTime = CommonConstants.DASH, inExeTime = CommonConstants.DASH, exAvgTime = CommonConstants.DASH, inAvgTime = CommonConstants.DASH, exeAvgTime = CommonConstants.DASH, inExeAvgTime = CommonConstants.DASH;
@@ -272,17 +282,15 @@ public class UIFunctionProfilingDataChecker {
                } else {
                        return;
                }
-               String sourcePath = null;
-               if (DACommunicator.isTargetEmulator()) {
-                       sourcePath = AnalyzerPaths.DA_EMULATOR_SOUECE_PATH;
-               } else {
-                       sourcePath = AnalyzerPaths.DA_DEVICE_SOUECE_PATH;
-               }
-               File configFolder = new File(sourcePath);
-               if (!configFolder.isDirectory()) {
-                       System.out.println("Not Exist UI API Header List Path ");
+
+               String sourcePath = AnalyzerPaths.TIZEN_HEADER_SOUECE_PATH;
+               File sourceFolder = new File(sourcePath);
+               if (!sourceFolder.exists() && !sourceFolder.isDirectory()) {
+                       System.out.println("Not Found the tizen_header_file folder : "
+                                       + sourcePath);
                        return;
                }
+
                String uiFileOptionList = null;
                String uiApiOptionList = null;
                String uiOptionList = getUIApiOptionList();
@@ -320,8 +328,7 @@ public class UIFunctionProfilingDataChecker {
                String[] splitUiApiOptionList = uiApiOptionList
                                .split(AnalyzerConstants.DATA_PARSING_TOKEN);
 
-               File file = new File(sourcePath);
-               File[] files = file.listFiles();
+               File[] files = sourceFolder.listFiles();
                String filename = null;
                int filelength = files.length;
                for (int i = 0; i < filelength; i++) {
index 002c1c4..dea3063 100644 (file)
@@ -34,7 +34,6 @@ 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.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
@@ -79,10 +78,7 @@ public class UISceneListTable extends DATableComposite {
        }
 
        private String getSnapsotForScene(String strTime) {
-               StringBuilder query = new StringBuilder(128);
-               query.append("select min(time) from screenshot where time >=").append(strTime).append(CommonConstants.SEMICOLON);//$NON-NLS-1$
-               System.out.println("getSnapsotForScene");
-               String result = SqlManager.getInstance().executeSelectQuery(query.toString());
+               String result = SqlManager.getInstance().getLastSnapshotTime(strTime);
                if (result == null) {
                        result = strTime;
                }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAContextMenu.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAContextMenu.java
new file mode 100644 (file)
index 0000000..a9a751f
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ *  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.widgets;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.ContextMenu;
+
+
+public class DAContextMenu extends ContextMenu{
+
+       public DAContextMenu(Composite parent) {
+               super(parent);
+               setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+       }
+       public void setTitleSetting(){
+               setTitle(TimelineChartLabels.RANGE_CONTEXT_TITLE);
+               setTitleHeight(25);
+               setTitleFont(FontResources.CONTEXT_MENU_TITLE_FONT);
+               setTitleFontColor(ColorResources.CONTEXT_MENU_TITLE_FONT_COLOR);
+               setTitleBacgroundColor(ColorResources.CONTEXT_MENU_TITLE_BACKGROUND_COLOR);
+       }
+}
\ No newline at end of file
index 1da32f3..f48cdea 100644 (file)
@@ -52,7 +52,6 @@ public class DADialog {
        private Shell parent = null;
        private Shell shell = null;
        private DACustomButton okButton = null;
-       // private DACustomButton cancelButton = null;
        private String message = null;
        private boolean returnType = false;
        private String titleText = AnalyzerLabels.DA_WARNING;
@@ -68,16 +67,6 @@ public class DADialog {
                }
        };
 
-       // private DACustomButtonClickEventListener cancelButtonListener = new
-       // DACustomButtonClickEventListener() {
-       //
-       // @Override
-       // public void handleClickEvent(DACustomButton button) {
-       // returnType = false;
-       // shell.dispose();
-       // }
-       // };
-
        public DADialog(Shell parent, int style) {
                this.parent = parent;
        }
@@ -164,24 +153,14 @@ public class DADialog {
                okData.height = DesignConstants.DA_BUTTON_HEIGHT;
                okButton.setLayoutData(okData);
 
-               // cancelButton = new DAButton(buttonComp, SWT.NONE);
-               // cancelButton.addClickListener(cancelButtonListener);
-               //              cancelButton.setText(AnalyzerLabels.CANCEL); //$NON-NLS-1$    
-               // cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
-               // okData = new FormData();
-               // okData.top = new FormAttachment(0, 12);
-               // okData.right = new FormAttachment(okButton, -10);
-               // okData.width = 100;
-               // okData.height = 34;
-               // cancelButton.setLayoutData(okData);
-
                shell.open();
 
                Display display = PlatformUI.createDisplay();
 
                while (!shell.isDisposed()) {
-                       if (!display.readAndDispatch())
+                       if (!display.readAndDispatch()) {
                                display.sleep();
+                       }
                }
 
                shell.dispose();
index cfee1c3..fe6237f 100644 (file)
@@ -36,12 +36,13 @@ public class DAGrid extends Grid {
 
        public DAGrid(Composite parent, int style) {
                super(parent, style);
-               // TODO Auto-generated constructor stub
        }
 
+       // for disable default grid tooltip bug
        @Override
        protected void showToolTip(GridItem item, GridColumn column,
                        GridColumnGroup group, Point location) {
                return;
        }
+
 }
index fb83ffe..9d57636 100644 (file)
@@ -79,8 +79,9 @@ public class DAMessageBox {
                                exceptionHandler.handleException(e);
                        }
                }
-               if (!display.isDisposed())
+               if (!display.isDisposed()) {
                        display.update();
+               }
        }
 
        private static class DefaultExceptionHandler implements IExceptionHandler {
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabButton.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabButton.java
new file mode 100644 (file)
index 0000000..1d520ad
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ *  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.ui.widgets;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class DATabButton extends DACustomButton {
+
+       public static final int CLOSE_NORMAL = 0;
+       public static final int CLOSE_PUSH = 1;
+       public static final int CLOSE_HOVER = 2;
+       public static final int CLOSE_DISABLE = 3;
+
+       private List<Image> closeImages = null;
+       private boolean closable = false;
+
+       protected int closeState = STATE_NORMAL;
+       protected TabButtonRenderer tabRenderer;
+       protected Rectangle closeRect = null;
+       protected DACustomButtonClickEventListener closeListener = null;
+
+       public DATabButton(Composite parent, int style) {
+               super(parent, ColorResources.TAB_NORMAL_COLOR_START,
+                               ColorResources.TAB_NORMAL_COLOR_END,
+                               ColorResources.TAB_PUSH_COLOR_START,
+                               ColorResources.TAB_PUSH_COLOR_END,
+                               ColorResources.TAB_HOVER_COLOR_START,
+                               ColorResources.TAB_HOVER_COLOR_END,
+                               ColorResources.TAB_SELECTED_COLOR_START,
+                               ColorResources.TAB_SELECTED_COLOR_END);
+               this.setLayout(new FormLayout());
+
+               this.addListener(SWT.MouseMove, tabMouseListener);
+               this.addListener(SWT.MouseDown, tabMouseListener);
+               this.addListener(SWT.MouseUp, tabMouseListener);
+       }
+
+       private Listener tabMouseListener = new Listener() {
+
+               @Override
+               public void handleEvent(Event event) {
+                       DATabButton button = (DATabButton) event.widget;
+                       if (!button.isClosable()) {
+                               return;
+                       }
+                       int type = event.type;
+
+                       if (null == closeRect) {
+                               Rectangle imgRect = button.getCloseImage().getBounds();
+                               Rectangle rect = button.getBounds();
+                               closeRect = new Rectangle(rect.width - imgRect.width - 2,
+                                               (rect.height - imgRect.height) / 2, imgRect.width,
+                                               imgRect.height);
+                       }
+
+                       if (type == SWT.MouseMove) {
+                               if (state == STATE_DISABLE) {
+                                       if (closeRect.contains(event.x, event.y)) {
+                                               button.setCloseState(STATE_HOVER);
+                                       } else {
+                                               button.setCloseState(STATE_NORMAL);
+                                       }
+                               } else if (state == STATE_NORMAL) {
+                                       button.setCloseState(STATE_DISABLE);
+                               } else if (state == STATE_HOVER) {
+                                       if (closeRect.contains(event.x, event.y)) {
+                                               button.setCloseState(STATE_HOVER);
+                                       } else {
+                                               button.setCloseState(STATE_DISABLE);
+                                       }
+                               }
+                       } else if (type == SWT.MouseDown) {
+                               if (state == STATE_DISABLE) {
+                                       if (closeRect.contains(event.x, event.y)) {
+                                               button.setCloseState(STATE_PUSH);
+                                       }
+                               }
+                       } else if (type == SWT.MouseUp) {
+                               if (closeRect.contains(event.x, event.y)) {
+                                       button.setCloseState(STATE_HOVER);
+                                       if (null != closeListener) {
+                                               closeListener.handleClickEvent(null);
+                                       }
+                               } else {
+                                       button.setCloseState(STATE_NORMAL);
+                               }
+                       }
+               }
+
+       };
+
+       private List<Image> getCloseImages() {
+               if (null == closeImages) {
+                       closeImages = new ArrayList<Image>();
+                       closeImages.add(ImageResources.CLOSE_BOX_NORMAL);
+                       closeImages.add(ImageResources.CLOSE_BOX_PUSH);
+                       closeImages.add(ImageResources.CLOSE_BOX_HOVER);
+                       closeImages.add(ImageResources.CLOSE_BOX_DISABLE);
+               }
+               return closeImages;
+       }
+
+       public Image getCloseImage() {
+               return getCloseImages().get(closeState);
+       }
+
+       public void setClosable(boolean enabled) {
+               closable = enabled;
+       }
+
+       public boolean isClosable() {
+               return closable;
+       }
+
+       public int getCloseState() {
+               return closeState;
+       }
+
+       public void setCloseState(int state) {
+               closeState = state;
+               this.redraw();
+       }
+
+       protected void changeButtonState(int state) {
+               this.state = state;
+
+               if (state == STATE_NORMAL) {
+                       closeState = STATE_DISABLE;
+               } else {
+                       closeState = STATE_NORMAL;
+               }
+               this.redraw();
+       }
+
+       public void addCloseButtonListener(DACustomButtonClickEventListener listener) {
+               closeListener = listener;
+       }
+}
index 12c1e10..2e2fb80 100644 (file)
@@ -100,23 +100,24 @@ public class DATabComposite extends DAView {
                contentsComposite.setLayoutData(data);
        }
 
-       public void addView(Composite child, boolean usingAnimation) {
+       public DATabButton addView(Composite child, boolean usingAnimation) {
+               return addView(child, usingAnimation, false);
+       }
+
+       public DATabButton addView(Composite child) {
+               return addView(child, false, false);
+       }
+
+       public DATabButton addView(Composite child, boolean usingAnimation,
+                       boolean closeable) {
                if (!(child instanceof ViewAction)) {
-                       return;
+                       return null;
                }
 
                String ID = child.getClass().getName();
                String title = ((ViewAction) child).getViewName();
 
-               final DACustomButton tabButton = new DACustomButton(tabComposite,
-                               ColorResources.TAB_NORMAL_COLOR_START,
-                               ColorResources.TAB_NORMAL_COLOR_END,
-                               ColorResources.TAB_PUSH_COLOR_START,
-                               ColorResources.TAB_PUSH_COLOR_END,
-                               ColorResources.TAB_HOVER_COLOR_START,
-                               ColorResources.TAB_HOVER_COLOR_END,
-                               ColorResources.TAB_SELECTED_COLOR_START,
-                               ColorResources.TAB_SELECTED_COLOR_END);
+               final DATabButton tabButton = new DATabButton(tabComposite, SWT.NONE);
                tabButton.setFontColors(ColorResources.TAB_NORMAL_FONT_COLOR,
                                ColorResources.TAB_PUSH_FONT_COLOR,
                                ColorResources.TAB_HOVER_FONT_COLOR,
@@ -126,10 +127,11 @@ public class DATabComposite extends DAView {
                                ColorResources.TAB_OUTLINE_HOVER_COLOR,
                                ColorResources.TAB_OUTLINE_SELECTED_COLOR);
                tabButton.setRenderer(new TabButtonRenderer());
-               tabButton.setEnabled(true);
+               tabButton.setButtonEnabled(true);
                tabButton.setFont(FontResources.TAB_BUTTON_FONT);
                tabButton.setText(title);
-               tabButton.setToolTipText(title);
+               tabButton.setToolTipText((String) child.getData("tooltip"));
+               tabButton.setClosable(closeable);
 
                FormData data = new FormData();
                data.top = new FormAttachment(0, 0);
@@ -175,7 +177,7 @@ public class DATabComposite extends DAView {
                        tabButton.setGradationColor(DACustomButton.STATE_DISABLE,
                                        ColorResources.TAB_SELECTED_COLOR_START,
                                        ColorResources.TAB_SELECTED_COLOR_END);
-                       tabButton.setEnabled(false);
+                       tabButton.setButtonEnabled(false);
                        tabButton.setRenderer(new TabButtonRenderer());
                }
 
@@ -185,6 +187,7 @@ public class DATabComposite extends DAView {
                } else {
                        tabComposite.layout();
                }
+               return tabButton;
        }
 
        public void removeView(final String ID, boolean usingAnimation) {
@@ -206,7 +209,7 @@ public class DATabComposite extends DAView {
                                        button.setGradationColor(DAButton.STATE_DISABLE,
                                                        ColorResources.TAB_NORMAL_COLOR_START,
                                                        ColorResources.TAB_NORMAL_COLOR_END);
-                                       button.setEnabled(false);
+                                       button.setButtonEnabled(false);
                                        tabAnimation(button, false);
                                }
                        });
@@ -258,9 +261,9 @@ public class DATabComposite extends DAView {
                                        button.setGradationColor(DACustomButton.STATE_DISABLE,
                                                        ColorResources.TAB_SELECTED_COLOR_START,
                                                        ColorResources.TAB_SELECTED_COLOR_END);
-                                       button.setEnabled(false);
+                                       button.setButtonEnabled(false);
                                } else {
-                                       sample.setEnabled(true);
+                                       sample.setButtonEnabled(true);
                                }
                        }
                }
index 9975cff..ca381a4 100644 (file)
@@ -210,14 +210,14 @@ public class FindDialog extends DAMessageBox {
                @Override
                public void keyReleased(KeyEvent e) {
                        if (null != textBox.getText() && !textBox.getText().isEmpty()) {
-                               findButton.setEnabled(true);
+                               findButton.setButtonEnabled(true);
 
                                if (e.keyCode == ENTER_KEY_CODE) {
                                        findProperty.setLastSearch(textBox.getText());
                                        executeFindCommand();
                                }
                        } else {
-                               findButton.setEnabled(false);
+                               findButton.setButtonEnabled(false);
                        }
                }
 
index 74e1cc3..71a0fc3 100644 (file)
@@ -37,40 +37,38 @@ import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonAttribute;
+import org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer;
 
 public class TabButtonRenderer implements IDACustomButtonRenderer {
 
-       @Override
-       public void draw(GC gc, Canvas canvas, int state,
-                       DACustomButtonAttribute attr) {
-               Rectangle rect = canvas.getClientArea();
-
-               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       Image image = attr.getImage(state);
-                       if (null == image) {
-                               return;
-                       }
-
-                       gc.drawImage(image, rect.x, rect.y);
-                       drawButtonText(gc, rect, state, attr);
-               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
-                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
-                       drawButton(gc, rect, state, attr);
-               }
-               drawButtonImage(gc, rect, attr);
-       }
-
        public int computeFontSize(Rectangle rect) {
-               if (rect.height > 20)
+               if (rect.height > 20) {
                        return 10;
-               else
+               } else {
                        return 8;
+               }
        }
 
-       public void drawButton(GC gc, Rectangle rect, int state,
-                       DACustomButtonAttribute attr) {
+       protected void drawImageButton(GC gc, Rectangle rect, int state,
+                       DACustomButtonAttribute attr, DATabButton button) {
+               Image image = attr.getImage(state);
+               if (null == image) {
+                       return;
+               }
+
+               gc.drawImage(image, rect.x, rect.y);
+               drawButtonText(gc, rect, state, attr);
+
+               if (button.isClosable()) {
+                       Image img = button.getCloseImage();
+                       Rectangle imgRect = img.getBounds();
+                       gc.drawImage(img, rect.width - imgRect.width, rect.y + 1);
+               }
+       }
+
+       protected void drawButton(GC gc, Rectangle rect, int state,
+                       DACustomButtonAttribute attr, DATabButton button) {
                if (attr.getDrawType() == DACustomButton.TYPE_COLOR) {
                        gc.setBackground(attr.getColor(state));
                        gc.fillRectangle(rect);
@@ -91,6 +89,12 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
                gc.setForeground((outline == null) ? c : outline);
                gc.drawRectangle(r);
                gc.setForeground(c);
+
+               if (button.isClosable()) {
+                       Image img = button.getCloseImage();
+                       Rectangle imgRect = img.getBounds();
+                       gc.drawImage(img, rect.width - imgRect.width - 2, rect.y + 2);
+               }
        }
 
        protected void drawButtonImage(GC gc, Rectangle rect,
@@ -117,6 +121,15 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
                String s = null;
                Font f = null;
                Point p = null;
+
+               Rectangle textRect = new Rectangle(rect.x, rect.y, rect.width,
+                               rect.height);
+               if (null != attr.getIcon()) {
+                       Rectangle iconRect = attr.getIcon().getBounds();
+                       textRect.x = textRect.x + iconRect.width;
+                       textRect.width = textRect.width - iconRect.width;
+               }
+
                if (null != (s = attr.getText())) {
                        if (null == (f = attr.getFont())) {
                                f = new Font(Display.getCurrent(), "Arial", //$NON-NLS-1$
@@ -129,11 +142,15 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
                        int offset = 0;
                        if (null == (p = attr.getFontPoint())) {
                                p = gc.textExtent(s, SWT.DRAW_MNEMONIC);
-                               x = (rect.width - p.x) / 2;
-                               y = (rect.height - p.y) / 2;
-                               x = (x < 0) ? 0 : x;
-                               // rect size < text length -> insert offset
-                               offset = ((x - rect.x) < 4) ? 4 : 0;
+                               if (attr.getAlign() == SWT.CENTER) {
+                                       x = (textRect.width - p.x) / 2 + textRect.x;
+                                       x = (x < 0) ? 0 : x;
+                                       offset = -2;
+                               } else {
+                                       x = textRect.x;
+                                       offset = 5;
+                               }
+                               y = (textRect.height - p.y) / 2;
                        } else {
                                x = p.x;
                                y = p.y;
@@ -147,7 +164,32 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
                                x += 1;
                                y += 1;
                        }
-                       gc.drawString(s, x + offset, y, true);
+                       gc.drawString(s, x + offset, y + 1, true);
+               }
+       }
+
+       @Override
+       public void draw(GC gc, Canvas canvas, int state,
+                       DACustomButtonAttribute attr) {
+               Rectangle rect = canvas.getClientArea();
+
+               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
+                       drawImageButton(gc, rect, state, attr, (DATabButton) canvas);
+               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
+                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
+                       drawButton(gc, rect, state, attr, (DATabButton) canvas);
+               }
+               // drawButtonImage(gc, rect, attr);
+               drawIcon(gc, rect, attr);
+       }
+
+       protected void drawIcon(GC gc, Rectangle parentRect,
+                       DACustomButtonAttribute attr) {
+               Image icon = attr.getIcon();
+               if (null == icon) {
+                       return;
                }
+               gc.drawImage(icon, parentRect.x + 2,
+                               (parentRect.height - icon.getBounds().height) / 2);
        }
 }
index 4a05f7b..8306178 100644 (file)
@@ -27,6 +27,7 @@
 package org.tizen.dynamicanalyzer.ui.widgets;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
@@ -41,7 +42,8 @@ import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboRenderer;
 public class TitleComboRenderer extends DACustomComboRenderer {
 
        @Override
-       public void draw(GC gc, Canvas canvas, String text, int state) {
+       public void draw(GC gc, Canvas canvas, String text, int textAlign,
+                       Font font, int state) {
                Rectangle rect = canvas.getClientArea();
                setColors(state, gc);
                gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true);
@@ -51,11 +53,23 @@ public class TitleComboRenderer extends DACustomComboRenderer {
                if (null == text) {
                        text = CommonConstants.EMPTY;
                }
-               gc.setFont(FontResources.COMBO);
+               if (null == font) {
+                       gc.setFont(FontResources.COMBO);
+               } else {
+                       gc.setFont(font);
+               }
+
                Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
                gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE);
-               gc.drawString(text, 5, (rect.height - p.y) / 2, true);
-
+               int textX = 0;
+               if (textAlign == DACustomCombo.TEXT_ALIGN_LEFT) {
+                       textX = 5;
+               } else if (textAlign == DACustomCombo.TEXT_ALIGN_RIGHT) {
+                       textX = rect.width - p.x;
+               } else {
+                       textX = (rect.width / 2) - (p.x / 2);
+               }
+               gc.drawString(text, textX, (rect.height - p.y) / 2, true);
                setColors(state, gc);
                gc.fillGradientRectangle(rect.x + rect.width - 20, rect.y, 19,
                                rect.height - 1, true);
@@ -71,15 +85,27 @@ public class TitleComboRenderer extends DACustomComboRenderer {
 
        @Override
        public void drawImage(GC gc, Canvas canvas, Image image, String text,
-                       int state) {
+                       int textAlign, Font font, int state) {
                Rectangle rect = canvas.getClientArea();
                gc.drawImage(image, rect.x, rect.y);
-               gc.setFont(FontResources.COMBO);
+               if (null == font) {
+                       gc.setFont(FontResources.COMBO);
+               } else {
+                       gc.setFont(font);
+               }
                gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE);
                Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-               gc.drawString(text, 5, (rect.height - p.y) / 2, true);
-               Rectangle clipping = new Rectangle(rect.x + rect.width - 19, rect.y,
-                               19, rect.height);
+               int textX = 0;
+               if (textAlign == DACustomCombo.TEXT_ALIGN_LEFT) {
+                       textX = 5;
+               } else if (textAlign == DACustomCombo.TEXT_ALIGN_RIGHT) {
+                       textX = rect.width - p.x;
+               } else {
+                       textX = (rect.width / 2) - (p.x / 2);
+               }
+               gc.drawString(text, textX, (rect.height - p.y) / 2, true);
+               Rectangle clipping = new Rectangle(rect.x + rect.width - 0, rect.y, 19,
+                               rect.height);
                gc.setClipping(clipping);
                gc.drawImage(image, rect.x, rect.y);
        }
index 6214e44..4f37278 100644 (file)
@@ -31,6 +31,7 @@ import java.util.List;
 
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
 
@@ -40,6 +41,10 @@ public class DAApiListTableComposite extends DATableComposite {
                        int tableStyle) {
                super(parent, compStyle, tableStyle);
                setRangePopup();
+               
+               setComparator(new DefaultTableComparator());
+               comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
+               comparator.setColumn(0);
        }
 
        @Override
index de40d99..0298aeb 100644 (file)
@@ -59,16 +59,20 @@ import org.tizen.dynamicanalyzer.model.TableInput;
 import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
 import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
 import org.tizen.dynamicanalyzer.ui.widgets.FindDialog;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 
 public abstract class DATableComposite extends Composite {
 
+       protected static final int START_TIME = 0;
+       protected static final int END_TIME = 1;
+
        // for find
        protected String tableName = CommonConstants.EMPTY;
        protected DATableComposite me = null;
@@ -96,9 +100,10 @@ public abstract class DATableComposite extends Composite {
 
        private DAContextMenu popupMenu = null;
 
-       private Point mousePoint = new Point(0, 0);
+       protected Point mousePoint = new Point(0, 0);
 
-       private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+       protected RangeDataManager rangeDataManager = RangeDataManager
+                       .getInstance();
 
        public DATableComposite(Composite parent, int style) {
                this(parent, SWT.NONE, style);
@@ -379,15 +384,17 @@ public abstract class DATableComposite extends Composite {
                                gridItem.setBackground(rangeColor);
                        }
 
-                       String seqNum = gridData.getSelectionKey();
-                       for (int ii = 0; ii < selSeqs.size(); ii++) {
-                               if (seqNum.equals(selSeqs.get(ii))) {
-                                       sels[iii++] = i;
-                                       selSeqs.remove(ii);
+                       if (gridData != null) {
+                               String seqNum = gridData.getSelectionKey();
+                               for (int ii = 0; ii < selSeqs.size(); ii++) {
+                                       if (seqNum.equals(selSeqs.get(ii))) {
+                                               sels[iii++] = i;
+                                               selSeqs.remove(ii);
+                                       }
+                               }
+                               if (null != focusSeq && seqNum.equals(focusSeq)) {
+                                       focusIndex = i;
                                }
-                       }
-                       if (null != focusSeq && seqNum.equals(focusSeq)) {
-                               focusIndex = i;
                        }
                }
                table.setSelection(sels);
@@ -425,6 +432,9 @@ public abstract class DATableComposite extends Composite {
 
        public void setSortTypes(int[] types) {
                sortTypes = types;
+               if (null != comparator) {
+                       this.comparator.setType(sortTypes[0]);
+               }
        }
 
        public void setSourceColumns(int[] columns) {
@@ -545,27 +555,35 @@ public abstract class DATableComposite extends Composite {
                DATableComposite.findProferty = findProferty;
        }
 
+       protected void actionSetStartEnd(int type) {
+               GridItem item = table.getItem(mousePoint);
+               if (null != item) {
+                       List<String> data = ((DATableDataFormat) item.getData()).getData();
+                       String time = data.get(LogCenterConstants.TIME_INDEX);
+                       long inputTime = -1;
+                       try {
+                               inputTime = Long.parseLong(time);
+                       } catch (NumberFormatException e) {
+                               e.printStackTrace();
+                               return;
+                       }
+                       if (type == START_TIME) {
+                               rangeDataManager.setMarkerStartTime(inputTime);
+                       } else if (type == END_TIME) {
+                               rangeDataManager.setMarkerEndTime(inputTime);
+                       }
+               }
+       }
+
        public void setRangePopup() {
                popupMenu = new DAContextMenu(table);
+               popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
                DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
                startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
                startItem.addClickListener(new DAContextMenuListener() {
                        @Override
                        public void widgetSelected(DAContextMenuItem menuItem) {
-                               GridItem item = table.getItem(mousePoint);
-                               if (null != item) {
-                                       List<String> startData = ((DATableDataFormat) item
-                                                       .getData()).getData();
-                                       String time = startData.get(LogCenterConstants.TIME_INDEX);
-                                       long startTime = -1;
-                                       try {
-                                               startTime = Long.parseLong(time);
-                                       } catch (NumberFormatException e) {
-                                               e.printStackTrace();
-                                               return;
-                                       }
-                                       rangeDataManager.setMarkerStartTime(startTime);
-                               }
+                               actionSetStartEnd(START_TIME);
                        }
                });
 
@@ -575,31 +593,14 @@ public abstract class DATableComposite extends Composite {
 
                        @Override
                        public void widgetSelected(DAContextMenuItem menuItem) {
-                               GridItem item = table.getItem(mousePoint);
-                               if (null != item) {
-                                       List<String> startData = ((DATableDataFormat) item
-                                                       .getData()).getData();
-                                       String time = startData.get(LogCenterConstants.TIME_INDEX);
-                                       long endTime = -1;
-                                       try {
-                                               endTime = Long.parseLong(time);
-                                       } catch (NumberFormatException e) {
-                                               e.printStackTrace();
-                                               return;
-                                       }
-                                       rangeDataManager.setMarkerEndTime(endTime);
-                               }
+                               actionSetStartEnd(END_TIME);
                        }
                });
 
                DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
                analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
-               analysisItem.addClickListener(new DAContextMenuListener() {
-                       @Override
-                       public void widgetSelected(DAContextMenuItem menuItem) {
-                               rangeDataManager.startRangeAnalysis();
-                       }
-               });
+               analysisItem
+                               .addClickListener(new ContextAnalysisMenuItemClickListener());
 
                DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
                clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
@@ -619,32 +620,29 @@ public abstract class DATableComposite extends Composite {
                                        List<DAContextMenuItem> menuItems = popupMenu.getItems();
                                        int size = menuItems.size();
                                        GridItem item = table.getItem(mousePoint);
-                                       long analysisStart = RangeDataManager.getInstance()
-                                                       .getAnalysisStartTime();
-                                       long analysisEnd = RangeDataManager.getInstance()
-                                                       .getAnalysisEndTime();
+
                                        for (int i = 0; i < size; i++) {
                                                if (i == 0 || i == 1) {
                                                        if (null != item) {
                                                                if (!menuItems.get(i).isButtonEnabled()) {
-                                                                       menuItems.get(i).setEnabled(true);
+                                                                       menuItems.get(i).setButtonEnabled(true);
                                                                }
                                                        } else {
                                                                if (menuItems.get(i).isButtonEnabled()) {
-                                                                       menuItems.get(i).setEnabled(false);
+                                                                       menuItems.get(i).setButtonEnabled(false);
                                                                }
                                                        }
                                                } else if (i == 2) {
                                                        if (rangeDataManager.isAnalyzable()) {
-                                                               menuItems.get(i).setEnabled(true);
+                                                               menuItems.get(i).setButtonEnabled(true);
                                                        } else {
-                                                               menuItems.get(i).setEnabled(false);
+                                                               menuItems.get(i).setButtonEnabled(false);
                                                        }
                                                } else if (i == 3) {
-                                                       if (analysisStart >= 0 || analysisEnd >= 0) {
-                                                               menuItems.get(i).setEnabled(true);
+                                                       if (rangeDataManager.isBeingAnalyzed()) {
+                                                               menuItems.get(i).setButtonEnabled(true);
                                                        } else {
-                                                               menuItems.get(i).setEnabled(false);
+                                                               menuItems.get(i).setButtonEnabled(false);
                                                        }
                                                }
                                        }
index 3cfa2fb..8266caf 100644 (file)
@@ -40,8 +40,9 @@ public class DATableEmptyCellRenderer extends GridCellRenderer {
        public void paint(GC gc, Object value) {
 
                Grid table = null;
-               if (value instanceof Grid)
+               if (value instanceof Grid) {
                        table = (Grid) value;
+               }
 
                GridItem item = null;
                if (value instanceof GridItem) {
index b437513..23de8c2 100644 (file)
@@ -88,7 +88,8 @@ public abstract class DATreeComposite extends DATableComposite {
                } else if (parent instanceof GridItem) {
                        gridItem = new GridItem((GridItem) parent, SWT.NONE);
                } else {
-                       System.out.println("it is bug!! need debug - DATreeComposite makeTreeItem");//$NON-NLS-1$
+                       System.out
+                                       .println("it is bug!! need debug - DATreeComposite makeTreeItem");//$NON-NLS-1$
                }
                // data
                DATableDataFormat gridData = (DATableDataFormat) input.getData();
@@ -122,7 +123,7 @@ public abstract class DATreeComposite extends DATableComposite {
                                selSeqs.remove(ii);
                        }
                }
-               
+
                if (null != focusSeq && gridData.getSelectionKey().equals(focusSeq)) {
                        focusIndex = gridItemCount;
                }
@@ -190,6 +191,7 @@ public abstract class DATreeComposite extends DATableComposite {
 
        @Override
        protected List<TableInput> makeTableInput() {
+               makeTreeInput();
                return null;
        }
 
index 48d820b..95b7a3c 100644 (file)
 
 package org.tizen.dynamicanalyzer.uirecorder;
 
-import java.io.File;
-import java.io.IOException;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
 import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
-import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.sdblib.MultiLineReceiver;
-import org.tizen.sdblib.SyncService;
-import org.tizen.sdblib.SyncService.SyncResult;
 
-public class UIRecorderTool extends DACommunicator {
+public class UIRecorderTool {
        private static UIRecorderTool instance;
-       public static String RECORD_MODE = " -r"; //$NON-NLS-1$
-       public static String PLAY_MODE = " -s"; //$NON-NLS-1$
+       public static String RECORD_MODE = " record"; //$NON-NLS-1$
+       public static String PLAY_MODE = " play"; //$NON-NLS-1$
        public static String PLAY_STATE = "play"; //$NON-NLS-1$
        public static String RECORD_STATE = "record"; //$NON-NLS-1$
        public static String STOP_STATE = "stop"; //$NON-NLS-1$
@@ -50,7 +41,6 @@ public class UIRecorderTool extends DACommunicator {
        private UIRecorderPlayThread playThread;
        private Boolean isReplay = false;
        private String xmlFileStr = null;
-       private String executeResult = null;
        private String state = STOP_STATE;
 
        private UIRecorderTool() {
@@ -109,7 +99,6 @@ public class UIRecorderTool extends DACommunicator {
                        playThread.end();
                        playThread = null;
                }
-
        }
 
        public void setState(String state) {
@@ -120,88 +109,13 @@ public class UIRecorderTool extends DACommunicator {
                return state;
        }
 
-       public boolean upload(boolean overwrite) {
-               try {
-                       if (overwrite == false) {
-                               if (isToolExist() == true) {
-                                       return true;
-                               } else {
-                                       uploadEventUtil();
-                               }
-                       } else {
-                               uploadEventUtil();
-                       }
-               } catch (IOException e) {
-                       return false;
-               }
-               return true;
-       }
-
        public Process execute(String mode) {
 
-               Process runProcess = null;
-
-               if (null == getSelectedDevice()) {
-                       return null;
-               }
-
-               try {
-                       addExecutePermission();
-                       runProcess = execCommand(AnalyzerShellCommands.CMD_EXE_PERMISSION
-                                       + CommonConstants.SPACE
-                                       + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH + " && "//$NON-NLS-1$
-                                       + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH + mode);
-                       // runProcess = currentDevice.executeShellCommand("top");
-               } catch (IOException e) {
+               if (null == DACommunicator.getSelectedDevice()) {
                        return null;
                }
 
-               return runProcess;
-       }
-
-       private void uploadEventUtil() throws IOException {
-               String recorderToolName = AnalyzerPaths.TARGET_PATH;
-               if (isCurrentDeviceArmArch()) {
-                       recorderToolName += CommonConstants.ARM_ARCH;
-               } else {
-                       recorderToolName += CommonConstants.X86_ARCH;
-               }
-
-               recorderToolName += File.separator
-                               + AnalyzerConstants.TOOL_RECORDER_NAME;
-
-               SyncResult result = push(recorderToolName,
-                               AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH);
-               if (null != result && SyncService.RESULT_OK == result.getCode()) {
-                       addExecutePermission();
-               }
-       }
-
-       private void addExecutePermission() throws IOException {
-               execShellCommand(AnalyzerShellCommands.CMD_EXE_PERMISSION
-                               + CommonConstants.SPACE
-                               + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH);
-       }
-
-       public boolean isToolExist() throws IOException {
-               execShellCommand(AnalyzerShellCommands.CMD_GET_LIST
-                               + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH,
-                               new MultiLineReceiver() {
-                                       @Override
-                                       public void processNewLines(String[] lines) {
-                                               executeResult = lines[0];
-                                       }
-                               });
-
-               if (executeResult.startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
-                       return false;
-               }
-
-               if (executeResult
-                               .equals(AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH)) {
-                       return true;
-               } else {
-                       return false;
-               }
+               return DACommunicator
+                               .execCommand(AnalyzerShellCommands.DACOMMAND_RUN_EVENT + mode);
        }
 }
index f6c3bf2..01a95cc 100644 (file)
@@ -61,12 +61,12 @@ import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 import org.tizen.dynamicanalyzer.ui.page.BaseView;
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
@@ -405,10 +405,10 @@ public class AnalyzerUtil {
                        }
                }
 
-               HashMap<Integer, CallStackData> cdMap = CallStackManager.getInstance()
-                               .getCallStackDataBySeqMap();
-               HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
-                               .getCallStackApiByAddrMap();
+               HashMap<Integer, CallStackData> cdMap = AnalyzerManager
+                               .getCallstackManager().getCallStackDataBySeqMap();
+               HashMap<Long, CallStackUnit> addrMap = AnalyzerManager
+                               .getCallstackManager().getCallStackApiByAddrMap();
 
                if (null == cdMap || null == addrMap) {
                        return AnalyzerConstants.USER_CALL_CHECK_ERROR;
@@ -423,7 +423,7 @@ public class AnalyzerUtil {
                }
 
                String funcName = addrMap.get(addrs.get(0)).getFunctionName();
-               if (CallStackManager.getInstance().checkUserCall(funcName)) {
+               if (AnalyzerManager.getCallstackManager().checkUserCall(funcName)) {
                        return AnalyzerConstants.USER_CALL;
                }
                return AnalyzerConstants.INTERNAL_CALL;
index 2f698e4..4f62e3a 100644 (file)
@@ -235,7 +235,7 @@ public class Formatter {
                                                value += "." + remStr.substring(0, 1); //$NON-NLS-1$
                                        }
                                }
-                               value += " " + getMeasure(count); //$NON-NLS-1$
+                               value += " " + getByteMeasure(count); //$NON-NLS-1$
                                break;
                        }
                }
@@ -253,9 +253,9 @@ public class Formatter {
                String value = ""; //$NON-NLS-1$
 
                while (true) {
-                       if (quotient >= 1024) {
-                               reminder = (int) (quotient % 1024);
-                               quotient = quotient / 1024;
+                       if (quotient >= 1000) {
+                               reminder = (int) (quotient % 1000);
+                               quotient = quotient / 1000;
                                count++;
                                continue;
                        } else {
@@ -296,15 +296,15 @@ public class Formatter {
                return toBpsFormat((long) nByte, startTime, endTime);
        }
 
-       private static String getMeasure(int count) {
+       private static String getByteMeasure(int count) {
                if (count == 4) {
-                       return "TB"; //$NON-NLS-1$
+                       return "TiB"; //$NON-NLS-1$
                } else if (count == 3) {
-                       return "GB"; //$NON-NLS-1$
+                       return "GiB"; //$NON-NLS-1$
                } else if (count == 2) {
-                       return "MB"; //$NON-NLS-1$
+                       return "MiB"; //$NON-NLS-1$
                } else if (count == 1) {
-                       return "KB"; //$NON-NLS-1$
+                       return "KiB"; //$NON-NLS-1$
                } else {
                        return "Byte"; //$NON-NLS-1$
                }
@@ -366,7 +366,7 @@ public class Formatter {
                                count++;
                                continue;
                        } else {
-                               value = getMeasure(count); //$NON-NLS-1$
+                               value = getByteMeasure(count); //$NON-NLS-1$
                                break;
                        }
                }
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/close_box_disable.png b/org.tizen.dynamicanalyzer/theme/white/img/close_box_disable.png
new file mode 100644 (file)
index 0000000..297e4e6
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/close_box_disable.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/close_box_hover.png b/org.tizen.dynamicanalyzer/theme/white/img/close_box_hover.png
new file mode 100644 (file)
index 0000000..8344353
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/close_box_hover.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/close_box_normal.png b/org.tizen.dynamicanalyzer/theme/white/img/close_box_normal.png
new file mode 100644 (file)
index 0000000..577896a
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/close_box_normal.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/close_box_push.png b/org.tizen.dynamicanalyzer/theme/white/img/close_box_push.png
new file mode 100644 (file)
index 0000000..96795d1
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/close_box_push.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_file.png b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_file.png
new file mode 100644 (file)
index 0000000..d5f2097
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_file.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_range.png b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_range.png
new file mode 100644 (file)
index 0000000..0e620d7
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_range.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_summary.png b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_summary.png
new file mode 100644 (file)
index 0000000..32b92c6
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_summary.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_thread.png b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_thread.png
new file mode 100644 (file)
index 0000000..e2a6f92
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_thread.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_timeline.png b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_timeline.png
new file mode 100644 (file)
index 0000000..2b1fa26
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_timeline.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_userinterface.png b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_userinterface.png
new file mode 100644 (file)
index 0000000..ac5ff02
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/tab_icon_userinterface.png differ