From: Hyunjong,park Date: Mon, 26 May 2014 02:37:37 +0000 (+0900) Subject: Replay Editor : New UX application, and disable replay editor button until complete... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F21644%2F1;p=sdk%2Ftools%2Fdynamic-analyzer.git Replay Editor : New UX application, and disable replay editor button until complete TV SDK Signed-off-by: Hyunjong,park Change-Id: Ib1ee83c1ccea32a16ca3af5a0463895a8f97a757 --- 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 d11fb89..9bb1f85 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 @@ -182,7 +182,7 @@ public class ToolbarArea { && (null != appName && !appName.isEmpty() && !text.isEmpty() && appName.equals(text))) { replayButton.setButtonEnabled(true); - replayEditButton.setButtonEnabled(true); + replayEditButton.setButtonEnabled(false); //disable button until complete TV SDK } else { replayButton.setButtonEnabled(false); replayEditButton.setButtonEnabled(false); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDBManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDBManager.java index de9b1a7..6407217 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDBManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDBManager.java @@ -1,8 +1,35 @@ +/* + * 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.replay.data; import java.sql.PreparedStatement; +import java.sql.SQLException; import java.util.List; +import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.database.DBColumn; import org.tizen.dynamicanalyzer.database.DBConstants; import org.tizen.dynamicanalyzer.database.DBTable; @@ -13,19 +40,46 @@ import org.tizen.dynamicanalyzer.swap.model.data.ReplayData; public class ReplayDBManager extends DBTable { - private static final String TABLENAME = "REPLAY"; - public static final String RID = "RID"; - public static final String MESSAGE_ID = "MESSAGE_ID"; - public static final String SEQ = "SEQ"; - public static final String TIME = "TIME"; - public static final String SEC = "SEC"; - public static final String NANO = "NANO"; - public static final String EVENT_ID = "EVENT_ID"; - public static final String EVENT_TYPE = "EVENT_TYPE"; - public static final String EVENT_CODE = "EVENT_CODE"; - public static final String EVENT_VALUE = "EVENT_VALUE"; + private static final String TABLENAME = "REPLAY";//$NON-NLS-1$ + public static final String RID = "RID";//$NON-NLS-1$ + public static final String SEQ = "SEQ";//$NON-NLS-1$ + public static final String TIME = "TIME";//$NON-NLS-1$ + public static final String SEC = "SEC";//$NON-NLS-1$ + public static final String NANO = "NANO";//$NON-NLS-1$ + public static final String EVENT_ID = "EVENT_ID";//$NON-NLS-1$ + public static final String EVENT_TYPE = "EVENT_TYPE";//$NON-NLS-1$ + public static final String EVENT_CODE = "EVENT_CODE";//$NON-NLS-1$ + public static final String EVENT_VALUE = "EVENT_VALUE";//$NON-NLS-1$ - private static final String SELECT_QUERY = "select * from " + TABLENAME + " order by " + TIME + " , " + RID; //$NON-NLS-1$ + private final int DB_RID_INDEX = 0; + private final int DB_SEQ_INDEX = 1; + private final int DB_TIME_INDEX = 2; + private final int DB_SEC_INDEX = 3; + private final int DB_NANO_INDEX = 4; + private final int DB_EVENT_ID_INDEX = 5; + private final int DB_EVENT_TYPE_INDEX = 6; + private final int DB_EVENT_CODE_INDEX = 7; + private final int DB_EVENT_VALUE = 8; + + private static final String SELECT_QUERY = "select " + + RID + + CommonConstants.COMMA + + SEQ + + CommonConstants.COMMA + + TIME + + CommonConstants.COMMA + + SEC + + CommonConstants.COMMA + + NANO + + CommonConstants.COMMA + + EVENT_ID + + CommonConstants.COMMA + + EVENT_TYPE + + CommonConstants.COMMA + + EVENT_CODE + + CommonConstants.COMMA + + EVENT_VALUE + + " from " + TABLENAME + " order by " + TIME + CommonConstants.COMMA + RID; //$NON-NLS-1$ private static final String DELETE_QUERY = "delete from " + TABLENAME; @Override @@ -36,8 +90,6 @@ public class ReplayDBManager extends DBTable { public ReplayDBManager() { addColumn(new DBColumn(RID, DBConstants.PRIMARY_KEY, DBConstants.INTEGER)); - addColumn(new DBColumn(MESSAGE_ID, DBConstants.NOT_NULL, - DBConstants.INTEGER)); addColumn(new DBColumn(SEQ, DBConstants.NOT_NULL, DBConstants.INTEGER)); addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.LONG)); addColumn(new DBColumn(SEC, DBConstants.NOT_NULL, DBConstants.INTEGER)); @@ -64,17 +116,17 @@ public class ReplayDBManager extends DBTable { List eventObjs = output.getRecordEvent(); for (List data : result) { RecordEventObject reObj = new RecordEventObject(); - reObj.setId((Integer) data.get(0)); - reObj.setSeq((Integer) data.get(2)); - reObj.setTime((Long) data.get(3)); + reObj.setId((Integer) data.get(DB_RID_INDEX)); + reObj.setSeq((Integer) data.get(DB_SEQ_INDEX)); + reObj.setTime((Long) data.get(DB_TIME_INDEX)); DATime eventTime = new DATime(); - eventTime.setSec((Integer) data.get(4)); - eventTime.setNano((Integer) data.get(5)); + eventTime.setSec((Integer) data.get(DB_SEC_INDEX)); + eventTime.setNano((Integer) data.get(DB_NANO_INDEX)); reObj.setEventTime(eventTime); - reObj.setEventId((Integer) data.get(6)); - reObj.setEventType((Integer) data.get(7)); - reObj.setEventCode((Integer) data.get(8)); - reObj.setEventValue((Integer) data.get(9)); + reObj.setEventId((Integer) data.get(DB_EVENT_ID_INDEX)); + reObj.setEventType((Integer) data.get(DB_EVENT_TYPE_INDEX)); + reObj.setEventCode((Integer) data.get(DB_EVENT_CODE_INDEX)); + reObj.setEventValue((Integer) data.get(DB_EVENT_VALUE)); eventObjs.add(reObj); } output.setObjectCount(eventObjs.size()); @@ -88,7 +140,37 @@ public class ReplayDBManager extends DBTable { @Override public boolean prepare(PreparedStatement prep, List rowData) { - // TODO Auto-generated method stub - return false; + boolean isPrepared = true; + + int columnsize = getColumnSize(); + if (columnsize != rowData.size()) { + isPrepared = false; + } else { + try { + prep.setInt(DB_RID_INDEX + 1, + (Integer) (rowData.get(DB_RID_INDEX))); + prep.setInt(DB_SEQ_INDEX + 1, + (Integer) (rowData.get(DB_SEQ_INDEX))); + prep.setLong(DB_TIME_INDEX + 1, + (Long) (rowData.get(DB_TIME_INDEX))); + prep.setInt(DB_SEC_INDEX + 1, + (Integer) (rowData.get(DB_SEC_INDEX))); + prep.setInt(DB_NANO_INDEX + 1, + (Integer) (rowData.get(DB_NANO_INDEX))); + prep.setInt(DB_EVENT_ID_INDEX + 1, + (Integer) (rowData.get(DB_EVENT_ID_INDEX))); + prep.setInt(DB_EVENT_TYPE_INDEX + 1, + (Integer) (rowData.get(DB_EVENT_TYPE_INDEX))); + prep.setInt(DB_EVENT_CODE_INDEX + 1, + (Integer) (rowData.get(DB_EVENT_CODE_INDEX))); + prep.setInt(DB_EVENT_VALUE + 1, + (Integer) (rowData.get(DB_EVENT_VALUE))); + } catch (SQLException e) { + e.printStackTrace(); + isPrepared = false; + } + } + + return isPrepared; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDataManager.java index 7eea7f3..f4d43d3 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replay/data/ReplayDataManager.java @@ -81,7 +81,6 @@ public class ReplayDataManager extends PageDataManager { RecordEventObject reo = events.get(ii); List insertObject = new ArrayList(); insertObject.add(rid++); - insertObject.add(7); insertObject.add(reo.getSeq()); insertObject.add(reo.getTime()); insertObject.add(reo.getEventTime().getSec()); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/RepalyEditSaveDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/RepalyEditSaveDialog.java index 1564fc5..71b4877 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/RepalyEditSaveDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/RepalyEditSaveDialog.java @@ -4,7 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * Jooyoul Lee + * Hyunjong Park * Juyoung Kim * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -70,8 +70,8 @@ public class RepalyEditSaveDialog extends DAMessageBox { public String saveFileName = null; private DAButton okButton = null; private DAButton cancelButton = null; - - private String targetPath = ""; + + private String targetPath = CommonConstants.EMPTY; public RepalyEditSaveDialog(Shell parentShell) { super(parentShell); @@ -248,10 +248,9 @@ public class RepalyEditSaveDialog extends DAMessageBox { private boolean executeSaveTrace() { Project project = AnalyzerManager.getProject(); String sourcePath = project.getSavePath(); - targetPath = PathManager.DA_SAVE_PATH - + File.separator + saveFileName; + targetPath = PathManager.DA_SAVE_PATH + File.separator + saveFileName; - if(AnalyzerManager.getProject().getSavePath().equals(targetPath)){ + if (AnalyzerManager.getProject().getSavePath().equals(targetPath)) { return true; } @@ -289,7 +288,8 @@ public class RepalyEditSaveDialog extends DAMessageBox { } return true; } - public String getSavedPath(){ + + public String getSavedPath() { return this.targetPath; } 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 index 9fe498d..9ea769c 100644 --- 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 @@ -37,7 +37,6 @@ import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; -import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.nl.ReplayEditLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; @@ -53,32 +52,22 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox; public class ReplayEditDialog extends DAMessageBox { private static final DALogger DA_LOG = DALogger.getInstance(); - + private static boolean opened = false; private DACustomButton cancelButton = null; - //private DATabComposite tabView = null; private DATableComposite replayTable; public ReplayEditDialog(Shell parent) { super(parent); } - private DACustomButtonClickEventListener saveButtonListener = new DACustomButtonClickEventListener() { - - @Override - public void handleClickEvent(DACustomButton button) { - ReplayEditDialogDataManager.getInstance().setTableItemsList(replayTable); - ReplayEditDialogDataManager.getInstance().saveDialog(); - } - }; - private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() { @Override public void handleClickEvent(DACustomButton button) { - ReplayEditDialogDataManager.getInstance().setTableItemsList(replayTable); - ReplayEditDialogDataManager.getInstance().insertDB(false, - AnalyzerManager.getProject().getSavePath()); + ReplayEditDialogDataManager.getInstance().setTableItemsList( + replayTable); + ReplayEditDialogDataManager.getInstance().insertDB(); shell.dispose(); } }; @@ -145,10 +134,8 @@ public class ReplayEditDialog extends DAMessageBox { compData.bottom = new FormAttachment(100, 0); featuresPage.setLayoutData(compData); - replayTable =featuresPage.getReplayTable(); - - - + replayTable = featuresPage.getReplayTable(); + // button Composite buttonContentsComp = new Composite(shell, SWT.NONE); buttonContentsComp.addPaintListener(new PaintListener() { @@ -183,27 +170,21 @@ public class ReplayEditDialog extends DAMessageBox { buttonData.height = 28; cancelButton.setLayoutData(buttonData); - ReplayEditDialogDataManager.getInstance().setOkButton(new DAButton(buttonContentsComp, SWT.NONE)); - ReplayEditDialogDataManager.getInstance().getOkButton().addClickListener(okButtonListener); - ReplayEditDialogDataManager.getInstance().getOkButton().setText(ReplayEditLabels.OK); - ReplayEditDialogDataManager.getInstance().getOkButton().setFont(FontResources.DIALOG_BUTTON_FONT); + ReplayEditDialogDataManager.getInstance().setOkButton( + new DAButton(buttonContentsComp, SWT.NONE)); + ReplayEditDialogDataManager.getInstance().getOkButton() + .addClickListener(okButtonListener); + ReplayEditDialogDataManager.getInstance().getOkButton() + .setText(ReplayEditLabels.OK); + ReplayEditDialogDataManager.getInstance().getOkButton() + .setFont(FontResources.DIALOG_BUTTON_FONT); buttonData = new FormData(); buttonData.right = new FormAttachment(cancelButton, -8); buttonData.top = new FormAttachment(0, 11); buttonData.width = 100; buttonData.height = 28; - ReplayEditDialogDataManager.getInstance().getOkButton().setLayoutData(buttonData); - - ReplayEditDialogDataManager.getInstance().setSaveButton(new DAButton(buttonContentsComp, SWT.NONE)); - ReplayEditDialogDataManager.getInstance().getSaveButton().addClickListener(saveButtonListener); - ReplayEditDialogDataManager.getInstance().getSaveButton().setText(ReplayEditLabels.SAVE); - ReplayEditDialogDataManager.getInstance().getSaveButton().setFont(FontResources.DIALOG_BUTTON_FONT); - buttonData = new FormData(); - buttonData.right = new FormAttachment(ReplayEditDialogDataManager.getInstance().getOkButton(), -8); - buttonData.top = new FormAttachment(0, 11); - buttonData.width = 100; - buttonData.height = 28; - ReplayEditDialogDataManager.getInstance().getSaveButton().setLayoutData(buttonData); + ReplayEditDialogDataManager.getInstance().getOkButton() + .setLayoutData(buttonData); opened = true; ShortCutManager.getInstance().setEnabled(!opened); 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 index dfe8f21..69d97df 100644 --- 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 @@ -44,7 +44,6 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; public class ReplayEditDialogDataManager { private DACustomButton saveButton = null; private DACustomButton okButton = null; - private final int MESSAGE_ID = 7; private final int sequenceNaumber = 0000; public static String MODIFIABILITY_TRUE = "MODIFIABILITY_TRUE "; public static String SELECTED_ITEM_COPY = "SELECTED_ITEM_COPY "; @@ -99,7 +98,6 @@ public class ReplayEditDialogDataManager { replayDBData = new ReplayData(); replayDBData = ReplayDataManager.getInstance().getReplayDBManager() .getReplayLogs(false); - // replayDBData = SqlManager.getInstance().getReplayLogs(false); } return replayDBData; } @@ -282,14 +280,14 @@ public class ReplayEditDialogDataManager { if (dbPath.equals(AnalyzerManager.getProject().getSavePath())) { dbPath = AnalyzerManager.getProject().getSavePath(); } - insertDB(true, dbPath); + insertDB(); } } - public void insertDB(boolean isSave, String dbPath) { + public void insertDB() { ReplayDataManager.getInstance().getReplayDBManager() .deleteReplayTableItems(); - insertDBData(isSave, dbPath); + insertDBData(); } private void cleanInsertData() { @@ -297,7 +295,7 @@ public class ReplayEditDialogDataManager { insertkeySequence = 1; } - private void insertDBData(boolean isSave, String dbPath) { + private void insertDBData() { cleanInsertData(); int size = getTableItemsList().size(); for (int i = 0; i < size; i++) { @@ -409,6 +407,9 @@ public class ReplayEditDialogDataManager { .get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX)); String itemMouseUpTime = getDBTime(item .get(EVENT_MOUSE_UP_TIME_TABLE_INDEX)); + if (itemMouseUpTime.equals(CommonConstants.EMPTY)) { + itemMouseUpTime = itemMouseDownTime; + } DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime)); DATime mouseUpTime = getDATimeValue(Long.parseLong(itemMouseUpTime)); int itemValue1 = getKeyValue(item); @@ -418,7 +419,6 @@ public class ReplayEditDialogDataManager { List keyData = new ArrayList(); if (i == 0) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -429,7 +429,6 @@ public class ReplayEditDialogDataManager { keyData.add(1); } else if (i == 1) { keyData.add(mouseUpTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -440,7 +439,6 @@ public class ReplayEditDialogDataManager { keyData.add(0); } else if (i == 2) { keyData.add(mouseUpTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseUpTime.getSec()); @@ -451,7 +449,6 @@ public class ReplayEditDialogDataManager { keyData.add(0); } else if (i == 3) { keyData.add(mouseUpTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseUpTime.getSec()); @@ -490,7 +487,6 @@ public class ReplayEditDialogDataManager { List keyData = new ArrayList(); if (i == 0) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -501,7 +497,6 @@ public class ReplayEditDialogDataManager { keyData.add(insertkeySequence++); } else if (i == 1) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -512,7 +507,6 @@ public class ReplayEditDialogDataManager { keyData.add(TOUCH_EVENT_VALUE_SECOND_ITEM); } else if (i == 2) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -523,7 +517,6 @@ public class ReplayEditDialogDataManager { keyData.add(getDBPoint(itemValue1)); } else if (i == 3) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -534,7 +527,6 @@ public class ReplayEditDialogDataManager { keyData.add(getDBPoint(itemValue2)); } else if (i == 4) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseDownTime.getSec()); @@ -545,7 +537,6 @@ public class ReplayEditDialogDataManager { keyData.add(0); } else if (i == 5) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseUpTime.getSec()); @@ -556,7 +547,6 @@ public class ReplayEditDialogDataManager { keyData.add(-1); } else if (i == 6) { keyData.add(mouseDownTime.getSec() + insertDBRid++); - keyData.add(MESSAGE_ID); keyData.add(sequenceNaumber); keyData.add(Long.parseLong(itemMouseDownTime)); keyData.add(mouseUpTime.getSec()); 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 index c4518ee..8efa25d 100644 --- 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 @@ -4,7 +4,7 @@ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * yeongtaik byeon + * Hyunjong Park * Juyoung Kim * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java index 9ed0d4b..f665bff 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditScreenshotDialog.java @@ -4,7 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * Jooyoul Lee + * Hyunjong Park * Juyoung Kim * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,7 +50,6 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.GlobalInformation; import org.tizen.dynamicanalyzer.common.ScreenshotConstants; import org.tizen.dynamicanalyzer.common.path.PathManager; -import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.constant.CommonConstants; import org.tizen.dynamicanalyzer.nl.ReplayEditLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; @@ -192,20 +191,22 @@ public class ReplayEditScreenshotDialog extends DAMessageBox { int point = 0; if (value.contains(ReplayEditLabels.CONTEXT_VALUE_X)) { point = Integer.parseInt(value.replace( - ReplayEditLabels.CONTEXT_VALUE_X, "")); - point = (point * ScreenshotConstants.DEFAULT_IMAGE_WIDTH) / Integer.parseInt(resolutionWidth); + ReplayEditLabels.CONTEXT_VALUE_X, CommonConstants.EMPTY)); + point = (point * ScreenshotConstants.DEFAULT_IMAGE_WIDTH) + / Integer.parseInt(resolutionWidth); } if (value.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) { point = Integer.parseInt(value.replace( - ReplayEditLabels.CONTEXT_VALUE_Y, "")); - point = (point * ScreenshotConstants.DEFAULT_IMAGE_HEIGHT) / Integer.parseInt(resolutionHeight); + ReplayEditLabels.CONTEXT_VALUE_Y, CommonConstants.EMPTY)); + point = (point * ScreenshotConstants.DEFAULT_IMAGE_HEIGHT) + / Integer.parseInt(resolutionHeight); } return point; } private void getDeviceResolution() { - String selDeviceName = GlobalInformation.getCurrentDeviceInfo().getIDevice() - .getDeviceName(); + String selDeviceName = GlobalInformation.getCurrentDeviceInfo() + .getIDevice().getDeviceName(); String resolutionInfoXmlPath = PathManager.TIZEN_SDK_DATA_PATH + File.separator + "emulator-vms" + File.separator + "vms"//$NON-NLS-1$ + File.separator + selDeviceName + File.separator 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 index 1b24cce..6867d15 100644 --- 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 @@ -84,6 +84,8 @@ public class ReplayEditTable extends DATableComposite { private DAText inputValueText = null; + private boolean enableCoordinateIcon = true; + @Override protected List makeTableInput() { List input = new ArrayList(); @@ -196,7 +198,6 @@ public class ReplayEditTable extends DATableComposite { break; } case MOUSE_RIGHT: { - openPoppupMenuMouseDownSequenceColumn(item, event); break; } default: { @@ -761,7 +762,11 @@ public class ReplayEditTable extends DATableComposite { item.setImage(null); } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X) || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) { - item.setImage(ImageResources.REPLAY_EDIT_SNAPSHOT_DOWN); + if (enableCoordinateIcon) { + item.setImage(ImageResources.REPLAY_EDIT_SNAPSHOT_DOWN); + } else { + item.setImage(null); + } } else { item.setImage(ImageResources.REPLAY_EDIT_DROPDOWN_DOWN); } @@ -1030,10 +1035,14 @@ public class ReplayEditTable extends DATableComposite { MousePt.x, MousePt.y); } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X) || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) { - ReplayEditScreenshotDialog dialog = new ReplayEditScreenshotDialog( - table.getShell(), item); - dialog.open(); + if (enableCoordinateIcon) { + ReplayEditScreenshotDialog dialog = new ReplayEditScreenshotDialog( + table.getShell(), item); + dialog.open(); + } return false; + } else { + openPoppupMenuMouseDownSequenceColumn(item, event); } } return true; 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 index a9ef91d..fee573e 100644 --- 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 @@ -28,8 +28,6 @@ package org.tizen.dynamicanalyzer.ui.toolbar.replayEditor; import org.eclipse.nebula.widgets.grid.GridItem; import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Rectangle; @@ -48,54 +46,18 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer { public void paint(GC gc, Object value) { GridItem item = (GridItem) value; gc.setFont(item.getFont(getColumn())); - paintBackground(gc, item); paintImage(gc, item); paintText(gc, item); paintTableBoardLine(gc, item); paintMouseOverColumn(gc, item); paintSelectedInputKey(gc, item); - // paintSelectedCopy(gc, item); paintVaildTime(gc, item); } - private void paintBackground(GC gc, GridItem item) { - boolean drawBackground = true; - String optionColumn = item.getText(6); - if (item.getChecked() && getColumn() == 0) { - gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START); - gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END); - } else if (!optionColumn - .contains(ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) { - gc.setBackground(ColorResources.YELLOW); - } else if (item.getText(ReplayEditTable.UP_TIME_TABLE_INDEX).equals("")) { - gc.setBackground(ColorResources.YELLOW); - } else { - if (item.getParent().isEnabled()) { - Color bg = item.getBackground(); - if (bg != null) { - gc.setBackground(bg); - } else { - drawBackground = false; - } - } else { - gc.setBackground(getDisplay().getSystemColor( - SWT.COLOR_WIDGET_BACKGROUND)); - } - } - - if (drawBackground && item.getChecked() && getColumn() == 0) { - gc.fillGradientRectangle(getBounds().x, getBounds().y, - getBounds().width, getBounds().height, true); - } else if (drawBackground) { - gc.fillRectangle(getBounds().x, getBounds().y + 1, - getBounds().width, getBounds().height); - } - } - private void paintImage(GC gc, GridItem item) { menuImg = item.getImage(); - if (menuImg != null && getColumn() != 0 && item.getChecked(getColumn())) { + if (menuImg != null && item.getChecked(getColumn())) { int y = getBounds().y; y += (getBounds().height - menuImg.getBounds().height) / 2; @@ -134,7 +96,7 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer { } private void paintMouseOverColumn(GC gc, GridItem item) { - if (getColumn() != 0 && item.getChecked(getColumn())) { + if (item.getChecked(getColumn())) { Rectangle focusRect = new Rectangle(getBounds().x - 1, getBounds().y - 1, getBounds().width, getBounds().height + 1); @@ -152,8 +114,7 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer { private void paintSelectedInputKey(GC gc, GridItem item) { String optionColumn = item.getText(6); - if (getColumn() != 0 - && item.getChecked(getColumn()) + if (item.getChecked(getColumn()) && optionColumn .contains(ReplayEditDialogDataManager.SELECTED_ITEM_KEY_INPUT)) { Rectangle focusRect = new Rectangle(getBounds().x - 1, @@ -171,35 +132,6 @@ public class ReplayEditTableCellRenderer extends DefaultCellRenderer { } } - // private void paintSelectedCopy(GC gc, GridItem item) { - // String optionColumn = item.getText(6); - // if (optionColumn - // .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) { - // gc.setForeground(ColorResources.BLACK); - // gc.setLineWidth(2); - // gc.setLineStyle(SWT.LINE_DOT); - // gc.drawLine(getBounds().x, getBounds().y, getBounds().x - // + getBounds().width, getBounds().y); - // - // gc.drawLine(getBounds().x, getBounds().y + getBounds().height, - // getBounds().x + getBounds().width, getBounds().y - // + getBounds().height); - // if (getColumn() == 0) { - // gc.drawLine(getBounds().x, getBounds().y, getBounds().x, - // getBounds().y + getBounds().height); - // } - // - // if (getColumn() == 0) { - // gc.drawLine(getBounds().x, getBounds().y, getBounds().x, - // getBounds().y + getBounds().height); - // } - // - // gc.setLineStyle(SWT.LINE_SOLID); - // gc.setLineWidth(1); - // - // } - // } - private void paintVaildTime(GC gc, GridItem item) { String optionColumn = item.getText(6); if (optionColumn 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 index 6c4e4c6..12b64d4 100644 --- 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 @@ -1,3 +1,29 @@ +/* + * 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.tizen.dynamicanalyzer.constant.CommonConstants; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableItemListSortComparator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableItemListSortComparator.java index 2519e9f..e54186a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableItemListSortComparator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableItemListSortComparator.java @@ -4,7 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * Jooyoul Lee + * Hyunjong Park * Juyoung Kim * * Licensed under the Apache License, Version 2.0 (the "License");