From: Lee Date: Fri, 23 Nov 2012 07:29:25 +0000 (+0900) Subject: [Title] Open trace bug fix, tree selection bug fix, animation control added X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbf699b1744c5f491c5b3b3be614cf6a371b6ddc;p=sdk%2Ftools%2Fdynamic-analyzer.git [Title] Open trace bug fix, tree selection bug fix, animation control added [Desc.] animation control added [Issue] - --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java index 0803f5c..344131e 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java @@ -65,6 +65,7 @@ public class CommonConstants { public static final String EXTENSION_LEAK_CHECK = ".leak"; //$NON-NLS-1$ public static final String EXTENSION_JPG_IMAGE = ".jpg"; //$NON-NLS-1$ public static final String EXTENSION_PNG_IMAGE = ".png"; //$NON-NLS-1$ + public static final String EXTENSION_GIF_IMAGE = ".gif"; //$NON-NLS-1$ /* Arch */ public static final String ARM_ARCH = "arm"; //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java index 400e394..f34b56d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java @@ -47,10 +47,12 @@ import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands; import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.project.AppDesktopInfo; +import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider; import org.tizen.dynamicanalyzer.ui.info.range.StopProcessManager; import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool; +import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; import org.tizen.sdblib.IDevice; import org.tizen.sdblib.IShellOutputReceiver; import org.tizen.sdblib.MultiLineReceiver; @@ -743,6 +745,8 @@ public class DACommunicator { System.out.println("Disconnected while DA is running."); //$NON-NLS-1$ UIRecorderTool.getInstance().stop(); + AnalyzerUtil + .setRecordState(RecordStateSourceProvider.RECORD_READY); Display.getDefault().syncExec(new Runnable() { @Override public void run() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java index cdf1b8b..57bfb41 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java @@ -93,13 +93,8 @@ public class OpenTraceHandler extends AbstractHandler { System.out.println("invalid save file"); //$NON-NLS-1$ return null; } - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - OpenTraceProgressManager.getInstance().openTracePrgressStart( - "Loading xml files.."); - } - }); + OpenTraceProgressManager.getInstance().openTracePrgressStart( + "Loading xml files.."); int size = pInfo.size(); List logCenterNames = new ArrayList(); for (int i = 0; i < size; i++) { @@ -154,78 +149,71 @@ public class OpenTraceHandler extends AbstractHandler { } p.initLogCenters(logCenterNames); - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - int percent = OpenTraceProgressManager.getInstance() - .getPercent(); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading appInfo..", percent += 20); - - loadAppInfo(p); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading Callstack data..", percent += 5); - - loadCallStackData(p); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading Callstack APIs..", percent += 5); - - loadCallStackApis(p); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading Profiling data..", percent += 5); - - loadProfilingData(); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Making Profiling tree..", percent += 5); - - loadProfilingChildData(); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading Leak data..", percent += 5); - - loadLeakData(p); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading Failed data..", percent += 5); - - loadFailedData(); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading Images..", percent += 5); - - loadImageSet(p); - OpenTraceProgressManager.getInstance().setProgressPercent( - "Toolbar setting...", percent += 5); - p.closeConnection(); - - ToolbarArea.getInstance().setTime(p.getLastTime()); - ToolbarArea.getInstance().setAppComboText(p.getAppName()); - ToolbarArea.getInstance().setRepalyButtonEnable(true); - if (AnalyzerManager.getProject().getBinaryPath().isEmpty()) { - ToolbarArea.getInstance().setSourceViewEnable(false); - ToolbarArea.getInstance().setSourceViewTooltip( - AnalyzerLabels.MESSAGE_PROCESS_PG_WARNING); - } else { - ToolbarArea.getInstance().setSourceViewEnable(true); - ToolbarArea.getInstance().setSourceViewTooltip( - AnalyzerLabels.MESSAGE_PROCESS_VIEW_SOURCE); - } - - OpenTraceProgressManager.getInstance().setProgressPercent( - "Loading data..", percent += 3); + int percent = OpenTraceProgressManager.getInstance().getPercent(); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading appInfo..", percent += 20); + + loadAppInfo(p); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading Callstack data..", percent += 5); + + loadCallStackData(p); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading Callstack APIs..", percent += 5); + + loadCallStackApis(p); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading Profiling data..", percent += 5); + + loadProfilingData(); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Making Profiling tree..", percent += 5); + + loadProfilingChildData(); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading Leak data..", percent += 5); + + loadLeakData(p); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading Failed data..", percent += 5); + + loadFailedData(); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading Images..", percent += 5); + + loadImageSet(p); + OpenTraceProgressManager.getInstance().setProgressPercent( + "Toolbar setting...", percent += 5); + p.closeConnection(); + + ToolbarArea.getInstance().setTime(p.getLastTime()); + ToolbarArea.getInstance().setAppComboText(p.getAppName()); + ToolbarArea.getInstance().setRepalyButtonEnable(true); + if (AnalyzerManager.getProject().getBinaryPath().isEmpty()) { + ToolbarArea.getInstance().setSourceViewEnable(false); + ToolbarArea.getInstance().setSourceViewTooltip( + AnalyzerLabels.MESSAGE_PROCESS_PG_WARNING); + } else { + ToolbarArea.getInstance().setSourceViewEnable(true); + ToolbarArea.getInstance().setSourceViewTooltip( + AnalyzerLabels.MESSAGE_PROCESS_VIEW_SOURCE); + } + OpenTraceProgressManager.getInstance().setProgressPercent( + "Loading data..", percent += 3); + /* add each part action.. close... open...etc... */ - /* add each part action.. close... open...etc... */ + /* resource log view action start */ + List logCenters = AnalyzerManager.getLogCenters(); + size = logCenters.size(); + for (int i = 0; i < size; i++) { + LogCenter center = logCenters.get(i); + int dataSize = SqlManager.selectCount(center); + center.setDataSize(dataSize); + } + /* Timeline + file chart */ + OpenTraceProgressManager.getInstance().runThreads(); + OpenTraceProgressManager.getInstance().openTraceComplete(); - /* resource log view action start */ - List logCenters = AnalyzerManager.getLogCenters(); - int size = logCenters.size(); - for (int i = 0; i < size; i++) { - LogCenter center = logCenters.get(i); - int dataSize = SqlManager.selectCount(center); - center.setDataSize(dataSize); - } - /* Timeline + file chart */ - OpenTraceProgressManager.getInstance().runThreads(); - OpenTraceProgressManager.getInstance().openTraceComplete(); - } - }); return null; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java index 423c437..4eeae7c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java @@ -40,6 +40,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.communicator.DACommunicator; +import org.tizen.dynamicanalyzer.handlers.StopHandler; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider; import org.tizen.dynamicanalyzer.ui.info.range.StopProcessManager; @@ -106,7 +107,7 @@ 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, 2); @@ -128,10 +129,10 @@ public class MessageProcess { break; case AnalyzerConstants.MSG_DEVICE_LOG: /* device info : 4 */ case AnalyzerConstants.MSG_LOG: /* log : 5 */ -// if (AnalyzerConstants.MSG_LOG == messageIndex) { -// System.out -// .println("count " + messageCount + ": " + message); -// } + // if (AnalyzerConstants.MSG_LOG == messageIndex) { + // System.out + // .println("count " + messageCount + ": " + message); + // } buffer.add(messages[1]); messageCount += 1; break; @@ -348,14 +349,15 @@ public class MessageProcess { syncStopTrace(); System.out.println("finally part run stop log process thread"); //$NON-NLS-1$ StopLogProcessor.runStopLogProcessThread(); + AnalyzerUtil.executeCommand(StopHandler.ID); } } public void processUserProfiling(String input) { -// FunctionUsageProfiler profiler = AnalyzerManager -// .getFunctionUserProfiler(); + // FunctionUsageProfiler profiler = AnalyzerManager + // .getFunctionUserProfiler(); FunctionUsageProfiler profiler = FunctionUsageProfiler.getInstance(); profiler.pushSample(input); -// profiler.makeFunctionUsageProfileData(input); + // profiler.makeFunctionUsageProfileData(input); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/OpenTraceProgressManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/OpenTraceProgressManager.java index aec4709..0311b00 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/OpenTraceProgressManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/OpenTraceProgressManager.java @@ -1,3 +1,28 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jooyoul Lee + * Juyoung Kim + * + * 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.logparser; import org.eclipse.swt.SWT; @@ -64,35 +89,52 @@ public class OpenTraceProgressManager implements Runnable { return instance; } - public void openTracePrgressStart(String EndMessage) { + public void openTracePrgressStart(final String EndMessage) { if (state == OPEN_TRACE_PROCESS_START) { return; } - state = OPEN_TRACE_PROCESS_START; - Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); - dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL); - if (null != dialog) { - dialog.open(); - dialog.setProgressMessage(EndMessage); - dialog.setProgressInfo(AnalyzerLabels.STOP_PROCESS_DLG_PLEASE_WAIT); - } + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + state = OPEN_TRACE_PROCESS_START; + Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); + dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL); + if (null != dialog) { + + dialog.open(); + dialog.setProgressMessage(EndMessage); + dialog.setProgressInfo(AnalyzerLabels.STOP_PROCESS_DLG_PLEASE_WAIT); + + } + } + }); } - public void setProgressPercent(String message, int percent) { + public void setProgressPercent(final String message, final int percent) { if (null != dialog) { this.percent = percent; - dialog.setValue(percent); - dialog.setProgressMessage(message); + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + dialog.setValue(percent); + dialog.setProgressMessage(message); + } + }); } } public void openTraceComplete() { if (null != dialog) { waitingThreads(); - dialog.setValue(100); - AnalyzerUtil.changePage(TimelinePage.ID); - closeOpenTraceDialog(); + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + AnalyzerUtil.changePage(TimelinePage.ID); + dialog.setValue(100); + closeOpenTraceDialog(); + } + }); AnalyzerUtil.executeCommand(OpenTraceCompleteHandler.ID); percent = 0; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java index 26024a8..4e51443 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java @@ -291,6 +291,15 @@ public class ImageResources { /*** stop progress dialog ***/ public static final Image STOP_PROGRESS_LOADING = getPngImage("loading_icon"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_GIF = getImage("loading_icon",CommonConstants.EXTENSION_GIF_IMAGE); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_01 = getPngImage("loading_icon_01"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_02 = getPngImage("loading_icon_02"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_03 = getPngImage("loading_icon_03"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_04 = getPngImage("loading_icon_04"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_05 = getPngImage("loading_icon_05"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_06 = getPngImage("loading_icon_06"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_07 = getPngImage("loading_icon_07"); //$NON-NLS-1$ + public static final Image STOP_PROGRESS_LOADING_08 = getPngImage("loading_icon_08"); //$NON-NLS-1$ /*** thread page ***/ public static final Image THREAD_LOCK_COMBO_DISABLE = getPngImage("thread_lock_dropdown_disable"); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/range/StopProcessManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/range/StopProcessManager.java index ae1fd18..e2a111c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/range/StopProcessManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/range/StopProcessManager.java @@ -28,6 +28,7 @@ package org.tizen.dynamicanalyzer.ui.info.range; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; +import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider; import org.tizen.dynamicanalyzer.ui.summary.SummaryPage; import org.tizen.dynamicanalyzer.ui.widgets.ProgressDialog; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; @@ -54,6 +55,7 @@ public class StopProcessManager { return; } state = STOP_PROCESS_START; + AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY); Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL); if (null != dialog) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/RecordStartStopThread.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/RecordStartStopThread.java index 39daaee..8cfab31 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/RecordStartStopThread.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/RecordStartStopThread.java @@ -116,7 +116,7 @@ public class RecordStartStopThread implements Runnable { LogParser.startLogParser(); FileChartManager.getInstance().startUpdateLogThread(); UIDataManager.getInstance().startUpdateLogThread(); - + FunctionUsageProfiler.startProfiler(); /* Timeline */ @@ -125,6 +125,7 @@ public class RecordStartStopThread implements Runnable { } private void recordStop() { + AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY); Display.getDefault().syncExec(new Runnable() { @Override public void run() { @@ -147,7 +148,7 @@ public class RecordStartStopThread implements Runnable { AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA); } }); - + AnalyzerUtil.executeCommand(StopHandler.ID); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java index 399916f..f83dbae 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java @@ -246,22 +246,27 @@ public class ToolbarArea { shell.addShellListener(shellListener); } - public void setRepalyButtonEnable(boolean enabled) { - Project p = AnalyzerManager.getProject(); - if (null == p || !enabled) { - replayButton.setEnabled(false); - return; - } + public void setRepalyButtonEnable(final boolean enabled) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + Project p = AnalyzerManager.getProject(); + if (null == p || !enabled) { + replayButton.setEnabled(false); + return; + } - String appName = p.getAppName(); - String text = appCombo.getText(); - if (null != appName && !appName.isEmpty() && !text.isEmpty() - && appName.equals(text)) { - replayButton.setEnabled(true); - return; - } + String appName = p.getAppName(); + String text = appCombo.getText(); + if (null != appName && !appName.isEmpty() && !text.isEmpty() + && appName.equals(text)) { + replayButton.setEnabled(true); + return; + } - replayButton.setEnabled(false); + replayButton.setEnabled(false); + } + }); } private void addToolbarListeners() { @@ -667,8 +672,13 @@ public class ToolbarArea { return timerClock.getTimeInMicroseconds(); } - public void setTime(long time) { - timerClock.setTime(time); + public void setTime(final long time) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + timerClock.setTime(time); + } + }); } private void initAppCombo() { @@ -759,11 +769,16 @@ public class ToolbarArea { } } - public void setAppComboText(String text) { + public void setAppComboText(final String text) { AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByName(text); if (null != appInfo) { DACommunicator.setSelectedApp(appInfo); - appCombo.setText(text); + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + appCombo.setText(text); + } + }); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java index 658a49d..5511b6c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java @@ -396,6 +396,11 @@ public class OpenTraceDialog extends DAMessageBox { } int index = grid.getSelectionIndex(); GridItem item = items[0]; + + if (item.getForeground() == ColorResources.BLUE) { + return; + } + String openPath = null; if ((Integer) item.getData() == TEMP_FOLDER) { openPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java index 9fb0dc2..16b3857 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java @@ -1,3 +1,28 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jooyoul Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ package org.tizen.dynamicanalyzer.ui.toolbar.opentrace; import java.io.File; @@ -12,8 +37,10 @@ import org.eclipse.nebula.widgets.grid.GridItem; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.common.AnalyzerPaths; import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.project.Project; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.sql.SqlManager; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; @@ -93,11 +120,26 @@ public class SaveFilesTable extends DATableComposite { gridItem.setText(index, inputText); } if (text.get(VALIDATE_INDEX).equals("N")) { - gridItem.setForeground(ColorResources.RED); + gridItem.setForeground(ColorResources.ORANGE); gridItem.setToolTipText(TRACE_NAME_INDEX, "invalid save file - old version"); gridItem.setToolTipText(DATE_INDEX, "invalid save file - old version"); + } else { + String path = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH + + File.separator + text.get(TRACE_NAME_INDEX); + + Project project = AnalyzerManager.getProject(); + if (null != project) { + String projectPath = project.getSavePath(); + if (path.equals(projectPath)) { + gridItem.setForeground(ColorResources.BLUE); + gridItem.setToolTipText(TRACE_NAME_INDEX, + "current project file - can't delete"); + gridItem.setToolTipText(DATE_INDEX, + "current project file - can't delete"); + } + } } } table.update(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/TempFilesTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/TempFilesTable.java index 240c462..d8345e1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/TempFilesTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/TempFilesTable.java @@ -1,3 +1,28 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jooyoul Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ package org.tizen.dynamicanalyzer.ui.toolbar.opentrace; import java.io.File; @@ -12,14 +37,18 @@ import org.eclipse.nebula.widgets.grid.GridItem; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.common.AnalyzerPaths; import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.project.Project; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.sql.SqlManager; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; public class TempFilesTable extends DATableComposite { + private final int TRACE_NAME_INDEX = 0; + private final int DATE_INDEX = 1; public TempFilesTable(Composite parent, int style) { super(parent, style); @@ -69,6 +98,20 @@ public class TempFilesTable extends DATableComposite { for (int index = 0; index < columnCount; index++) { gridItem.setText(index, text.get(index)); } + + String path = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator + + text.get(TRACE_NAME_INDEX); + Project project = AnalyzerManager.getProject(); + if (null != project) { + String projectPath = project.getSavePath(); + if (path.equals(projectPath)) { + gridItem.setForeground(ColorResources.BLUE); + gridItem.setToolTipText(TRACE_NAME_INDEX, + "current project file - can't delete"); + gridItem.setToolTipText(DATE_INDEX, + "current project file - can't delete"); + } + } } table.update(); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAAnimation.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAAnimation.java index 19b9bb7..9b02a6d 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAAnimation.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAAnimation.java @@ -1,11 +1,11 @@ package org.tizen.dynamicanalyzer.ui.widgets; import java.util.ArrayList; -import java.util.Date; 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.Image; @@ -13,7 +13,6 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.tizen.dynamicanalyzer.resources.ColorResources; public class DAAnimation extends Canvas { @@ -21,12 +20,12 @@ public class DAAnimation extends Canvas { Timer timer = null; long startTime = 0; - long interval = 1000; + long interval = 100; int index = 0; public DAAnimation(Composite parent, int style) { - super(parent, style); + super(parent, style | SWT.TRANSPARENT); this.addPaintListener(paintListener); } @@ -49,13 +48,12 @@ public class DAAnimation extends Canvas { @Override public void paintControl(PaintEvent e) { Canvas canvas = (Canvas) e.widget; + canvas.setBackground(canvas.getParent().getBackground()); Rectangle rect = canvas.getClientArea(); if (index >= imageList.size()) { index = 0; } e.gc.drawImage(imageList.get(index++), rect.x, rect.y); - e.gc.setForeground(ColorResources.WHITE); - e.gc.drawRectangle(rect); } }; @@ -72,11 +70,14 @@ public class DAAnimation extends Canvas { Display.getDefault().syncExec(new Runnable() { @Override public void run() { - redraw(); + if (null != this && !isDisposed()) { + redraw(); + update(); + } } }); } - }, new Date(), interval); + }, 10, interval); } public void stopTimer() { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/Progress.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/Progress.java index 5478958..3229e29 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/Progress.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/Progress.java @@ -1,11 +1,42 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jooyoul Lee + * Juyoung Kim + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ package org.tizen.dynamicanalyzer.ui.widgets; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.swt.SWT; import org.eclipse.swt.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.Image; import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; @@ -19,7 +50,8 @@ public class Progress extends Canvas { public static final int PROGRESS_STYLE_BAR_ALONE = 0; public static final int PROGRESS_STYLE_ALL = 1; - private Image loadingImage = ImageResources.STOP_PROGRESS_LOADING; + private List loadingImage = new ArrayList(); + private DAAnimation icon = null; private String upperText = CommonConstants.EMPTY; private String bottomText = CommonConstants.EMPTY; private int maxSize = 100; @@ -34,6 +66,23 @@ public class Progress extends Canvas { super(parent, style); this.addPaintListener(progressPaintListener); this.setLayout(new FormLayout()); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_01); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_02); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_03); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_04); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_05); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_06); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_07); + loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_08); + + icon = new DAAnimation(this, SWT.NONE, loadingImage); + FormData data = new FormData(); + data.top = new FormAttachment(0, 11); + data.left = new FormAttachment(0, 12); + data.width = 24; + data.height = 24; + icon.setLayoutData(data); + icon.start(); } public Progress(Composite parent, int style, int progressStyle) { @@ -51,8 +100,8 @@ public class Progress extends Canvas { this.update(); } - public Image getLoadingImage() { - return loadingImage; + public void close() { + icon.stopTimer(); } public Color getOutlineColor1() { @@ -71,7 +120,7 @@ public class Progress extends Canvas { this.outlineColor2 = outlineColor2; } - public void setLoadingImage(Image loadingImage) { + public void setLoadingImage(List loadingImage) { this.loadingImage = loadingImage; } @@ -121,7 +170,9 @@ public class Progress extends Canvas { rect.height - 2); // draw icon - e.gc.drawImage(loadingImage, 12, 11); + // e.gc.drawImage(loadingImage, 12, 11); + + // e.gc.drawImage(loadingImage.get(1), 12 + 100, 11); // draw upper text e.gc.setForeground(ColorResources.BLACK); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/ProgressDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/ProgressDialog.java index bf97072..a69a6f6 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/ProgressDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/ProgressDialog.java @@ -1,3 +1,29 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jooyoul Lee + * yeongtaik byeon + * Juyoung Kim + * + * 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.Date; @@ -40,6 +66,7 @@ public class ProgressDialog { stopTimer(); if (null != progress) { if (!progress.isDisposed()) { + progress.close(); progress.dispose(); } progress = null; diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_01.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_01.png new file mode 100644 index 0000000..4dbcaaa Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_01.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_02.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_02.png new file mode 100644 index 0000000..ba19c72 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_02.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_03.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_03.png new file mode 100644 index 0000000..f99d4b3 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_03.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_04.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_04.png new file mode 100644 index 0000000..f9588d2 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_04.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_05.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_05.png new file mode 100644 index 0000000..f15e48f Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_05.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_06.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_06.png new file mode 100644 index 0000000..0fade41 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_06.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_07.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_07.png new file mode 100644 index 0000000..9693f60 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_07.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_08.png b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_08.png new file mode 100644 index 0000000..cf330d8 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/loading_icon_08.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon.gif b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon.gif new file mode 100644 index 0000000..a2ec1ea Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon.gif differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_01.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_01.png new file mode 100644 index 0000000..4dbcaaa Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_01.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_02.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_02.png new file mode 100644 index 0000000..ba19c72 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_02.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_03.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_03.png new file mode 100644 index 0000000..f99d4b3 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_03.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_04.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_04.png new file mode 100644 index 0000000..f9588d2 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_04.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_05.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_05.png new file mode 100644 index 0000000..f15e48f Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_05.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_06.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_06.png new file mode 100644 index 0000000..0fade41 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_06.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_07.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_07.png new file mode 100644 index 0000000..9693f60 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_07.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_08.png b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_08.png new file mode 100644 index 0000000..cf330d8 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/loading_icon_08.png differ