[Title] readelf wait code added
authorLee <jy.exe.lee@samsung.com>
Fri, 3 May 2013 08:43:05 +0000 (17:43 +0900)
committerLee <jy.exe.lee@samsung.com>
Fri, 3 May 2013 08:43:05 +0000 (17:43 +0900)
[Desc.] -
[Issue] -

142 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/DACustomButtonRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/radio/DARadioButton.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
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/DAContextMenu.java [deleted file]
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/DACustomTimeline.java [deleted file]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimelineRangeMarker.java [deleted file]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimelineRenderer.java [deleted file]
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/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/ErrorCode.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/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/LogInserter.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/TimelineChartLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/TimelineChartLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppDesktopInfo.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextFromSelectionMenuItemClickListener.java [moved from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/ContextToSelectionMenuItemClickListener.java with 83% similarity]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseEventListener.java [moved from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseAdapter.java with 59% similarity]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseMoveListener.java [deleted file]
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/FileChartManager.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/CallstackTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageSelectionListener.java [deleted file]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageViewer.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/ThreadAPIListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadChartManager.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/ThreadPageThreadDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/CPUCoreChart.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/ScreenshotChart.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/uievent/UIEventListDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/uievent/UIEventListDialogTableCellRenderer.java
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/StartProcessManager.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StopLogProcessor.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StopProcessManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialogFeaturesPage.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/userinterface/UIDataManager.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/widgets/DADialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAMessageBox.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabButton.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TabButtonRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TitleComboPopupRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TitleComboRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/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/RecorderXml.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/RecordingQueue.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/UIRecorderPlayThread.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/UIRecorderRecordThread.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/empty_snapshot_small.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 0cf5800..d10921c 100644 (file)
@@ -55,10 +55,11 @@ public class DACustomButtonRenderer implements IDACustomButtonRenderer {
        }
 
        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,
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 17472f9..bd8a47e 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;
@@ -50,6 +54,8 @@ public class DAChartPlot {
        protected boolean hasUpdate = false;
        private Font axisFont;
        private String axisUnit;
+       private String secondAxisUnit;
+       private UnitType axisUnitType = UnitType.DECIMAL;
 
        public DAChartPlot(DAChart chart) {
                this.chart = chart;
@@ -295,4 +301,20 @@ public class DAChartPlot {
        public void setAxisUnit(String axisUnit) {
                this.axisUnit = axisUnit;
        }
+
+       public void setAxisUnitType(UnitType type) {
+               axisUnitType = type;
+       }
+
+       public UnitType getAxisUnitType() {
+               return axisUnitType;
+       }
+
+       public String getSecondAxisUnit() {
+               return secondAxisUnit;
+       }
+
+       public void setSecondAxisUnit(String secondAxisUnit) {
+               this.secondAxisUnit = secondAxisUnit;
+       }
 }
index 834f6ad..81306c7 100644 (file)
 package org.tizen.dynamicanalyzer.widgets.chart;
 
 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;
+       
        private double endVal;
+       private int markerStyle = INTERVAL_MARKER_STYLE_LINE;
 
-       public DAChartPlotIntervalMarker(double start, double end) {
+       public DAChartPlotIntervalMarker(double start, double end, int markerStyle) {
                super(start);
                endVal = end;
+               this.setMarkerStyle(markerStyle);
        }
 
        public void setInterval(double start, double end) {
@@ -56,4 +61,12 @@ public class DAChartPlotIntervalMarker extends DAChartPlotMarker {
                this.endVal = endVal;
                redrawRegisteredChart();
        }
+
+       public int getMarkerStyle() {
+               return markerStyle;
+       }
+
+       public void setMarkerStyle(int markerStyle) {
+               this.markerStyle = markerStyle;
+       }
 }
index ec26fce..9646483 100644 (file)
@@ -35,6 +35,7 @@ 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;
 
@@ -99,8 +100,8 @@ public class DAChartPlotMarker {
        }
 
        public Color getForegroundColor() {
-               if (null == backgroundColor){
-                       backgroundColor = ColorResources.BLUE;
+               if (null == foregroundColor){
+                       foregroundColor = ColorResources.BLUE;
                }
                return foregroundColor;
        }
@@ -109,4 +110,12 @@ public class DAChartPlotMarker {
                this.foregroundColor = foregroundColor;
                redrawRegisteredChart();
        }
+
+       public int getLineWidth() {
+               return lineWidth;
+       }
+
+       public void setLineWidth(int lineWidth) {
+               this.lineWidth = lineWidth;
+       }
 }
index f655392..d7a13c8 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;
 
@@ -209,10 +207,16 @@ public class DAChartRenderer {
                gc.setForeground(ColorResources.CHART_AXIS);
 
                Font axisFont = plot.getAxisFont();
-               String axisUnit = plot.getAxisUnit();
+               String axisUnit;
+               if (true == bPosRight){
+                       axisUnit = plot.getAxisUnit();                  
+               }
+               else{
+                       axisUnit = plot.getSecondAxisUnit();
+               }
                gc.setFont(axisFont);
 
-               String text;
+               String text = "";
                int textX;
                int textHeight;
 
@@ -226,7 +230,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;
                }
@@ -239,7 +247,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;
                }
@@ -250,7 +262,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;
                }
@@ -275,39 +291,51 @@ public class DAChartRenderer {
                }
 
                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);
-                       pixcelStartX = plot
-                                       .getXPixcelFromX(marker
-                                                       .getVal());
+                       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);
+                                       gc.drawLine(pixcelEndX, r.y, pixcelEndX, r.height);
+                               }
                        } else {
-                               pixcelEndX = pixcelStartX;
-                       }
-
-                       Color color = marker.getBackgroundColor();
-
-                       gc.setAlpha(marker.getAlpha());
-                       if (pixcelStartX == pixcelEndX) {
-                               gc.setForeground(color);
-                               gc.setLineWidth(2);
+                               gc.setLineWidth(marker.getLineWidth());
                                gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
-                       } else {
-                               gc.setBackground(color);
-                               gc.fillRectangle(pixcelStartX, 0, pixcelEndX - pixcelStartX,
-                                               r.height);
                        }
-
                }
                gc.setAlpha(oldAlpha);
+               gc.setBackground(oldBackColor);
+               gc.setForeground(oldForeColor);
+               gc.setLineWidth(oldLineWidth);
        }
 
        private int getTooltipStartX(double startVal, int width, int margin) {
@@ -557,6 +585,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) {
@@ -584,6 +614,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) {
@@ -1083,7 +1119,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 89d25ca..c7b0359 100644 (file)
@@ -121,8 +121,14 @@ public class DAChartBoard extends Composite {
                                .addClickListener(new DACustomButtonClickEventListener() {
                                        @Override
                                        public void handleClickEvent(DACustomButton button) {
+
+                                               // long startTime = System.currentTimeMillis();
                                                boolean bZoomout = chartZoomButton.isToggled();
                                                zoomoutItem(bZoomout);
+
+                                               // long endTime = System.currentTimeMillis();
+                                               // System.out.println("board end : "
+                                               // + (endTime - startTime));
                                        }
                                });
 
@@ -276,12 +282,17 @@ public class DAChartBoard extends Composite {
                        itemRatio = DEFAULT_EXPAND_MEDIUM;
                }
 
-               itemListHeight = itemList.callbackZoom(itemRatio);
+               itemListHeight = itemList.callbackZoom(itemRatio, false);
+               itemList.layout();
                itemList.setSize(0, itemListHeight);
-
                itemListScrollComp.redraw();
        }
 
+       protected void zoomoutFoldItem() {
+               itemList.zoomoutFoldItem();
+               itemList.layout();
+       }
+
        public boolean isZoomout() {
                if (null == chartZoomButton) {
                        return false;
@@ -467,7 +478,7 @@ public class DAChartBoard extends Composite {
                } else {
                        itemListHeight = height;
                }
-
+               itemList.layout();
                itemList.setSize(0, itemListHeight);
        }
 
index 856debf..aad08af 100644 (file)
@@ -145,20 +145,27 @@ public class DAChartBoardItem extends Composite {
                }
                itemChildListHeight = height;
 
-               FormData data = (FormData) childList.getLayoutData();
-               data.height = itemChildListHeight;
-               childList.setLayoutData(data);
-               this.layout();
+               FormData childDListata = (FormData) childList.getLayoutData();
+               childDListata.height = itemChildListHeight;
+               childList.setLayoutData(childDListata);
                callNotifyResizeChild();
        }
 
-       private int expandItem() {
+       protected int expandItem(boolean isFold) {
                itemCellHeight = (int) (expandRatio * DEFAULT_ITEM_HEIGHT);
+               if (isFold == false) {
+                       FormData data = (FormData) itemCell.getLayoutData();
+                       data.height = itemCellHeight;
+                       itemCell.setLayoutData(data);
+               }
+               
+               return itemCellHeight;
+       }
+
+       protected void expandFoldItem() {
                FormData data = (FormData) itemCell.getLayoutData();
                data.height = itemCellHeight;
                itemCell.setLayoutData(data);
-               this.layout();
-               return itemCellHeight;
        }
 
        protected void registeItem(DAChartBoardItem child) {
@@ -168,10 +175,10 @@ public class DAChartBoardItem extends Composite {
                int chartListHeight = childList.registeItem(child);
 
                itemChildListHeight = chartListHeight;
-               FormData data = (FormData) childList.getLayoutData();
-               data.height = itemChildListHeight;
-               childList.setLayoutData(data);
-               this.layout();
+               FormData childDListata = (FormData) childList.getLayoutData();
+               childDListata.height = itemChildListHeight;
+               childList.setLayoutData(childDListata);
+
                callNotifyResizeChild();
        }
 
@@ -179,18 +186,20 @@ public class DAChartBoardItem extends Composite {
                if (isFold == bFold) {
                        return;
                }
+
+               zoomoutFoldItem();
+
                isFold = bFold;
                childList.setFold(isFold);
 
-               FormData data = (FormData) childList.getLayoutData();
+               FormData childDListata = (FormData) childList.getLayoutData();
                if (false == isFold) {
-                       data.height = itemChildListHeight;
+                       childDListata.height = itemChildListHeight;
                } else {
-                       data.height = 0;
+                       childDListata.height = 0;
                }
-               childList.setLayoutData(data);
+               childList.setLayoutData(childDListata);
 
-               this.layout();
                callNotifyResizeChild();
        }
 
@@ -200,24 +209,42 @@ public class DAChartBoardItem extends Composite {
                } else {
                        expandRatio = normalRatio;
                }
-               expandItem();
+               expandItem(false);
                callNotifyResizeChild();
        }
 
-       protected int callbackZoom(double zoomRatio) {
+       protected int callbackZoom(double zoomRatio, boolean isFold) {
                normalRatio = zoomRatio;
                expandRatio = normalRatio;
 
                if (null != childList) {
-                       itemChildListHeight = childList.callbackZoom(zoomRatio);
-                       FormData data = (FormData) childList.getLayoutData();
-                       data.height = itemChildListHeight;
-                       childList.setLayoutData(data);
-                       this.layout();
+                       itemChildListHeight = childList
+                                       .callbackZoom(zoomRatio, this.isFold);
+                       if (this.isFold == false) {
+                               FormData childDListata = (FormData) childList.getLayoutData();
+                               childDListata.height = itemChildListHeight;
+                               childList.setLayoutData(childDListata);
+                       }
                }
 
                itemCell.setExpandButtonNormal();
-               itemCellHeight = expandItem();
+               itemCellHeight = expandItem(isFold);
+
+               return getItemHeight();
+       }
+
+       protected int zoomoutFoldItem() {
+               final int height;
+               if (null != childList) {
+                       height = childList.zoomoutFoldItem();
+                       if (this.isFold == true) {
+                               FormData childDListata = (FormData) childList.getLayoutData();
+                               childDListata.height = height;
+                               childList.setLayoutData(childDListata);
+                       }
+               }
+
+               expandFoldItem();
 
                return getItemHeight();
        }
@@ -244,12 +271,12 @@ public class DAChartBoardItem extends Composite {
                if (null == childList) {
                        childList = new DAChartBoardItemList(this);
                        childList.setLayout(new FormLayout());
-                       FormData data = new FormData();
-                       data.left = new FormAttachment(0, 0);
-                       data.top = new FormAttachment(itemCell, 0);
-                       data.right = new FormAttachment(100, 0);
-                       data.height = 0;
-                       childList.setLayoutData(data);
+                       FormData childDListata = new FormData();
+                       childDListata.left = new FormAttachment(0, 0);
+                       childDListata.top = new FormAttachment(itemCell, 0);
+                       childDListata.right = new FormAttachment(100, 0);
+                       childDListata.height = 0;
+                       childList.setLayoutData(childDListata);
                        childList.setFold(true);
                        childList.setItemRatio(normalRatio);
                        this.layout();
@@ -349,7 +376,7 @@ public class DAChartBoardItem extends Composite {
                } else {
                        this.isHide = isHide;
                        if (false == isHide) {
-                               // itemCellHeight = (int) (expandRatio * DEFAULT_ITEM_HEIGHT);
+                               itemCellHeight = (int) (expandRatio * DEFAULT_ITEM_HEIGHT);
                                FormData data = (FormData) itemCell.getLayoutData();
                                data.height = getItemHeight();
                                itemCell.setLayoutData(data);
index b6c0cee..4fddfcc 100644 (file)
@@ -116,9 +116,9 @@ class DAChartBoardItemList extends Composite {
                                FormData data = (FormData) child.getLayoutData();
                                data.height = itemHeight;
                                child.setLayoutData(data);
-                               this.layout();
                        }
                }
+
                if (this.listHeight != listHeight) {
                        this.listHeight = listHeight;
                        return this.listHeight;
@@ -131,7 +131,7 @@ class DAChartBoardItemList extends Composite {
                return items.size();
        }
 
-       protected int callbackZoom(double zoomRatio) {
+       protected int callbackZoom(double zoomRatio, boolean isFold) {
                itemRatio = zoomRatio;
                if (null == items) {
                        return 0;
@@ -140,16 +140,33 @@ class DAChartBoardItemList extends Composite {
                DAChartBoardItem item;
                int itemHeight;
                listHeight = 0;
+
                for (int i = 0; i < itemsSize; i++) {
                        item = items.get(i);
-                       itemHeight = item.callbackZoom(zoomRatio);
-                       FormData data = (FormData) item.getLayoutData();
-                       data.height = itemHeight;
-                       item.setLayoutData(data);
-                       this.layout();
+                       itemHeight = item.callbackZoom(zoomRatio, isFold);
+
+                       if (isFold == false) {
+                               FormData data = (FormData) item.getLayoutData();
+                               data.height = itemHeight;
+                               item.setLayoutData(data);
+                       }
                        listHeight += itemHeight;
                }
+               return listHeight;
+       }
+
+       protected int zoomoutFoldItem() {
+               int itemsSize = items.size();
 
+               for (int i = 0; i < itemsSize; i++) {
+                       final DAChartBoardItem item = items.get(i);
+                       final int height = item.zoomoutFoldItem();
+                       if (isFold == true) {
+                               FormData data = (FormData) item.getLayoutData();
+                               data.height = height;
+                               item.setLayoutData(data);
+                       }
+               }
                return listHeight;
        }
 
index c62f10f..bf35e53 100644 (file)
@@ -27,7 +27,7 @@ package org.tizen.dynamicanalyzer.widgets.chartBoard;
 
 import org.tizen.dynamicanalyzer.widgets.timeline.DATimelineRenderer;
 
-class DAChartBoardManager {
+public class DAChartBoardManager {
        public final static int SCALE_100 = 1;
        public final static int SCALE_400 = 4;
        public final static int SCALE_800 = 8;
@@ -95,18 +95,18 @@ class DAChartBoardManager {
                visibleStartTime = (double) sel / 1000.0;
                board.notifyScrollChanged(visibleStartTime);
        }
-       
-       public void startTimeChanged(double time){
-               if (time+thumb > totalEndTime){
-                       time = totalEndTime - thumb;    
+
+       public void startTimeChanged(double time) {
+               if (time + thumb > totalEndTime) {
+                       time = totalEndTime - thumb;
                }
-               if(time < 0){
+               if (time < 0) {
                        time = 0;
                }
                visibleStartTime = time;
                board.notifyVisibleStartTimeChanged(visibleStartTime);
        }
-       
+
        public void middleTimeChanged(double middleTime) {
                double startTime = middleTime - thumb / 2;
                startTimeChanged(startTime);
@@ -119,9 +119,9 @@ class DAChartBoardManager {
                int visibleEnd = (int) (visibleStartTime * 1000) + (int) (thumb * 1000);
                int realEnd = (int) (this.totalEndTime * 1000);
                int distance = realEnd - visibleEnd;
-               if (distance > -1000 && distance < 1000) {                      //Tolerances
+               if (distance > -1000 && distance < 1000) { // Tolerances
                        visibleStartTime = totalEndTime - thumb;
-                       if(visibleStartTime < 0){
+                       if (visibleStartTime < 0) {
                                visibleStartTime = 0;
                        }
                        board.setScrollSelection((int) (visibleStartTime * 1000));
index 7ab6268..e3ab411 100644 (file)
@@ -37,6 +37,7 @@ 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;
@@ -62,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;
@@ -95,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);
@@ -354,9 +361,10 @@ public class DACustomCombo extends Canvas {
                        popup.setLayoutData(data);
                }
 
-               size = (size > MAX_SIZE) ? MAX_SIZE : size;
                getRects().clear();
-               for (int i = 0; i < size; i++) {
+               System.out.println("rects clear and add new rects. count is :"
+                               + boundSize);
+               for (int i = 0; i < boundSize; i++) {
                        Rectangle r = new Rectangle(2, 2 + i * height, shellWidth - 2,
                                        height);
                        getRects().add(r);
@@ -405,7 +413,15 @@ public class DACustomCombo extends Canvas {
                        itemIndex = size - MAX_SIZE;
                        select(selection);
                } else {
-                       selection = index - itemIndex;
+                       if (index >= MAX_SIZE) {
+                               itemIndex = index / MAX_SIZE;
+                               itemIndex *= MAX_SIZE;
+                               index %= MAX_SIZE;
+                       } else if (index < 0) {
+                               System.out.println("Combo indexing bug!");
+                               return false;
+                       }
+                       selection = index;
                        select(selection);
                }
                return true;
@@ -444,7 +460,8 @@ public class DACustomCombo extends Canvas {
 
                        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 (tmpItemIndex - event.count + MAX_SIZE >= size - 1) {
                                                        tmpItemIndex = size - MAX_SIZE;
@@ -502,6 +519,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;
+                                       }
+                               }
+                       });
                }
        }
 
@@ -510,10 +537,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);
                        }
                }
        };
@@ -692,6 +719,7 @@ public class DACustomCombo extends Canvas {
                selection = 0;
                items.add(DAWidgetConstants.EMPTY_STRING);
                dirty = false;
+               itemIndex = 0;
        }
 
        public void setComboButtonColor(Color normal, Color push, Color hover,
@@ -798,4 +826,12 @@ public class DACustomCombo extends Canvas {
                        }
                }, 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/DAContextMenu.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/contextMenu/DAContextMenu.java
deleted file mode 100644 (file)
index 76f2cb7..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- *  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.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.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 DAContextMenu {
-
-       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 = 7;
-       private final int STORKE_PIXEL = 2;
-       private final int STAUES_ITEMS_CHECK_TIME = 200;
-       private final int ADJUSTED_CONTEXT_MENU_POINT = 5;
-
-       public static final int MOUSE_LEFT = 1;
-       public static final int MOUSE_RIGHT = 3;
-       private Shell menuShell = null;
-       private Shell parentShell = null;
-       private Composite menuComp = null;
-       private Composite parentComp = null;
-       private Rectangle parentArea = null;
-       private Timer checkEableTimer = null;
-       private List<DAContextMenuItem> itemList = 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);
-
-               FormData compData = new FormData();
-               compData.top = new FormAttachment(0, 0);
-               compData.left = new FormAttachment(0, 0);
-               compData.right = new FormAttachment(100, 0);
-               compData.bottom = new FormAttachment(100, 0);
-               menuComp.setLayoutData(compData);
-
-               parentComp.addListener(SWT.MouseUp, parentMouseListener);
-       }
-
-       /**
-        * 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 DAContextMenu(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 parent mouse listeners event.<br>
-        */
-       private Listener parentMouseListener = new Listener() {
-               @Override
-               public void handleEvent(Event event) {
-                       if (event.type == SWT.MouseUp) {
-                               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;
-                               }
-                               }
-                       }
-               }
-       };
-
-       /**
-        * 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() {
-               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 == menuShell) {
-                       setDefaultSetting();
-               }
-               if (getItems() == null) {
-                       menuShell.setSize(CHARACTER_WIDTH_PIXEL, DEFAULT_HEIGHT);
-               } else {
-                       menuShell.setSize(itemLongestTextLenght() * CHARACTER_WIDTH_PIXEL,
-                                       DEFAULT_HEIGHT * getItems().size() + STORKE_PIXEL * 2);
-               }
-               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();
-                                               }
-                                       }
-                               });
-                       }
-               }, 200, 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);
-               } else {
-                       compData.top = new FormAttachment(0, DEFAULT_HEIGHT
-                                       * getItems().size() + STORKE_PIXEL);
-               }
-               compData.left = new FormAttachment(0, STORKE_PIXEL);
-               compData.right = new FormAttachment(100, -STORKE_PIXEL);
-               compData.height = DEFAULT_HEIGHT;
-               item.setLayoutData(compData);
-
-               itemList.add(item);
-               item.addListener(SWT.MouseUp, itemMouseListener);
-       }
-
-       /**
-        * Get the DAContextMenuItem.<br>
-        * 
-        * @return contextMenu items list
-        */
-       public List<DAContextMenuItem> getItems() {
-               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;
-       }
-}
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 4636879..b14dc26 100644 (file)
@@ -43,12 +43,16 @@ public class LifecycleBar extends Canvas {
        private double visibleStartTime = 0;
        private double totalEndTime = 0;
        private int scale = DATimeline.SCALE_100;
-       private List<LifecycleData> lifecycleDataList = new ArrayList<LifecycleData>();
+       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();
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/DACustomTimeline.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimeline.java
deleted file mode 100644 (file)
index 5684d3f..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- *  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.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
-
-public class DACustomTimeline 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 DACustomTimelineRenderer timelineRenderer = new DACustomTimelineRenderer();
-       private DACustomTimelineRangeMarker startRangeMarker = new DACustomTimelineRangeMarker(
-                       ImageResources.RANGE_MARKER_START,
-                       ImageResources.RANGE_MARKER_START_PUSH);
-       private DACustomTimelineRangeMarker endRangeMarker = new DACustomTimelineRangeMarker(
-                       ImageResources.RANGE_MARKER_END,
-                       ImageResources.RANGE_MARKER_END_PUSH);
-
-       public DACustomTimeline(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 DACustomTimelineRangeMarker getStartRangeMarker() {
-               return startRangeMarker;
-       }
-
-       public DACustomTimelineRangeMarker getEndRangeMarker() {
-               return endRangeMarker;
-       }
-
-       private PaintListener chartPaintListener = new PaintListener() {
-               @Override
-               public void paintControl(PaintEvent e) {
-                       timelineRenderer.draw(e.gc, (DACustomTimeline) 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
-                               * DACustomTimelineRenderer.DEFAULT_INTERVAL;
-       }
-
-       private double pixcelToSecond(int pixcel) {
-               return (double) pixcel / scale
-                               / DACustomTimelineRenderer.DEFAULT_INTERVAL + startTime;
-       }
-
-       public void setTotalEndTime(double time) {
-               totalEndTime = time;
-       }
-
-       public void addStickyTime(double time) {
-               stickyTimeList.add(time);
-       }
-
-       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);
-                               DACustomTimeline.this.redraw();
-                       } else if (e.x >= startMarkerPosition
-                                       && e.x <= startMarkerPosition
-                                                       + startRangeMarker.getImage().getBounds().width) {
-                               startRangeMarker.setPushStatus(true);
-                               DACustomTimeline.this.redraw();
-                       }
-               }
-
-               public void mouseUp(MouseEvent e) {
-                       if (startRangeMarker.isPushed()) {
-                               startRangeMarker.setPushStatus(false);
-                               if (startRangeMarker.getTime() > endRangeMarker.getTime()) {
-                                       endRangeMarker.setTime(-1);
-                               }
-                               DACustomTimeline.this.redraw();
-                       } else if (endRangeMarker.isPushed()) {
-                               endRangeMarker.setPushStatus(false);
-                               if (endRangeMarker.getTime() < startRangeMarker.getTime()) {
-                                       startRangeMarker.setTime(-1);
-                               }
-                               DACustomTimeline.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 > DACustomTimeline.this.getBounds().width
-                                               - startRangeMarker.getImage().getBounds().width) {
-                                       double endTimePx = secondToPixcel(totalEndTime);
-                                       if (e.x > endTimePx) {
-                                               e.x = (int) endTimePx;
-                                       } else {
-                                               e.x = DACustomTimeline.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);
-                               DACustomTimeline.this.redraw();
-                       } else if (endRangeMarker.isPushed()) {
-                               if (e.x < 0 + endRangeMarker.getImage().getBounds().width) {
-                                       e.x = endRangeMarker.getImage().getBounds().width;
-                               } else if (e.x > DACustomTimeline.this.getBounds().width) {
-                                       double endTimePx = secondToPixcel(totalEndTime);
-                                       if (e.x > endTimePx) {
-                                               e.x = (int) endTimePx;
-                                       } else {
-                                               e.x = DACustomTimeline.this.getBounds().width;
-                                       }
-                               } else {
-                                       double endTimePx = secondToPixcel(totalEndTime);
-                                       if (e.x > endTimePx) {
-                                               e.x = (int) endTimePx;
-                                       }
-                               }
-
-                               double movedTime = pixcelToSecond(e.x);
-                               endRangeMarker.setTime(movedTime);
-                               DACustomTimeline.this.redraw();
-                       }
-               }
-       }
-}
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimelineRangeMarker.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimelineRangeMarker.java
deleted file mode 100644 (file)
index a613151..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  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 DACustomTimelineRangeMarker {
-       private double time = -1;
-       private Image normalImage;
-       private Image pushedImage;
-       
-       private boolean isPushed = false;
-
-       public DACustomTimelineRangeMarker(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/DACustomTimelineRenderer.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimelineRenderer.java
deleted file mode 100644 (file)
index 9453bf9..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *  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.eclipse.swt.widgets.Display;
-import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
-import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
-
-public class DACustomTimelineRenderer {
-       public static final int DEFAULT_FONT_SIZE = 6;
-       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 int startTime;
-       int scale;
-       Font font = new Font(Display.getCurrent(), "Verdana", // FIXME
-                       DEFAULT_FONT_SIZE, SWT.NORMAL);
-
-       private void drawRangeMarkers(GC gc, DACustomTimeline timeline) {
-               DACustomTimelineRangeMarker startMarker = timeline
-                               .getStartRangeMarker();
-               DACustomTimelineRangeMarker 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, DACustomTimeline timeline) {
-               Rectangle rt = timeline.getClientArea();
-               gc.setFont(font);
-               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 >= DACustomTimeline.SCALE_400) {
-                                       drawTimeString(gc, startTime, pixcelX, 1);
-                               }
-                               gc.drawLine(pixcelX, rt.height - 5, pixcelX, rt.height - 1);
-                       } else {
-                               if (scale >= DACustomTimeline.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(new Font(Display.getCurrent(), "Verdana", 7, SWT.NONE));
-
-                       gc.drawString(time,
-                                       timeline.getDetailedTimePosition()
-                                                       - gc.stringExtent(time).x / 2, 1, true);
-               }
-       }
-}
index 73b3274..7313d1d 100644 (file)
@@ -1,5 +1,5 @@
 Internal call=off
-Platform=etc
+Platform=tizen2.1
 Build time=09/05/2012 10:30 AM (GMT)
 Snapshot=0
 Selected chart list=CPU,CPU core,CPU frequency,Heap allocation,Process Size,Memory,File,Screenshot,UI event
index b5688b1..0724184 100755 (executable)
@@ -54,7 +54,7 @@ public class Application implements IApplication {
                        String logPath = WorkbenchPathManager.getLogsPath();
                        File logs = new File(logPath);
                        if (!logs.exists()) {
-                               logs.mkdir();
+                               logs.mkdirs();
                        }
 
                        String logFileName = "da_log_" + logPostFix;//$NON-NLS-1$
index 85c7ba4..ff97f72 100755 (executable)
@@ -116,10 +116,6 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
 
        public boolean preWindowShellClose() {
                if (DACommunicator.isRunning()) {
-                       // DACommunicator
-                       // .sendMessage(AnalyzerConstants.MSG_STOP
-                       // + CommonConstants.CMD_SPLIT + 0
-                       // + CommonConstants.CMD_SPLIT);
                        DACommunicator.sendStopMessage();
                }
 
index fb4ecb6..ce25d31 100644 (file)
@@ -30,8 +30,7 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 \r
 public class AnalyzerConstants {\r
        // if log change occurs then increase save data version!!\r
-       public static final String DA_VERSION = "2.1";\r
-       public static final String SAVE_DATA_VERSION = "0.85"; //$NON-NLS-1$\r
+       public static final String SAVE_DATA_VERSION = "0.86"; //$NON-NLS-1$\r
        public static final boolean CHECK_INTERNAL = true;\r
 \r
        /* folder names */\r
@@ -57,6 +56,10 @@ public class AnalyzerConstants {
        public static final String ABOUT_FILE_NAME = "about.mappings"; //$NON-NLS-1$\r
        public static final String LICENSE_FILE_NAME = "license"; //$NON-NLS-1$\r
        public static final String USER_INTERFACE_API_LIST_FILE_NAME = "user_interface_api_list"; //$NON-NLS-1$\r
+       public static final String TIZEN_FOLDER_ROOTSTRAPS = "rootstraps"; //$NON-NLS-1$\r
+       public static final String TIZEN_FOLDER_USR = "usr"; //$NON-NLS-1$\r
+       public static final String TIZEN_FOLDER_INCLUDE = "include"; //$NON-NLS-1$\r
+       public static final String TIZEN_FOLDER_OSP = "osp"; //$NON-NLS-1$\r
 \r
        public static final String DA_DAEMON_NAME = "da_manager"; //$NON-NLS-1$\r
        public static final String TOOL_RECORDER_NAME = "da_event"; //$NON-NLS-1$\r
@@ -107,7 +110,7 @@ public class AnalyzerConstants {
 \r
        /* timer intervals */\r
        public static final int SOCKET_CHECK_INTERVAL = 10;\r
-       public static final int SOCKET_TIMEOUT = 10000;\r
+       public static final int SOCKET_TIMEOUT = 120000;\r
        public static final int SOCKET_FORWARD_INTERVAL = 1000;\r
        public static final int LOG_CHECK_INTERVAL = 1000;\r
        public static final int SAVE_PREPARE_TIME = 2000;\r
@@ -144,8 +147,12 @@ public class AnalyzerConstants {
        public static final String MSG_VERSION = "999"; //$NON-NLS-1$\r
        public static final String MSG_OK = "901"; //$NON-NLS-1$\r
        public static final String MSG_NOT_OK = "902"; //$NON-NLS-1$\r
+       public static final String MSG_WAIT = "903"; //$NON-NLS-1$\r
        public static final String MSG_SNAPSHOT = "103"; //$NON-NLS-1$\r
 \r
+       public static final int MSG_RECORD = 801;\r
+       public static final int MSG_REPLAY = 802;\r
+\r
        public static final int OPT_OFF = 0x0000;\r
        public static final int OPT_CPUMEM = 0x0001;\r
        public static final int OPT_FUNC = 0x0002;\r
index 1a08368..d423f08 100755 (executable)
@@ -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;
@@ -82,6 +84,8 @@ public class AnalyzerManager {
        private static String startBinaryAddr = null;
        private static String endBinaryAddr = null;
 
+       public static final int THREAD_JOIN_WAIT_TIME = 5000;
+
        public static boolean isExit() {
                return exit;
        }
@@ -119,9 +123,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 +191,7 @@ public class AnalyzerManager {
                failedChecker.clear();
                warningChecker.clear();
                calledChecker.clear();
+               callstackManager.clear();
                isHaveSampleThread = false;
                StopProcessManager.clear();
                UserFunctionManager.getInstance().clear();
@@ -379,6 +382,10 @@ public class AnalyzerManager {
                return warningChecker;
        }
 
+       public static CallStackManager getCallstackManager() {
+               return callstackManager;
+       }
+
        public static FailedChecker getCalledFunctionChecker() {
                return calledChecker;
        }
index 40a144b..f51f41c 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,18 +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 TIZEN_2_0_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 TIZEN_2_0_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_2_1_EMULATOR_SOUECE_PATH = TIZEN_ROOT_PATH
-                       + "/platforms/tizen2.1/rootstraps/tizen-emulator-2.1.native/usr/include/osp"; //$NON-NLS-1$
-       public static final String TIZEN_2_1_DEVICE_SOUECE_PATH = TIZEN_ROOT_PATH
-                       + "/platforms/tizen2.1/rootstraps/tizen-device-2.1.native/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$
@@ -83,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$
+
+       public static final String DA_DAEMON_LOG_PATH = "/tmp/daemonlog.da"; //$NON-NLS-1$
 }
index 3c999f9..65215b9 100644 (file)
@@ -44,6 +44,7 @@ import org.tizen.dynamicanalyzer.listeners.AnalyzerPartListener;
 import org.tizen.dynamicanalyzer.listeners.AnalyzerPerspectiveListener;\r
 import org.tizen.dynamicanalyzer.resources.ColorResources;\r
 import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;\r
+import org.tizen.dynamicanalyzer.sql.SqlManager;\r
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
 \r
 public class AnalyzerPlugin extends AbstractUIPlugin {\r
@@ -86,6 +87,7 @@ public class AnalyzerPlugin extends AbstractUIPlugin {
                                 * = false; break; } if (i + 1 == count) { delete = true; } } }\r
                                 **/\r
                                if (delete) {\r
+                                       SqlManager.getInstance().closeConnection();\r
                                        File tempDir = new File(AnalyzerPaths.TEMP_FOLDER_PATH);\r
                                        if (tempDir.isDirectory() && tempDir.exists()) {\r
                                                if (AnalyzerUtil.deleteFile(tempDir)) {\r
index deaa410..4c6a7b4 100755 (executable)
@@ -31,9 +31,7 @@ public class AnalyzerShellCommands {
        /* Commands */
        public static final String CMD_REMOVE = "rm -rf"; //$NON-NLS-1$
 
-       public static final String CMD_APPLICATION_LIST = "/usr/bin/pkginfo --listapp";
-       public static final String CMD_FIND_UNITTEST_PREFIX = "find ";//$NON-NLS-1$
-       public static final String CMD_FIND_UNITTEST_POSTFIX = " -name *.unittest";//$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;
 
@@ -41,6 +39,8 @@ public class AnalyzerShellCommands {
        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 f0a0c6e..d6deed8 100644 (file)
@@ -25,7 +25,11 @@ public enum ErrorCode {
 
        private final String message;
        private final int errNo;
-
+       
+       public static final int ERROR_MSG_INDEX = 0;
+       public static final int ERROR_LENGTH_INDEX = 1;
+       public static final int ERROR_NUMBER_INDEX = 2;
+       
        private ErrorCode(int num, String msg) {
                errNo = num;
                message = msg;
index 0b6f2ce..de4b022 100755 (executable)
@@ -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 f1526e0..d0c5501 100644 (file)
@@ -32,29 +32,29 @@ import java.io.File;
 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.SWT;
 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.AnalyzerPaths;
 import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
-import org.tizen.dynamicanalyzer.common.ErrorCode;
 import org.tizen.dynamicanalyzer.common.PathManager;
 import org.tizen.dynamicanalyzer.model.DeviceInfo;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.project.AppInfo;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
 import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.sdblib.IDevice;
@@ -62,7 +62,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;
@@ -78,6 +77,8 @@ public class DACommunicator {
        private static final int PORT_WAIT_TIME = 5;
        private static List<String> portLines = new ArrayList<String>();
 
+       private static boolean blocked = false;
+
        private static Socket controlSock = null;
        private static BufferedWriter controlWriter = null;
        private static BufferedReader controlReader = null;
@@ -89,15 +90,16 @@ public class DACommunicator {
        private static SmartDevelopmentBridge sdbBridge = null;
 
        private static List<String> packageInfoMultiLines = new ArrayList<String>();
-       private static List<AppInfo> appInfoList = new ArrayList<AppInfo>();
-       private static HashMap<String, AppInfo> packageInfoHash = new HashMap<String, AppInfo>();
+
        private static AppInfo selectedApp = null;
 
        private static List<DeviceInfo> devices = null;
        private static DeviceInfo currentDevice = null;
 
-       private static List<String> unittestMultiLines = new ArrayList<String>();
-       private static List<String> uploadDataResult = 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;
 
@@ -112,11 +114,207 @@ public class DACommunicator {
                isRunning = false;
                devices = null;
                isArch = false;
-               appInfoList.clear();
-               packageInfoHash.clear();
+               packageInfoMultiLines.clear();
+               filterMultiLines.clear();
+               uploadDataResult.clear();
+               unittestList.clear();
                remotePort = -1;
        }
 
+       public static boolean connectionProcess() {
+               // step 1. 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 2. run da_manager
+               execCommand(AnalyzerShellCommands.DACOMMAND_RUN_MANAGER);
+
+               // step 3. get remote port from /tmp/port.da in device or emul
+               if (!initRemotePort()) {
+                       return false;
+               }
+
+               // step 4. port foward
+               foward(LOCAL_PORT, remotePort);
+
+               // step 5. set da_communicator is running!
+               setRunning(true);
+
+               // step 6. create data socket
+               if (null == createControlSocket(LOCAL_PORT)) {
+                       System.out.println("control socket creation failed."); //$NON-NLS-1$
+                       setRunning(false);
+                       return false;
+               } else {
+                       System.out.println("control socket create success!!");
+               }
+
+               if (null == createSocket(LOCAL_PORT)) {
+                       System.out.println("data socket creation failed."); //$NON-NLS-1$
+                       setRunning(false);
+                       return false;
+               } else {
+                       System.out.println("data socket create success!!");
+               }
+               return true;
+       }
+
+       protected static boolean initRemotePort() {
+               int count = 0;
+               boolean ret = false;
+               // add error check
+               while (count < PORT_WAIT_TIME) {
+                       try {
+                               execShellCommand(AnalyzerShellCommands.CMD_CAT_PORT_FILE,
+                                               new MultiLineReceiver() {
+                                                       @Override
+                                                       public void processNewLines(String[] lines) {
+                                                               portLines.clear();
+                                                               for (int i = 0; i < lines.length; i++) {
+                                                                       portLines.add(lines[i]);
+                                                               }
+                                                       }
+                                               });
+                               if (!portLines.isEmpty()) {
+                                       String line = portLines.get(0);
+                                       System.out.println("port : " + line);
+                                       try {
+                                               remotePort = Integer.parseInt(line);
+                                               System.out
+                                                               .println("port get success!! : " + remotePort);
+                                               ret = true;
+                                               break;
+                                       } catch (NumberFormatException e) {
+                                               System.out.print("port is invalid...");
+                                       }
+                               }
+                               count++;
+                               System.out.print("wait for port..");
+                               Thread.sleep(1000);
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                               break;
+                       }
+               }
+               return ret;
+       }
+
+       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])) {
+                               return true;
+                       } else {
+                               System.out
+                                               .println("start message ack error :" + splitResult[1]);
+                               return false;
+                       }
+               }
+               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;
+                               } else {
+                                       System.out.println("stop message ack error :"
+                                                       + splitResult[1]);
+                                       return false;
+                               }
+                       }
+               }
+               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() {
                if (null == devices) {
                        devices = new ArrayList<DeviceInfo>();
@@ -124,11 +322,11 @@ public class DACommunicator {
                return devices;
        }
 
-       public static DeviceInfo getDeviceBySerial(String serial) {
+       public static DeviceInfo getDeviceByName(String name) {
                List<DeviceInfo> devices = getDevices();
                int size = devices.size();
                for (int i = 0; i < size; i++) {
-                       if (devices.get(i).getIDevice().getSerialNumber().equals(serial)) {
+                       if (devices.get(i).getIDevice().getSerialNumber().equals(name)) {
                                return devices.get(i);
                        }
                }
@@ -191,7 +389,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]);
+                                       }
                                }
                        }
                }
@@ -204,17 +404,18 @@ public class DACommunicator {
 
        private static boolean isArch = false;
 
-       private static MultiLineReceiver archReceiver = new MultiLineReceiver() {
-               @Override
-               public void processNewLines(String[] lines) {
-                       if (lines[0].contains(CommonConstants.ARM_ARCH)) {
-                               isArch = true;
-                       }
-               }
-       };
-
-       private static boolean isCurrentDeviceArmArch() {
-               execShellCommand(AnalyzerShellCommands.CMD_IS_ARM_ARCH, archReceiver);
+       public static boolean isCurrentDeviceArmArch() {
+               execShellCommand(AnalyzerShellCommands.CMD_IS_ARM_ARCH,
+                               new MultiLineReceiver() {
+                                       @Override
+                                       public void processNewLines(String[] lines) {
+                                               if (lines[0].contains(CommonConstants.ARM_ARCH)) {
+                                                       isArch = true;
+                                               } else {
+                                                       isArch = false;
+                                               }
+                                       }
+                               });
 
                return isArch;
        }
@@ -232,33 +433,28 @@ public class DACommunicator {
                return devNameList;
        }
 
-       private static MultiLineReceiver packageInfoReceiver = new MultiLineReceiver() {
-               @Override
-               public void processNewLines(String[] appLines) {
-                       for (int i = 0; i < appLines.length; i++) {
-                               packageInfoMultiLines.add(appLines[i]);
-                       }
-               }
-       };
-
-       private static MultiLineReceiver unittestInfoReceiver = new MultiLineReceiver() {
-               @Override
-               public void processNewLines(String[] appLines) {
-                       for (int i = 0; i < appLines.length; i++) {
-                               unittestMultiLines.add(appLines[i]);
-                       }
-               }
-       };
-
        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(packageInfoHash.values());
+               backList.addAll(appInfoHash.values());
 
                packageInfoMultiLines.clear();
 
                execShellCommand(AnalyzerShellCommands.CMD_APPLICATION_LIST,
-                               packageInfoReceiver);
+                               new MultiLineReceiver() {
+                                       @Override
+                                       public void processNewLines(String[] appLines) {
+                                               for (int i = 0; i < appLines.length; i++) {
+                                                       packageInfoMultiLines.add(appLines[i]);
+                                               }
+                                       }
+                               });
+               checkUnittest();
+               checkIME();
 
                int size = packageInfoMultiLines.size();
 
@@ -266,40 +462,43 @@ public class DACommunicator {
                        String line = packageInfoMultiLines.get(i);
                        if (line.contains("Appid")) {
                                List<String> lines = new ArrayList<String>();
-                               for (int ii = 0; ii < AppInfo.APPINFO_SIZE; ii++) {
+                               for (int ii = 0; ii < AppInfo.PKGINFO_SIZE; ii++) {
                                        lines.add(packageInfoMultiLines.get(ii + i));
                                }
-                               AppInfo pkgInfo = makeAppInfo(lines);
+                               AppInfo pkgInfo = makePackageInfo(lines);
                                if (null != pkgInfo
                                                && pkgInfo.getInfo(AppInfo.APPTYPE_INDEX).contains(
                                                                AppInfo.APPTYPE_CPP)
                                                && pkgInfo.getInfo(AppInfo.MULTIPLE_INDEX).equals(
-                                                               CommonConstants.ZERO)) {
+                                                               AppInfo.FLAG_ZERO)
+                                               && pkgInfo.getInfo(AppInfo.NODISPLAY_INDEX).equals(
+                                                               AppInfo.FLAG_ZERO)) {
                                        String pkgId = pkgInfo.getInfo(AppInfo.PACKAGE_INDEX);
-                                       if (null == packageInfoHash.get(pkgId)) {
-                                               if (!isUnittest(pkgId)) {
+                                       String appId = pkgInfo.getInfo(AppInfo.APPID_INDEX);
+                                       if (null == appInfoHash.get(pkgId)) {
+                                               if (!isUnittest(pkgId) && !isIME(appId)) {
                                                        appInfoList.add(pkgInfo);
-                                                       packageInfoHash.put(pkgId, pkgInfo);
+                                                       appInfoHash.put(pkgId, pkgInfo);
                                                }
                                        } else {
-                                               backList.remove(packageInfoHash.get(pkgId));
+                                               backList.remove(appInfoHash.get(pkgId));
                                        }
                                }
-                               i += AppInfo.APPINFO_SIZE - 1;
+                               i += AppInfo.PKGINFO_SIZE - 1;
                        }
                }
                if (!backList.isEmpty()) {
                        for (AppInfo pkg : backList) {
                                appInfoList.remove(pkg);
-                               packageInfoHash.remove(pkg);
+                               appInfoHash.remove(pkg);
                        }
                }
                return appInfoList;
        }
 
        private static boolean isUnittest(String pkgId) {
-               if (null != getUnittestList()) {
-                       for (String id : getUnittestList()) {
+               if (null != unittestList && !unittestList.isEmpty()) {
+                       for (String id : unittestList) {
                                if (id.equals(pkgId)) {
                                        return true;
                                }
@@ -308,58 +507,117 @@ public class DACommunicator {
                return false;
        }
 
-       private static List<String> getUnittestList() {
+       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();
 
-               unittestMultiLines.clear();
-               execShellCommand(AnalyzerShellCommands.CMD_FIND_UNITTEST_PREFIX
-                               + appInstallPath
-                               + AnalyzerShellCommands.CMD_FIND_UNITTEST_POSTFIX,
-                               unittestInfoReceiver);
+               filterMultiLines.clear();
+               execShellCommand(AnalyzerShellCommands.DACOMMAND_FIND_UNITTEST,
+                               new MultiLineReceiver() {
+                                       @Override
+                                       public void processNewLines(String[] appLines) {
+                                               for (int i = 0; i < appLines.length; i++) {
+                                                       filterMultiLines.add(appLines[i]);
+                                               }
+                                       }
+                               });
 
-               if (unittestMultiLines.isEmpty()) {
-                       return null;
+               if (filterMultiLines.isEmpty()) {
+                       return;
                }
 
-               List<String> unittestPkgIds = new ArrayList<String>();
-               for (String line : unittestMultiLines) {
-                       line = line.replaceFirst(appInstallPath + CommonConstants.SLASH,
-                                       CommonConstants.EMPTY);
-                       int index = line.indexOf(CommonConstants.SLASH);
-                       line = line.substring(0, index);
-                       unittestPkgIds.add(line);
+               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);
+                       }
                }
-               return unittestPkgIds;
        }
 
-       private static AppInfo makeAppInfo(List<String> lines) {
-               AppInfo appInfo = new AppInfo();
-               for (int i = 0; i < AppInfo.APPINFO_SIZE; i++) {
+       private static void checkIME() {
+               imeList.clear();
+               if (null == currentDevice) {
+                       return;
+               }
+
+               filterMultiLines.clear();
+               execShellCommand(AnalyzerShellCommands.DACOMMAND_FIND_IME,
+                               new MultiLineReceiver() {
+                                       @Override
+                                       public void processNewLines(String[] appLines) {
+                                               for (int i = 0; i < appLines.length; i++) {
+                                                       filterMultiLines.add(appLines[i]);
+                                               }
+                                       }
+                               });
+
+               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);
+                       }
+               }
+       }
+
+       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(CommonConstants.COLON);
+                       int index = line.indexOf(":");
                        String data = line.substring(index + 1, line.length()).trim();
-                       appInfo.setInfo(i, data);
+                       pkgInfo.setInfo(i, data);
                }
-               return appInfo;
+               return pkgInfo;
        }
 
-       public static AppInfo getAppInfoByName(String appLabel) {
-               int size = appInfoList.size();
-               for (int i = 0; i < size; i++) {
-                       AppInfo pkgInfo = appInfoList.get(i);
-                       if (pkgInfo.getInfo(AppInfo.LABEL_INDEX).equals(appLabel)) {
-                               return pkgInfo;
+       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 AppInfo getAppInfoByAppPkgId(String pkgid) {
-               int size = appInfoList.size();
-               for (int i = 0; i < size; i++) {
-                       AppInfo ai = appInfoList.get(i);
-                       if (ai.getInfo(AppInfo.PACKAGE_INDEX).equals(pkgid)) {
-                               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;
@@ -371,6 +629,8 @@ public class DACommunicator {
                        if (null == sock) {
                                System.out.println("failed to create a socket"); //$NON-NLS-1$
                                return null;
+                       } else {
+                               System.out.println("data socket create success!!");
                        }
 
                        sock.setSoTimeout(AnalyzerConstants.SOCKET_TIMEOUT);
@@ -385,6 +645,7 @@ public class DACommunicator {
                        new Thread(null, new ReceiveCommunicator(),
                                        AnalyzerConstants.COMMUNICATOR_RECEIVE_THREAD).start();
 
+                       System.out.println("Receive Thread start");
                } catch (SocketTimeoutException e) {
                        System.out.println("socket timeout."); //$NON-NLS-1$
                        e.printStackTrace();
@@ -427,7 +688,8 @@ public class DACommunicator {
        }
 
        public static void closeSocket() {
-               AnalyzerUtil.tryClose(reader, writer, sock);
+               AnalyzerUtil.tryClose(reader, writer, sock, controlReader,
+                               controlWriter, controlSock);
        }
 
        public static BufferedReader getSockBufferedReader() {
@@ -458,6 +720,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) {
@@ -472,10 +735,6 @@ public class DACommunicator {
                }
        }
 
-       public static void killDaemon() {
-               execShellCommand(AnalyzerShellCommands.DACOMMAND_KILL_MANAGER);
-       }
-
        public static void execShellCommand(String command) {
                execShellCommand(command, new NullOutputReceiver());
        }
@@ -498,10 +757,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();
                        }
@@ -525,34 +785,42 @@ public class DACommunicator {
        public static String handleControlMessage(String message) {
                String result = null;
                try {
-                       if (null != controlSock) {
+                       if (null != controlSock && !controlSock.isClosed()) {
                                controlWriter.write(message);
                                controlWriter.flush();
                        }
 
-                       System.out.println("wait for ack...");
+                       System.out.println("wait for ack... [send message : " + message
+                                       + " ]");
                        while (isRunning) {
                                char cbuf[] = new char[64];
+                               blocked = true;
                                int readsize = controlReader.read(cbuf);
-//                             System.out.println(readsize);
-                               
-                               if(readsize > 0)
-                               {
+                               blocked = false;
+                               if (readsize > 0) {
                                        result = String.copyValueOf(cbuf, 0, readsize);
-                                       System.out.println(result.length() + "="+ result);
-                               
-                                       if (null != result      && !result.isEmpty()) {
-                                               break;
+                                       if (null != result && !result.isEmpty()) {
+                                               String[] splitResult = result
+                                                               .split(CommonConstants.CMD_SPLIT_READ);
+                                               if (AnalyzerConstants.MSG_WAIT.equals(splitResult[0])) {
+                                                       continue;
+                                               } else {
+                                                       break;
+                                               }
                                        }
                                }
-//                             System.out.println("wait!!");
                        }
-                       System.out.println("pass");
-                       // result = "test ack message";
-
+               } catch (SocketException e) {
+                       e.printStackTrace();
+                       return null;
+               } catch (SocketTimeoutException e) {
+                       e.printStackTrace();
+                       return null;
                } catch (IOException e) {
                        e.printStackTrace();
                        return null;
+               } finally {
+                       blocked = false;
                }
                return result;
        }
@@ -639,29 +907,21 @@ 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 uploadReadelf() {
+       public static boolean uploadReadElf() {
                long readelfSize = -1;
                String readelf = AnalyzerPaths.READELF_PATH;
 
-               // for readelf
                if (isCurrentDeviceArmArch()) {
                        readelf += CommonConstants.ARM_ARCH;
                } else {
@@ -669,29 +929,46 @@ public class DACommunicator {
                }
                String source = readelf + File.separator
                                + AnalyzerConstants.READELF_BIN;
-               readelfSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PATH
-                               + AnalyzerConstants.READELF_BIN);
+               File file = new File(source);
+               if (file.exists()) {
+                       readelfSize = file.length();
+               } else {
+                       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;
+               }
 
-               if (readelfSize < 0) {
+               // readelf
+               long uploadSize = getReadelfSize();
+               if (uploadSize < 0) {
                        return false;
-               } 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()));
-                       }
+               }
+               if (readelfSize != uploadSize) {
+                       System.out.println("readelf file size is different!! "); //$NON-NLS-1$
+                       return false;
+               }
+               return true;
+       }
 
-                       boolean ret = true;
-                       // readelf
-                       if (readelfSize != Long.parseLong(resultString.get(0))) {
-                               System.out.println("readelf 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() {
@@ -718,6 +995,10 @@ public class DACommunicator {
                SmartDevelopmentBridge.removeDeviceChangeListener(deviceChanged);
        }
 
+       public static void testDisConnected() {
+               deviceChanged.deviceDisconnected(currentDevice.getIDevice());
+       }
+
        public static boolean isDeviceConnected() {
                if (null == devices || devices.isEmpty()) {
                        return false;
@@ -728,16 +1009,21 @@ public class DACommunicator {
        private static IDeviceChangeListener deviceChanged = new IDeviceChangeListener() {
                @Override
                public void deviceDisconnected(IDevice device) {
-                       // called : each device disconnected time
-                       System.out.println("device disconnected : "
-                                       + device.getSerialNumber());
-                       DeviceInfo deviceInfo = getDeviceBySerial(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 (!AnalyzerManager.isRunning()) {
+                               // called : each device disconnected time
+                               System.out.println("device disconnected : "
+                                               + device.getSerialNumber());
+                               DeviceInfo deviceInfo = getDeviceByName(device
+                                               .getSerialNumber());
+                               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);
+                                       }
+                               }
                        }
                }
 
@@ -752,19 +1038,23 @@ public class DACommunicator {
                public void deviceChanged(IDevice device, int changeMask) {
                        // called : device added - already dynamic-analyzer running (not
                        // tracing)
-                       System.out.println("device changed : " + device.getSerialNumber()
-                                       + "   " + changeMask);
-                       if (1 == changeMask) {
-                               addDevice(device);
-                               checkDevices();
-                               if (null != getSelectedDevice() && null != getSelectedApp()) {
-                                       Display.getDefault().syncExec(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       ToolbarArea.getInstance().setStartButtonEnablement(
-                                                                       true);
-                                               }
-                                       });
+                       if (!AnalyzerManager.isRunning()) {
+                               System.out.println("device changed : "
+                                               + device.getSerialNumber() + "   " + changeMask);
+                               if (1 == changeMask) {
+                                       addDevice(device);
+                                       checkDevices();
+                                       if (null != getSelectedDevice() && null != getSelectedApp()) {
+                                               Display.getDefault().syncExec(new Runnable() {
+                                                       @Override
+                                                       public void run() {
+                                                               ToolbarArea.getInstance()
+                                                                               .setStartButtonEnablement(true);
+                                                               ToolbarArea.getInstance()
+                                                                               .setStartButtonEnablement(true);
+                                                       }
+                                               });
+                                       }
                                }
                        }
                }
@@ -800,7 +1090,6 @@ public class DACommunicator {
        private static void clearDeviceAppInfo() {
                setSelectedDevice(null);
                setSelectedApp(null);
-               appInfoList.clear();
                packageInfoMultiLines.clear();
        }
 
@@ -828,206 +1117,35 @@ public class DACommunicator {
                }
        }
 
-       // NEW_COM
-       protected static void initRemotePort() {
-               int count = 0;
-               while (count < PORT_WAIT_TIME) {
-                       try {
-                               execShellCommand("cat /tmp/port.da", portReceiver);
-                               if (!portLines.isEmpty()) {
-                                       String line = portLines.get(0);
-                                       remotePort = Integer.parseInt(line);
-                                       break;
-                               }
-                               count++;
-                               System.out.println("wait for remote port get");
-                               Thread.sleep(1000);
-                       } catch (InterruptedException e) {
-                               e.printStackTrace();
-                       } catch (NumberFormatException e) {
-                               e.printStackTrace();
-                       }
-               }
-       }
-
-       // NEW_COM
-       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 connect() {
-
-               killDaemon();
-
-               System.out.println("upload readelf");
-               if (!uploadReadelf()) {
-                       System.out.println("Failed to upload files..."); //$NON-NLS-1$
-                       return false;
-               }
-
-               execCommand(AnalyzerShellCommands.DACOMMAND_RUN_MANAGER);
-
-               initRemotePort();
-               if (remotePort < 0) {
-                       System.out.println("get port failed! : "
-                                       + ErrorCode.getError(remotePort).getMessage());
-                       return false;
-               }
-               foward(LOCAL_PORT, remotePort);
-
-               setRunning(true);
+       public static String getLocalhost() {
+               NetworkInterface ni;
+               InetAddress i;
 
-               if (null == createControlSocket(LOCAL_PORT)) {
-                       System.out.println("socket creation failed."); //$NON-NLS-1$
-                       return false;
+               Enumeration<NetworkInterface> ne;
+               try {
+                       ne = NetworkInterface.getNetworkInterfaces();
+               } catch (SocketException e1) {
+                       e1.printStackTrace();
+                       return null;
                }
-
-               return true;
-       }
-
-       // NEW_COM
-       public static boolean sendVersionMessage() {
-               String message = AnalyzerConstants.MSG_VERSION
-                               + CommonConstants.CMD_SPLIT + AnalyzerConstants.DA_VERSION.length() +
-                               CommonConstants.CMD_SPLIT + AnalyzerConstants.DA_VERSION;
-               System.out.println("Send control message :" + message); //$NON-NLS-1$
-
-               String result = handleControlMessage(message);
-
-               if (null != result) {
-                       System.out.println("version message ack :" + result);
-                       String[] splitResult = result.split(CommonConstants.CMD_SPLIT_READ);
-
-                       if (AnalyzerConstants.MSG_NOT_OK.equals(splitResult[0])) {
-                               final String deviceVersion = splitResult[2];
-                               Display.getDefault().syncExec(new Runnable() {
-                                       @Override
-                                       public void run() {
-                                               Shell shell = AnalyzerUtil.getWorkbenchWindow()
-                                                               .getShell();
-                                               DADialog warning = new DADialog(shell, SWT.NONE);
-                                               warning.setMessage("Version is invalid (device :"
-                                                               + deviceVersion + " host :"
-                                                               + AnalyzerConstants.DA_VERSION);
-                                               warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
-                                               warning.open();
+               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 false;
-                       } else if (AnalyzerConstants.MSG_OK.equals(splitResult[0])) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-
-       // NEW_COM
-       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;
-               }
-
-               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;
-       }
-
-       // NEW_COM
-       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;
-       }
-
-       // NEW_COM
-       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;
+               return null;
        }
 
-       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 boolean isWaitControlMessage() {
+               return blocked;
        }
 }
index 53d21df..ff157a5 100644 (file)
@@ -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;
@@ -76,6 +84,8 @@ public class IDECommunicator implements Runnable {
        private static boolean openWelcomeDlg = false;
        private static Boolean waitingWelcomeDlg = false;
 
+       DADialog warning = null;
+
        public void run() {
                while (true) {
                        try {
@@ -265,22 +275,14 @@ public class IDECommunicator implements Runnable {
 
        // trace Application
        private void autoStartApplication(String[] strMsg) {
-               final String deviceName = new String(strMsg[1].trim());
-               final String appid = new String(strMsg[2].trim());
-
-               System.out.println("auto start : " + appid);
-               DeviceInfo device = DACommunicator.getDeviceBySerial(deviceName);
-               DACommunicator.setSelectedDevice(device);
-
-               DACommunicator.getAppListFromTarget();
-               AppInfo appInfo = DACommunicator.getAppInfoByAppPkgId(appid);
-               if (null == appInfo) {
-                       System.out.println("invalid application name :" + appid);
+               if (strMsg.length < MSG_LENGTH) {
+                       System.out.println("wrong message format!!");
                        return;
                }
-               final String appLabel = appInfo.getInfo(AppInfo.LABEL_INDEX);
-               System.out.println("IDE recv - deviceName: " + deviceName
-                               + " appName : " + appLabel);
+               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());
 
                if (isOpenWelcomeDlg()) {
                        System.out.println("Start -AutoRun Waiting...");
@@ -293,7 +295,36 @@ public class IDECommunicator implements Runnable {
                        }
                        System.out.println("End - AutoRun Waiting");
                }
-               
+
+               System.out.println("auto start : " + appid);
+               DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
+               DACommunicator.setSelectedDevice(device);
+
+               DACommunicator.getAppListFromTarget();
+               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 appLabel = appInfo.getInfo(AppInfo.LABEL_INDEX);
+               System.out.println("IDE recv - deviceName: " + deviceName
+                               + " appName : " + appLabel);
+
                Display.getDefault().syncExec(new Runnable() {
                        public void run() {
                                ToolbarArea.getInstance().setDeviceComboText(deviceName);
@@ -301,6 +332,7 @@ public class IDECommunicator implements Runnable {
                                ToolbarArea.getInstance().startTrace();
                        }
                });
+
                DASingletonFocusManager.setFocusDA();
        }
 
index 82db6d9..4a615f7 100644 (file)
@@ -32,7 +32,7 @@ public class ReceiveCommunicator implements Runnable {
 
        @Override
        public void run() {
-               MessageProcess.getInstance().run(
-                               DACommunicator.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 597950f..0ab5215 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
+                               .execCommand(AnalyzerShellCommands.DACOMMAND_KILL_MANAGER);
                DACommunicator.pullDaemonLog();
                return null;
        }
index 367461d..b117139 100644 (file)
@@ -48,7 +48,6 @@ import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ImageResources;\r
 import org.tizen.dynamicanalyzer.sql.SqlManager;\r
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;\r
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;\r
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;\r
 import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;\r
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;\r
@@ -83,9 +82,8 @@ public class OpenTraceHandler extends AbstractHandler {
                                p.getSavePath());\r
 \r
                if (null == pInfo || pInfo.isEmpty()) {\r
-                       // TODO: message box\r
-                       // TODO: valid check\r
                        System.out.println("The trace file is invalid."); //$NON-NLS-1$\r
+                       createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE);\r
                        AnalyzerUtil.executeCommand(ClearHandler.ID);\r
                        return null;\r
                }\r
@@ -196,6 +194,7 @@ public class OpenTraceHandler extends AbstractHandler {
                }\r
 \r
                ToolbarArea.getInstance().setTime(p.getLastTime());\r
+               ToolbarArea.getInstance().setDeviceComboText(p.getDevice());\r
                ToolbarArea.getInstance().setAppComboText(p.getAppName());\r
                ToolbarArea.getInstance().setRepalyButtonEnable(true);\r
                if (AnalyzerManager.getProject().getBinaryPath().isEmpty()) {\r
@@ -263,7 +262,7 @@ public class OpenTraceHandler extends AbstractHandler {
                                long addr = Long.parseLong(splitAddrs[j]);\r
                                addrList.add(addr);\r
                        }\r
-                       CallStackManager.getInstance().getCallStackDataBySeqMap()\r
+                       AnalyzerManager.getCallstackManager().getCallStackDataBySeqMap()\r
                                        .put(seq, csd);\r
                }\r
                return isSuccess;\r
@@ -278,8 +277,8 @@ public class OpenTraceHandler extends AbstractHandler {
                        isSuccess = false;\r
                }\r
 \r
-               HashMap<Long, CallStackUnit> apiHash = CallStackManager.getInstance()\r
-                               .getCallStackApiByAddrMap();\r
+               HashMap<Long, CallStackUnit> apiHash = AnalyzerManager\r
+                               .getCallstackManager().getCallStackApiByAddrMap();\r
                for (int i = 0; i < dbInfo.size(); i++) {\r
                        List<String> pInfo = dbInfo.get(i);\r
                        long addr = Long.parseLong(pInfo.get(0));\r
@@ -401,7 +400,7 @@ public class OpenTraceHandler extends AbstractHandler {
                        String seq = pInfo.get(ProfilingData.SEQUENCE_INDEX);\r
                        profiler.getProfilingDataMap().put(seq, fupData);\r
                        String symbol = pInfo.get(ProfilingData.KEY_INDEX);\r
-                       FunctionUsageProfiler.getSymbolSeqHash().put(symbol, seq);\r
+                       profiler.getSymbolSeqHash().put(symbol, seq);\r
                        UIDataManager.getInstance().getfunctionProfilingDataChecker()\r
                                        .addProfilingData(fupData);\r
                }\r
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 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 287da39..4909faf 100644 (file)
@@ -54,7 +54,6 @@ import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;\r
 import org.tizen.dynamicanalyzer.resources.FontResources;\r
 import org.tizen.dynamicanalyzer.resources.ImageResources;\r
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;\r
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;\r
 import org.tizen.dynamicanalyzer.ui.widgets.DADialog;\r
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;\r
@@ -364,7 +363,7 @@ public class TableTooltipListener implements Listener {
                                sl.setError(AnalyzerConstants.SOURCELINE_NO_SOURCELINE_DATA);\r
                                return sl;\r
                        }\r
-                       addr = CallStackManager.getInstance().getPCAddrBySeq(seqNum);\r
+                       addr = AnalyzerManager.getCallstackManager().getPCAddrBySeq(seqNum);\r
                }\r
                boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();\r
                String baseAddr = AnalyzerManager.getProject().getBaseAddress();\r
index 945d03b..b925cb8 100644 (file)
@@ -109,13 +109,21 @@ public class LogCenterConstants {
        public static final int FD_TYPE_THREAD = 2;
        
        /* 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 = 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_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 3fe611e..aa54d0f 100644 (file)
@@ -52,7 +52,7 @@ public class LogInserter implements Runnable {
                if (null != insertLogThread && insertLogThread.isAlive()) {
                        try {
                                sendNotify();
-                               insertLogThread.join();
+                               insertLogThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                                System.out.println("insert thread join complete!!"); //$NON-NLS-1$
                        } catch (InterruptedException e) {
                                e.printStackTrace();
index 2a446e3..04ed199 100755 (executable)
@@ -38,10 +38,11 @@ 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;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderPlayThread;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.utils.ImageUtil;
 import org.tizen.sdblib.SyncService;
@@ -65,8 +66,6 @@ public class LogParser implements Runnable {
        /** thread **/
        private String pid = null;
 
-       // private String lastLogSeqNumber = CommonConstants.ZERO;
-
        public static void clear() {
                stopLogParser();
                getLogQueue().clear();
@@ -112,7 +111,7 @@ public class LogParser implements Runnable {
                        }
                        try {
                                System.out.println("wait for log parser join");//$NON-NLS-1$
-                               logParser.join();
+                               logParser.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                        } catch (InterruptedException e) {
                                e.printStackTrace();
                        }
@@ -195,11 +194,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];
@@ -222,18 +216,26 @@ 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());
-                       } else if (id == LogCenterConstants.LOG_DEVICE
-                                       || id == LogCenterConstants.LOG_PROFILING) {
+                       } else if (id == LogCenterConstants.LOG_DEVICE) {
+                               if (seqNum == 1) {
+                                       UIRecorderPlayThread rp = UIRecorderTool.getInstance()
+                                                       .getPlayThead();
+                                       if (null != rp && rp.isAlive()) {
+                                               UIRecorderTool.getInstance().getPlayThead().interrupt();
+                                       }
+                               }
+                               pushLog(logId, slicedLog, logPack);
+                       } else if (id == LogCenterConstants.LOG_PROFILING) {
                                pushLog(logId, slicedLog, logPack);
                        } else {
                                if (id == LogCenterConstants.LOG_SCREENSHOT) {
@@ -244,14 +246,15 @@ 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
@@ -267,32 +270,47 @@ public class LogParser implements Runnable {
                                + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
                                + File.separator + fileName;
                final int angle = Integer.parseInt(rotate);
+               if (angle != 0) {
+                       System.out.println("[ image rotate : " + angle + " ]");
+               }
 
                new Thread(null, new Runnable() {
+                       int count = 0;
+
                        @Override
                        public void run() {
-                               SyncResult res = DACommunicator.pull(from, to);
-                               if (null != res && SyncService.RESULT_OK == res.getCode()) {
-                                       DACommunicator.removeCommand(from);
-                                       /* image resizing */
-                                       String smallImagePath = AnalyzerManager.getProject()
-                                                       .getSavePath()
-                                                       + File.separator
-                                                       + AnalyzerConstants.IMAGE_FOLDER_NAME
-                                                       + File.separator
-                                                       + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
-                                                       + File.separator + fileName;
-                                       ImageUtil.transform(to, to, DEFAULT_IMG_WIDTH,
-                                                       DEFAULT_IMG_HEIGHT, angle);
-                                       if (angle == 90 || angle == 270) {
-                                               ImageUtil.resize(to, smallImagePath, SMALL_IMG_HEIGHT,
-                                                               SMALL_IMG_WIDTH);
+                               while (true && count < 5) {
+                                       SyncResult res = DACommunicator.pull(from, to);
+                                       if (null != res && SyncService.RESULT_OK == res.getCode()) {
+                                               DACommunicator.removeCommand(from);
+                                               /* image resizing */
+                                               String smallImagePath = AnalyzerManager.getProject()
+                                                               .getSavePath()
+                                                               + File.separator
+                                                               + AnalyzerConstants.IMAGE_FOLDER_NAME
+                                                               + File.separator
+                                                               + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
+                                                               + File.separator + fileName;
+                                               ImageUtil.transform(to, to, DEFAULT_IMG_WIDTH,
+                                                               DEFAULT_IMG_HEIGHT, angle);
+                                               if (angle == 90 || angle == 270) {
+                                                       ImageUtil.resize(to, smallImagePath,
+                                                                       SMALL_IMG_HEIGHT, SMALL_IMG_WIDTH);
+                                               } else {
+                                                       ImageUtil.resize(to, smallImagePath,
+                                                                       SMALL_IMG_WIDTH, SMALL_IMG_HEIGHT);
+                                               }
+
+                                               break;
                                        } else {
-                                               ImageUtil.resize(to, smallImagePath, SMALL_IMG_WIDTH,
-                                                               SMALL_IMG_HEIGHT);
+                                               System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+                                               try {
+                                                       Thread.sleep(1000);
+                                                       count++;
+                                               } catch (InterruptedException e) {
+                                                       e.printStackTrace();
+                                               }
                                        }
-                               } else {
-                                       System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
                                }
                        }
                }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
index 0fe1f32..3c78869 100644 (file)
@@ -46,7 +46,8 @@ import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
 import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
 import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
+import org.tizen.dynamicanalyzer.uirecorder.RecordingQueue;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderRecordThread;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.sdblib.SyncService;
 import org.tizen.sdblib.SyncService.SyncResult;
@@ -62,10 +63,11 @@ public class MessageProcess {
        final int MSG_BUFFER_MAX = 100;
        final int MSG_BUFFER_TIMER_DELAY = 5;
        final int MSG_BUFFER_TIMER_PERIOD = 1000; // 1 second
-       private static int count = 0;
        final int WAITING_TIME = 10;
 
        class AddBufferTimerTask extends TimerTask {
+               private int count = 0;
+
                @Override
                public void run() {
                        if (!buffer.isEmpty()) {
@@ -117,10 +119,10 @@ public class MessageProcess {
 
        public void processMessage(String message) {
                // DO NOT DELETE : for debugging
-               // System.out.println("count " + messageCount + ": " + message);
+//              System.out.println("count " + messageCount + ": " + message);
                try {
-                       String[] messages = message
-                                       .split(CommonConstants.CMD_SPLIT_READ, MSG_SPLIT_SIZE);
+                       String[] messages = message.split(CommonConstants.CMD_SPLIT_READ,
+                                       MSG_SPLIT_SIZE);
                        int messageIndex = Integer.parseInt(messages[MSG_ID_INDEX]);
 
                        switch (messageIndex) {
@@ -150,6 +152,9 @@ public class MessageProcess {
                        case AnalyzerConstants.MSG_TERMINATE: /* terminate : 7 */
                                processTerminate();
                                break;
+                       case AnalyzerConstants.MSG_RECORD: /* terminate : 7 */
+                               processRecordLog(messages[MSG_PAYLOAD_INDEX]);
+                               break;
                        case AnalyzerConstants.MSG_DEBUG: /* debug message : 9 */
                        default:
                                // System.out.println("DA_LOG : " + message); //$NON-NLS-1$
@@ -163,8 +168,6 @@ public class MessageProcess {
 
                } catch (NumberFormatException e) {
                        e.printStackTrace();
-               } catch (IndexOutOfBoundsException e) {
-                       e.printStackTrace();
                }
        }
 
@@ -204,6 +207,11 @@ public class MessageProcess {
                return name;
        }
 
+       private void processRecordLog(final String record) {
+               RecordingQueue rq = UIRecorderRecordThread.getRecordingQueue();
+               rq.putLog(record);
+       }
+
        private void processImage(final String from) {
                final String fileName = getImageName(from);
                final String to = AnalyzerManager.getProject().getSavePath()
@@ -297,7 +305,8 @@ public class MessageProcess {
                                        }
                                }
                        } // end while()
-                       Display.getDefault().syncExec(new Runnable() {
+                       System.out.println("Receive thread end!!");
+                       Display.getDefault().asyncExec(new Runnable() {
                                @Override
                                public void run() {
                                        StopProcessManager.getInstance().stopProcessStart(
@@ -310,7 +319,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
@@ -325,6 +334,7 @@ public class MessageProcess {
        }
 
        private void endingSteps() {
+               System.out.println("Ending steps!");
                message = null;
                DACommunicator.setRunning(false);
                AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
@@ -337,7 +347,6 @@ public class MessageProcess {
                });
                stopTimer();
                addBufferToList();
-               UIRecorderTool.getInstance().stop();
                System.out.println("stop log process start");//$NON-NLS-1$
                StopLogProcessor.runStopLogProcessThread();
                DACommunicator.closeSocket();
index ec2d2e1..898e613 100644 (file)
@@ -1,14 +1,23 @@
 package org.tizen.dynamicanalyzer.model;
 
-import org.tizen.sdblib.IDevice;
+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) {
@@ -22,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 0e16c6e..e794a0d 100755 (executable)
@@ -50,7 +50,15 @@ public class AnalyzerLabels extends NLS {
        public static String STOP_TRACE;
        public static String SAVE_TRACE;
        public static String OPEN_TRACE;
+       public static String OPEN_TRACE_TITLE;
        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 +68,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;
@@ -105,6 +114,13 @@ public class AnalyzerLabels extends NLS {
        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 0796648..7e93927 100755 (executable)
@@ -13,21 +13,29 @@ OPEN=Open
 CLOSE=Close
 
 #Toolbar button
-START_TRACE=Start trace [Ctrl + Space]
-STOP_TRACE=Stop trace [Ctrl + Space]
-SAVE_TRACE=Save trace [Ctrl + s]
-OPEN_TRACE=Open trace [Ctrl + o]
-REPLAY=Replay [Ctrl + r]
+START_TRACE=Start trace [Ctrl + G]
+STOP_TRACE=Stop trace [Ctrl + G]
+SAVE_TRACE=Save trace [Ctrl + S]
+OPEN_TRACE=Open trace [Ctrl + O]
+OPEN_TRACE_TITLE=Open trace
+REPLAY=Replay [Ctrl + P]
+
+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 + P]
+
 RANGE_PAGE=Range page
-VIEW_SOURCE=View source [F2]
-SNAPSHOT_ENABLE=Take snapshot [F3]
-SETTING=Settings [F6]
+VIEW_SOURCE=View source [F3]
+SNAPSHOT_ENABLE=Take snapshot
+SETTING=Settings [F2]
 
 #Setting menu
 ABOUT=About Tizen Dynamic Analyzer [F1]
 LICENSE=License
 CONFIGURATION=Configuration
-
+WELCOME=Welcome
 # SingletonInfoDlg.
 DA_WARNING=Warning
 
@@ -71,6 +79,13 @@ 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
 
@@ -125,7 +140,7 @@ PATH_WARNING=Please install the Tizen SDK
 OS_WARNING=Current OS not supported. Please check your OS.
 RE_TRACE_FORM_IDE=Another application is already running.
 IDE_DA_COMMUNICATION_ERROR_MESSAGE=IDE connection error.
-START_TRACE_ERROR=Start trace failed.\nSee log.
+START_TRACE_ERROR=Start trace failed.
 INVALID_APPLICATION=Invalid Application
 
 STOP_PROCESS_DLG_PLEASE_WAIT=Please wait
index 2040e78..3d6fdbc 100644 (file)
@@ -20,23 +20,24 @@ USERINTERFACE=UserInterface
 SNAPSHOT=Snapshot
 EVENT=Event
 RECORDING=Recording <always on>
-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 screen shots of application.
+
+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 1e0fd15..d6e01db 100644 (file)
@@ -78,7 +78,7 @@ public class TimelineChartLabels extends NLS {
        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_TO_SELECTION;
+       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 c3d4276..73020c9 100644 (file)
@@ -53,7 +53,7 @@ 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_SET_TO_SELECTION=Set range to selection
+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
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppDesktopInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppDesktopInfo.java
deleted file mode 100644 (file)
index b3bc0bd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  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;
-
-public class AppDesktopInfo {
-       private String desktopName;
-       private String name;
-       private String id;
-       private String execPath;
-
-       public String getDesktopName() {
-               return desktopName;
-       }
-
-       public void setDesktopName(String desktopName) {
-               this.desktopName = desktopName;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getExecPath() {
-               return execPath;
-       }
-
-       public void setExecPath(String execPath) {
-               this.execPath = execPath;
-       }
-
-       public void setPkgId(String pkgid) {
-               id = pkgid;
-       }
-
-       public String getPkgId() {
-               return id;
-       }
-}
index bd4f776..86a83d2 100644 (file)
@@ -44,23 +44,35 @@ public class AppInfo {
        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 APPINFO_SIZE = 11;
+       public static final int USER_DATA_INDEX = 11;
+       public static final int PKGINFO_SIZE = 12;
 
-       public static final String APPTYPE_CPP = "c++";
+       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 List<String> pkginfo = new ArrayList<String>();
+       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 < APPINFO_SIZE; i++) {
-                       pkginfo.add(CommonConstants.EMPTY);
+               for (int i = 0; i < PKGINFO_SIZE; i++) {
+                       appInfo.add(CommonConstants.EMPTY);
                }
        }
 
        public void setInfo(int index, String data) {
-               pkginfo.set(index, data);
+               appInfo.set(index, data);
        }
 
        public String getInfo(int index) {
-               return pkginfo.get(index);
+               return appInfo.get(index);
        }
 }
index 21dad5a..c8f6ef0 100644 (file)
@@ -300,6 +300,7 @@ public class ImageResources {
        public static final Image TREE_OPEN = getPngImage("tree_open"); //$NON-NLS-1$\r
        public static final Image TREE_FOLD = getPngImage("tree_fold"); //$NON-NLS-1$\r
        public static final Image NO_IMAGE = getPngImage("empty_snapshot"); //$NON-NLS-1$\r
+       public static final Image NO_IMAGE_SMALL = getPngImage("empty_snapshot_small"); //$NON-NLS-1$\r
 \r
        /* score */\r
        public static final Image SCORE_0 = getPngImage("score_0"); //$NON-NLS-1$\r
index d45ba86..a08b064 100644 (file)
@@ -6,6 +6,7 @@ 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;
@@ -25,6 +26,47 @@ 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) {
@@ -33,6 +75,12 @@ public class ShortCutManager {
                return instance;
        }
 
+       private ShortCutManager() {
+               if (AnalyzerUtil.isMac()) {
+                       CTRL_STATE_MASK = SWT.COMMAND;
+               }
+       }
+
        // for normal listener
        public void handleShortCutEvent(Event event) {
                if (!enabled) {
@@ -44,64 +92,54 @@ public class ShortCutManager {
                        AboutDialog dialog = new AboutDialog(shell, SWT.NONE); // FIXME
                        dialog.open();
                } else if (event.keyCode == SWT.F2) {
-                       System.out.println("view source toggle");
-                       DACustomToggleButton button = (DACustomToggleButton) ToolbarArea
-                                       .getInstance().getButton(ToolbarArea.SOURCE_BUTTON);
-                       button.setToggled(!button.isToggled());
-               } else if (event.keyCode == SWT.F3) {
-                       System.out.println("snap shot toggle");
-
-               } else if (event.keyCode == SWT.F4) {
-                       System.out.println("range toggle");
-                       if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-                               RangeDataManager.getInstance().initRange();
-                       } else {
-                               if (RangeDataManager.getInstance().isAnalyzable()) {
-                                       RangeDataManager.getInstance().startRangeAnalysis();
-                               }
-                       }
-               } else if (event.keyCode == SWT.F5) {
-                       System.out.println("refresh page");
-                       AnalyzerManager.getCurrentPage().updateView();
-               } else if (event.keyCode == SWT.F6) {
                        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 == SWT.CTRL && event.keyCode == 49) {
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 49) {
                        System.out.println("timeline page");
                        AnalyzerUtil.changePage(TimelinePage.ID);
-               } else if (event.stateMask == SWT.CTRL && event.keyCode == 50) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 50) {
                        System.out.println("file page");
                        AnalyzerUtil.changePage(FilePage.ID);
-               } else if (event.stateMask == SWT.CTRL && event.keyCode == 51) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 51) {
                        System.out.println("thread page");
                        AnalyzerUtil.changePage(ThreadPage.ID);
-               } else if (event.stateMask == SWT.CTRL && event.keyCode == 52) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 52) {
                        System.out.println("ui page");
                        AnalyzerUtil.changePage(UIPage.ID);
-               } else if (event.stateMask == SWT.CTRL && event.keyCode == 53) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 53) {
                        System.out.println("summary page");
                        AnalyzerUtil.changePage(SummaryPage.ID);
-               } else if (event.stateMask == SWT.CTRL && event.keyCode == 54) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 54) {
                        System.out.println("range page");
                        AnalyzerUtil.changePage(RangePage.ID);
                }
                // ctrl + t = 116
-               // 32 -> space
-               else if (event.stateMask == SWT.CTRL && event.keyCode == 32) {
-                       System.out.println("start trace");
+               // 103 -> g
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 103) {
                        if (!AnalyzerManager.isRunning()) {
+                               System.out.println("start trace");
+                               enabled = false;
+                               System.out.println("start trace start");
                                ToolbarArea.getInstance().startTrace();
+                               System.out.println("start trace end");
                        } else {
+                               System.out.println("stop trace");
+                               enabled = false;
                                ToolbarArea.getInstance().stopTrace();
                        }
                }
                // o
-               else if (event.stateMask == SWT.CTRL && event.keyCode == 111) {
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 111) {
                        System.out.println("open trace");
                        if (!AnalyzerManager.isRunning()) {
                                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
@@ -110,7 +148,7 @@ public class ShortCutManager {
                        }
                }
                // s
-               else if (event.stateMask == SWT.CTRL && event.keyCode == 115) {
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 115) {
                        System.out.println("save trace");
                        if (ToolbarArea.getInstance().getButton(ToolbarArea.SAVE_BUTTON)
                                        .isButtonEnabled()) {
@@ -124,8 +162,8 @@ public class ShortCutManager {
                                }
                        }
                }
-               // r
-               else if (event.stateMask == SWT.CTRL && event.keyCode == 114) {
+               // p
+               else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 112) {
                        System.out.println("replay ");
                        if (!AnalyzerManager.isRunning()) {
                                DACustomButton button = (DACustomButton) ToolbarArea
@@ -137,6 +175,17 @@ public class ShortCutManager {
                                }
                        }
                }
+               // 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) {
index 43915fa..d965a22 100755 (executable)
@@ -47,7 +47,6 @@ 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;
@@ -64,6 +63,7 @@ public class SqlManager {
        private Semaphore semaphore = new Semaphore(PERMIT);
        private static SqlManager instance = null;
        private Connection connection = null;
+
        private Connection getConnection() {
                Project project = AnalyzerManager.getProject();
                if (null != project && !AnalyzerManager.isExit()) {
@@ -74,7 +74,6 @@ public class SqlManager {
 
        public Connection getConnection(String path) {
                try {
-                       semaphore.acquire();
                        if (null != connection) {
                                return connection;
                        }
@@ -85,17 +84,21 @@ public class SqlManager {
                        e.printStackTrace();
                } catch (SQLException e) {
                        e.printStackTrace();
-               } catch (InterruptedException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               } finally {
-                       if (connection == null) {
-                               semaphore.release();
-                       }
                }
                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;
@@ -138,7 +141,7 @@ public class SqlManager {
                        if (null == conn) {
                                return;
                        }
-
+                       semaphoreAcquire();
                        Statement stat = conn.createStatement();
                        stat.executeUpdate(createDropTableQuery(lcenter.getName()));
                        stat.executeUpdate(createTableQuery(lcenter));
@@ -177,6 +180,7 @@ public class SqlManager {
                        if (null == conn) {
                                return;
                        }
+                       semaphoreAcquire();
                        Statement stat = conn.createStatement();
                        stat.executeUpdate(createDropTableQuery("project")); //$NON-NLS-1$
                        String query = "create table project (info TEXT not null)"; //$NON-NLS-1$
@@ -202,7 +206,7 @@ public class SqlManager {
                        if (null == conn) {
                                return;
                        }
-
+                       semaphoreAcquire();
                        DBTableManager dbManager = DBTableManager.getInstance();
                        Statement stat = conn.createStatement();
                        if (!executeUpdateCreateTable(stat,
@@ -285,6 +289,7 @@ public class SqlManager {
                                System.out.println("failed sql inset : " + input);
                                return false;
                        }
+                       semaphoreAcquire();
                        prep = conn.prepareStatement(query);
                        int dataRowSize = input.size();
                        for (int i = 0; i < dataRowSize; i++) {
@@ -480,8 +485,10 @@ public class SqlManager {
                                DBTableManager.TABLE_INDEX_CALLSTACK_UNITS);
                List<List<String>> insetData = new ArrayList<List<String>>();
                String insertQuery = unitTableInfo.insertQuery();
-               HashMap<Long, CallStackUnit> callstackMap = CallStackManager
-                               .getInstance().getCallStackApiByAddrMap();
+               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();
@@ -504,7 +511,9 @@ public class SqlManager {
                                DBTableManager.TABLE_INDEX_CALLSTACK_DATA);
                List<List<String>> insetData = new ArrayList<List<String>>();
                String insertQuery = callstackData.insertQuery();
-               Collection<CallStackData> col = CallStackManager.getInstance()
+               // Collection<CallStackData> col = CallStackManager.getInstance()
+               // .getCallStackDataBySeqMap().values();
+               Collection<CallStackData> col = AnalyzerManager.getCallstackManager()
                                .getCallStackDataBySeqMap().values();
                List<CallStackData> callstackDataList = new ArrayList<CallStackData>();
                callstackDataList.addAll(col);
@@ -628,7 +637,7 @@ public class SqlManager {
                        if (null == conn) {
                                return null;
                        }
-
+                       semaphoreAcquire();
                        if (null == tableName || tableName.length() < 1) {
                                System.out.println("tableName is null");
                                return null;
@@ -655,7 +664,7 @@ public class SqlManager {
 
                        stat = conn.createStatement();
                        rs = stat.executeQuery(query);
-                       if(null == rs){
+                       if (null == rs) {
                                return null;
                        }
                        dbInfo = new ArrayList<List<String>>();
@@ -780,7 +789,7 @@ public class SqlManager {
        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){
+               if (dbInfo == null) {
                        return null;
                }
                List<String> pInfo = new ArrayList<String>();
@@ -7,23 +7,19 @@ import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
 import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 
-public class ContextToSelectionMenuItemClickListener extends
+public class ContextFromSelectionMenuItemClickListener extends
                DAContextMenuListener {
-       // private DAContextMenuItem toSelectionItem;
        private DAChartBoard chartBoard;
        private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
 
-       public ContextToSelectionMenuItemClickListener(DAContextMenuItem item,
+       public ContextFromSelectionMenuItemClickListener(DAContextMenuItem item,
                        DAChartBoard board) {
-               // toSelectionItem = item;
                chartBoard = board;
        }
 
        @Override
        public void widgetSelected(DAContextMenuItem menuItem) {
                // TODO Auto-generated method stub
-               // double startTime = chartBoard.getSelectionStartTime();
-               // double endTime = chartBoard.getSelectionEndTime();
                double startTime = ((DAChartPlotIntervalMarker) chartBoard.getMarkers()
                                .get(UICommonConstants.SELECTION_MARKER_INDEX)).getStartVal();
                double endTime = ((DAChartPlotIntervalMarker) chartBoard.getMarkers()
@@ -1,29 +1,3 @@
-/*
- *  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.ui.common;
 
 import java.util.List;
@@ -31,6 +5,7 @@ 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;
@@ -45,20 +20,28 @@ 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 TimelineChartMouseAdapter extends MouseAdapter {
+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 TimelineChartMouseAdapter(DAContextMenu menu) {
+       public TimelineChartMouseEventListener(DAContextMenu menu,
+                       DATimeline timeline) {
                this.menu = menu;
+               this.timeline = timeline;
        }
 
        @Override
@@ -78,7 +61,7 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                        List<DAContextMenuItem> itemList = menu.getItems();
                        DAContextMenuItem startItem = itemList.get(0);
                        DAContextMenuItem endItem = itemList.get(1);
-                       DAContextMenuItem toSelectionItem = itemList.get(2);
+                       DAContextMenuItem fromSelectionItem = itemList.get(2);
                        DAContextMenuItem analysisItem = itemList.get(3);
                        DAContextMenuItem clearItem = itemList.get(4);
 
@@ -97,10 +80,11 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                                analysisItem.setButtonEnabled(rangeDataManager.isAnalyzable());
                                clearItem.setButtonEnabled(rangeDataManager.isBeingAnalyzed());
                        }
-                       
-                       if (intervalMarker.getStartVal() != intervalMarker.getEndVal())
-                       {
-                               toSelectionItem.setButtonEnabled(true);
+
+                       if (intervalMarker.getStartVal() != intervalMarker.getEndVal()) {
+                               fromSelectionItem.setButtonEnabled(true);
+                       } else {
+                               fromSelectionItem.setButtonEnabled(false);
                        }
 
                        if (plot instanceof DAUIEventChartPlot) {
@@ -144,22 +128,44 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                                                - plot.getVisibleStartX();
 
                                if (eventTime > itemTime && eventTime < imageRightTime) {
-                                       if (e.button == 3) {
-                                               intervalMarker.setInterval(itemTime, itemTime);
-                                       } else if (bShift == true
-                                                       && intervalMarker.getStartVal() != -1) {
-                                               intervalMarker.setEndVal(eventTime);
+                                       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 {
-                                       intervalMarker.setInterval(eventTime, eventTime);
+                                       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) {
-                                       intervalMarker.setEndVal(eventTime);
+                                       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();
@@ -169,11 +175,17 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                                        screenshotChartPlot, chartWidget.getSeriesList(), e.x));
                } else {
                        if (bShift == true && intervalMarker.getStartVal() != -1) {
-                               intervalMarker.setEndVal(eventTime);
+                               if (baseTime > eventTime) {
+                                       intervalMarker.setStartVal(eventTime);
+                                       intervalMarker.setEndVal(baseTime);
+                               } else {
+                                       intervalMarker.setStartVal(baseTime);
+                                       intervalMarker.setEndVal(eventTime);
+                               }
                        } else {
                                intervalMarker.setInterval(eventTime, eventTime);
+                               baseTime = eventTime;
                        }
-                       // intervalMarker.setInterval(eventTime, eventTime);
                }
 
                chart.redraw();
@@ -193,38 +205,22 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                        return;
                }
                DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) marker;
-               // DAChartPlotTooltip tooltip = plot.getTooltip();
-               //
-               // if (null == tooltip) {
-               // return;
-               // }
-               //
-               // double oldYPosRatio = tooltip.getYPosRatio();
-               // double newYPosRatio = (double) e.y / ((Canvas) e.widget).getSize().y;
-               //
-               // if (oldYPosRatio != newYPosRatio) {
-               // tooltip.setYPosRatio(newYPosRatio);
-               // }
-               //
-               // tooltip.setStartVal(getTooltipStartX(plot, chart.getSeriesList(),
-               // e.x,
-               // newYPosRatio));
-               // tooltip.setTooltip(true);
 
                double eventTime = plot.getXFromXPixcel(e.x);
+               double markerStartTime;
+               double markerEndTime;
 
-               double markerStartTime = intervalMarker.getStartVal();
-               double markerEndTime = eventTime;
+               if (intervalMarker.getStartVal() >= eventTime) {
+                       markerStartTime = eventTime;
+                       markerEndTime = intervalMarker.getEndVal();
+               } else {
+                       markerStartTime = intervalMarker.getStartVal();
+                       markerEndTime = eventTime;
+               }
 
-               // if (markerStartTime > markerEndTime) {
-               // double temp = markerStartTime;
-               // markerStartTime = markerEndTime;
-               // markerEndTime = temp;
-               // }
                double toolbarTime = TimelineChartManager.getInstance().getChartBoard()
                                .getLifecycleEndTime();
-               // double toolbarTime = ToolbarArea.getInstance().getTime()
-               // / TimelineConstants.MEGA +1;
+
                if (markerStartTime < 0) {
                        markerStartTime = 0;
                } else if (markerStartTime > toolbarTime) {
@@ -280,35 +276,77 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                                intervalMarker.getEndVal());
        }
 
-       // 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;
-       // }
+       @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);
@@ -336,4 +374,58 @@ public class TimelineChartMouseAdapter extends MouseAdapter {
                        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;
+               }
+       }
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseMoveListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/common/TimelineChartMouseMoveListener.java
deleted file mode 100644 (file)
index 1aa8e1e..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- *  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.ui.common;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.widgets.Canvas;
-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.timeline.DATimeline;
-
-public class TimelineChartMouseMoveListener implements MouseMoveListener {
-       private DATimeline timeline;
-       private final int SELECTION_MARKER_INDEX = 0; // FIXME
-
-       public TimelineChartMouseMoveListener(DATimeline timeline) {
-               this.timeline = timeline;
-       }
-
-       @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) {
-                       intervalMarker.setEndVal(plot.getXFromXPixcel(e.x));
-               }
-               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 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 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 430450d..c36e137 100644 (file)
@@ -196,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) {
@@ -320,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();
                                }
                        }
                }
@@ -388,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)
@@ -399,7 +409,7 @@ 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);
                }
        }
 
index 5985a92..4ff1ee8 100644 (file)
@@ -75,7 +75,7 @@ public class FileChartManager implements Runnable {
                if (null != updateLogThread && updateLogThread.isAlive()) {
                        try {
                                sendNotify();
-                               updateLogThread.join();
+                               updateLogThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                                System.out.println("file chart manager joined!"); //$NON-NLS-1$
                        } catch (InterruptedException e) {
                                e.printStackTrace();
index b998d0b..1c634b0 100644 (file)
@@ -116,6 +116,7 @@ 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());
@@ -152,6 +153,10 @@ public class FileChartView extends DAView {
                                                        / TimelineConstants.MEGA,
                                                        rangeDataManager.getAnalysisEndTime()
                                                                        / TimelineConstants.MEGA);
+               } else {
+                       ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(-1, -1);
                }
 
                ((DAChartPlotIntervalMarker) fileChart.getMarkers().get(
@@ -220,23 +225,23 @@ public class FileChartView extends DAView {
        private void initIntervalMarkers(DAChartBoard board) {
                // selection marker
                DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker(
-                               -1, -1);
+                               -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);
+                               -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);
-               rangeMarker.setBackgroundColor(ColorResources.YELLOW);
-               rangeMarker.setAlpha((int) (255 * 0.10));
+                               -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE);
+               rangeMarker.setForegroundColor(ColorResources.RED);
+               rangeMarker.setAlpha((int) (255 * 0.25));
                board.addIntervalMarker(rangeMarker);
        }
 
index 29f6203..3c789ed 100644 (file)
@@ -45,10 +45,9 @@ import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
 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.ContextToSelectionMenuItemClickListener;
-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.summary.failed.FailedChecker;
 import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
@@ -165,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);
 
@@ -349,12 +352,12 @@ public class FileDataMaker {
                endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
                                board));
 
-               DAContextMenuItem toSelectionItem = new DAContextMenuItem(popupMenu);
-               toSelectionItem
-                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_TO_SELECTION);
-               toSelectionItem
-                               .addClickListener(new ContextToSelectionMenuItemClickListener(
-                                               toSelectionItem, board));
+               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);
@@ -366,9 +369,10 @@ public class FileDataMaker {
                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.setMarkers(board.getMarkers());
@@ -387,7 +391,6 @@ public class FileDataMaker {
                        chart = item.getChart();
                        initFileChart(chart, false);
                }
-               setChartStyle(chart);
                sync.setItem(item);
                item.setData(sync);
                chart.setData(sync);
@@ -395,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();
index 31a6eb7..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,7 +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, AnalyzerLabels.COOLBAR_AREA_FILE_TOOLTIP);
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_FILE_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.HORIZONTAL);
index 7644d5e..58dccd5 100644 (file)
@@ -67,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();
@@ -165,8 +157,8 @@ public class CallStackManager {
                                                addrMap.put(
                                                                LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
                                                                defaultCallstackUnit);
-                                       }                                       
-                                       userCallstack.add(callerCallstackUnit);                                 
+                                       }
+                                       userCallstack.add(callerCallstackUnit);
                                } else {
                                        CallStackUnit callerCsa = addrMap.get(callerAddr);
                                        if (null == callerCsa) {
@@ -195,15 +187,17 @@ public class CallStackManager {
                        if (selfCallstackUnit.getFunctionName().equals(
                                        removeCallStackUnit.getFunctionName())) {
                                userCallstack.remove(size - 1);
-                               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");
+                               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();
@@ -471,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 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;
                                }
                        }
                }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageSelectionListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageSelectionListener.java
deleted file mode 100644 (file)
index aa52e94..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  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.info.snapshot;
-
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Display;
-
-public class ImageSelectionListener implements SelectionListener {
-
-       @Override
-       public void widgetSelected(final SelectionEvent e) {
-               Display.getDefault().syncExec(new Runnable() {
-                       @Override
-                       public void run() {
-
-//                             String[] data = null;
-//                             if (e.widget instanceof Grid) {
-//                                     final Grid table = (Grid) e.widget;
-//                                     GridItem[] ti = table.getSelection();
-//                                     // get center id
-//                                     if (null == ti || 0 == ti.length) {
-//                                             return;
-//                                     }
-//                                     data = (String[]) ti[0].getData();
-//                             }
-                               
-                               //TODO:implements action
-                       }
-               });
-       }
-
-       @Override
-       public void widgetDefaultSelected(SelectionEvent e) {
-       }
-
-}
index 99f8df7..93459e5 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;
@@ -280,13 +271,17 @@ public class ImageViewer extends Composite {
                        } else {
                                try {
                                        img = new Image(Display.getDefault(), path);
+                               } catch (IllegalArgumentException e) {
+                                       e.printStackTrace();
+                                       img = ImageResources.NO_IMAGE;
                                } catch (SWTError err) {
                                        err.printStackTrace();
                                        img = ImageResources.NO_IMAGE;
-                               } catch (Exception e) {
+                               } catch (SWTException e) {
                                        System.out.println("Wait for receiving image : " + path);//$NON-NLS-1$
                                        img = ImageResources.NO_IMAGE;
                                }
+
                                if (img.isDisposed()) {
                                        System.out.println("before set image : disposed"); //$NON-NLS-1$
                                }
index 9013b45..e46d4b8 100644 (file)
@@ -60,6 +60,7 @@ public class RangeDataManager implements Runnable {
        private WarningChecker warningChecker = null;
        private FileDataMaker fileDataMaker = null;
        private ProfileDataMaker profileDataMaker = null;
+       private CallStackManager callstackManager = null;
 
        private long markerStartTime = 0;
        private long markerEndTime = 0;
@@ -72,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);
@@ -83,6 +85,7 @@ public class RangeDataManager implements Runnable {
                leakDetector.clear();
                warningChecker.clear();
                profileDataMaker.clear();
+               callstackManager.clear();
        }
 
        public void initRange() {
@@ -128,13 +131,11 @@ public class RangeDataManager implements Runnable {
                                        SWT.NONE);
                        DATabButton rangeTab = mainTab.addView(rangePage, true, true);
                        rangeTab.addCloseButtonListener(new DACustomButtonClickEventListener() {
-
                                @Override
                                public void handleClickEvent(DACustomButton button) {
                                        RangeDataManager.getInstance().initRange();
                                }
                        });
-
                        startRangeThread();
                } else {
                        startRangeThread();
@@ -400,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 c6bb467..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,7 +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, AnalyzerLabels.COOLBAR_AREA_RANGE_TOOLTIP);
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_RANGE_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.VERTICAL);
index dfaebb9..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,7 +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, AnalyzerLabels.COOLBAR_AREA_SUMMARY_TOOLTIP);
+               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..d2574f0 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) {
@@ -186,10 +185,12 @@ public class LeakDetector {
                                .parseInt(input[LogCenterConstants.SEQUENCE_NUMBER_INDEX]);
                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();
+//                     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();
                        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..98723c8 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>>>();
@@ -140,7 +132,7 @@ public class FunctionUsageProfiler implements Runnable {
                if (null != profiler && profiler.isAlive()) {
                        try {
                                sendNotify();
-                               profiler.join();
+                               profiler.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                                System.out.println("profiling thread joined!"); //$NON-NLS-1$
                        } catch (InterruptedException e) {
                                e.printStackTrace();
index 3848ebe..9a26297 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;
                        }
 
@@ -332,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();
@@ -373,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;
@@ -426,7 +443,7 @@ public class ProfileDataMaker {
                                if (null == current) {
                                        // bug
                                        System.out
-                                                       .println("bug found!! must debug!!!" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
+                                                       .println("exit without entry - range only :" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
                                } else {
                                        CallstackTree parentCt = current.getParent();
                                        if (null != parentCt) {
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 593a257..afae97a 100644 (file)
@@ -82,7 +82,7 @@ public class ThreadChartManager implements Runnable {
                if (null != updateLogThread && updateLogThread.isAlive()) {
                        try {
                                sendNotify();
-                               updateLogThread.join();
+                               updateLogThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                                System.out.println("thread chart manager joined!"); //$NON-NLS-1$
                        } catch (InterruptedException e) {
                                e.printStackTrace();
index ce07cb9..e37f982 100644 (file)
@@ -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,
@@ -308,6 +310,14 @@ public class ThreadChartView extends DAView {
                                                        / 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);
                }
 
                ((DAChartPlotIntervalMarker) threadChart.getMarkers().get(
@@ -376,23 +386,23 @@ public class ThreadChartView extends DAView {
        private void initIntervalMarkers(DAChartBoard board) {
                // selection marker
                DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker(
-                               -1, -1);
+                               -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);
+                               -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);
-               rangeMarker.setBackgroundColor(ColorResources.YELLOW);
-               rangeMarker.setAlpha((int) (255 * 0.10));
+                               -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE);
+               rangeMarker.setForegroundColor(ColorResources.RED);
+               rangeMarker.setAlpha((int) (255 * 0.25));
                board.addIntervalMarker(rangeMarker);
 
        }
index bf3ff43..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,7 +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, AnalyzerLabels.COOLBAR_AREA_THREAD_TOOLTIP);
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_THREAD_TOOLTIP);
                this.setLayout(new FillLayout());
 
                baseForm = new SashForm(this, SWT.HORIZONTAL);
index 4d1fe12..52e9e4e 100644 (file)
@@ -41,10 +41,9 @@ import org.tizen.dynamicanalyzer.resources.ImageResources;
 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.ContextToSelectionMenuItemClickListener;
-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.common.TimelineConstants;
 import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
@@ -377,12 +376,12 @@ public class ThreadPageSyncDataManager {
                endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
                                board));
 
-               DAContextMenuItem toSelectionItem = new DAContextMenuItem(popupMenu);
-               toSelectionItem
-                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_TO_SELECTION);
-               toSelectionItem
-                               .addClickListener(new ContextToSelectionMenuItemClickListener(
-                                               toSelectionItem, board));
+               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);
@@ -394,9 +393,10 @@ public class ThreadPageSyncDataManager {
                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.setMarkers(board.getMarkers());
index 4fffbfb..71bf13a 100644 (file)
@@ -43,10 +43,9 @@ import org.tizen.dynamicanalyzer.resources.ImageResources;
 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.ContextToSelectionMenuItemClickListener;
-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.summary.warning.WarningCase;
 import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
@@ -164,12 +163,12 @@ public class ThreadPageThreadDataManager {
                endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
                                board));
 
-               DAContextMenuItem toSelectionItem = new DAContextMenuItem(popupMenu);
-               toSelectionItem
-                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_TO_SELECTION);
-               toSelectionItem
-                               .addClickListener(new ContextToSelectionMenuItemClickListener(
-                                               toSelectionItem, board));
+               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);
@@ -181,9 +180,10 @@ public class ThreadPageThreadDataManager {
                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()));
 
@@ -245,12 +245,12 @@ public class ThreadPageThreadDataManager {
                endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
                                board));
 
-               DAContextMenuItem toSelectionItem = new DAContextMenuItem(popupMenu);
-               toSelectionItem
-                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_TO_SELECTION);
-               toSelectionItem
-                               .addClickListener(new ContextToSelectionMenuItemClickListener(
-                                               toSelectionItem, board));
+               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);
@@ -262,9 +262,10 @@ public class ThreadPageThreadDataManager {
                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.setMarkers(board.getMarkers());
index 53e3283..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,7 +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, AnalyzerLabels.COOLBAR_AREA_TIMELINE_TOOLTIP);
+               this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_TIMELINE_TOOLTIP);
                this.setLayout(new FillLayout());
 
                leftForm = new SashForm(this, SWT.HORIZONTAL);
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 5be6df2..3a6165e 100644 (file)
@@ -39,6 +39,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;
@@ -60,7 +61,7 @@ public class FileChart extends TimelineChart {
        private static FileChart instance = null;
 
        private final int MIN_FDCOUNT = 5;
-       private final int MIN_READ_WRITE_BYTE = 5;
+       private final int MIN_READ_WRITE_BYTE = 0;
 
        private final int TYPE_FDCOUNT = 0;
        private final int TYPE_READ = 1;
@@ -98,15 +99,16 @@ 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,
                                ColorResources.SERIESE_COLOR_FILE_FD);
-
        }
 
        @Override
@@ -114,13 +116,16 @@ public class FileChart extends TimelineChart {
                DAChartBoardItem item = super.createBoardItem(board);
 
                chart.addSeries(readSeries);
-               chart.addSeries(writeSeries);
                chart.addSeries(fdCountSeries);
+               chart.addSeries(writeSeries);
 
                chart.getPlot().setAutoHeightRange(false);
                chart.getPlot().setSeriesHeightRange(true);
-               chart.getPlot().setShowAxis(true);      
-               
+               chart.getPlot().setAxisUnit("B");
+               chart.getPlot().setSecondAxisUnit("");
+               chart.getPlot().setAxisUnitType(DAChartPlot.UnitType.BINARY);
+               chart.getPlot().setShowAxis(true);
+
                fdCountSeries.setEndY(maxFDCount);
                readSeries.setEndY(maxReadWrite);
                writeSeries.setEndY(maxReadWrite);
@@ -235,6 +240,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 ded77a7..1697db7 100644 (file)
@@ -123,7 +123,9 @@ public class ScreenshotChart extends TimelineChart {
                                yPostion = 23;
                        }
 
-                       new CreateImageThread(imagePath, time, yPostion).run();
+                       Thread createImageThread = new Thread(null, new CreateImageThread(
+                                       imagePath, time, yPostion), "small image getter thread");
+                       createImageThread.start();
                } catch (NumberFormatException ne) {
                        ne.printStackTrace();
                }
@@ -142,24 +144,29 @@ public class ScreenshotChart extends TimelineChart {
 
                public void run() {
                        Image image = null;
+                       int count = 0;
 
-                       while (true) {
+                       while (true && count < 5) {
                                try {
                                        image = new Image(Display.getDefault(), imagePath);
+                                       break;
                                } catch (SWTException se) {
+                                       count++;
                                        try {
                                                Thread.sleep(1000);
-                                               continue;
                                        } catch (InterruptedException ie) {
-                                               continue;
+                                               break;
                                        }
                                }
-
-                               break;
                        }
 
-                       screenshotSeries.addSeriesItem(new DAChartSeriesItem(time,
-                                       yPosition, image));
+                       if (null != image) {
+                               screenshotSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                               yPosition, image));
+                       } else {
+                               screenshotSeries.addSeriesItem(new DAChartSeriesItem(time,
+                                               yPosition, ImageResources.NO_IMAGE_SMALL));
+                       }
                }
        }
 }
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 65df57e..e188cf2 100644 (file)
@@ -37,7 +37,7 @@ 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.ContextToSelectionMenuItemClickListener;
+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.DAChartPlot;
@@ -78,12 +78,12 @@ public abstract class TimelineChart {
                endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
                                chartBoard));
 
-               DAContextMenuItem toSelectionItem = new DAContextMenuItem(popupMenu);
-               toSelectionItem
-                               .setText(TimelineChartLabels.RANGE_CONTEXT_SET_TO_SELECTION);
-               toSelectionItem
-                               .addClickListener(new ContextToSelectionMenuItemClickListener(
-                                               toSelectionItem, chartBoard));
+               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);
index 9d43dcd..b8f13eb 100644 (file)
@@ -51,12 +51,10 @@ import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
 public class UIEventChart extends TimelineChart {
        private static UIEventChart instance = null;
 
-       private DAChartSeries keyEventSeries;
        private DAChartSeries touchEventSeries;
        private DAChartSeries gestureEventSeries;
        private DAChartSeries orientationEventSeries;
 
-       private final int TYPE_KEY = 1;
        private final int TYPE_TOUCH = 2;
        private final int TYPE_GESTURE = 3;
        private final int TYPE_ORIENTATION = 4;
@@ -69,8 +67,6 @@ public class UIEventChart extends TimelineChart {
        private final int GESTURE_TYPE_TAP = 5;
 
        private final String NEW_LINE = CommonConstants.NEW_LINE;
-       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());
@@ -91,10 +87,6 @@ public class UIEventChart extends TimelineChart {
                chartIcon = ImageResources.CHART_UI_EVENT;
                addIcon = ImageResources.ADD_CHART_UI_EVENT;
 
-               keyEventSeries = new DAChartSeries(
-                               TimelineChartLabels.UI_EVENT_CHART_SERIES_NAME_KEY,
-                               DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
-                               ColorResources.SERIES_COLOR_UI_EVENT_KEY);
                touchEventSeries = new DAChartSeries(
                                TimelineChartLabels.UI_EVENT_CHART_SERIES_NAME_TOUCH,
                                DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
@@ -108,7 +100,6 @@ public class UIEventChart extends TimelineChart {
                                DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
                                ColorResources.SERIES_COLOR_UI_EVENT_ORIENTATION);
 
-               keyEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
                touchEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
                gestureEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
                orientationEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
@@ -139,7 +130,6 @@ public class UIEventChart extends TimelineChart {
                });
                item.useExpand(false);
 
-               chart.addSeries(keyEventSeries);
                chart.addSeries(touchEventSeries);
                chart.addSeries(gestureEventSeries);
                chart.addSeries(orientationEventSeries);
@@ -169,19 +159,6 @@ public class UIEventChart extends TimelineChart {
                                        .get(LogCenterConstants.UI_EVENT_EVENT_TYPE));
                        String info;
                        switch (type) {
-                       case TYPE_KEY:
-                               String keyStatus;
-                               String keyName = log.get(LogCenterConstants.UI_EVENT_INFO1);
-                               detailType = Integer.parseInt(log
-                                               .get(LogCenterConstants.UI_EVENT_DETAIL_TYPE));
-                               if (detailType == 0) {
-                                       keyStatus = KEY_DOWN;
-                               } else {
-                                       keyStatus = KEY_UP;
-                               }
-                               keyEventSeries.addSeriesItem(new DAChartSeriesItem(time, 0,
-                                               keyName + CommonConstants.SPACE + keyStatus));
-                               break;
                        case TYPE_TOUCH:
                                detailType = Integer.parseInt(log
                                                .get(LogCenterConstants.UI_EVENT_DETAIL_TYPE));
index e935ae3..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;
@@ -145,8 +144,8 @@ public class TimelineChartManager {
        public List<TimelineChart> getSelectedChartList() {
                return selectedChartList;
        }
-       
-       public DAChartBoard getChartBoard(){
+
+       public DAChartBoard getChartBoard() {
                return chartBoard;
        }
 
@@ -262,11 +261,11 @@ public class TimelineChartManager {
                                                chartBoard.getVisibleEndTime());
 
                                chartWidget.getPlot().setMarkers(chartBoard.getMarkers());
-                               chartWidget.addMouseListener(new TimelineChartMouseAdapter(
-                                               chart.getPopupMenu()));
+                               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 285029e..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;
@@ -40,8 +41,7 @@ import org.tizen.dynamicanalyzer.model.SnapshotData;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 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;
@@ -52,6 +52,7 @@ 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;
@@ -78,11 +79,20 @@ 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());
@@ -148,6 +158,10 @@ public class TimelineView extends DAView {
                                                        / TimelineConstants.MEGA,
                                                        rangeDataManager.getAnalysisEndTime()
                                                                        / TimelineConstants.MEGA);
+               } else {
+                       ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
+                                       UICommonConstants.RANGE_ANALYSIS_MARKER_INDEX))
+                                       .setInterval(-1, -1);
                }
 
                ((DAChartPlotIntervalMarker) chartBoard.getMarkers().get(
@@ -222,11 +236,10 @@ public class TimelineView extends DAView {
                                        chartBoard.getVisibleEndTime());
 
                        chartWidget.getPlot().setMarkers(chartBoard.getMarkers());
-                       chartWidget.addMouseListener(new TimelineChartMouseAdapter(
-                                       timelineChart.getPopupMenu()));
-                       chartWidget
-                                       .addMouseMoveListener(new TimelineChartMouseMoveListener(
-                                                       chartBoard.getTimeline()));
+                       TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+                                       timelineChart.getPopupMenu(), chartBoard.getTimeline());
+                       chartWidget.addMouseListener(timelineChartMouseEventListener);
+                       chartWidget.addMouseMoveListener(timelineChartMouseEventListener);
                        chartWidget
                                        .addMouseTrackListener(new TimelineChartMouseTrackAdapter(
                                                        chartBoard.getTimeline()));
@@ -246,23 +259,23 @@ public class TimelineView extends DAView {
        private void initIntervalMarkers(DAChartBoard board) {
                // selection marker
                DAChartPlotIntervalMarker selectionMarker = new DAChartPlotIntervalMarker(
-                               -1, -1);
+                               -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);
+                               -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);
-               rangeMarker.setBackgroundColor(ColorResources.YELLOW);
-               rangeMarker.setAlpha((int) (255 * 0.10));
+                               -1, -1, DAChartPlotIntervalMarker.INTERVAL_MARKER_STYLE_LINE);
+               rangeMarker.setForegroundColor(ColorResources.RED);
+               rangeMarker.setAlpha((int) (255 * 0.25));
                board.addIntervalMarker(rangeMarker);
        }
 }
index 4e411c9..15e1741 100644 (file)
@@ -6,6 +6,9 @@ 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;
@@ -34,10 +37,12 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
 
 public class UIEventListDialog extends Dialog {
-       static final String KEY_START_CHECK_INDEX = "start_check_index";
-       static final String KEY_END_CHECK_INDEX = "end_check_index";
-       static final String KEY_START_TIME = "start_time";
-       static final String KEY_END_TIME = "end_time";
+       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;
@@ -48,7 +53,7 @@ public class UIEventListDialog extends Dialog {
        private String[] columnNames = { TimelinePageLabels.UI_EVENT_LIST_NAME,
                        TimelinePageLabels.UI_EVENT_LIST_TIME,
                        TimelinePageLabels.UI_EVENT_LIST_SET_RANGE };
-       private int[] columnSizes = { 140, 50, 110 };
+       private int[] columnSizes = { 180, 112, 140 };
        private boolean[] columnVisibility = { true, true, true };
 
        public UIEventListDialog(Shell parent) {
@@ -59,15 +64,16 @@ public class UIEventListDialog extends Dialog {
        public int open() {
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
                shell.setText(eventType + " event list");
-               shell.setSize(450, 450);
+               shell.setSize(446, 450);
                shell.setLayout(new FormLayout());
 
                Composite tableComp = new Composite(shell, SWT.NONE);
-               tableComp.setBackground(ColorResources.RED);
+               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(80, 0);
+               data.bottom = new FormAttachment(100, -49);
                data.left = new FormAttachment(0, 0);
                data.right = new FormAttachment(100, 0);
                tableComp.setLayoutData(data);
@@ -82,14 +88,15 @@ public class UIEventListDialog extends Dialog {
                uiEventListTable.getTable().setData(UIEventListDialog.KEY_END_TIME,
                                -1.0);
                data = new FormData();
-               data.top = new FormAttachment(tableComp, 0);
-               data.bottom = new FormAttachment(100, 0);
-               data.left = new FormAttachment(10, 0);
-               data.right = new FormAttachment(90, 0);
+               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.BLUE);
+               buttonComp
+                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
                buttonComp.setLayout(new FormLayout());
                data = new FormData();
                data.top = new FormAttachment(tableComp, 0);
@@ -120,6 +127,19 @@ public class UIEventListDialog extends Dialog {
                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();
 
@@ -210,7 +230,7 @@ public class UIEventListDialog extends Dialog {
                        List<TableInput> inputList = new ArrayList<TableInput>();
                        for (DAChartSeriesItem item : seriesItemList) {
                                List<String> columnTexts = new ArrayList<String>();
-                               columnTexts.add(item.getTooltipText());
+                               columnTexts.add(item.getTooltipText().split("\n")[0]);//$NON-NLS-1$
                                columnTexts.add(String.valueOf(item.getX()));
 
                                TableInput tableInput = new TableInput();
index bcecef7..9a5bab0 100644 (file)
@@ -23,6 +23,9 @@ public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
 
        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;
@@ -62,18 +65,38 @@ public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
                int x = leftMargin;
                if (getColumn() == CHECK_INDEX) {
                        Image buttonImage;
+                       Integer data = (Integer) item
+                                       .getData(UIEventListDialog.KEY_OLD_HOVERED_INDEX);
                        if (item.getChecked(CHECK_INDEX)) {
-                               buttonImage = ImageResources.CHECKBOX_SELECTED;
-                       } else
-                               buttonImage = ImageResources.CHECKBOX_UNSELECTED;
-                       gc.drawImage(buttonImage, getStartButtonXPostion(buttonImage),
+                               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)) {
-                               buttonImage = ImageResources.CHECKBOX_SELECTED;
-                       } else
-                               buttonImage = ImageResources.CHECKBOX_UNSELECTED;
-                       gc.drawImage(buttonImage, getEndButtonXPosition(buttonImage),
+                               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);
                }
 
@@ -146,29 +169,28 @@ public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
                }
        }
 
-       private int getStartButtonXPostion(Image buttonImage) {
-               return getBounds().x + getBounds().width / 2
-                               - buttonImage.getBounds().width - 2;
+       private int getStartButtonXPostion() {
+               return getBounds().x + getBounds().width / 2 - buttonWidth - 5;
        }
 
-       private int getEndButtonXPosition(Image buttonImage) {
-               return getBounds().x + getBounds().width / 2 + 2;
+       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.CHECKBOX_SELECTED;
+                       buttonImage = ImageResources.UIEVENT_DIALOG_START_NORMAL;
                } else {
-                       buttonImage = ImageResources.CHECKBOX_UNSELECTED;
+                       buttonImage = ImageResources.UIEVENT_DIALOG_END_NORMAL;
                }
 
-               if (point.x >= getStartButtonXPostion(buttonImage)
-                               && point.x <= getStartButtonXPostion(buttonImage)
+               if (point.x >= getStartButtonXPostion()
+                               && point.x <= getStartButtonXPostion()
                                                + buttonImage.getBounds().width) {
                        return CHECK_INDEX;
-               } else if (point.x >= getEndButtonXPosition(buttonImage)
-                               && point.x <= getEndButtonXPosition(buttonImage)
+               } else if (point.x >= getEndButtonXPosition()
+                               && point.x <= getEndButtonXPosition()
                                                + buttonImage.getBounds().width) {
                        return CHECK_INDEX - 1;
                } else {
@@ -178,7 +200,26 @@ public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
 
        public boolean notify(int event, Point point, Object value) {
                if (getColumn() == CHECK_INDEX) {
-                       if (event == IInternalWidget.LeftMouseButtonDown) {
+                       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) {
@@ -192,29 +233,29 @@ public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
 
                                                if (checkBoxIndex == CHECK_INDEX) {
                                                        GridItem oldCheckedItem = (GridItem) parentGrid
-                                                                       .getData(UIEventListDialog.KEY_START_CHECK_INDEX);
+                                                                       .getData(UIEventListDialog.KEY_START_OLD_CHECKED_ITEM);
 
                                                        if (oldCheckedItem != null) {
                                                                oldCheckedItem.setChecked(CHECK_INDEX, false);
                                                        }
-                                                       parentGrid.setData(
-                                                                       UIEventListDialog.KEY_START_CHECK_INDEX,
-                                                                       item);
+                                                       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_CHECK_INDEX);
+                                                                       .getData(UIEventListDialog.KEY_END_OLD_CHECKED_ITEM);
 
                                                        if (oldCheckedItem != null) {
                                                                oldCheckedItem.setChecked(CHECK_INDEX - 1,
                                                                                false);
                                                        }
-                                                       parentGrid
-                                                                       .setData(
-                                                                                       UIEventListDialog.KEY_END_CHECK_INDEX,
-                                                                                       item);
+                                                       parentGrid.setData(
+                                                                       UIEventListDialog.KEY_END_OLD_CHECKED_ITEM,
+                                                                       item);
 
                                                        parentGrid.setData(UIEventListDialog.KEY_END_TIME,
                                                                        data);
index 0c42497..00c697c 100644 (file)
@@ -233,8 +233,9 @@ public class AboutDialog {
                Display display = PlatformUI.createDisplay();
 
                while (!shell.isDisposed()) {
-                       if (!display.readAndDispatch())
+                       if (!display.readAndDispatch()) {
                                display.sleep();
+                       }
                }
 
                shell.dispose();
index 0b6a99a..27f39c5 100644 (file)
@@ -257,16 +257,17 @@ public class ConfigureManager {
                        data = new HashMap<String, String>();
                        return 0;
                }
-               String valuestr = data.get(key);
-               if(valuestr == null)
+               String valueStr = data.get(key);
+               try {
+                       if (null == valueStr) {
+                               return 0;
+                       } else {
+                               return Integer.parseInt(valueStr);
+                       }
+               } catch (NumberFormatException e) {
+                       e.printStackTrace();
                        return 0;
-               else
-                       return Integer.parseInt(valuestr);
-//             if (valuestr.equalsIgnoreCase(ConfigureLabels.ON)) {
-//                     return 1;
-//             } else {
-//                     return 0;
-//             }
+               }
        }
 
        public void setValue(String key, String val) {
index 71a0605..3f44536 100644 (file)
@@ -31,14 +31,13 @@ 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.DACommunicator;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
 import org.tizen.dynamicanalyzer.logparser.LogParser;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.file.FileChartManager;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 import org.tizen.dynamicanalyzer.ui.thread.ThreadChartManager;
@@ -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) {
@@ -76,11 +74,14 @@ public class RecordStartStopThread implements Runnable {
                                                ToolbarArea.getInstance()
                                                                .setStartButtonEnablement(true);
                                                ToolbarArea.getInstance().setStartButtonToolTipText(
-                                                               AnalyzerLabels.STOP_TRACE);
+                                                               ShortCutManager.STOP_TRACE);
                                                ToolbarArea.getInstance().setSnapshotButtonEnablement(
                                                                true);
+                                               ToolbarArea.getInstance().setSettingsButtonEnablement(
+                                                               true);
                                        }
                                });
+                               ShortCutManager.getInstance().setEnabled(true);
                        } else {
                                AnalyzerUtil
                                                .setRecordState(RecordStateSourceProvider.RECORD_READY);
@@ -91,14 +92,16 @@ public class RecordStartStopThread implements Runnable {
                                                                .getShell();
                                                DADialog dialog = new DADialog(shell, SWT.NONE);
                                                dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
-                                               dialog.setMessage(AnalyzerLabels.START_TRACE_ERROR
-                                                               + PathManager.getLogPath());
+                                               dialog.setMessage(AnalyzerLabels.START_TRACE_ERROR);
                                                dialog.open();
 
                                                ToolbarArea.getInstance().setToolbarState(
                                                                ToolbarArea.TOOLBAR_STATE_READY);
                                                ToolbarArea.getInstance()
                                                                .setStartButtonEnablement(true);
+                                               ToolbarArea.getInstance().setSettingsButtonEnablement(
+                                                               true);
+                                               ShortCutManager.getInstance().setEnabled(true);
                                        }
                                });
                        }
@@ -116,24 +119,30 @@ public class RecordStartStopThread implements Runnable {
                                ToolbarArea.getInstance().setToolbarState(
                                                ToolbarArea.TOOLBAR_STATE_RECORDING);
                                ToolbarArea.getInstance().setStartButtonEnablement(false);
+                               ToolbarArea.getInstance().setSettingsButtonEnablement(false);
                        }
                });
 
                AnalyzerManager.initRecordStart();
-               if (!DACommunicator.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()) {
+                       if (!DACommunicator.sendStartMessage()) {
+                               DACommunicator.setRunning(false);
+                               return false;
+                       }
                        UIRecorderTool.getInstance().startRecorder();
-                       DACommunicator.sendStartMessage();
                        ToolbarArea.getInstance().startTimer();
                        LogParser.startLogParser();
                        FileChartManager.getInstance().startUpdateLogThread();
@@ -143,6 +152,8 @@ public class RecordStartStopThread implements Runnable {
 
                        /* Timeline */
                        UpdateViewTimer.start();
+                       System.out
+                                       .println("Start recorder, timer, log parser, file, thread, ui, profile , update timer");
                        return true;
                }
 
@@ -157,17 +168,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);
                        }
                });
 
                DACommunicator.sendStopMessage();
-//             if (DACommunicator.isRunning()) {
-//                     String message = AnalyzerConstants.MSG_STOP
-//                                     + CommonConstants.CMD_SPLIT + 0 + CommonConstants.CMD_SPLIT;
-//                     DACommunicator.sendMessage(message);
-//                     System.out.println("stop send message :" + message);
-//             }
        }
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StartProcessManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StartProcessManager.java
new file mode 100644 (file)
index 0000000..60e0be4
--- /dev/null
@@ -0,0 +1,92 @@
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.widgets.ProgressDialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class StartProcessManager implements Runnable {
+       private static ProgressDialog dialog = null;
+       private static int count = 1;
+
+       private static StartProcessManager instance = new StartProcessManager();
+
+       public static StartProcessManager getInstance() {
+               return instance;
+       }
+
+       public void startProcessStart(String waitMessage) {
+               Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+               dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
+               if (null != dialog) {
+                       dialog.open();
+                       dialog.setProgressMessage(waitMessage);
+                       dialog.setProgressInfo(AnalyzerLabels.STOP_PROCESS_DLG_PLEASE_WAIT);
+               }
+
+               Thread thread = new Thread(new StartProcessManager());
+               thread.start();
+       }
+
+       public void setValue(final int nSelect) {
+
+               if (null != dialog) {
+                       Display.getDefault().syncExec(new Runnable() {
+                               @Override
+                               public void run() {
+                                       dialog.setValue(nSelect);
+                               }
+                       });
+               }
+       }
+
+       public void stopProgress() {
+               if (null != dialog) {
+                       dialog.setValue(100);
+                       dialog.close();
+               }
+       }
+
+       @Override
+       public void run() {
+               count = 10;
+               System.out.println("appinfo : " + AnalyzerManager.isAppInfoArrived()
+                               + "is exit :" + AnalyzerManager.isExit());
+               while (!AnalyzerManager.isExit()) {
+
+                       if (AnalyzerManager.isRunning()
+                                       && AnalyzerManager.isAppInfoArrived()) {
+                               break;
+                       }
+                       count += 2;
+
+                       if (count > 50 && !AnalyzerManager.isRunning()) {
+                               break;
+                       } else if (count / 10 < 99) {
+                               Display.getDefault().syncExec(new Runnable() {
+                                       @Override
+                                       public void run() {
+                                               dialog.setValue(count / 10);
+                                       }
+                               });
+                       }
+
+                       try {
+                               Thread.sleep(100);
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
+
+               Display.getDefault().syncExec(new Runnable() {
+                       @Override
+                       public void run() {
+                               stopProgress();
+                       }
+               });
+
+       }
+}
index b946275..d92fe38 100644 (file)
@@ -29,6 +29,7 @@ package org.tizen.dynamicanalyzer.ui.toolbar;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.logparser.LogInserter;
 import org.tizen.dynamicanalyzer.logparser.LogParser;
 import org.tizen.dynamicanalyzer.project.Project;
@@ -37,6 +38,7 @@ import org.tizen.dynamicanalyzer.ui.file.FileChartManager;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
 import org.tizen.dynamicanalyzer.ui.thread.ThreadChartManager;
 import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
 import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
 
 public class StopLogProcessor implements Runnable {
@@ -79,7 +81,7 @@ public class StopLogProcessor implements Runnable {
                FileChartManager.getInstance().stopUpdateLogThread();
                percent += 10;
                StopProcessManager.getInstance().setValue(percent);
-               
+
                ThreadChartManager.getInstance().stopUpdateLogThread();
 
                FunctionUsageProfiler.stopProfiler();
@@ -98,6 +100,21 @@ public class StopLogProcessor implements Runnable {
                percent += 10;
                StopProcessManager.getInstance().setValue(percent);
 
+               System.out.println("record thread stop");
+               UIRecorderTool.getInstance().stop();
+               percent += 10;
+               StopProcessManager.getInstance().setValue(percent);
+
+               int exitCount = 0;
+               while (DACommunicator.isWaitControlMessage() && exitCount < 60) {
+                       System.out.println("wait for control ack message...");
+                       try {
+                               Thread.sleep(100);
+                               exitCount++;
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
                /* save Project */
                System.out.println(" save project and others..."); //$NON-NLS-1$
 
@@ -132,6 +149,7 @@ public class StopLogProcessor implements Runnable {
                        public void run() {
                                ToolbarArea.getInstance().setStartButtonEnablement(true);
                                ToolbarArea.getInstance().setMainControlEnablement(true);
+                               ToolbarArea.getInstance().setSettingsButtonEnablement(true);
                        }
                });
                count--;
index d658eb9..9e39d46 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
 import org.tizen.dynamicanalyzer.ui.widgets.ProgressDialog;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
@@ -49,7 +50,7 @@ public class StopProcessManager {
                return instance;
        }
 
-       public void stopProcessStart(String EndMessage) {
+       public void stopProcessStart(String endMessage) {
                if (state == STOP_PROCESS_START || state == STOP_PROCESS_END) {
                        return;
                }
@@ -59,7 +60,7 @@ public class StopProcessManager {
                dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
                if (null != dialog) {
                        dialog.open();
-                       dialog.setProgressMessage(EndMessage);
+                       dialog.setProgressMessage(endMessage);
                        dialog.setProgressInfo(AnalyzerLabels.STOP_PROCESS_DLG_PLEASE_WAIT);
                }
        }
@@ -83,6 +84,7 @@ public class StopProcessManager {
                        dialog.close();
                        state = STOP_PROCESS_END;
                }
+               ShortCutManager.getInstance().setEnabled(true);
        }
 
        public int getState() {
index f3a7fae..840b9ae 100755 (executable)
@@ -27,6 +27,7 @@
 
 package org.tizen.dynamicanalyzer.ui.toolbar;
 
+import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 
@@ -58,12 +59,14 @@ 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;
 import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
 import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
 import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
+import org.tizen.dynamicanalyzer.uirecorder.RecorderXml;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
@@ -161,10 +164,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;
@@ -217,15 +222,24 @@ public class ToolbarArea {
                        @Override
                        public void run() {
                                Project p = AnalyzerManager.getProject();
-                               if (null == p || !enabled) {
+                               if (null == p || !p.isValid() || !enabled) {
+                                       replayButton.setButtonEnabled(false);
+                                       return;
+                               }
+
+                               if (!checkRecordFile(p)) {
                                        replayButton.setButtonEnabled(false);
                                        return;
                                }
+                               String device = deviceCombo.getText();
+                               String deviceName = p.getDevice();
 
                                String appName = p.getAppName();
                                String text = appCombo.getText();
-                               if (null != appName && !appName.isEmpty() && !text.isEmpty()
-                                               && appName.equals(text)) {
+                               if ((null != deviceName && !deviceName.isEmpty()
+                                               && !device.isEmpty() && deviceName.equals(device))
+                                               && (null != appName && !appName.isEmpty()
+                                                               && !text.isEmpty() && appName.equals(text))) {
                                        replayButton.setButtonEnabled(true);
                                        return;
                                }
@@ -235,6 +249,15 @@ public class ToolbarArea {
                });
        }
 
+       private boolean checkRecordFile(Project p) {
+               String path = p.getSavePath() + RecorderXml.xmlFileName;
+               File file = new File(path);
+               if (file.exists()) {
+                       return true;
+               }
+               return false;
+       }
+
        private void addToolbarListeners() {
                deviceCombo.addSelectionListener(new DACustomComboSelectionListener() {
 
@@ -257,7 +280,7 @@ public class ToolbarArea {
                                String appName = combo.getText();
                                if (null != appName && !appName.isEmpty()) {
                                        AppInfo selectedApp = DACommunicator
-                                                       .getAppInfoByName(appName);
+                                                       .getPkgInfoByName(appName);
 
                                        if (null != selectedApp) {
                                                DACommunicator.setSelectedApp(selectedApp);
@@ -281,8 +304,7 @@ public class ToolbarArea {
                        @Override
                        public void handleEvent(Event event) {
                                if (!appCombo.isChildShellOpened()) {
-                                       List<AppInfo> apps = DACommunicator
-                                                       .getAppListFromTarget();
+                                       List<AppInfo> apps = DACommunicator.getAppListFromTarget();
                                        if (apps.isEmpty()) {
                                                return;
                                        }
@@ -290,8 +312,7 @@ public class ToolbarArea {
                                        appCombo.initCombo();
                                        int size = apps.size();
                                        for (int i = 0; i < size; i++) {
-                                               appCombo.add(apps.get(i).getInfo(
-                                                               AppInfo.LABEL_INDEX));
+                                               appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX));
                                        }
                                        appCombo.setText(selectedApp);
                                }
@@ -376,6 +397,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();
 
@@ -405,6 +429,8 @@ public class ToolbarArea {
                                                        ConfigureLabels.SNAPSHOT, CommonConstants.ON);
                                } else {
                                        DACommunicator
+                                                       .sendSnapshotMessage(AnalyzerConstants.OPT_OFF);
+                                       DACommunicator
                                                        .sendSnapshotMessage(AnalyzerConstants.SNAPSHOT_OFF);
                                        ConfigureManager.getInstance().setValue(
                                                        ConfigureLabels.SNAPSHOT, CommonConstants.OFF);
@@ -424,6 +450,14 @@ public class ToolbarArea {
        }
 
        public void startTrace() {
+               ShortCutManager.getInstance().setEnabled(false);
+               Display.getDefault().syncExec(new Runnable() {
+                       @Override
+                       public void run() {
+                               StartProcessManager.getInstance().startProcessStart(
+                                               "Prepare trace");
+                       }
+               });
                if (!checkValidApplication()) {
                        // fail message box
                        Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
@@ -431,6 +465,27 @@ public class ToolbarArea {
                        warning.setMessage(AnalyzerLabels.INVALID_APPLICATION);
                        warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
                        warning.open();
+
+                       setToolbarStartStopState(true);
+
+                       if (null == DACommunicator.getDevices()
+                                       || DACommunicator.getDevices().isEmpty()) {
+                               deviceCombo.setEnabled(false);
+                       }
+
+                       if (!deviceCombo.isEnabled()
+                                       || null == DACommunicator.getSelectedDevice()) {
+                               appCombo.setEnabled(false);
+                       }
+
+                       if (!appCombo.isEnabled()
+                                       || null == DACommunicator.getSelectedApp()) {
+                               setStartButtonEnablement(false);
+                       }
+
+                       setSaveButtonEnable(false);
+
+                       ShortCutManager.getInstance().setEnabled(true);
                        return;
                }
                AnalyzerUtil.changePage(TimelinePage.ID);
@@ -439,6 +494,7 @@ public class ToolbarArea {
        }
 
        public void stopTrace() {
+               ShortCutManager.getInstance().setEnabled(false);
                AnalyzerManager.getProject().setStopTime(getTime());
                AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
                RecordStartStopThread.runStartStopThread();
@@ -454,7 +510,7 @@ public class ToolbarArea {
                                ImageResources.START_PUSH, ImageResources.START_HOVER,
                                ImageResources.START_DISABLE);
                startButton.setButtonEnabled(false);
-               startButton.setToolTipText(AnalyzerLabels.START_TRACE);
+               startButton.setToolTipText(ShortCutManager.START_TRACE);
                buttons.put(START_BUTTON, startButton);
 
                // Creates TimerClock widget.
@@ -467,21 +523,21 @@ public class ToolbarArea {
                                ImageResources.SAVE_PUSH, ImageResources.SAVE_HOVER,
                                ImageResources.SAVE_DISABLE);
                saveTraceButton.setButtonEnabled(false);
-               saveTraceButton.setToolTipText(AnalyzerLabels.SAVE_TRACE);
+               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
@@ -553,7 +609,7 @@ public class ToolbarArea {
                data = new FormData();
                data.top = new FormAttachment(0, 4);
                data.left = new FormAttachment(openTraceButton, 0, SWT.RIGHT);
-               data.width = 31;
+               data.width = 31; // 31
                data.height = 30;
                replayButton.setLayoutData(data);
 
@@ -581,8 +637,8 @@ public class ToolbarArea {
                data = new FormData();
                data.top = new FormAttachment(0, 4);
                data.right = new FormAttachment(viewSourceButton, 0);
-               data.width = 0;
-               data.height = 0;
+               data.width = 0; // 31
+               data.height = 30;
                snapshotButton.setLayoutData(data);
 
                /** device and application combo */
@@ -690,9 +746,6 @@ public class ToolbarArea {
                }
                appCombo.setEnabled(true);
                List<AppInfo> apps = DACommunicator.getAppListFromTarget();
-               if (apps.isEmpty()) {
-                       return;
-               }
 
                appCombo.initCombo();
                int size = apps.size();
@@ -709,15 +762,21 @@ public class ToolbarArea {
                                DACommunicator.getSelectedDevice().setSelectedAppName(
                                                apps.get(0).getInfo(AppInfo.LABEL_INDEX));
                        } else {
-                               AppInfo appInfo = DACommunicator.getAppInfoByName(appName);
+                               AppInfo appInfo = DACommunicator.getPkgInfoByName(appName);
                                appCombo.setText(appName);
                                setSelectedApp(appInfo);
                                DACommunicator.setSelectedApp(appInfo);
+                               DACommunicator.getSelectedDevice().setSelectedAppName(
+                                               appInfo.getInfo(AppInfo.LABEL_INDEX));
                        }
                        startButton.setButtonEnabled(true);
 
                } else {
                        appCombo.add(CommonConstants.EMPTY);
+                       appCombo.select(0);
+                       setSelectedApp(null);
+                       DACommunicator.setSelectedApp(null);
+
                }
        }
 
@@ -756,12 +815,12 @@ public class ToolbarArea {
                        appCombo.setEnabled(true);
                        setRepalyButtonEnable(true);
                        setStartButtonEnablement(true);
+                       setSettingsButtonEnablement(true);
                }
        }
 
        public void setAppComboItems(List<String> items) {
                appCombo.initCombo();
-
                if (null == items) {
                        return;
                }
@@ -773,7 +832,7 @@ public class ToolbarArea {
                                appCombo.add(items.get(i));
                        }
                        appCombo.select(COMBO_FIRST_INDEX);
-                       AppInfo appInfo = DACommunicator.getAppInfoByName(items.get(0));
+                       AppInfo appInfo = DACommunicator.getPkgInfoByName(items.get(0));
                        DACommunicator.setSelectedApp(appInfo);
                        DACommunicator.getSelectedDevice().setSelectedAppName(
                                        appInfo.getInfo(AppInfo.LABEL_INDEX));
@@ -785,7 +844,7 @@ public class ToolbarArea {
        }
 
        public void setAppComboText(final String text) {
-               AppInfo appInfo = DACommunicator.getAppInfoByName(text);
+               AppInfo appInfo = DACommunicator.getPkgInfoByName(text);
                if (null != appInfo) {
                        DACommunicator.setSelectedApp(appInfo);
                        DACommunicator.getSelectedDevice().setSelectedAppName(
@@ -800,7 +859,7 @@ public class ToolbarArea {
        }
 
        public void setAppComboTextByAppId(String id) {
-               AppInfo appInfo = DACommunicator.getAppInfoByAppPkgId(id);
+               AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(id);
                if (null != appInfo) {
                        DACommunicator.setSelectedApp(appInfo);
                        DACommunicator.getSelectedDevice().setSelectedAppName(
@@ -809,10 +868,16 @@ public class ToolbarArea {
                }
        }
 
-       public void setDeviceComboText(String text) {
+       public void setDeviceComboText(final String text) {
                DACommunicator.setSelectedDeviceBySerial(text);
-               deviceCombo.setText(text);
-               initAppCombo();
+               Display.getDefault().syncExec(new Runnable() {
+                       @Override
+                       public void run() {
+                               deviceCombo.setText(text);
+                               initAppCombo();
+                       }
+               });
+
        }
 
        public boolean isSourceViewEnabled() {
@@ -823,17 +888,21 @@ public class ToolbarArea {
                startButton.setButtonEnabled(enabled);
        }
 
+       public void setSettingsButtonEnablement(boolean enabled) {
+               settingsButton.setButtonEnabled(enabled);
+       }
+
        private void setStartButtonImagesToStop(boolean isStarted) {
                if (isStarted) {
                        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);
                }
        }
 
@@ -929,7 +998,7 @@ public class ToolbarArea {
 
        private boolean checkValidApplication() {
                List<AppInfo> apps = DACommunicator.getAppListFromTarget();
-               if (apps.isEmpty()) {
+               if (null == apps || apps.isEmpty()) {
                        return false;
                }
                String selectedApp = appCombo.getText();
@@ -952,4 +1021,14 @@ public class ToolbarArea {
                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 6877973..e5f934b 100644 (file)
@@ -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 fd7310e..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;
@@ -94,6 +95,9 @@ public class ConfigurationDialogFeaturesTableCellRenderer extends
                        } 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);
                }
 
@@ -173,7 +177,7 @@ public class ConfigurationDialogFeaturesTableCellRenderer extends
                GridItem item = (GridItem) value;
                if (event == IInternalWidget.LeftMouseButtonDown) {
                        if (overCheck(item, point)) {
-                               if (item.getText(1).contains("Recording")) { // the recording function determined to be always on.
+                               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);
index 8be97ed..d6c7a7c 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;
-import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton;
-import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioGroup;
-import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioSelectionListener;
 
 public class ConfigurationDialogSettingPage extends DAPageComposite {
        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 DARadioButton whiteRaidoButton = null;
-       private DARadioButton blackRadioButton = null;
+       private DACheckBox showInitialCheckBox = null;
+       private DACheckBox autoStopCheckBox = null;
 
        public ConfigurationDialogSettingPage(Composite parent, int style) {
 
@@ -68,69 +54,6 @@ public class ConfigurationDialogSettingPage extends DAPageComposite {
                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);
-
-               DARadioGroup radioGroup = new DARadioGroup();
-               whiteRaidoButton = new DARadioButton(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;
-               whiteRaidoButton.setLayoutData(data);
-               whiteRaidoButton.setForeground(ColorResources.BLACK);
-               whiteRaidoButton.setBackground(ColorResources.DIALOG_BG_UPPER);
-               whiteRaidoButton.setText(ConfigureLabels.SETTING_WHITE);
-               whiteRaidoButton.addSelectionListener(whiteRadioButtonListener);
-               radioGroup.addChild(whiteRaidoButton);
-
-               blackRadioButton = new DARadioButton(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;
-               blackRadioButton.setLayoutData(data);
-               blackRadioButton.setForeground(ColorResources.BLACK);
-               blackRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
-               blackRadioButton.setText(ConfigureLabels.SETTING_BLACK);
-               blackRadioButton.addSelectionListener(blackRadioButtonListener);
-               radioGroup.addChild(blackRadioButton);
-               blackRadioButton.setEnabled(false);
-
                // Configuration Setting
                Label settingLabel = new Label(this, SWT.TRANSPARENT);
                settingLabel.setText(ConfigureLabels.SETTING_CONFIGURATION_TITLE);
@@ -138,26 +61,25 @@ public class ConfigurationDialogSettingPage extends DAPageComposite {
                                .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);
@@ -165,23 +87,23 @@ public class ConfigurationDialogSettingPage extends DAPageComposite {
                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.height = 20; // 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()
+               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);
@@ -190,34 +112,17 @@ public class ConfigurationDialogSettingPage extends DAPageComposite {
                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 DARadioSelectionListener whiteRadioButtonListener = new DARadioSelectionListener() {
-               @Override
-               public void handleSelectionEvent(DARadioButton radio) {
-                       whiteRaidoButton.setEnabled(true);
-
-               }
-       };
-
-       private DARadioSelectionListener blackRadioButtonListener = new DARadioSelectionListener() {
-
-               @Override
-               public void handleSelectionEvent(DARadioButton radio) {
-                       blackRadioButton.setEnabled(false);
-
-               }
-       };
-
        private DACheckboxSelectionListener showInitiaRadioButtonListener = new DACheckboxSelectionListener() {
                @Override
                public void handleSelectionEvent(DACheckBox checkbox) {
                        ConfigurationDialogValues.getInstance().setShowInitia(
                                        !ConfigurationDialogValues.getInstance().isShowInitia());
-                       showInitialRadioButton.setChecked(ConfigurationDialogValues
+                       showInitialCheckBox.setChecked(ConfigurationDialogValues
                                        .getInstance().isShowInitia());
                }
        };
@@ -227,8 +132,8 @@ public class ConfigurationDialogSettingPage extends DAPageComposite {
                public void handleSelectionEvent(DACheckBox checkbox) {
                        ConfigurationDialogValues.getInstance().setAutoStop(
                                        !ConfigurationDialogValues.getInstance().isAutoStop());
-                       autoStopRadioButton.setChecked(ConfigurationDialogValues
-                                       .getInstance().isAutoStop());
+                       autoStopCheckBox.setChecked(ConfigurationDialogValues.getInstance()
+                                       .isAutoStop());
                }
        };
 }
\ No newline at end of file
index 1ecc511..745abdf 100644 (file)
@@ -45,9 +45,6 @@ public class ConfigurationDialogValues {
        private int bRecordingCall = AnalyzerConstants.OPT_RECORD;
 
        // Configuration
-       private boolean whiteTheme = true;
-       private boolean blackTheme = false;
-
        private boolean showInitia = false;
        private boolean autoStop = false;
 
@@ -65,8 +62,7 @@ public class ConfigurationDialogValues {
                        featuresName = new String[] { ConfigureLabels.FUNCTIONPROFILING,
                                        ConfigureLabels.ALLOCATION, ConfigureLabels.FILE,
                                        ConfigureLabels.THREAD, ConfigureLabels.USERINTERFACE,
-                                       ConfigureLabels.SNAPSHOT, ConfigureLabels.EVENT,
-                                       ConfigureLabels.RECORDING };
+                                       ConfigureLabels.SNAPSHOT, ConfigureLabels.EVENT };
                        mConfig = ConfigureManager.getInstance();
                }
                return instance;
@@ -95,8 +91,6 @@ public class ConfigurationDialogValues {
                                        return getSnapshotCall();
                                } else if (featueName.equals(ConfigureLabels.EVENT)) {
                                        return getEventCall();
-                               } else if (featueName.equals(ConfigureLabels.RECORDING)) {
-                                       return isbRecordingCall();
                                } else {
                                        System.out.println("failed undefine features");
                                }
@@ -145,11 +139,6 @@ public class ConfigurationDialogValues {
                                                value = AnalyzerConstants.OPT_EVENT;
                                        }
                                        setEventCall(value);
-                               } else if (featueName.equals(ConfigureLabels.RECORDING)) {
-                                       if (status) {
-                                               value = AnalyzerConstants.OPT_RECORD;
-                                       }
-                                       setbRecordingCall(value);
                                } else {
                                        System.out.println("failed undefine features");
                                }
@@ -288,7 +277,8 @@ public class ConfigurationDialogValues {
                for (String featueName : ConfigurationDialogValues.getInstance()
                                .getFeature()) {
                        if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
-                               if (isChangeFeatuesValues(getFunctionProfilingCall(), featueName)) {
+                               if (isChangeFeatuesValues(getFunctionProfilingCall(),
+                                               featueName)) {
                                        System.out.println("change valuse FUNCTIONPROFILING");
                                }
                        } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
@@ -397,22 +387,6 @@ public class ConfigurationDialogValues {
        }
 
        // 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;
-       }
-
        public boolean isShowInitia() {
                return showInitia;
        }
index efc7ee6..8054cb0 100644 (file)
@@ -96,7 +96,7 @@ public class WelcomeDialog {
                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
                Label banner = new Label(window, SWT.TRANSPARENT);
index 1341c66..5ae431b 100644 (file)
@@ -115,7 +115,7 @@ public class OpenTraceDialog extends DAMessageBox {
                }
                shell.setLayout(new FormLayout());
                shell.setSize(400, 410);
-               shell.setText(AnalyzerLabels.OPEN_TRACE);
+               shell.setText(AnalyzerLabels.OPEN_TRACE_TITLE);
 
                shell.addDisposeListener(new DisposeListener() {
 
@@ -508,14 +508,14 @@ public class OpenTraceDialog extends DAMessageBox {
 
        private boolean setDetailsInfo(String path) {
                boolean isSuccess = true;
-                       List<String> pInfo = SqlManager.getInstance().getDetailsInfo(path);
-                       if (null == pInfo || pInfo.isEmpty()) {
-                               isSuccess = false;
-                       }
-                       createTime = pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
-                       device = pInfo.get(AnalyzerConstants.PROJECT_DEVICE_INDEX);
-                       application = pInfo.get(AnalyzerConstants.PROJECT_APPNAME_INDEX);
-                       elapsedTime = pInfo.get(AnalyzerConstants.PROJECT_LAST_TIME_INDEX);
+               List<String> pInfo = SqlManager.getInstance().getDetailsInfo(path);
+               if (null == pInfo || pInfo.isEmpty() || pInfo.size() < 9) {
+                       return false;
+               }
+               createTime = pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
+               device = pInfo.get(AnalyzerConstants.PROJECT_DEVICE_INDEX);
+               application = pInfo.get(AnalyzerConstants.PROJECT_APPNAME_INDEX);
+               elapsedTime = pInfo.get(AnalyzerConstants.PROJECT_LAST_TIME_INDEX);
                return isSuccess;
        }
 }
index e3cd050..25d7bbb 100644 (file)
@@ -55,7 +55,7 @@ public class OpenTraceInputReader implements Runnable {
        public static void stopOpenTraceInputReader() {
                if (null != openTraceInputThread && openTraceInputThread.isAlive()) {
                        try {
-                               openTraceInputThread.join();
+                               openTraceInputThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                        } catch (InterruptedException e) {
                                e.printStackTrace();
                        }
index 8346ed5..090fa0c 100644 (file)
@@ -77,7 +77,7 @@ public class UIDataManager implements Runnable {
                if (null != updateLogThread && updateLogThread.isAlive()) {
                        try {
                                sendNotify();
-                               updateLogThread.join();
+                               updateLogThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
                                System.out.println("ui data manager joined!");
                        } catch (InterruptedException e) {
                                e.printStackTrace();
index 83009b6..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,7 +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, AnalyzerLabels.COOLBAR_AREA_UI_TOOLTIP);
+               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 4181025..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;
@@ -201,10 +205,10 @@ public class UIControlListDataChecker {
                }
        }
 
-       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());
index 63467d9..e958e36 100644 (file)
@@ -269,7 +269,7 @@ 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 (isRootNode(controlList, i)) {
                                output.add(currentNode);
@@ -288,9 +288,14 @@ public class UIControlListTable extends DATreeComposite {
 
        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;
                        }
index 9533cbf..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;
@@ -56,7 +55,6 @@ public class UIFunctionProfilingDataChecker {
        final String UI_API_TRUE = "true";//$NON-NLS-1$
        final String UI_API_FALSE = "false";//$NON-NLS-1$
        static int nUserProfilingDataCount = 0;
-       final int tizenReleaseCount = 2;
 
        public boolean addProfilingData(ProfilingData input) {
 
@@ -278,30 +276,6 @@ public class UIFunctionProfilingDataChecker {
                return returnData;
        }
 
-       private String tieznSouecePath() {
-               String sourcePath = null;
-               for (int i = 0; i < tizenReleaseCount; i++) {
-                       if (DACommunicator.isTargetEmulator()) {
-                               if (i == 0) {
-                                       sourcePath = AnalyzerPaths.TIZEN_2_1_EMULATOR_SOUECE_PATH;
-                               } else {
-                                       sourcePath = AnalyzerPaths.TIZEN_2_0_EMULATOR_SOUECE_PATH;
-                               }
-                       } else {
-                               if (i == 0) {
-                                       sourcePath = AnalyzerPaths.TIZEN_2_1_DEVICE_SOUECE_PATH;
-                               } else {
-                                       sourcePath = AnalyzerPaths.TIZEN_2_0_DEVICE_SOUECE_PATH;
-                               }
-                       }
-                       File configFolder = new File(sourcePath);
-                       if (configFolder.isDirectory()) {
-                               return sourcePath;
-                       }
-               }
-               return null;
-       }
-
        private void getUIApiListFile() {
                if (InitUIApiList == false) {
                        InitUIApiList = true;
@@ -309,8 +283,11 @@ public class UIFunctionProfilingDataChecker {
                        return;
                }
 
-               String sourcePath = tieznSouecePath();
-               if (null == sourcePath) {
+               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;
                }
 
@@ -351,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 1da32f3..8010ca1 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;
        }
@@ -122,7 +111,7 @@ public class DADialog {
                labelData = new FormData();
                labelData.left = new FormAttachment(0, 95);
                labelData.right = new FormAttachment(100, 0);
-               labelData.top = new FormAttachment(0, 25);
+               labelData.top = new FormAttachment(0, 15);
                labelData.height = 40;
                strMessage.setLayoutData(labelData);
 
@@ -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 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 {
index a8119c1..1d520ad 100644 (file)
@@ -1,3 +1,28 @@
+/*
+ *  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;
index 71d4d54..71a0fc3 100644 (file)
@@ -43,10 +43,11 @@ import org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer;
 public class TabButtonRenderer implements IDACustomButtonRenderer {
 
        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,
index 2e06803..0cdfeff 100644 (file)
@@ -36,13 +36,20 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboPopupRenderer;
 
-
 public class TitleComboPopupRenderer extends DACustomComboPopupRenderer {
 
        @Override
        public void draw(GC gc, Canvas canvas, int state, List<Rectangle> rects,
                        int selection, List<String> items) {
                int size = rects.size();
+               int itemSize = items.size();
+               if (size != itemSize) {
+                       System.out
+                                       .println("invalid parameter in popup renderer : Rect size "
+                                                       + size + "item size :" + itemSize);
+                       return;
+               }
+
                for (int i = 0; i < size; i++) {
                        Rectangle r = rects.get(i);
                        if (selection == i) {
@@ -63,12 +70,9 @@ public class TitleComboPopupRenderer extends DACustomComboPopupRenderer {
                                gc.drawLine(r.x, r.y + r.height - 1, r.x + r.width, r.y
                                                + r.height - 1);
                        }
+
                        gc.setForeground(ColorResources.DEVICE_APPLICATION_DROPDOWN_TEXT);
                        gc.setFont(FontResources.DROPDOWN);
-                       // Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
-                       // gc.drawString(items.get(i), 5, (r.height - p.y) / 2 + i *
-                       // r.height,
-                       // true);
                        gc.drawString(items.get(i), 5, 6 + i * r.height, true);
 
                        Rectangle rect = canvas.getClientArea();
index 4a05f7b..927cfa4 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 - 17, rect.y, 17,
+                               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 5449318..0298aeb 100644 (file)
@@ -102,7 +102,8 @@ public abstract class DATableComposite extends Composite {
 
        protected Point mousePoint = new Point(0, 0);
 
-       protected RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+       protected RangeDataManager rangeDataManager = RangeDataManager
+                       .getInstance();
 
        public DATableComposite(Composite parent, int style) {
                this(parent, SWT.NONE, style);
@@ -383,7 +384,7 @@ public abstract class DATableComposite extends Composite {
                                gridItem.setBackground(rangeColor);
                        }
 
-                       if(gridData != null) {
+                       if (gridData != null) {
                                String seqNum = gridData.getSelectionKey();
                                for (int ii = 0; ii < selSeqs.size(); ii++) {
                                        if (seqNum.equals(selSeqs.get(ii))) {
@@ -431,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) {
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 8e3b94e..adeb91a 100755 (executable)
@@ -43,6 +43,7 @@ import javax.xml.transform.TransformerFactoryConfigurationError;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -99,7 +100,7 @@ public class RecorderXml {
                } catch (TransformerConfigurationException e) {
                        e.printStackTrace();
                } catch (TransformerFactoryConfigurationError e) {
-                       System.out.println(e.getMessage());
+                       e.printStackTrace();
                } catch (TransformerException e) {
                        e.printStackTrace();
                } catch (IOException e) {
@@ -201,7 +202,7 @@ public class RecorderXml {
 
        public XmlData setEvent(String line, long time) {
                XmlData eventData = new XmlData();
-               String[] eventDatas = line.trim().split(TOKEN);
+               String[] eventDatas = line.trim().split(AnalyzerConstants.DATA_PARSING_TOKEN);
 
                if (eventDatas.length < 7) {
                        return null;
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/RecordingQueue.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/RecordingQueue.java
new file mode 100644 (file)
index 0000000..a9f2de3
--- /dev/null
@@ -0,0 +1,66 @@
+package org.tizen.dynamicanalyzer.uirecorder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+
+public class RecordingQueue {
+       private List<String> data = null;
+
+       public RecordingQueue() {
+               data = new ArrayList<String>();
+       }
+       
+       public synchronized String getFirst() {
+               while (isEmpty()) {
+                       if (LogParser.isLogParsingComplete()) {
+                               return null;
+                       }
+                       try {
+                               wait();
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                       }
+               }
+               String output = data.get(0);
+               data.remove(0);
+               notifyAll();
+               return output;
+       }
+
+       public synchronized void putLog(String input) {
+               while (isFull()) {
+                       try {
+                               wait();
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                               break;
+                       }
+               }
+               data.add(input);
+               notifyAll();
+       }
+
+       public boolean isEmpty() {
+               if (null == data) {
+                       data = new ArrayList<String>();
+               }
+               return data.isEmpty();
+       }
+
+       private boolean isFull() {
+               if (size() > 10000) {
+                       return true;
+               }
+               return false;
+       }
+
+       public int size() {
+               return data.size();
+       }
+
+       public void clear() {
+               data.clear();
+       }
+}
index 27f7dd3..f124698 100644 (file)
 
 package org.tizen.dynamicanalyzer.uirecorder;
 
-import java.io.BufferedOutputStream;
-import java.io.PrintStream;
-import java.sql.Time;
 import java.util.ArrayList;
 
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.common.ErrorCode;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 
 public class UIRecorderPlayThread extends Thread {
-       String[] commands;
-       String command;
-       PrintStream pout;
-       Time startTime;
-       Process process = null;
-       Time stopTime;
+       private final String FILTER_STRING = "ls:";//$NON-NLS-1$ 
+       private long readyTime = 100000;
+
        long pauseTime;
        private static UIRecorderPlayThread instance = null;
-       private String xmlFileName;
+       private String xmlFileName = null;
 
        boolean end = false;
 
-       String fileName;
-
-       public UIRecorderPlayThread(Process process) {
-               this.process = process;
-               this.xmlFileName = null;
-       }
-
        public static UIRecorderPlayThread getInstance() {
                return instance;
        }
@@ -74,41 +63,61 @@ public class UIRecorderPlayThread extends Thread {
                oldData.event_type = CommonConstants.ZERO;
                oldData.event_value = CommonConstants.ZERO;
                ArrayList<XmlData> playDatas = xml.getPlayDatas(xmlFileName);
-               BufferedOutputStream out;
-
-               startTime = new Time(System.currentTimeMillis());
 
-               out = new BufferedOutputStream(process.getOutputStream());
-
-               pout = new PrintStream(out, true);
+               try {
+                       System.out.println("Replay event ready for app start!!");
+                       Thread.sleep(readyTime);
+               } catch (InterruptedException e) {
+                       System.out.println("Replay start!!");
+               }
                for (XmlData data : playDatas) {
-                       if (AnalyzerManager.isExit()) {
-                               AnalyzerUtil.tryClose(pout);
+                       if (AnalyzerManager.isExit() || !AnalyzerManager.isRunning()) {
                                return;
                        }
                        try {
                                nowTime = Long.parseLong(data.time);
                                sleep(nowTime - preTime);
-                       } catch (NumberFormatException e1) {
-                               e1.printStackTrace();
-                       } catch (InterruptedException e1) {
-                               e1.printStackTrace();
+                       } catch (NumberFormatException e) {
+                               e.printStackTrace();
+                       } catch (InterruptedException e) {
+                               System.out.println("UI recorder play thread exit by interrupt");
+                               break;
                        }
 
-                       pout.println(new String(
-                                       data.eventType
-                                                       + " " + data.event_type + " " + data.event_code + " " + data.event_value + " ")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+                       String recordEvent = new String(data.eventType
+                                       + AnalyzerConstants.DATA_PARSING_TOKEN + data.event_type
+                                       + AnalyzerConstants.DATA_PARSING_TOKEN + data.event_code
+                                       + AnalyzerConstants.DATA_PARSING_TOKEN + data.event_value);
+                       String replayEvent = AnalyzerConstants.MSG_REPLAY + "|"
+                                       + recordEvent.length() + "|" + recordEvent;
+
+                       if (!replayEvent.contains(FILTER_STRING)) {
+                               String result = DACommunicator
+                                               .handleControlMessage(replayEvent);
+                               if (null != result) {
+                                       System.out.println("replay message ack :" + result);
+                                       String[] splitResult = result
+                                                       .split(CommonConstants.CMD_SPLIT_READ);
+                                       if (!AnalyzerConstants.MSG_OK
+                                                       .equals(splitResult[ErrorCode.ERROR_MSG_INDEX])) {
+//                                             System.out.println("replay : " + replayEvent
+//                                                             + " send failed!!");
+
+                                               try {
+                                                       int errno = Integer
+                                                                       .parseInt(splitResult[ErrorCode.ERROR_NUMBER_INDEX]);
+                                                       System.out.println(ErrorCode.getError(errno)
+                                                                       .getMessage());
+                                               } catch (NumberFormatException e) {
+                                                       e.printStackTrace();
+                                               }
+                                       }
+                               }
+                       }
 
                        oldData = data;
                        preTime = nowTime;
                }
        }
 
-       public void end() {
-               if (process != null) {
-                       process.destroy();
-                       process = null;
-               }
-               AnalyzerUtil.tryClose(pout);
-       }
 }
index 27e3880..6c7e293 100755 (executable)
 
 package org.tizen.dynamicanalyzer.uirecorder;
 
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.sql.Time;
 import java.util.ArrayList;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class UIRecorderRecordThread extends Thread {
-       String[] command;
-       BufferedInputStream in;
-       Time startTime;
-       Time stopTime;
        ArrayList<XmlData> recordDatas;
+       private static RecordingQueue recordQueue = null;
 
        boolean end = false;
-       Process process = null;
-
-       public UIRecorderRecordThread(Process process) {
-               this.process = process;
-       }
 
        public void run() {
                recordDatas = new ArrayList<XmlData>();
@@ -57,55 +44,36 @@ public class UIRecorderRecordThread extends Thread {
                RecorderXml xml = new RecorderXml();
                ToolbarArea coolbarArea = ToolbarArea.getInstance();
 
-               startTime = new Time(System.currentTimeMillis());
-
-               in = new BufferedInputStream(process.getInputStream());
+               RecordingQueue rq = getRecordingQueue();
+               while (!AnalyzerManager.isExit()) {
+                       String record = rq.getFirst();
+                       if (null == record) {
+                               break;
+                       }
 
-               byte[] buf = new byte[1024];
-               String[] lines;
-               String strBuffer = new String();
-               int byteReads = 0;
-               try {
-                       while ((byteReads = in.read(buf)) > 0) {
-                               strBuffer += new String(buf, 0, byteReads);
-                               if (strBuffer.length() - 1 != strBuffer.lastIndexOf("\n")) { //$NON-NLS-1$
-                                       continue;
-                               }
-                               lines = strBuffer.split("\n"); //$NON-NLS-1$
-                               for (int i = 0; i < lines.length; i++) {
-                                       if (lines[i].isEmpty()
-                                                       || lines[i]
-                                                                       .contains(AnalyzerConstants.TOOL_RECORDER_NAME)) {
-                                               continue;
-                                       }
+//                     System.out.println("record data : " + record);
 
-                                       recordData = xml.setEvent(lines[i],
-                                                       coolbarArea.getTime() / 1000);
-                                       if (null != recordData) {
-                                               recordDatas.add(recordData);
-                                               if (recordData.event_type.equals("0") && recordData.event_code.equals("0") && recordData.event_value.equals("0")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                                                       recordDatas = new ArrayList<XmlData>();
-                                               }
-                                       }
+                       recordData = xml.setEvent(record, coolbarArea.getTime() / 1000);
+                       if (null != recordData) {
+                               recordDatas.add(recordData);
+                               if (recordData.event_type.equals("0") && recordData.event_code.equals("0") && recordData.event_value.equals("0")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                                       recordDatas = new ArrayList<XmlData>();
                                }
-                               strBuffer = new String();
                        }
-               } catch (IOException e) {
-                       e.printStackTrace();
                }
                xml.createXml(AnalyzerManager.getProject().getSavePath());
+               System.out.println("create xml file...");
                end = true;
        }
 
-       public void end() {
-               if (process != null) {
-                       process.destroy();
-                       process = null;
-               }
-               AnalyzerUtil.tryClose(in);
-       }
-
        public boolean isEnd() {
                return end;
        }
+
+       public static RecordingQueue getRecordingQueue() {
+               if (null == recordQueue) {
+                       recordQueue = new RecordingQueue();
+               }
+               return recordQueue;
+       }
 }
index 95b7a3c..b1a4946 100644 (file)
 
 package org.tizen.dynamicanalyzer.uirecorder;
 
-import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 
 public class UIRecorderTool {
        private static UIRecorderTool instance;
-       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$
        private UIRecorderRecordThread recordThread;
        private UIRecorderPlayThread playThread;
        private Boolean isReplay = false;
        private String xmlFileStr = null;
-       private String state = STOP_STATE;
-
-       private UIRecorderTool() {
-               xmlFileStr = null;
-               state = STOP_STATE;
-       }
 
        public static UIRecorderTool getInstance() {
                if (instance == null) {
@@ -64,58 +52,55 @@ public class UIRecorderTool {
        }
 
        public void startRecorder() {
-               Process runProcess = null;
                if (isReplay) {
                        /* recored */
-                       runProcess = execute(RECORD_MODE);
-                       if (runProcess != null) {
-                               recordThread = new UIRecorderRecordThread(runProcess);
-                               recordThread.start();
-                       }
+                       recordThread = new UIRecorderRecordThread();
+                       recordThread.start();
                        /* play */
-                       runProcess = execute(PLAY_MODE);
-                       if (runProcess != null) {
-                               playThread = new UIRecorderPlayThread(runProcess);
-                               playThread.setXmlFile(xmlFileStr);
-                               playThread.start();
-                       }
+                       playThread = new UIRecorderPlayThread();
+                       playThread.setXmlFile(xmlFileStr);
+                       playThread.start();
                        isReplay = false;
                } else {
                        /* play */
-                       runProcess = execute(RECORD_MODE);
-                       if (runProcess != null) {
-                               recordThread = new UIRecorderRecordThread(runProcess);
-                               recordThread.start();
-                       }
+                       recordThread = new UIRecorderRecordThread();
+                       recordThread.start();
                }
        }
 
        public void stop() {
-               if (recordThread != null) {
-                       recordThread.end();
+               if (recordThread != null && recordThread.isAlive()) {
+                       try {
+                               sendNotify();
+                               System.out.println("record thread join wait!");
+                               recordThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                               System.out.println("record thread join interrupted!");
+                       }
                        recordThread = null;
                }
-               if (playThread != null) {
-                       playThread.end();
+               if (playThread != null && playThread.isAlive()) {
+                       try {
+                               playThread.interrupt();
+                               System.out.println("replay thread join wait!");
+                               playThread.join(AnalyzerManager.THREAD_JOIN_WAIT_TIME);
+                       } catch (InterruptedException e) {
+                               e.printStackTrace();
+                               System.out.println("play thread join interrupted!");
+                       }
                        playThread = null;
                }
        }
 
-       public void setState(String state) {
-               this.state = state;
-       }
-
-       public String getState() {
-               return state;
-       }
-
-       public Process execute(String mode) {
-
-               if (null == DACommunicator.getSelectedDevice()) {
-                       return null;
+       public void sendNotify() {
+               RecordingQueue rq = UIRecorderRecordThread.getRecordingQueue();
+               synchronized (rq) {
+                       rq.notifyAll();
                }
+       }
 
-               return DACommunicator
-                               .execCommand(AnalyzerShellCommands.DACOMMAND_RUN_EVENT + mode);
+       public UIRecorderPlayThread getPlayThead() {
+               return playThread;
        }
 }
index f6c3bf2..01a95cc 100755 (executable)
@@ -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/empty_snapshot_small.png b/org.tizen.dynamicanalyzer/theme/white/img/empty_snapshot_small.png
new file mode 100644 (file)
index 0000000..46cc700
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/empty_snapshot_small.png differ