From: Hyunjong,park Date: Mon, 18 Nov 2013 02:49:36 +0000 (+0900) Subject: [Title] add feature replay editor dlg. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c81ad6a4e66958d3e24af0d3becd793e6c6ebf6a;p=sdk%2Ftools%2Fdynamic-analyzer.git [Title] add feature replay editor dlg. [Desc.] only replay editor dlg UI. [Issue] - --- diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/popupMenu/DAPopupMenu.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/popupMenu/DAPopupMenu.java index 71354f9..41cd9c4 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/popupMenu/DAPopupMenu.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/popupMenu/DAPopupMenu.java @@ -77,7 +77,10 @@ public class DAPopupMenu { public DAPopupMenu(Composite parent) { this.parent = parent; - + setMouseListener(); + } + + public void setMouseListener(){ parent.getShell().addShellListener(new ShellListener() { @Override @@ -106,17 +109,24 @@ public class DAPopupMenu { parent.addMouseListener(new MouseListener() { @Override public void mouseUp(MouseEvent e) { - if (e.button == 3) { + switch (e.button) { + case 1: + break; + case 2: + break; + case 3: Point pt = Display.getCurrent().getCursorLocation(); if (true == isInParent(pt)) { open(topShell, pt.x - 5, pt.y - 5); } + break; } } @Override public void mouseDown(MouseEvent event) { + // TODO Auto-generated method stub switch (event.button) { case MOUSE_LEFT: { closeParent(); @@ -214,7 +224,7 @@ public class DAPopupMenu { } } - private boolean makeItem(Shell shell, int x, int y) { + public boolean makeItem(Shell shell, int x, int y) { if (null == children) { return false; } @@ -339,7 +349,8 @@ public class DAPopupMenu { return nTextWidth; } - protected boolean open(Shell shell, int x, int y) { + + public boolean open(Shell shell, int x, int y) { if (null != shell) { shell.dispose(); shell = null; @@ -396,6 +407,64 @@ public class DAPopupMenu { disposeContextMenuTimer(STAUES_ITEMS_CHECK_TIME); return true; } + +// public boolean open(Shell shell, int x, int y) { +// if (null != shell) { +// shell.dispose(); +// shell = null; +// } +// if (null != parent) { +// topShell = new Shell(parent.getShell(), SWT.NO_TRIM); +// this.shell = topShell; +// } else if (null != parentItem) { +// this.shell = new Shell(parentItem.getControl().getShell(), +// SWT.NO_TRIM); +// } else { +// return false; +// } +// shell = this.shell; +// if (false == makeItem(shell, x, y)) { +// shell.dispose(); +// shell = null; +// return false; +// } +// shell.addShellListener(new ShellListener() { +// +// @Override +// public void shellIconified(ShellEvent e) { +// } +// +// @Override +// public void shellDeiconified(ShellEvent e) { +// } +// +// @Override +// public void shellDeactivated(ShellEvent e) { +// if (null == childMenu) { +// Point pt = Display.getCurrent().getCursorLocation(); +// +// if (isInCursorOnMenu(pt) == false) { +// closeParent(); +// } +// } +// } +// +// @Override +// public void shellClosed(ShellEvent e) { +// } +// +// @Override +// public void shellActivated(ShellEvent e) { +// } +// }); +// shell.open(); +// if (checkEnableTimer != null) { +// checkEnableTimer.cancel(); +// checkEnableTimer = null; +// } +// disposeContextMenuTimer(STAUES_ITEMS_CHECK_TIME); +// return true; +// } protected boolean isInCursorOnShell(Shell shell) { Rectangle rt = shell.getBounds(); @@ -451,7 +520,7 @@ public class DAPopupMenu { } } - protected void closeChild() { + public void closeChild() { if (null != childMenu) { childMenu.closeChild(); } @@ -527,7 +596,7 @@ public class DAPopupMenu { return shell; } - protected Shell getTopShell() { + public Shell getTopShell() { return topShell; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PathManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PathManager.java index aeffec0..934d323 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PathManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PathManager.java @@ -345,7 +345,6 @@ public class PathManager { if (null == files || files.length < 1) { return null; } - System.out.println("files.length : " + files.length); String aboutFilePath = aboutFolderPath + File.separator + files[files.length - 1]; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java index 61b66b1..f3e9c0a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java @@ -32,6 +32,7 @@ import java.util.List; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.sql.SqlManager; +import org.tizen.dynamicanalyzer.swap.channel.data.DataChannelConstants; import org.tizen.dynamicanalyzer.swap.logparser.LogPackage; import org.tizen.dynamicanalyzer.swap.logparser.Logs; import org.tizen.dynamicanalyzer.swap.model.data.LogData; @@ -108,6 +109,12 @@ public class LogInserter implements Runnable { newLogs.addAll(logs.getLogs()); SqlManager.getInstance().insert(logId, newLogs); } + if (null != logs && logId == DataChannelConstants.MSG_FUNCTION_EXIT) { + List newLogs = new ArrayList(); + newLogs.addAll(logs.getLogs()); + SqlManager.getInstance().updateProfileTable(newLogs); + } + } // for initLogPackage(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.java index 3a0796f..c263023 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.java @@ -52,6 +52,7 @@ public class AnalyzerLabels extends NLS { public static String OPEN_TRACE; public static String OPEN_TRACE_TITLE; public static String REPLAY; + public static String REPLAY_EDIT; // Toolbar button tooltip for mac public static String START_TRACE_MAC; @@ -59,6 +60,7 @@ public class AnalyzerLabels extends NLS { public static String SAVE_TRACE_MAC; public static String OPEN_TRACE_MAC; public static String REPLAY_MAC; + public static String REPLAY_EDIT_MAC; public static String RANGE_PAGE; public static String SNAPSHOT_ENABLE; @@ -77,6 +79,7 @@ public class AnalyzerLabels extends NLS { public static String ABOUT_TITLE; public static String LICENSE; public static String CONFIGURATION; + public static String REPLAYEDIT; public static String WELCOME; // SingletonInfoDlg. diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties index 303c7c3..b710a20 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties @@ -19,12 +19,14 @@ SAVE_TRACE=Save trace [Ctrl + S] OPEN_TRACE=Open trace [Ctrl + O] OPEN_TRACE_TITLE=Open trace REPLAY=Replay [Ctrl + P] +REPLAY_EDIT=Replay Edit [Ctrl + E] 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] +REPLAY_EDIT_MAC=Replay Edit [Command + E] RANGE_PAGE=Range page SNAPSHOT_ENABLE=Take snapshot @@ -46,6 +48,7 @@ CONFIGURATION=Configuration WELCOME=Welcome # SingletonInfoDlg. DA_WARNING=Warning +REPLAYEDIT=Replay Editor #Source tooltip SOURCE_NOT_EXIST=Source file does not exist. diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java new file mode 100644 index 0000000..5482182 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.java @@ -0,0 +1,75 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * YeongTaik Byeon + * HyunJong Park + * 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.nl; + +import org.eclipse.osgi.util.NLS; + +public class ReplayEditLabels extends NLS { + private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.ReplayEditLabels"; //$NON-NLS-1$ + + public static String REPLAY_EDIT_TITLE; + public static String TABLE_PAGE_TITLE; + public static String TABLE_TITLE; + public static String TABLE_COLUMN_SEQ; + public static String TABLE_COLUMN_MOUSE_DOWN_TIME; + public static String TABLE_COLUMN_MOUSE_UP_TIME; + public static String TABLE_COLUMN_TYPE; + public static String TABLE_COLUMN_VALUE1; + public static String TABLE_COLUMN_VALUE2; + public static String TABLE_FEATURE_EMPTY; + public static String TABLE_FEATURE_NAME; + public static String DETAIL_TITLE; + + public static String CONTEXT_CUT; + public static String CONTEXT_COPY; + public static String CONTEXT_INSERT; + public static String CONTEXT_PASTE; + public static String CONTEXT_DELETE; + + public static String CONTEXT_TOUCH; + public static String CONTEXT_KEY; + public static String CONTEXT_DRAW; + + public static String CONTEXT_KEY_MENU; + public static String CONTEXT_KEY_HOME; + public static String CONTEXT_KEY_BACK; + public static String CONTEXT_KEY_POWER; + public static String CONTEXT_KEY_VOLUME_UP; + public static String CONTEXT_KEY_VOLUME_DOWN; + + public static String CONTEXT_VALUE_X; + public static String CONTEXT_VALUE_Y; + public static String CONTEXT_VALUE_S; + + + static { + NLS.initializeMessages(BUNDLE_NAME, ReplayEditLabels.class); + } + + private ReplayEditLabels() { + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties new file mode 100644 index 0000000..7ce46ae --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/ReplayEditLabels.properties @@ -0,0 +1,33 @@ +REPLAY_EDIT_TITLE =Replya Edit +TABLE_PAGE_TITLE=Table +TABLE_TITLE=Table +TABLE_FEATURE_EMPTY= +TABLE_FEATURE_NAME=Name +DETAIL_TITLE=Details +TABLE_COLUMN_SEQ = Sequence +TABLE_COLUMN_MOUSE_DOWN_TIME = MouseDownTime +TABLE_COLUMN_MOUSE_UP_TIME = MouseUpTime +TABLE_COLUMN_TYPE = Type +TABLE_COLUMN_VALUE1 = Value1 +TABLE_COLUMN_VALUE2 = Value2 + +CONTEXT_CUT =Cut +CONTEXT_COPY= Copy +CONTEXT_INSERT=Insert +CONTEXT_PASTE=Paste +CONTEXT_DELETE=Delete + +CONTEXT_TOUCH=TOUCH +CONTEXT_KEY=KEY +CONTEXT_DRAW=DRAW + +CONTEXT_KEY_MENU=MENU +CONTEXT_KEY_HOME=HOME +CONTEXT_KEY_BACK=BACK +CONTEXT_KEY_POWER=POWER +CONTEXT_KEY_VOLUME_UP=VOLUME + +CONTEXT_KEY_VOLUME_DOWN=VOLUME - + +CONTEXT_VALUE_X =x : +CONTEXT_VALUE_Y =y : +CONTEXT_VALUE_S=s \ No newline at end of file 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 ba7d63e..b6f8d94 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java @@ -85,6 +85,10 @@ public class ImageResources { public static final Image REPLAY_PUSH = getPngImage("toolbar_replay_push"); //$NON-NLS-1$ public static final Image REPLAY_HOVER = getPngImage("toolbar_replay_hover"); //$NON-NLS-1$ public static final Image REPLAY_DISABLE = getPngImage("toolbar_replay_disable"); //$NON-NLS-1$ + public static final Image REPLAY_EDIT = getPngImage("toolbar_replay_edit_nor"); //$NON-NLS-1$ + public static final Image REPLAY_EDIT_PUSH = getPngImage("toolbar_replay_edit_push"); //$NON-NLS-1$ + public static final Image REPLAY_EDIT_HOVER = getPngImage("toolbar_replay_edit_hover"); //$NON-NLS-1$ + public static final Image REPLAY_EDIT_DISABLE = getPngImage("toolbar_replay_edit_disable"); //$NON-NLS-1$ public static final Image SETTINGS_NORMAL = getPngImage("toolbar_settings_nor"); //$NON-NLS-1$ public static final Image SETTINGS_PUSH = getPngImage("toolbar_settings_push"); //$NON-NLS-1$ @@ -199,6 +203,7 @@ public class ImageResources { public static final Image COMBO_DROPDOWN_UP = getPngImage("dropdown_up"); //$NON-NLS-1$ public static final Image COMBO_DROPDOWN_DOWN = getPngImage("dropdown_down"); //$NON-NLS-1$ + public static final Image REPLAY_EDIT_DROPDOWN_DOWN = getPngImage("toolbar_dropdown_normal_a"); //$NON-NLS-1$ // On, Off button public static final Image ON_HOVER = getPngImage("onoff_on_hover"); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java index 42dfa9c..ffb2318 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java @@ -46,6 +46,7 @@ import org.tizen.dynamicanalyzer.ui.toolbar.SaveAsDialog; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialog; import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog; +import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.ReplayEditDialog; import org.tizen.dynamicanalyzer.ui.userinterface.UIPage; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; @@ -70,6 +71,7 @@ public class ShortCutManager { public static String SAVE_TRACE = null; public static String OPEN_TRACE = null; public static String REPLAY = null; + public static String REPLAY_EDIT = 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; @@ -90,6 +92,7 @@ public class ShortCutManager { SAVE_TRACE = AnalyzerLabels.SAVE_TRACE_MAC; OPEN_TRACE = AnalyzerLabels.OPEN_TRACE_MAC; REPLAY = AnalyzerLabels.REPLAY_MAC; + REPLAY_EDIT = AnalyzerLabels.REPLAY_EDIT_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; @@ -108,6 +111,7 @@ public class ShortCutManager { SAVE_TRACE = AnalyzerLabels.SAVE_TRACE; OPEN_TRACE = AnalyzerLabels.OPEN_TRACE; REPLAY = AnalyzerLabels.REPLAY; + REPLAY_EDIT = AnalyzerLabels.REPLAY_EDIT; 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; @@ -245,6 +249,15 @@ public class ShortCutManager { } } } + // e + else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == 101) { + System.out.println("replay Edit"); + if (!AnalyzerManager.isRunning()) { + Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); + ReplayEditDialog dialog = new ReplayEditDialog(shell); + dialog.open(); + } + } } public void setEnabled(boolean enabled) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java index f93c62f..2f83fa2 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java @@ -56,6 +56,7 @@ import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage; import org.tizen.dynamicanalyzer.swap.model.RecordEventObject; import org.tizen.dynamicanalyzer.swap.model.data.LogData; import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory; +import org.tizen.dynamicanalyzer.swap.model.data.ProfileData; import org.tizen.dynamicanalyzer.swap.model.data.ReplayData; import org.tizen.dynamicanalyzer.swap.model.format.LogFormat; import org.tizen.dynamicanalyzer.swap.model.format.ReplayLogFormat; @@ -527,6 +528,83 @@ public class SqlManager { } + public void updateProfileTable(List input) + throws InterruptedException { + String query = "update profiling set ret = ? where pcaddr = ? and messageid = ?"; + PreparedStatement prep = null; + try { + Connection conn = getConnection(); + if (null == conn || null == query || null == input) { + System.out.println("failed sql inset : " + input); + return; + } + semaphoreAcquire(); + prep = conn.prepareStatement(query); + + ProfileData logData = null; + int dataRowSize = input.size(); + for (int i = 0; i < dataRowSize; i++) { + logData = (ProfileData) input.get(i); + prep.setString(1, logData.getReturn()); + prep.setLong(2, logData.getPcAddr()); + prep.setInt(3, DataChannelConstants.MSG_FUNCTION_ENTRY); + prep.addBatch(); + } + conn.setAutoCommit(false); + prep.executeBatch(); + conn.setAutoCommit(true); + } catch (SQLException e) { + System.out.println("[Error Update ProfileTable] query = " + query); + e.printStackTrace(); + } finally { + if (null != prep) { + try { + prep.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + semaphoreRelease(); + } + } + + // public void updateProfileTable(List input) + // throws InterruptedException { + // Statement stat = null; + // ProfileData logData = null; + // int dataRowSize = input.size(); + // for (int i = 0; i < dataRowSize; i++) { + // logData = (ProfileData) input.get(i); + // PreparedStatement prep = null; + // try { + // semaphoreAcquire(); + // Connection conn = getConnection(); + // if (null == conn) { + // System.out.println("failed sql inset : " + input); + // return; + // } + // stat = conn.createStatement(); + // String query = String + // .format("update profiling set ret = '%s' where pcaddr = %s and messageid = %s", + // logData.getReturn(), + // logData.getPcAddr(), + // DataChannelConstants.MSG_FUNCTION_ENTRY);//$NON-NLS-1$ + // stat.executeUpdate(query); + // } catch (SQLException e) { + // e.printStackTrace(); + // } finally { + // if (null != prep) { + // try { + // prep.close(); + // } catch (SQLException e) { + // e.printStackTrace(); + // } + // } + // semaphoreRelease(); + // } + // } + // } + public void saveLeakData() { LeakDetector leakDectector = AnalyzerManager.getLeakDetector(); DBTableInfo leakTableInfo = DBTableManager.getInstance().getTableInfo( @@ -959,9 +1037,6 @@ public class SqlManager { buffer.append(","); } } - query = String.format("select * from %s", buffer.toString(), - "replay"); - stat = conn.createStatement(); rs = stat.executeQuery("select * from replay;"); if (null == rs) { @@ -1410,7 +1485,7 @@ public class SqlManager { } return 0; } - + public int getTableItemCount(String tableName, String option) { String query = null; Statement stat = null; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java index 1bf7004..c411008 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java @@ -139,10 +139,12 @@ public class FileApiListView extends DAView { if (!(data.getData() instanceof FileChartData)) { selectionStartTime = data.getStartTime(); selectionEndTime = data.getEndTime(); - tableComp.getTable().removeAll(); - tableComp.updateTable(); - tableComp.setSelectionByTime(selectionStartTime, selectionEndTime); + } else { + this.data = (FileChartData)data.getData(); } + tableComp.getTable().removeAll(); + tableComp.updateTable(); + tableComp.setSelectionByTime(selectionStartTime, selectionEndTime); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java index 16beabd..f1d77b7 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java @@ -78,9 +78,7 @@ public class NetworkDataMaker { private HashMap addressByFdHashMap = new HashMap(); private HashMap parentFDByFdHashMap = new HashMap(); -// private DAChartBoardItem networkTrafficItem; -// private DAChartBoardItem networkIOItem; -// private DAChartBoardItem cpuItem; +// private DAChartBoardItem networkTransmissionSizeItem; private WarningChecker warningChecker = null; private FailedChecker failedChecker = null; @@ -101,9 +99,7 @@ public class NetworkDataMaker { networkEventQueue.clear(); addressByFdHashMap.clear(); parentFDByFdHashMap.clear(); -// networkTrafficItem = null; -// networkIOItem = null; -// cpuItem = null; +// networkTransmissionSizeItem = null; NetworkTrafficChart.getInstance().clear(); } @@ -520,133 +516,19 @@ public class NetworkDataMaker { } // private boolean createTransmissionSizeBoardItem() { -// if (null == networkTrafficItem) { +// if (null == networkTransmissionSizeItem) { // if (null == board) { // return false; // } // DAChart chart; -// networkTrafficItem = NetworkTrafficChart.getInstance() +// networkTransmissionSizeItem = NetworkTrafficChart.getInstance() // .createBoardItem(board); // -// chart = networkTrafficItem.getChart(); +// chart = networkTransmissionSizeItem.getChart(); // initNetworkChart(chart, true); // } // return true; // } -// -// private boolean createNetworkIOBoardItem() { -// if (null == networkIOItem) { -// if (null == board) { -// return false; -// } -// DAChart chart; -// networkIOItem = NetworkIOChart.getInstance().createBoardItem(board); -// chart = networkIOItem.getChart(); -// -// DAChartPlot plot = chart.getPlot(); -// DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1); -// tooltip.setFont(FontResources.CHART_TOOLTIP_FONT); -// plot.setTooltip(tooltip); -// -// DAPopupMenu popupMenu = new DAPopupMenu(chart); -// popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); -// DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START); -// startItem.addListener(new PopupStartMenuItemClickListener( -// startItem, board)); -// -// DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END); -// endItem.addListener(new PopupEndMenuItemClickListener(endItem, -// board)); -// -// DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// fromSelectionItem -// .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION); -// fromSelectionItem -// .addListener(new PopupFromSelectionMenuItemClickListener( -// fromSelectionItem, board)); -// -// DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS); -// analysisItem.addListener(new PopupAnalysisMenuItemClickListener()); -// -// DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR); -// clearItem.addListener(new PopupClearMenuItemClickListener()); -// -// TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener( -// popupMenu, board.getTimeline()); -// chart.addMouseListener(timelineChartMouseEventListener); -// chart.addMouseMoveListener(timelineChartMouseEventListener); -// chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter( -// board.getTimeline())); -// plot.setMarkers(board.getMarkers()); -// } -// return true; -// } -// -// private boolean createCPUBoardItem() { -// if (null == cpuItem) { -// if (null == board) { -// return false; -// } -// DAChart chart; -// cpuItem = CPUChart.getInstance().createBoardItem(board); -// chart = cpuItem.getChart(); -// -// DAChartPlot plot = chart.getPlot(); -// DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1); -// tooltip.setFont(FontResources.CHART_TOOLTIP_FONT); -// plot.setTooltip(tooltip); -// -// DAPopupMenu popupMenu = new DAPopupMenu(chart); -// popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); -// DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START); -// startItem.addListener(new PopupStartMenuItemClickListener( -// startItem, board)); -// -// DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END); -// endItem.addListener(new PopupEndMenuItemClickListener(endItem, -// board)); -// -// DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// fromSelectionItem -// .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION); -// fromSelectionItem -// .addListener(new PopupFromSelectionMenuItemClickListener( -// fromSelectionItem, board)); -// -// DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS); -// analysisItem.addListener(new PopupAnalysisMenuItemClickListener()); -// -// DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu, -// DAPopupMenuItem.NONE); -// clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR); -// clearItem.addListener(new PopupClearMenuItemClickListener()); -// -// TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener( -// popupMenu, board.getTimeline()); -// chart.addMouseListener(timelineChartMouseEventListener); -// chart.addMouseMoveListener(timelineChartMouseEventListener); -// chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter( -// board.getTimeline())); -// plot.setMarkers(board.getMarkers()); -// } -// return true; -// } private NetworkChartData findAddressChart(NetworkChartDataEvent data) { @@ -666,9 +548,7 @@ public class NetworkDataMaker { public void checkUpdate() { -// createCPUBoardItem(); -// createNetworkIOBoardItem(); -// createTransmissionSizeBoardItem(); + // createTransmissionSizeBoardItem(); if (!AnalyzerManager.isRunning()) { int size = unConnectedDataList.size(); 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 feafbfa..33eaf8f 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 @@ -63,6 +63,7 @@ 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.toolbar.replayEditor.ReplayEditDialog; import org.tizen.dynamicanalyzer.ui.widgets.DADialog; import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer; import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer; @@ -88,6 +89,7 @@ public class ToolbarArea { public static final int CONFIG_BUTTON = 6; public static final int SETTING_BUTTON = 7; public static final int SCREENSHOT_BUTTON = 8; + public static final int REPLAY_EDIT_BUTTON = 9; String selectedDevice = null; PackageInfo selectedApp = null; @@ -110,6 +112,7 @@ public class ToolbarArea { private DACustomButton saveTraceButton; private DACustomButton openTraceButton; private DACustomButton replayButton; + private DACustomButton replayEditButton; private DACustomButton configButton; private DACustomButton screenshotButton; @@ -228,11 +231,13 @@ public class ToolbarArea { Project p = AnalyzerManager.getProject(); if (null == p || !p.isValid() || !enabled) { replayButton.setButtonEnabled(false); + replayEditButton.setButtonEnabled(false); return; } if (!checkRecordFile(p)) { replayButton.setButtonEnabled(false); + replayEditButton.setButtonEnabled(false); return; } String device = DACommunicator.getSelectedDevice().getIDevice() @@ -246,10 +251,12 @@ public class ToolbarArea { && (null != appName && !appName.isEmpty() && !text.isEmpty() && appName.equals(text))) { replayButton.setButtonEnabled(true); + replayEditButton.setButtonEnabled(true); return; } replayButton.setButtonEnabled(false); + replayEditButton.setButtonEnabled(false); } }); } @@ -406,6 +413,17 @@ public class ToolbarArea { } } }); + + replayEditButton.addClickListener(new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + Shell shell = AnalyzerUtil.getWorkbenchWindow() + .getShell(); + ReplayEditDialog dialog = new ReplayEditDialog(shell); + dialog.open(); + } + }); configButton.addClickListener(new DACustomButtonClickEventListener() { @@ -599,6 +617,14 @@ public class ToolbarArea { ImageResources.REPLAY_DISABLE); replayButton.setToolTipText(ShortCutManager.REPLAY); buttons.put(REPLAY_BUTTON, replayButton); + + // Creates replayEdit button. + replayEditButton = new DACustomButton(parent, + ImageResources.REPLAY_EDIT, ImageResources.REPLAY_EDIT_PUSH, + ImageResources.REPLAY_EDIT_HOVER, + ImageResources.REPLAY_EDIT_DISABLE); + replayEditButton.setToolTipText(ShortCutManager.REPLAY_EDIT); + buttons.put(REPLAY_EDIT_BUTTON, replayEditButton); // Creates config button configButton = new DACustomButton(parent, @@ -682,6 +708,13 @@ public class ToolbarArea { data.width = 31; // 31 data.height = 30; replayButton.setLayoutData(data); + + data = new FormData(); + data.top = new FormAttachment(0, 4); + data.left = new FormAttachment(replayButton, 0, SWT.RIGHT); + data.width = 31; + data.height = 30; + replayEditButton.setLayoutData(data); data = new FormData(); data.top = new FormAttachment(0, 4); @@ -864,6 +897,7 @@ public class ToolbarArea { appCombo.initCombo(); startButton.setButtonEnabled(false); replayButton.setButtonEnabled(false); + replayEditButton.setButtonEnabled(false); saveTraceButton.setButtonEnabled(false); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialog.java new file mode 100644 index 0000000..81e0183 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialog.java @@ -0,0 +1,221 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * HyunJong Park + * 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.replayEditor; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.Rectangle; +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.eclipse.swt.widgets.Shell; +import org.tizen.dynamicanalyzer.communicator.DACommunicator; +import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.shortcut.ShortCutManager; +import org.tizen.dynamicanalyzer.ui.widgets.DAButton; +import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox; +import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener; + +public class ReplayEditDialog extends DAMessageBox { + private static boolean opened = false; +// private DACustomButton applyButton = null; + private DACustomButton okButton = null; + private DACustomButton cancelButton = null; + DATabComposite tabView = null; + + public ReplayEditDialog(Shell parent) { + super(parent); + } + +// private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() { +// +// @Override +// public void handleClickEvent(DACustomButton button) { +// doApply(); +// } +// }; + + private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + doApply(); + shell.dispose(); + } + }; + private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() { + + @Override + public void handleClickEvent(DACustomButton button) { + doBack(); + shell.dispose(); + } + }; + + private void doApply() { + ReplayEditDialogDataManager.getInstance().clean(); + + if (DACommunicator.isRunning()) { + DACommunicator.sendRuntimeMessage(DACommunicator.MSG_TYPE_CONFIG, + null); + } + } + + private void doBack() { + } + + protected boolean run() { + if (opened) { + return false; + } + shell.setSize(608, 480); + shell.setLayout(new FormLayout()); + shell.setText(AnalyzerLabels.REPLAYEDIT); + + shell.addDisposeListener(new DisposeListener() { + + @Override + public void widgetDisposed(DisposeEvent e) { + System.out.println("shell disposed!"); //$NON-NLS-1$ + opened = false; + ShortCutManager.getInstance().setEnabled(!opened); + } + }); + + // banner + Label banner = new Label(shell, SWT.TRANSPARENT); + banner.setBackground(ColorResources.WINDOW_BG_COLOR); + banner.setImage(ImageResources.CONFIGURATION_BANNER_IMAGE); + + FormData labelData = new FormData(); + labelData.top = new FormAttachment(0, 0); + labelData.left = new FormAttachment(0, 0); + labelData.right = new FormAttachment(100, 0); + labelData.height = 80; + banner.setLayoutData(labelData); + + Composite tabContentsComp = new Composite(shell, SWT.NONE); + FormLayout compLayout = new FormLayout(); + tabContentsComp.setLayout(compLayout); + tabContentsComp + .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR); + + FormData compData = new FormData(); + compData = new FormData(); + compData.top = new FormAttachment(banner, 0); + compData.left = new FormAttachment(0, 0); + compData.right = new FormAttachment(100, 0); + compData.bottom = new FormAttachment(100, -50); + tabContentsComp.setLayoutData(compData); + + // tab + tabView = new DATabComposite(tabContentsComp, SWT.DOUBLE_BUFFERED); + tabView.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR); + tabView.setTabWidth(120); + compData = new 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); + tabView.setLayoutData(compData); + + Composite featuresPage = new ReplayEditTableView( + tabView.getContentComposite(), SWT.NONE); + tabView.addView(featuresPage, false); + + // button + Composite buttonContentsComp = new Composite(shell, SWT.NONE); + buttonContentsComp.addPaintListener(new PaintListener() { + @Override + public void paintControl(PaintEvent e) { + Composite composite = (Composite) e.widget; + Rectangle rect = composite.getClientArea(); + e.gc.setForeground(ColorResources.CONFIGURATION_SUNKEN_LINE_UP_COLOR); + e.gc.drawLine(0, 0, rect.x + rect.width, 0); + } + }); + compLayout = new FormLayout(); + buttonContentsComp.setLayout(compLayout); + buttonContentsComp + .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR); + + compData = new FormData(); + compData.top = new FormAttachment(tabContentsComp, 0); + compData.left = new FormAttachment(0, 0); + compData.right = new FormAttachment(100, 0); + compData.bottom = new FormAttachment(100, 0); + buttonContentsComp.setLayoutData(compData); + + cancelButton = new DAButton(buttonContentsComp, SWT.NONE); + cancelButton.addClickListener(cancelButtonListener); + cancelButton.setText(AnalyzerLabels.CANCEL); + cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT); + FormData buttonData = new FormData(); + buttonData.right = new FormAttachment(100, -9); + buttonData.top = new FormAttachment(0, 11); + buttonData.width = 100; + buttonData.height = 28; + cancelButton.setLayoutData(buttonData); + + okButton = new DAButton(buttonContentsComp, SWT.NONE); + okButton.addClickListener(okButtonListener); + okButton.setText(AnalyzerLabels.OK); + okButton.setFont(FontResources.DIALOG_BUTTON_FONT); + buttonData = new FormData(); + buttonData.right = new FormAttachment(cancelButton, -8); + buttonData.top = new FormAttachment(0, 11); + buttonData.width = 100; + buttonData.height = 28; + okButton.setLayoutData(buttonData); + +// applyButton = new DAButton(buttonContentsComp, SWT.NONE); +// applyButton.addClickListener(applyButtonListener); +// applyButton.setText(AnalyzerLabels.APPLY); +// applyButton.setFont(FontResources.DIALOG_BUTTON_FONT); +// buttonData = new FormData(); +// buttonData.right = new FormAttachment(okButton, -8); +// buttonData.top = new FormAttachment(0, 11); +// buttonData.width = 100; +// buttonData.height = 28; +// applyButton.setLayoutData(buttonData); + + opened = true; + ShortCutManager.getInstance().setEnabled(!opened); + return true; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java new file mode 100644 index 0000000..e32246b --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java @@ -0,0 +1,254 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * HyunJong Park + * 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.replayEditor; + +import java.util.ArrayList; +import java.util.List; + +import org.tizen.dynamicanalyzer.common.CommonConstants; +import org.tizen.dynamicanalyzer.nl.ReplayEditLabels; +import org.tizen.dynamicanalyzer.sql.SqlManager; +import org.tizen.dynamicanalyzer.swap.model.RecordEventObject; +import org.tizen.dynamicanalyzer.swap.model.data.ReplayData; + +public class ReplayEditDialogDataManager { + public static int MODIFIABILITY_FALSE = 0; + public static int MODIFIABILITY_TRUE = 1; + public static int SELECTED_ITEM_COPY = 2; + + private final int TOUCH_START_EVENT_CODE = 57; + private final int TOUCH_X_EVENT_CODE = 53; + private final int TOUCH_Y_EVENT_CODE = 54; + + private final int KEY = 1; + private final int TOUCH = 3; + private final int KEY_MENU = 169; + private final int KEY_HOME = 139; + private final int KEY_BACK = 158; + private final int KEY_POWER = 116; + private final int KEY_VOLUME_UP = 115; + private final int KEY_VOLUME_DOWN = 114; + + private static ReplayEditDialogDataManager instance = null; + private ReplayData replayDBData = null; + private List replayModifyDataList = null; + + public static ReplayEditDialogDataManager getInstance() { + if (null == instance) { + instance = new ReplayEditDialogDataManager(); + } + return instance; + } + + public void clean(){ + replayModifyDataList.clear(); + replayModifyDataList = null; + replayDBData = null; + } + + public ReplayData getReplayDBData() { + if (null == replayDBData) { + replayDBData = new ReplayData(); + replayDBData = SqlManager.getInstance().getReplayLogs(); + } + return replayDBData; + } + + public void setReplayDBData(ReplayData replayData) { + this.replayDBData = replayData; + } + + public List getReplayModifyData() { + if (null == replayModifyDataList) { + replayModifyDataList = new ArrayList(); + makeReplayEditData(getReplayDBData()); + } + return replayModifyDataList; + } + + private ReplayEditTableData getLastReplayEditTableData(){ + return getReplayModifyData().get(getReplayModifyData().size() - 1); + } + + private void makeReplayEditData(ReplayData dbData) { + int size = dbData.getRecordEvent().size(); + for (int i = 0; i < size; i++) { + RecordEventObject reo = dbData.getRecordEvent().get(i); + if (reo.getEventType() == 0) { // event end log + continue; + } + if (isEventMouseUpTime(reo)) { // mouse up Time + updateEventMouseUpTime(reo.getTime()); + continue; + } + ReplayEditTableData data = makeEditTableData(reo); + if (null != data) { + getReplayModifyData().add(data); + } + } + } + + private boolean isEventMouseUpTime(RecordEventObject reo) { + if (getReplayModifyData().size() < 1) { + return false; + } + boolean isEventMouseUpTime = false; + switch (reo.getEventType()) { + case KEY: { + if (reo.getEventType() == 1 && reo.getEventValue() == 0) { + isEventMouseUpTime = true; + } + break; + } + case TOUCH: { + if (reo.getEventValue() == -1) { + isEventMouseUpTime = true; + } + break; + } + default: { + + } + } + return isEventMouseUpTime; + } + + private void updateEventMouseUpTime(long time) { + getLastReplayEditTableData().setEventMouseUpTime(time); + } + + private ReplayEditTableData makeEditTableData(RecordEventObject reo) { + ReplayEditTableData replayType = null; + + switch (reo.getEventType()) { + case KEY: { + replayType = new ReplayEditTableData(); + replayType.setEventMouseDownTime(reo.getTime()); + replayType.setStrEventType(setEventType(reo.getEventType())); + replayType.setStrEventValue1(setEventValue1(reo.getEventCode())); + replayType.setStrEventValue2(CommonConstants.DASH); + break; + } + case TOUCH: { + if (reo.getEventCode() == TOUCH_START_EVENT_CODE + && reo.getEventValue() != -1) { + if (isDrawEvnet()) { + return null; + } + replayType = new ReplayEditTableData(); + replayType.setEventMouseDownTime(reo.getTime()); + replayType.setStrEventType(setEventType(reo.getEventType())); + } else if (reo.getEventCode() == TOUCH_X_EVENT_CODE) { + getReplayModifyData() + .get(getReplayModifyData().size() - 1) + .setStrEventValue1( + ReplayEditLabels.CONTEXT_VALUE_X + + Integer.toString(reo.getEventValue())); + } else if (reo.getEventCode() == TOUCH_Y_EVENT_CODE) { + getReplayModifyData() + .get(getReplayModifyData().size() - 1) + .setStrEventValue2( + ReplayEditLabels.CONTEXT_VALUE_Y + + Integer.toString(reo.getEventValue())); + } else { + replayType = null; + } + break; + } + default: { + + } + } + return replayType; + } + + private String setEventType(int type) { + String strType = CommonConstants.EMPTY; + switch (type) { + case KEY: { + strType = ReplayEditLabels.CONTEXT_KEY; + break; + } + case TOUCH: { + strType = ReplayEditLabels.CONTEXT_TOUCH; + break; + } + default: { + + } + } + return strType; + } + + private String setEventValue1(int type) { + String strType = CommonConstants.EMPTY; + switch (type) { + case KEY_MENU: { + strType = ReplayEditLabels.CONTEXT_KEY_MENU; + break; + } + case KEY_HOME: { + strType = ReplayEditLabels.CONTEXT_KEY_HOME; + break; + } + case KEY_BACK: { + strType = ReplayEditLabels.CONTEXT_KEY_BACK; + break; + } + case KEY_POWER: { + strType = ReplayEditLabels.CONTEXT_KEY_POWER; + break; + } + case KEY_VOLUME_DOWN: { + strType = ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN; + break; + } + case KEY_VOLUME_UP: { + strType = ReplayEditLabels.CONTEXT_KEY_VOLUME_UP; + break; + } + default: { + + } + } + return strType; + } + + private boolean isDrawEvnet() { + if (getReplayModifyData().size() < 1) { + return false; + } + boolean isDrawEvnet = false; + if (getLastReplayEditTableData().getStrEventMouseUpTime().equals( + CommonConstants.EMPTY)) { + getLastReplayEditTableData().setStrEventType( + ReplayEditLabels.CONTEXT_DRAW); + getLastReplayEditTableData().setModifiabilityEvent(false); + isDrawEvnet = true; + } + return isDrawEvnet; + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditPopupMenu.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditPopupMenu.java new file mode 100644 index 0000000..a18887d --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditPopupMenu.java @@ -0,0 +1,42 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * 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.toolbar.replayEditor; + +import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; + +public class ReplayEditPopupMenu extends DAPopupMenu { + + public ReplayEditPopupMenu(Composite parent) { + super(parent); + // TODO Auto-generated constructor stub + } + public void setMouseListener(){ + System.out.println("setMouseListener"); + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java new file mode 100644 index 0000000..2692696 --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java @@ -0,0 +1,904 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * HyunJong Park + * 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.replayEditor; + +import java.awt.event.KeyEvent; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.nebula.widgets.grid.GridColumn; +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +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.tizen.dynamicanalyzer.common.CommonConstants; +import org.tizen.dynamicanalyzer.model.TableInput; +import org.tizen.dynamicanalyzer.nl.ReplayEditLabels; +import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener; + +public class ReplayEditTable extends DATableComposite { + private String[] columnNames = null; + + protected DAPopupMenu typePopupMenu = null; + protected DAPopupMenu keyValuePopupMenu = null; + + private boolean mouseSelectedItem = false; + private int mouseSelectedItemIndex = -1; + private int mouseSelectedColumnIndex = -1; + private int mouseSelectedPreColunmEndX = -1; + + private String savedItemTextForReset = CommonConstants.EMPTY; + private List selectedPreKeyContext = new ArrayList(); + private List selectedPreTouchContext = new ArrayList(); + + private List copyItemText = new ArrayList(); + private int selectedCutItemIndex = -1; + private int selectedCopyItemIndex = -1; + + DAPopupMenuItem pasteItem = null; + + @Override + protected List makeTableInput() { + List input = new ArrayList(); + + int size = ReplayEditDialogDataManager.getInstance() + .getReplayModifyData().size(); + + for (int i = 0; i < size; i++) { + List text = new ArrayList(); + + ReplayEditTableData replayTableType = ReplayEditDialogDataManager + .getInstance().getReplayModifyData().get(i); + + text.add(Integer.toString(replayTableType.getModifiabilityEvent())); + text.add(Integer.toString(i)); + text.add(replayTableType.getStrEventMouseDownTime()); + text.add(replayTableType.getStrEventMouseUpTime()); + text.add(replayTableType.getStrEventType()); + text.add(replayTableType.getStrEventValue1()); + text.add(replayTableType.getStrEventValue2()); + + TableInput tableInput = new TableInput(); + tableInput.setText(text); + input.add(tableInput); + } + return input; + } + + @Override + public void updateTable() { + table.removeAll(); + List input = makeTableInput(); + if (null == input) { + return; + } + + int size = input.size(); + for (int i = 0; i < size; i++) { + List text = input.get(i).getText(); + GridItem gridItem = new GridItem(table, SWT.NONE); + for (int j = 0; j < text.size(); j++) { + gridItem.setText(j, text.get(j)); + } + } + table.update(); + } + + private List getSelectedItemText(int index) { + List text = new ArrayList(); + int size = table.getColumns().length; + for (int j = 0; j < size + 1; j++) { + text.add(table.getItem(index).getText(j)); + } + return text; + } + + private void replaceTableItems(int index, List itemText) { + List> gridItemTextList = new ArrayList>(); + for (int i = 0; i < table.getItemCount(); i++) { + List text = new ArrayList(); + if (i == index) { + gridItemTextList.add(itemText); + continue; + } + int size = table.getColumns().length; + for (int j = 0; j < size + 1; j++) { + text.add(table.getItem(i).getText(j)); + } + gridItemTextList.add(text); + } + table.removeAll(); + int size = gridItemTextList.size(); + for (int i = 0; i < size; i++) { + List text = gridItemTextList.get(i); + GridItem gridItem = new GridItem(table, SWT.NONE); + for (int j = 0; j < text.size(); j++) { + gridItem.setText(j, text.get(j)); + } + } + table.update(); + } + + private void addTableItems(int index, List itemText) { + List> gridItemTextList = new ArrayList>(); + for (int i = 0; i < table.getItemCount(); i++) { + List text = new ArrayList(); + int size = table.getColumns().length; + for (int j = 0; j < size + 1; j++) { + text.add(table.getItem(i).getText(j)); + } + gridItemTextList.add(text); + if (i == index) { + gridItemTextList.add(itemText); + } + } + table.removeAll(); + int size = gridItemTextList.size(); + for (int i = 0; i < size; i++) { + List text = gridItemTextList.get(i); + GridItem gridItem = new GridItem(table, SWT.NONE); + for (int j = 0; j < text.size(); j++) { + gridItem.setText(j, text.get(j)); + } + } + table.update(); + } + + private void updateTableSequenceNumber() { + int size = table.getItemCount(); + for (int i = 0; i < size; i++) { + table.getItem(i).setText(1, Integer.toString(i)); + } + table.redraw(); + } + + public ReplayEditTable(Composite parent, int style) { + super(parent, style); + + setItemSeqMenu(); + setTyepMenu(); + setKeyMenu(); + + table.addListener(SWT.Dispose, tableMouseListener); + table.addListener(SWT.MouseEnter, tableMouseListener); + table.addListener(SWT.MouseExit, tableMouseListener); + table.addListener(SWT.MouseMove, tableMouseListener); + table.addListener(SWT.MouseHover, tableMouseListener); + table.addListener(SWT.MouseUp, tableMouseListener); + table.addListener(SWT.MouseDown, tableMouseListener); + table.addListener(SWT.MouseDoubleClick, tableMouseListener); + + table.getShell().getDisplay().addFilter(SWT.KeyUp, new Listener() { + @Override + public void handleEvent(Event event) { + setItemKeyText(event); + } + }); + } + + private Listener tableMouseListener = new Listener() { + @Override + public void handleEvent(Event event) { + final int MOUSE_LEFT = 1; + final int MOUSE_RIGHT = 3; + GridItem item = table.getItem(new Point(event.x, event.y)); + + if (null == item) { + return; + } + switch (event.type) { + case SWT.Dispose: + break; + case SWT.MouseEnter: + break; + case SWT.MouseExit: + break; + case SWT.MouseMove: + upadteMouseOverSequenceColumn(item, event); + upadteMouseOverColumn(item, event); + break; + case SWT.MouseDoubleClick: + break; + case SWT.MouseHover: + break; + case SWT.MouseUp: + break; + case SWT.MouseDown: + updateSelectedItemIndex(item, event); + switch (event.button) { + case MOUSE_LEFT: { + popupMenuMouseDownImage(item, event); + enableKeyInsert(item, event); + break; + } + case MOUSE_RIGHT: { + popupMenuMouseDownSequenceColumn(event); + break; + } + default: { + break; + } + } + break; + default: + break; + } + } + }; + + private void setItemSeqMenu() { + popupMenu = new ReplayEditPopupMenu(table); + popupMenu.setMouseListener(); + popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); + DAPopupMenuItem cutItem = new DAPopupMenuItem(popupMenu); + cutItem.setText(ReplayEditLabels.CONTEXT_CUT); + cutItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + copyItemText = getSelectedItemText(mouseSelectedItemIndex - 1); + if (selectedCopyItemIndex > 0) { + disableCopyItem(selectedCopyItemIndex); + selectedCopyItemIndex = -1; + selectedCutItemIndex = mouseSelectedItemIndex; + } else { + disableCopyItem(selectedCutItemIndex); + selectedCutItemIndex = mouseSelectedItemIndex; + } + enableCopyItem(); + } + }); + DAPopupMenuItem copyItem = new DAPopupMenuItem(popupMenu); + copyItem.setText(ReplayEditLabels.CONTEXT_COPY); + copyItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + copyItemText = getSelectedItemText(mouseSelectedItemIndex - 1); + if (selectedCutItemIndex > 0) { + disableCopyItem(selectedCutItemIndex); + selectedCopyItemIndex = mouseSelectedItemIndex; + selectedCutItemIndex = -1; + } else { + disableCopyItem(selectedCopyItemIndex); + selectedCopyItemIndex = mouseSelectedItemIndex; + } + enableCopyItem(); + } + }); + pasteItem = new DAPopupMenuItem(popupMenu); + pasteItem.setText(ReplayEditLabels.CONTEXT_PASTE); + pasteItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + if (selectedCopyItemIndex > 0) { + replaceTableItems(mouseSelectedItemIndex - 1, copyItemText); + updateTableSequenceNumber(); + } else if (selectedCutItemIndex > 0) { + // disableCopyItem(selectedCutItemIndex); + replaceTableItems(mouseSelectedItemIndex - 1, copyItemText); + table.remove(selectedCutItemIndex - 1); + table.redraw(); + // disableCopyItem(mouseSelectedItemIndex-1); + pasteItem.setEnabled(false); + updateTableSequenceNumber(); + } + } + }); + pasteItem.setEnabled(false); + + DAPopupMenuItem insertItem = new DAPopupMenuItem(popupMenu); + insertItem.setText(ReplayEditLabels.CONTEXT_INSERT); + insertItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + addTableItems(mouseSelectedItemIndex - 1, + getSelectedItemText(mouseSelectedItemIndex - 1)); + updateTableSequenceNumber(); + } + }); + DAPopupMenuItem deleteItem = new DAPopupMenuItem(popupMenu); + deleteItem.setText(ReplayEditLabels.CONTEXT_DELETE); + deleteItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + table.remove(mouseSelectedItemIndex - 1); + table.redraw(); + updateTableSequenceNumber(); + } + }); + } + + private void enableCopyItem(){ + pasteItem.setEnabled(true); + int itemOption = Integer.parseInt(table.getItem(mouseSelectedItemIndex - 1).getText(0)); + itemOption += ReplayEditDialogDataManager.SELECTED_ITEM_COPY; + table.getItem(mouseSelectedItemIndex - 1).setText(0, Integer.toString(itemOption)); + } + + private void disableCopyItem(int index){ + if(index < 0){ + return; + } + int itemOption = Integer.parseInt(table.getItem(index - 1).getText(0)); + itemOption -= ReplayEditDialogDataManager.SELECTED_ITEM_COPY; + table.getItem(index - 1).setText(0, Integer.toString(itemOption)); + } + + private void setTyepMenu() { + typePopupMenu = new ReplayEditPopupMenu(table); + typePopupMenu.setMouseListener(); + typePopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); + DAPopupMenuItem cutItem = new DAPopupMenuItem(typePopupMenu); + cutItem.setText(ReplayEditLabels.CONTEXT_TOUCH); + cutItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_TOUCH); + } + }); + DAPopupMenuItem copyItem = new DAPopupMenuItem(typePopupMenu); + copyItem.setText(ReplayEditLabels.CONTEXT_KEY); + copyItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY); + } + }); + } + + private void setKeyMenu() { + keyValuePopupMenu = new ReplayEditPopupMenu(table); + keyValuePopupMenu.setMouseListener(); + keyValuePopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); + DAPopupMenuItem menuItem = new DAPopupMenuItem(keyValuePopupMenu); + menuItem.setText(ReplayEditLabels.CONTEXT_KEY_MENU); + menuItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_MENU); + } + }); + DAPopupMenuItem homeItem = new DAPopupMenuItem(keyValuePopupMenu); + homeItem.setText(ReplayEditLabels.CONTEXT_KEY_HOME); + homeItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_HOME); + } + }); + DAPopupMenuItem backItem = new DAPopupMenuItem(keyValuePopupMenu); + backItem.setText(ReplayEditLabels.CONTEXT_KEY_BACK); + backItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_BACK); + } + }); + DAPopupMenuItem powerItem = new DAPopupMenuItem(keyValuePopupMenu); + powerItem.setText(ReplayEditLabels.CONTEXT_KEY_POWER); + powerItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_POWER); + } + }); + DAPopupMenuItem volumeUpItem = new DAPopupMenuItem(keyValuePopupMenu); + volumeUpItem.setText(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP); + volumeUpItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP); + } + }); + DAPopupMenuItem volumeDownItem = new DAPopupMenuItem(keyValuePopupMenu); + volumeDownItem.setText(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN); + volumeDownItem.addListener(new DAPopupMenuListener() { + @Override + public void widgetSelected(DAPopupMenuItem menuItem) { + updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN); + } + }); + } + + private void setItemKeyText(Event event) { + boolean iskeyInput = false; + if (mouseSelectedItem) { + if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME) + || getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) { + if (KeyEvent.VK_0 <= event.character + && event.character <= KeyEvent.VK_9) { + iskeyInput = true; + } + if (KeyEvent.VK_PERIOD == event.character) { + iskeyInput = true; + } + + if (!iskeyInput) { + return; + } + + String savedString = table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 1); + String removeSString = CommonConstants.EMPTY; + if (savedString.contains(ReplayEditLabels.CONTEXT_VALUE_S)) { + removeSString = savedString.replace( + ReplayEditLabels.CONTEXT_VALUE_S, + CommonConstants.EMPTY); + } + + String inputString = removeSString + event.character; + if (!inputString.contains(ReplayEditLabels.CONTEXT_VALUE_S)) { + inputString += ReplayEditLabels.CONTEXT_VALUE_S; + } + + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, inputString); + table.redraw(); + } else if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_VALUE1) + || getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_VALUE2)) { + if (KeyEvent.VK_0 <= event.character + && event.character <= KeyEvent.VK_9) { + iskeyInput = true; + } + + if (!iskeyInput) { + return; + } + String savedString = table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 1); + StringBuffer inputString = new StringBuffer(savedString); + if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_VALUE1)) { + if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_X)) { + inputString.append(ReplayEditLabels.CONTEXT_VALUE_X); + } + } else { + if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) { + inputString.append(ReplayEditLabels.CONTEXT_VALUE_Y); + } + } + + inputString.append(event.character).toString(); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, inputString.toString()); + table.redraw(); + } + + } + } + + private void updateSelectPopupMenu(String text) { + if (!getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_TYPE)) { + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, text); + table.redraw(); + return; + } + + if (text.contains(ReplayEditLabels.CONTEXT_KEY)) { + if (selectedPreKeyContext.size() > 3 + && selectedPreKeyContext.get(0).equals( + Integer.toString(mouseSelectedItemIndex - 1))) { + setPreSelectedContext(text); + } else { + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, text); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 2, + ReplayEditLabels.CONTEXT_KEY_MENU); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 3, CommonConstants.DASH); + } + } else if (text.contains(ReplayEditLabels.CONTEXT_TOUCH)) { + if (selectedPreTouchContext.size() > 3 + && selectedPreTouchContext.get(0).equals( + Integer.toString(mouseSelectedItemIndex - 1))) { + setPreSelectedContext(text); + } else { + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, text); + table.getItem(mouseSelectedItemIndex - 1) + .setText( + mouseSelectedColumnIndex + 2, + ReplayEditLabels.CONTEXT_VALUE_X + + CommonConstants.ZERO); + table.getItem(mouseSelectedItemIndex - 1) + .setText( + mouseSelectedColumnIndex + 3, + ReplayEditLabels.CONTEXT_VALUE_Y + + CommonConstants.ZERO); + } + } + table.redraw(); + } + + private void savedSelectedContext(String text) { + if (text.equals(ReplayEditLabels.CONTEXT_KEY)) { + selectedPreKeyContext.clear(); + selectedPreKeyContext.add(Integer + .toString(mouseSelectedItemIndex - 1)); + selectedPreKeyContext.add(table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 1)); + selectedPreKeyContext.add(table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 2)); + selectedPreKeyContext.add(table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 3)); + } else if (text.equals(ReplayEditLabels.CONTEXT_TOUCH)) { + selectedPreTouchContext.clear(); + selectedPreTouchContext.add(Integer + .toString(mouseSelectedItemIndex - 1)); + selectedPreTouchContext.add(table.getItem( + mouseSelectedItemIndex - 1).getText( + mouseSelectedColumnIndex + 1)); + selectedPreTouchContext.add(table.getItem( + mouseSelectedItemIndex - 1).getText( + mouseSelectedColumnIndex + 2)); + selectedPreTouchContext.add(table.getItem( + mouseSelectedItemIndex - 1).getText( + mouseSelectedColumnIndex + 3)); + } + } + + private void setPreSelectedContext(String text) { + if (text.equals(ReplayEditLabels.CONTEXT_KEY)) { + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, selectedPreKeyContext.get(1)); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 2, selectedPreKeyContext.get(2)); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 3, selectedPreKeyContext.get(3)); + } else if (text.equals(ReplayEditLabels.CONTEXT_TOUCH)) { + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, + selectedPreTouchContext.get(1)); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 2, + selectedPreTouchContext.get(2)); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 3, + selectedPreTouchContext.get(3)); + } + + } + + private void upadteMouseOverColumn(GridItem item, Event event) { + for (int i = 0; i < table.getItemCount(); i++) { + for (int j = 0; j < table.getColumns().length; j++) { + table.getItem(i).setChecked(j, false); + } + } + int selectedColumnIndex = getMouseColumnIdnex(item, event); + String selectedText = item.getText(selectedColumnIndex + 1); + + if (selectedText.equals(CommonConstants.DASH)) { + return; + } + if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X) + || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y) + || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_S) + || selectedText.length() == 0) { + item.setImage(null); + } else { + item.setImage(ImageResources.REPLAY_EDIT_DROPDOWN_DOWN); + } + for (int i = 0; i < table.getColumns().length; i++) { + if (selectedColumnIndex != 0 + && item.getText(i).contentEquals( + ReplayEditLabels.CONTEXT_DRAW)) { + return; + } + } + + resetText(); + + mouseSelectedItem = false; + item.setChecked(selectedColumnIndex, true); + } + + private void resetText() { + if (mouseSelectedItem) { + String savedString = table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 1); + boolean isResetText = false; + if (savedString.length() == 0) { + isResetText = true; + } else { + if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME)) { + String preItemmouseUpTime = CommonConstants.ZERO + + CommonConstants.DOT + CommonConstants.ZERO + + ReplayEditLabels.CONTEXT_VALUE_S; + if (mouseSelectedItemIndex > 1) { + preItemmouseUpTime = table.getItem( + mouseSelectedItemIndex - 2).getText( + mouseSelectedColumnIndex + 2); + } + String mouseDownTime = updateDotChartAtTime(); + String mouseUpTime = table.getItem( + mouseSelectedItemIndex - 1).getText( + mouseSelectedColumnIndex + 2); + + int compareSameItemTime = compareTime(mouseDownTime, + mouseUpTime); + if (compareSameItemTime >= 0) { + isResetText = true; + } + + int comparePreItemTime = compareTime(preItemmouseUpTime, + mouseDownTime); + if (comparePreItemTime >= 0) { + isResetText = true; + } + + } else if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) { + String mouseUpTime = updateDotChartAtTime(); + if (table.getItemCount() <= mouseSelectedItemIndex) { + isResetText = false; + } else { + String sameItemMouseDownTime = table.getItem( + mouseSelectedItemIndex - 1).getText( + mouseSelectedColumnIndex); + String nextItemMouseDownTime = table.getItem( + mouseSelectedItemIndex).getText( + mouseSelectedColumnIndex); + + int compareSameItemTime = compareTime( + sameItemMouseDownTime, mouseUpTime); + if (compareSameItemTime >= 0) { + isResetText = true; + } + + int compareNextItemTime = compareTime(mouseUpTime, + nextItemMouseDownTime); + if (compareNextItemTime >= 0) { + isResetText = true; + } + } + } else if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_VALUE1)) { + if (savedString.length() > 7) { + isResetText = true; + } + } else if (getColumnName(mouseSelectedColumnIndex + 1).equals( + ReplayEditLabels.TABLE_COLUMN_VALUE2)) { + if (savedString.length() > 7) { + isResetText = true; + } + } + } + + if (isResetText) { + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, savedItemTextForReset); + } + } + } + + private int compareTime(String firstTime, String secondTime) { + StringBuffer firstTimeBuffer = new StringBuffer(firstTime); + StringBuffer highTimeBuffer = new StringBuffer(secondTime); + firstTimeBuffer.deleteCharAt(firstTime.length() - 1); + firstTimeBuffer.deleteCharAt(firstTime.length() - 3); + highTimeBuffer.deleteCharAt(secondTime.length() - 1); + highTimeBuffer.deleteCharAt(secondTime.length() - 3); + + long lowTime = Long.parseLong(firstTimeBuffer.toString()); + long highTime = Long.parseLong(highTimeBuffer.toString()); + + if (lowTime > highTime) { + return 1; + } else if (lowTime < highTime) { + return -1; + } else { + return 0; + } + } + + private String updateDotChartAtTime() { + String chagneString = CommonConstants.EMPTY; + String savedString = table.getItem(mouseSelectedItemIndex - 1).getText( + mouseSelectedColumnIndex + 1); + if (!savedString.contains(CommonConstants.DOT)) { + String strPoint = CommonConstants.DOT + CommonConstants.ZERO; + chagneString = new StringBuffer(savedString).insert( + savedString.length() - 1, strPoint).toString(); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, chagneString); + } else { + chagneString = savedString; + } + return chagneString; + } + + private void updateSelectedItemIndex(GridItem item, Event event) { + + GridColumn[] columns = table.getColumns(); + mouseSelectedItemIndex = -1; + mouseSelectedColumnIndex = -1; + mouseSelectedPreColunmEndX = -1; + + int tableItemSize = table.getItemCount(); + boolean isFindSelectedItem = false; + for (int i = 0; i < tableItemSize; i++) { + if (isFindSelectedItem == true) { + break; + } else { + mouseSelectedPreColunmEndX = -1; + } + for (int j = 0; j < columns.length; j++) { + if (table.getItem(i).getChecked(j)) { + mouseSelectedItemIndex = i + 1; + mouseSelectedColumnIndex = j; + isFindSelectedItem = true; + break; + } + mouseSelectedPreColunmEndX += columns[j].getWidth(); + } + } + } + + private void enableKeyInsert(GridItem item, Event event) { + int optionColumn = Integer.parseInt(item.getText(0)); + if (optionColumn == 0 || optionColumn == 2) { + return; + } + + String selectedText = item.getText(mouseSelectedColumnIndex + 1); + if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X) + || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y) + || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_S)) { + mouseSelectedItem = true; + savedItemTextForReset = table.getItem(mouseSelectedItemIndex - 1) + .getText(mouseSelectedColumnIndex + 1); + table.getItem(mouseSelectedItemIndex - 1).setText( + mouseSelectedColumnIndex + 1, CommonConstants.EMPTY); + } + } + + private void popupMenuMouseDownImage(GridItem item, Event event) { + if (mouseSelectedPreColunmEndX <= event.x + && event.x <= mouseSelectedPreColunmEndX + 20 + && mouseSelectedItemIndex != -1) { + Point popupPt = new Point(0, 0); + popupPt.x = table.getShell().getBounds().x + + mouseSelectedPreColunmEndX + 8; + + popupPt.y = table.getShell().getBounds().y + table.getItemHeight() + * mouseSelectedItemIndex + 145; + + String selectedText = item.getText(mouseSelectedColumnIndex + 1); + if (selectedText.contains(ReplayEditLabels.CONTEXT_TOUCH) + || selectedText.contains(ReplayEditLabels.CONTEXT_KEY)) { + typePopupMenu.open(typePopupMenu.getTopShell(), popupPt.x, + popupPt.y); + savedSelectedContext(selectedText); + } else if (selectedText.contains(ReplayEditLabels.CONTEXT_KEY_MENU) + || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_HOME) + || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_BACK) + || selectedText + .contains(ReplayEditLabels.CONTEXT_KEY_POWER) + || selectedText + .contains(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP) + || selectedText + .contains(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN)) { + keyValuePopupMenu.open(keyValuePopupMenu.getTopShell(), + popupPt.x, popupPt.y); + } else { + + } + } + } + + private void popupMenuMouseDownSequenceColumn(Event event) { + GridColumn[] columns = table.getColumns(); + if (event.x <= columns[0].getWidth()) { + Point pt = Display.getCurrent().getCursorLocation(); + popupMenu.open(popupMenu.getTopShell(), pt.x - 5, pt.y - 5); + } else { + popupMenu.closeChild(); + } + } + + private void upadteMouseOverSequenceColumn(GridItem item, Event event) { + GridColumn[] columns = table.getColumns(); + if (event.x <= columns[0].getWidth()) { + for (int i = 0; i < table.getItemCount(); i++) { + for (int j = 0; j < table.getColumns().length; j++) { + table.getItem(i).setChecked(j, false); + } + } + String seq = item.getText(1).trim(); + for (int i = 0; i < table.getItemCount(); i++) { + if (Integer.parseInt(seq) == i) { + table.getItem(i).setChecked(0, true); + } else { + table.getItem(i).setChecked(0, false); + } + } + } else { + for (int i = 0; i < table.getItemCount(); i++) { + table.getItem(i).setChecked(0, false); + } + } + if (event.y > table.getItemHeight() * (table.getItemCount() + 1)) { + for (int i = 0; i < table.getItemCount(); i++) { + table.getItem(i).setChecked(0, false); + } + } + } + + private int getMouseColumnIdnex(GridItem item, Event event) { + GridColumn[] columns = table.getColumns(); + int size = columns.length; + int preColunmStartX = 0; + int preColunmEndX = 0; + for (int i = 0; i < size; i++) { + preColunmEndX += columns[i].getWidth(); + if (preColunmStartX <= event.x && event.x <= preColunmEndX) { + return i; + } + preColunmStartX += columns[i].getWidth(); + } + return -1; + } + + @Override + public void setColumns(String[] columnNames) { + this.columnNames = columnNames; + int size = columnNames.length; + for (int i = 0; i < size; i++) { + GridColumn column = new GridColumn(table, SWT.NONE); + column.setText(columnNames[i]); + column.setCellRenderer(new ReplayEditTableCellRenderer()); + column.setHeaderRenderer(new DATableHeaderRenderer()); + column.pack(); + + } + } + + public String getColumnName(int index) { + if (null != this.columnNames || this.columnNames.length < index - 1) { + return this.columnNames[index - 1]; + } else { + return CommonConstants.EMPTY; + } + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableCellRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableCellRenderer.java new file mode 100644 index 0000000..4d7bb3c --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableCellRenderer.java @@ -0,0 +1,174 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * 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.replayEditor; + +import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.resources.FontResources; + +public class ReplayEditTableCellRenderer extends DefaultCellRenderer { + int leftMargin = 4; + int rightMargin = 4; + int textTopMargin = 1; + int insideMargin = 3; + + public Image menuImg = null; + + @Override + public void paint(GC gc, Object value) { + GridItem item = (GridItem) value; + gc.setFont(item.getFont(getColumn())); + paintBackground(gc, item); + paintImage(gc, item); + paintText(gc, item); + paintTableBoardLine(gc, item); + paintSelectedLine(gc, item); + paintSelectedCopy(gc, item); + } + + private void paintBackground(GC gc, GridItem item) { + boolean drawBackground = true; + int optionColumn = Integer.parseInt(item.getText(0)); + if (item.getChecked() && getColumn() == 0) { + gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START); + gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END); + } else if (optionColumn == 0 || optionColumn == 2) { + gc.setBackground(ColorResources.YELLOW); + } else { + if (item.getParent().isEnabled()) { + Color bg = item.getBackground(); + if (bg != null) { + gc.setBackground(bg); + } else { + drawBackground = false; + } + } else { + gc.setBackground(getDisplay().getSystemColor( + SWT.COLOR_WIDGET_BACKGROUND)); + } + } + + if (drawBackground && item.getChecked() && getColumn() == 0) { + gc.fillGradientRectangle(getBounds().x, getBounds().y, + getBounds().width, getBounds().height, true); + } else if (drawBackground) { + gc.fillRectangle(getBounds().x, getBounds().y + 1, + getBounds().width, getBounds().height); + } + } + + private void paintImage(GC gc, GridItem item) { + menuImg = item.getImage(); + if (menuImg != null && getColumn() != 0 && item.getChecked(getColumn())) { + int y = getBounds().y; + y += (getBounds().height - menuImg.getBounds().height) / 2; + gc.drawImage(menuImg, getBounds().x, y); + } + } + + private void paintText(GC gc, GridItem item) { + int x = leftMargin; + int width = getBounds().width - x - rightMargin; + String text = item.getText(getColumn() + 1); + int len = gc.stringExtent(text).x; + if (len < width) { + x += (width - len) / 2; + } + gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR); + gc.setFont(FontResources.TABLE_CELL_FONT); + gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin, + true); + } + + private void paintTableBoardLine(GC gc, GridItem item) { + if (item.getParent().getLinesVisible()) { + if (isCellSelected()) { + gc.setForeground(ColorResources.TABLE_LINE); + } else { + gc.setForeground(ColorResources.TABLE_LINE); + } + gc.drawLine(getBounds().x, getBounds().y + getBounds().height, + getBounds().x + getBounds().width - 1, getBounds().y + + getBounds().height); + gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, + getBounds().x + getBounds().width - 1, getBounds().y + + getBounds().height); + } + } + + private void paintSelectedLine(GC gc, GridItem item) { + if (getColumn() != 0 && item.getChecked(getColumn())) { + Rectangle focusRect = new Rectangle(getBounds().x - 1, + getBounds().y - 1, getBounds().width, + getBounds().height + 1); + gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START); + gc.drawRectangle(focusRect); + if (isFocus()) { + focusRect.x++; + focusRect.width -= 2; + focusRect.y++; + focusRect.height -= 2; + gc.drawRectangle(focusRect); + } + } + } + + private void paintSelectedCopy(GC gc, GridItem item) { + int optionColumn = Integer.parseInt(item.getText(0)); + if (optionColumn == 2 || optionColumn == 3) { + gc.setForeground(ColorResources.BLACK); + gc.setLineWidth(2); + gc.setLineStyle(SWT.LINE_DOT); + gc.drawLine(getBounds().x, getBounds().y, getBounds().x + + getBounds().width, getBounds().y); + + gc.drawLine(getBounds().x, getBounds().y + getBounds().height, + getBounds().x + getBounds().width, getBounds().y + + getBounds().height); + if (getColumn() == 0) { + gc.drawLine(getBounds().x, getBounds().y, getBounds().x, + getBounds().y + getBounds().height); + } + + if (getColumn() == 0) { + gc.drawLine(getBounds().x, getBounds().y, getBounds().x, + getBounds().y + getBounds().height); + } + + gc.setLineStyle(SWT.LINE_SOLID); + gc.setLineWidth(1); + + } + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableData.java new file mode 100644 index 0000000..52eeece --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableData.java @@ -0,0 +1,99 @@ +package org.tizen.dynamicanalyzer.ui.toolbar.replayEditor; + +import org.tizen.dynamicanalyzer.common.CommonConstants; +import org.tizen.dynamicanalyzer.nl.ReplayEditLabels; + +public class ReplayEditTableData { + private int eventSeq = -1; + private long eventMouseDownTime = -1; + private long eventMouseUpTime = -1; + private String strEventType = CommonConstants.EMPTY; + private String strEventValue1 = CommonConstants.EMPTY; + private String strEventValue2 = CommonConstants.EMPTY; + private boolean modifiabilityEvent = true; + + public int getEventSeq() { + return eventSeq; + } + + public void setEventSeq(int eventSeq) { + this.eventSeq = eventSeq; + } + + public String getStrEventMouseDownTime() { + if (eventMouseDownTime < 0) { + return CommonConstants.EMPTY; + } else { + return getStrTime(eventMouseDownTime); + } + } + + public void setEventMouseDownTime(long eventMouseDownTime) { + this.eventMouseDownTime = eventMouseDownTime; + } + + public String getStrEventMouseUpTime() { + if (eventMouseUpTime < 0) { + return CommonConstants.EMPTY; + } else { + return getStrTime(eventMouseUpTime); + } + } + + private String getStrTime(Long time) { + String reverseStrTime = reverseString(Long.toString(time)); + String strTime = CommonConstants.EMPTY; + for (int i = 5; i < reverseStrTime.length(); i++) { + strTime += reverseStrTime.charAt(i); + if (i == 5) { + strTime += CommonConstants.DOT; + } + } + return reverseString(strTime) + ReplayEditLabels.CONTEXT_VALUE_S; + } + + private String reverseString(String str) { + return (new StringBuffer(str).reverse().toString()); + } + + public void setEventMouseUpTime(long eventMouseUpTime) { + this.eventMouseUpTime = eventMouseUpTime; + } + + public int getModifiabilityEvent() { + if (modifiabilityEvent) { + return ReplayEditDialogDataManager.MODIFIABILITY_TRUE; + } else { + return ReplayEditDialogDataManager.MODIFIABILITY_FALSE; + } + } + + public void setModifiabilityEvent(boolean modifiabilityEvent) { + this.modifiabilityEvent = modifiabilityEvent; + } + + public String getStrEventType() { + return strEventType; + } + + public void setStrEventType(String strEventType) { + this.strEventType = strEventType; + } + + public String getStrEventValue1() { + return strEventValue1; + } + + public void setStrEventValue1(String strEventValue1) { + this.strEventValue1 = strEventValue1; + } + + public String getStrEventValue2() { + return strEventValue2; + } + + public void setStrEventValue2(String strEventValue2) { + this.strEventValue2 = strEventValue2; + } + +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableView.java new file mode 100644 index 0000000..6af174f --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableView.java @@ -0,0 +1,131 @@ +/* + * Dynamic Analyzer + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hyunjong Park + * 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.replayEditor; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +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.tizen.dynamicanalyzer.common.AnalyzerConstants; +import org.tizen.dynamicanalyzer.nl.ReplayEditLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.ui.page.DAPageComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite; +import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator; + +public class ReplayEditTableView extends DAPageComposite { + public static final String ID = ReplayEditTableView.class.getName(); + private DATableComposite featuresTable = null; + + int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID, + AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID, + AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID }; + int[] sourceColumns = { 0, 0, 0, 0, 0, 0 }; + private String[] columnNames = { ReplayEditLabels.TABLE_COLUMN_SEQ, + ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME, + ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME, + ReplayEditLabels.TABLE_COLUMN_TYPE, + ReplayEditLabels.TABLE_COLUMN_VALUE1, + ReplayEditLabels.TABLE_COLUMN_VALUE2 }; + private int[] columnSizes = { 80, 110, 110, 100, 100, 100 }; + private boolean[] columnVisibility = { true, true, true, true, true, true }; + + public ReplayEditTableView(Composite parent, int style) { + super(parent, style); + name = ReplayEditLabels.TABLE_PAGE_TITLE; + this.setLayout(new FormLayout()); + this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR); + FormData data = new FormData(); + + Composite tableComp = new Composite(this, SWT.NONE); + tableComp.setLayout(new FormLayout()); + data = new FormData(); + data.top = new FormAttachment(0, 5); + data.left = new FormAttachment(0, 5); + data.right = new FormAttachment(100, -5); + data.bottom = new FormAttachment(100, -5); + tableComp.setLayoutData(data); + tableComp.setBackground(ColorResources.DIALOG_BG_UPPER); + + // Table + featuresTable = new ReplayEditTable(tableComp, SWT.BORDER + | SWT.V_SCROLL | SWT.SINGLE); + featuresTable.setTableName(ReplayEditLabels.TABLE_TITLE); + featuresTable.setComparator(new DefaultTableComparator()); + featuresTable.setSortTypes(sortTypes); + featuresTable.setColumns(columnNames); + featuresTable.setColumnSize(columnSizes); + featuresTable.setColumnVisibility(columnVisibility); + featuresTable.setTableToolTipEnable(false); + featuresTable.getTable().addSelectionListener( + featureTableSelectionListener); + featuresTable.getTable().addMouseListener(mouseListener); + data = new FormData(); + data.top = new FormAttachment(0, 0); + data.left = new FormAttachment(0, 0); + data.right = new FormAttachment(100, 0); + data.bottom = new FormAttachment(100, 0); + featuresTable.setLayoutData(data); + + featuresTable.updateTable(); + } + + private SelectionListener featureTableSelectionListener = new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }; + + private MouseListener mouseListener = new MouseListener() { + + @Override + public void mouseUp(MouseEvent e) { + // TODO Auto-generated method stub + } + + @Override + public void mouseDown(MouseEvent e) { + // TODO Auto-generated method stub + } + + @Override + public void mouseDoubleClick(MouseEvent e) { + } + }; + +} \ No newline at end of file diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/UIListTableCellRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/UIListTableCellRenderer.java deleted file mode 100644 index 59b0221..0000000 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/UIListTableCellRenderer.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Hyunjong Park - * 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.userinterface; - -import org.eclipse.nebula.widgets.grid.GridItem; -import org.eclipse.nebula.widgets.grid.IInternalWidget; -import org.eclipse.nebula.widgets.grid.internal.CheckBoxRenderer; -import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.tizen.dynamicanalyzer.resources.ColorResources; -import org.tizen.dynamicanalyzer.resources.FontResources; -import org.tizen.dynamicanalyzer.ui.widgets.table.DATableToggleRenderer; - -public class UIListTableCellRenderer extends DefaultCellRenderer { - int leftMargin = 4; - int rightMargin = 4; - int topMargin = 0; - int bottomMargin = 0; - int textTopMargin = 1; - // int textBottomMargin = 2; - int insideMargin = 3; - // int treeIndent = 20; - - private DATableToggleRenderer toggleRenderer; - private CheckBoxRenderer checkRenderer; - - @Override - public void paint(GC uiGC, Object value) { - GridItem item = (GridItem) value; - uiGC.setFont(item.getFont(getColumn())); - - boolean drawAsSelected = isSelected(); - boolean drawBackground = true; - - if (isCellSelected()) { - drawAsSelected = true; - } - if (drawAsSelected) { - uiGC.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START); - uiGC.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END); - } else { - - if (item.getParent().isEnabled()) { - Color bg = item.getBackground(); - if (bg != null) { - uiGC.setBackground(bg); - } else { - drawBackground = false; - } - } else { - uiGC.setBackground(getDisplay().getSystemColor( - SWT.COLOR_WIDGET_BACKGROUND)); - } - } - - if (drawBackground && drawAsSelected) { - uiGC.fillGradientRectangle(getBounds().x, getBounds().y, - getBounds().width, getBounds().height, true); - } else if (drawBackground) { - uiGC.fillRectangle(getBounds().x, getBounds().y + 1, - getBounds().width, getBounds().height); - } - - int x = leftMargin; - - if (isTree()) { - x += getToggleIndent(item); - if (drawAsSelected) { - toggleRenderer.setSelected(true); - } else { - toggleRenderer.setSelected(false); - } - toggleRenderer.setExpanded(item.isExpanded()); - toggleRenderer.setHover(getHoverDetail().equals("toggle")); //$NON-NLS-1$ - toggleRenderer.setLocation(getBounds().x + x, - (getBounds().height - toggleRenderer.getBounds().height) - / 2 + getBounds().y); - toggleRenderer.paint(uiGC, item); - x += toggleRenderer.getBounds().width + insideMargin; - - } - - if (isCheck()) { - - checkRenderer.setChecked(item.getChecked(getColumn())); - checkRenderer.setGrayed(item.getGrayed(getColumn())); - if (!item.getParent().isEnabled()) { - checkRenderer.setGrayed(true); - } - checkRenderer.setHover(getHoverDetail().equals("check")); //$NON-NLS-1$ - checkRenderer.setBounds(getBounds().x + x, - (getBounds().height - checkRenderer.getBounds().height) / 2 - + getBounds().y, checkRenderer.getBounds().width, - checkRenderer.getBounds().height); - checkRenderer.paint(uiGC, null); - x += checkRenderer.getBounds().width + insideMargin; - } - - Image image = item.getImage(getColumn()); - if (image != null) { - int y = getBounds().y; - y += (getBounds().height - image.getBounds().height) / 2; - uiGC.drawImage(image, getBounds().x + x, y); - x += image.getBounds().width + insideMargin; - } - - int width = getBounds().width - x - rightMargin; - String uiText = item.getText(getColumn()); - - if (getAlignment() == SWT.RIGHT) { - int len = uiGC.stringExtent(uiText).x; - if (len < width) { - x += width - len; - } - } else if (getAlignment() == SWT.CENTER) { - int len = uiGC.stringExtent(uiText).x; - if (len < width) { - x += (width - len) / 2; - } - } - - if (drawAsSelected) { - uiGC.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR); - } else { - Color fontColor = item.getForeground(); - if (null != fontColor) { - uiGC.setForeground(item.getForeground()); - } else { - uiGC.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR); - } - } - - uiGC.setFont(FontResources.TABLE_CELL_FONT); - - if (getColumn() != 0) { - uiGC.drawText(uiText, getBounds().x + x, getBounds().y - + textTopMargin, true); - } - if (item.getParent().getLinesVisible()) { - if (isCellSelected()) { - uiGC.setForeground(ColorResources.TABLE_LINE); - } else { - uiGC.setForeground(ColorResources.TABLE_LINE); - } - uiGC.drawLine(getBounds().x, getBounds().y + getBounds().height, - getBounds().x + getBounds().width - 1, getBounds().y - + getBounds().height); - uiGC.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, - getBounds().x + getBounds().width - 1, getBounds().y - + getBounds().height); - } - if (isCellFocus()) { - Rectangle focusRect = new Rectangle(getBounds().x - 1, - getBounds().y - 1, getBounds().width, - getBounds().height + 1); - uiGC.setForeground(ColorResources.RED); - uiGC.drawRectangle(focusRect); - if (isFocus()) { - focusRect.x++; - focusRect.width -= 2; - focusRect.y++; - focusRect.height -= 2; - uiGC.drawRectangle(focusRect); - } - } - } - - private int getToggleIndent(GridItem item) { - return item.getLevel() * 20; - } - - public void setTree(boolean treeData) { - super.setTree(treeData); - if (treeData) { - toggleRenderer = new DATableToggleRenderer(); - toggleRenderer.setDisplay(getDisplay()); - } - } - - public Point computeSize(GC gc, int wHint, int hHint, Object value) { - GridItem item = (GridItem) value; - gc.setFont(item.getFont(getColumn())); - int x = 0; - - x += leftMargin; - - if (isTree()) { - x += getToggleIndent(item); - x += toggleRenderer.getBounds().width + insideMargin; - } - if (isCheck()) { - x += checkRenderer.getBounds().width + insideMargin; - } - - int y = 0; - Image image = item.getImage(getColumn()); - if (image != null) { - y = topMargin + image.getBounds().height + bottomMargin; - - x += image.getBounds().width + insideMargin; - } - x += gc.stringExtent(item.getText(getColumn())).x + rightMargin; - y = Math.max(y, topMargin + gc.getFontMetrics().getHeight() - + bottomMargin); - return new Point(x, y); - } - - public boolean notify(int event, Point point, Object value) { - GridItem item = (GridItem) value; - if (isCheck()) { - if (event == IInternalWidget.MouseMove) { - if (overCheck(item, point)) { - setHoverDetail("check"); //$NON-NLS-1$ - return true; - } - } - - if (event == IInternalWidget.LeftMouseButtonDown) { - if (overCheck(item, point)) { - item.setChecked(getColumn(), !item.getChecked(getColumn())); - item.getParent().redraw(); - item.fireCheckEvent(getColumn()); - return true; - } - } - } - - if (isTree() && item.hasChildren()) { - if (event == IInternalWidget.MouseMove) { - if (overToggle(item, point)) { - setHoverDetail("toggle"); //$NON-NLS-1$ - return true; - } - } - if (event == IInternalWidget.LeftMouseButtonDown) { - if (overToggle(item, point)) { - item.setExpanded(!item.isExpanded()); - item.getParent().redraw(); - if (item.isExpanded()) { - item.fireEvent(SWT.Expand); - } else { - item.fireEvent(SWT.Collapse); - } - return true; - } - } - } - - return false; - } - - private boolean overCheck(GridItem item, Point point) { - point = new Point(point.x, point.y); - point.x -= getBounds().x - 1; - point.y -= getBounds().y - 1; - - int x = leftMargin; - if (isTree()) { - x += getToggleIndent(item); - x += toggleRenderer.getSize().x + insideMargin; - } - if (point.x >= x && point.x < (x + checkRenderer.getSize().x)) { - int yStart = ((getBounds().height - checkRenderer.getBounds().height) / 2); - if (point.y >= yStart - && point.y < yStart + checkRenderer.getSize().y) { - return true; - } - } - return false; - } - - private boolean overToggle(GridItem item, Point point) { - point = new Point(point.x, point.y); - point.x -= getBounds().x - 1; - point.y -= getBounds().y - 1; - - int x = leftMargin; - x += getToggleIndent(item); - - if (point.x >= x && point.x < (x + toggleRenderer.getSize().x)) { - // return true; - int yStart = ((getBounds().height - toggleRenderer.getBounds().height) / 2); - if (point.y >= yStart - && point.y < yStart + toggleRenderer.getSize().y) { - return true; - } - } - return false; - } - - public void setCheck(boolean check) { - super.setCheck(check); - - if (check) { - checkRenderer = new CheckBoxRenderer(); - checkRenderer.setDisplay(getDisplay()); - } else { - checkRenderer = null; - } - } - - public Rectangle getTextBounds(GridItem item, boolean preferred) { - int x = leftMargin; - if (isTree()) { - x += getToggleIndent(item); - - x += toggleRenderer.getBounds().width + insideMargin; - } - if (isCheck()) { - x += checkRenderer.getBounds().width + insideMargin; - } - - Image image = item.getImage(getColumn()); - if (image != null) { - x += image.getBounds().width + insideMargin; - } - - Rectangle bounds = new Rectangle(x, topMargin, 0, 0); - - GC gc = new GC(item.getParent()); - gc.setFont(item.getFont(getColumn())); - Point size = gc.stringExtent(item.getText(getColumn())); - - bounds.height = size.y; - - if (preferred) { - bounds.width = size.x; - } else { - bounds.width = getBounds().width - x - rightMargin; - } - - gc.dispose(); - - return bounds; - } -} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java index f44a20e..05d2abe 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListDataChecker.java @@ -195,6 +195,33 @@ public class UIControlListDataChecker { } } } + +// private void setUIControlListTimeData() { +// UIDataManager uiManager = UIDataManager.getInstance(); +// List controlList = uiManager +// .getfunctionProfilingDataChecker().getDataList(); +// for (UIFunctionProfilingData apiName : controlList) { +// String[] splitProfilingList = apiName.getAPIName().split( +// CommonConstants.DOUBLE_COLON); +// String strProfilingClassName = new String( +// splitProfilingList[0].trim()); +// String strProfilingAPIName = new String( +// splitProfilingList[splitProfilingList.length - 1].trim()); +// for (UIControlListData className : getDataList()) { +// if (className.getChildClassName().trim() +// .contains(strProfilingClassName)) { +// if (strProfilingAPIName.trim().contains("OnInitializing")) { //$NON-NLS-1$ +// className.setInitializeTime(apiName +// .getExclEsapsedTime()); +// } else if (strProfilingAPIName.trim().contains( +// "OnTerminating")) { //$NON-NLS-1${ +// className +// .setTerminateTime(apiName.getExclEsapsedTime()); +// } +// } +// } +// } +// } private String getDemanglingName(String uiClassName) { String demangleName = CommonConstants.EMPTY; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListTable.java index 06c6cc6..cfe9701 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/control/UIControlListTable.java @@ -31,6 +31,7 @@ import java.util.List; import org.eclipse.nebula.widgets.grid.GridColumn; import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; @@ -48,7 +49,6 @@ import org.tizen.dynamicanalyzer.swap.model.data.ControlData; import org.tizen.dynamicanalyzer.swap.model.data.LogData; import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData; import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager; -import org.tizen.dynamicanalyzer.ui.userinterface.UIListTableCellRenderer; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer; import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite; @@ -164,7 +164,7 @@ public class UIControlListTable extends DATreeComposite { if (isTree && i == 0) { column.setTree(true); } - column.setCellRenderer(new UIListTableCellRenderer()); + column.setCellRenderer(new DefaultCellRenderer()); column.setHeaderRenderer(new DATableHeaderRenderer()); if (columnAlignment != null) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/profiling/UIFunctionProfilingTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/profiling/UIFunctionProfilingTable.java index b66269f..c325718 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/profiling/UIFunctionProfilingTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/userinterface/profiling/UIFunctionProfilingTable.java @@ -33,6 +33,7 @@ import org.eclipse.nebula.widgets.grid.Grid; import org.eclipse.nebula.widgets.grid.GridColumn; import org.eclipse.nebula.widgets.grid.GridColumnGroup; import org.eclipse.nebula.widgets.grid.GridItem; +import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; @@ -50,7 +51,6 @@ import org.tizen.dynamicanalyzer.model.ColumnData; import org.tizen.dynamicanalyzer.model.TreeInput; import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData; import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager; -import org.tizen.dynamicanalyzer.ui.userinterface.UIListTableCellRenderer; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat; import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer; import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite; @@ -171,7 +171,7 @@ public class UIFunctionProfilingTable extends DATreeComposite { column = new GridColumn(table, SWT.NONE); } - column.setCellRenderer(new UIListTableCellRenderer()); + column.setCellRenderer(new DefaultCellRenderer()); column.setHeaderRenderer(new DATableHeaderRenderer()); column.setText(columnData.getText()); if (columnAlignment != null) { diff --git a/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_disable.png b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_disable.png new file mode 100644 index 0000000..fc5c867 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_disable.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_hover.png b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_hover.png new file mode 100644 index 0000000..62bef86 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_hover.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_nor.png b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_nor.png new file mode 100644 index 0000000..cbd543d Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_nor.png differ diff --git a/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_push.png b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_push.png new file mode 100644 index 0000000..0b1d587 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/toolbar_replay_edit_push.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_disable.png b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_disable.png new file mode 100644 index 0000000..fc5c867 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_disable.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_hover.png b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_hover.png new file mode 100644 index 0000000..62bef86 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_hover.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_nor.png b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_nor.png new file mode 100644 index 0000000..cbd543d Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_nor.png differ diff --git a/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_push.png b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_push.png new file mode 100644 index 0000000..0b1d587 Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/toolbar_replay_edit_push.png differ