[Title] change replay edit dlg.
authorHyunjong,park <phjwithyou.park@samsung.com>
Fri, 22 Nov 2013 08:45:47 +0000 (17:45 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Fri, 22 Nov 2013 08:45:47 +0000 (17:45 +0900)
[Desc.] add feature show line when seleted items
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTableView.java

index b7a0225..dec66df 100644 (file)
@@ -47,13 +47,15 @@ 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.ui.widgets.table.DATableComposite;
 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 cancelButton = null;
-       DATabComposite tabView = null;
+       private DATabComposite tabView = null;
+       private DATableComposite replayTable;
 
        public ReplayEditDialog(Shell parent) {
                super(parent);
@@ -63,6 +65,7 @@ public class ReplayEditDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       ReplayEditDialogDataManager.getInstance().setTableItemsList(replayTable);
                        ReplayEditDialogDataManager.getInstance().saveDialog();
                }
        };
@@ -71,6 +74,7 @@ public class ReplayEditDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       ReplayEditDialogDataManager.getInstance().setTableItemsList(replayTable);
                        ReplayEditDialogDataManager.getInstance().insertDB(false,
                                        AnalyzerManager.getProject().getSavePath());
                        shell.dispose();
@@ -141,10 +145,14 @@ public class ReplayEditDialog extends DAMessageBox {
                compData.bottom = new FormAttachment(100, 0);
                tabView.setLayoutData(compData);
 
-               Composite featuresPage = new ReplayEditTableView(
+               ReplayEditTableView featuresPage = new ReplayEditTableView(
                                tabView.getContentComposite(), SWT.NONE);
                tabView.addView(featuresPage, false);
 
+               replayTable =featuresPage.getReplayTable(); 
+               
+               
+       
                // button
                Composite buttonContentsComp = new Composite(shell, SWT.NONE);
                buttonContentsComp.addPaintListener(new PaintListener() {
index 7db6660..f3176f6 100644 (file)
@@ -36,6 +36,7 @@ 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;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 
@@ -43,18 +44,17 @@ public class ReplayEditDialogDataManager {
        private DACustomButton saveButton = null;
        private DACustomButton okButton = null;
        private final int MESSAGE_ID = 7;
-       //public static String MODIFIABILITY_FALSE = 0;
        public static String MODIFIABILITY_TRUE = "MODIFIABILITY_TRUE ";
        public static String SELECTED_ITEM_COPY = "SELECTED_ITEM_COPY ";
        public static String ITEM_TIME_VAILD_FALSE = "ITEM_TIME_VAILD_FALSE ";
-       
+
        private final int TOUCH_EVENT_CODE_MOUSED_DOWN_START = 57;
        private final int TOUCH_EVENT_CODE_SECOND_ITEM = 48;
        private final int TOUCH_EVENT_CODE_X = 53;
        private final int TOUCH_EVENT_CODE_Y = 54;
        private final int TOUCH_EVENT_CODE_MOUSED_UP_START = 57;
        private final int TOUCH_EVENT_VALUE_SECOND_ITEM = 10;
-       
+
        private final int KEY = 1;
        private final int TOUCH = 3;
        private final int KEY_MENU = 169;
@@ -63,29 +63,24 @@ public class ReplayEditDialogDataManager {
        private final int KEY_POWER = 116;
        private final int KEY_VOLUME_UP = 115;
        private final int KEY_VOLUME_DOWN = 114;
-       
-       
+
        private final int EVENT_MOUSE_DOWN_TIME_TABLE_INDEX = 1;
        private final int EVENT_MOUSE_UP_TIME_TABLE_INDEX = 2;
        private final int EVENT_TYPE_TABLE_INDEX = 3;
        private final int EVENT_VALUE1_TABLE_INDEX = 4;
        private final int EVENT_VALUE2_TABLE_INDEX = 5;
-       
+
        private int insertDBRid = 0;
        private int insertkeySequence = 1;
        private int insertSecTimeSequence = 0;
-       
+
        private long preMouseUpTime = 0;
-       
-       private long repalyStartTime = 0;
-       private long replayStartSecTime = 0;
-       private long replayStartNanoTime = 0;
 
        private static ReplayEditDialogDataManager instance = null;
        private ReplayData replayDBData = null;
        private List<ReplayEditTableData> replayModifyDataList = null;
        private List<List<String>> tableItemsList = null;
-       
+
        private List<Integer> removeDBIndex = new ArrayList<Integer>();
 
        public static ReplayEditDialogDataManager getInstance() {
@@ -95,17 +90,16 @@ public class ReplayEditDialogDataManager {
                return instance;
        }
 
-       public void clean(){
+       public void clean() {
                replayModifyDataList = null;
                replayDBData = null;
                tableItemsList = null;
        }
-       
+
        public ReplayData getReplayDBData() {
                if (null == replayDBData) {
                        replayDBData = new ReplayData();
                        replayDBData = SqlManager.getInstance().getReplayLogs(false);
-               //      SqlManager.getInstance().closeReplayConnection();
                }
                return replayDBData;
        }
@@ -117,37 +111,57 @@ public class ReplayEditDialogDataManager {
        public List<ReplayEditTableData> getReplayModifyData() {
                if (null == replayModifyDataList) {
                        replayModifyDataList = new ArrayList<ReplayEditTableData>();
-                       makeReplayEditData(getReplayDBData());
+                       ReplayData replayData = getReplayDBData();
+                       makeReplayEditData(replayModifyDataList, replayData);
                        removeNotExistMouseUpTimeItem(replayModifyDataList);
-                       setRemoveDBIndex();
-                       sortTableItem();
-                       
+                       setRemoveDBIndex(replayModifyDataList);
+                       sortTableItem(replayModifyDataList);
+               //      removeWrongData(replayModifyDataList);
                }
                return replayModifyDataList;
        }
        
-       private void removeNotExistMouseUpTimeItem(List<ReplayEditTableData> listData){
-               for(int i = 0 ;i < listData.size() ; i++){
-                       if(listData.get(i).getStrEventMouseUpTime().length() < 1){
+       private void removeWrongData(List<ReplayEditTableData> listData) {
+               List<ReplayEditTableData> removeList = new ArrayList<ReplayEditTableData>();
+               for (int i = 0; i < listData.size(); i++) {
+                       if (listData.get(i).getLongEventMouseDownTime() > listData.get(i)
+                                       .getLongEventMouseUpTime()) {
+                               removeList.add(listData.get(i));
+                       }
+                       if (i > 0) {
+                               if (listData.get(i - 1).getLongEventMouseDownTime() == listData
+                                               .get(i).getLongEventMouseDownTime()
+                                               && listData.get(i - 1).getLongEventMouseUpTime() == listData
+                                                               .get(i).getLongEventMouseUpTime()) {
+                                       removeList.add(listData.get(i));
+                               }
+                       }
+               }
+               listData.removeAll(removeList);
+       }
+
+       private void removeNotExistMouseUpTimeItem(
+                       List<ReplayEditTableData> listData) {
+               for (int i = 0; i < listData.size(); i++) {
+                       if (listData.get(i).getStrEventMouseUpTime().length() < 1) {
                                listData.remove(i);
                        }
                }
        }
-       
-       
-       private void sortTableItem(){
-               Collections.sort(getReplayModifyData(), new ReplayEditTableItemListSortComparator());
+
+       private void sortTableItem(List<ReplayEditTableData> listData) {
+               Collections.sort(listData,
+                               new ReplayEditTableItemListSortComparator());
        }
-       
-       private ReplayEditTableData getLastReplayEditTableData(){
+
+       private ReplayEditTableData getLastReplayEditTableData() {
                return getReplayModifyData().get(getReplayModifyData().size() - 1);
        }
 
-       private void makeReplayEditData(ReplayData dbData) {
+       private void makeReplayEditData(List<ReplayEditTableData> editList, ReplayData dbData) {
                int size = dbData.getRecordEvent().size();
                for (int i = 0; i < size; i++) {
                        RecordEventObject reo = dbData.getRecordEvent().get(i);
-                       setEventStartTime(i, reo);
                        if (reo.getEventType() == 0) { // event end log
                                continue;
                        }
@@ -157,26 +171,22 @@ public class ReplayEditDialogDataManager {
                        }
                        ReplayEditTableData data = makeEditTableData(reo);
                        if (null != data) {
-                               getReplayModifyData().add(data);
+                               editList.add(data);
                        }
                }
        }
-       
-       private void setRemoveDBIndex() {
-               int nSize = getReplayModifyData().size();
+
+       private void setRemoveDBIndex(List<ReplayEditTableData> listData) {
+               int nSize = listData.size();
                for (int i = 0; i < nSize; i++) {
-                       int rid = getReplayModifyData().get(i).getEventRid();
+                       int rid = listData.get(i).getEventRid();
                        if (rid > -1) {
-                               System.out.println(getReplayModifyData().get(i)
-                                               .getStrEventType()
-                                               + " getReplayModifyData().get(i).getEventRid() : "
-                                               + getReplayModifyData().get(i).getEventRid());
-                               if (getReplayModifyData().get(i).getStrEventType()
+                               if (listData.get(i).getStrEventType()
                                                .equals(ReplayEditLabels.CONTEXT_TOUCH)) {
                                        for (int j = rid; j < rid + 7; j++) {
                                                removeDBIndex.add(j);
                                        }
-                               } else if (getReplayModifyData().get(i).getStrEventType()
+                               } else if (listData.get(i).getStrEventType()
                                                .equals(ReplayEditLabels.CONTEXT_KEY)) {
                                        for (int j = rid; j < rid + 4; j++) {
                                                removeDBIndex.add(j);
@@ -187,24 +197,8 @@ public class ReplayEditDialogDataManager {
 
                }
        }
-       
-       private void setEventStartTime(int i, RecordEventObject reo){
-               if( i == 0){
-                       repalyStartTime = reo.getTime();
-                       replayStartSecTime = reo.getEventTime().getSec();
-                       replayStartNanoTime = reo.getEventTime().getNano();
-               }
-               if(repalyStartTime >= reo.getTime()){
-                       repalyStartTime = reo.getTime();
-                       replayStartSecTime = reo.getEventTime().getSec();
-                       replayStartNanoTime = reo.getEventTime().getNano();
-               }
-       }
 
        private boolean isEventMouseUpTime(RecordEventObject reo) {
-               if (getReplayModifyData().size() < 1) {
-                       return false;
-               }
                boolean isEventMouseUpTime = false;
                switch (reo.getEventType()) {
                case KEY: {
@@ -235,27 +229,25 @@ public class ReplayEditDialogDataManager {
 
                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);
                        replayType.setEventRid(reo.getId());
-                       System.out.println("reo.getId() : "+reo.getId());
                        break;
                }
                case TOUCH: {
                        if (reo.getEventCode() == TOUCH_EVENT_CODE_MOUSED_DOWN_START
                                        && reo.getEventValue() != -1) {
-//                             if (isDrawEvnet()) {
-//                                     return null;
-//                             }
+                               if (isDrawEvnet()) {
+                                       return null;
+                               }
                                replayType = new ReplayEditTableData();
                                replayType.setEventMouseDownTime(reo.getTime());
                                replayType.setStrEventType(setEventType(reo.getEventType()));
                                replayType.setEventRid(reo.getId());
-                               System.out.println("reo.getId() : "+reo.getId());
                        } else if (reo.getEventCode() == TOUCH_EVENT_CODE_X) {
                                getReplayModifyData()
                                                .get(getReplayModifyData().size() - 1)
@@ -360,38 +352,44 @@ public class ReplayEditDialogDataManager {
                        SqlManager.getInstance().closeReplayConnection();
                }
        }
-       
-       public void insertDB(boolean isSave, String dbPath){
-               SqlManager.getInstance().deleteReplayTableItems(isSave, dbPath,removeDBIndex);
+
+       public void insertDB(boolean isSave, String dbPath) {
+               for (int i = 0; i < removeDBIndex.size(); i++) {
+               }
+               SqlManager.getInstance().deleteReplayTableItems(isSave, dbPath,
+                               removeDBIndex);
                insertDBData(isSave, dbPath);
        }
-       
-       private void cleanInsertData(){
+
+       private void cleanInsertData() {
                insertDBRid = 0;
                insertkeySequence = 1;
                insertSecTimeSequence = 0;
                preMouseUpTime = 0;
        }
-       
-       private void insertDBData(boolean isSave, String dbPath){
+
+       private void insertDBData(boolean isSave, String dbPath) {
                cleanInsertData();
                int size = getTableItemsList().size();
                for (int i = 0; i < size; i++) {
                        List<String> item = getTableItemsList().get(i);
                        List<List<String>> dataList = new ArrayList<List<String>>();
-                       if(item.get(EVENT_TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_TOUCH)){
+                       if (item.get(EVENT_TYPE_TABLE_INDEX).equals(
+                                       ReplayEditLabels.CONTEXT_TOUCH)) {
                                dataList = makeDBTouchData(item);
-                       }else if(item.get(EVENT_TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_KEY)){
+                       } else if (item.get(EVENT_TYPE_TABLE_INDEX).equals(
+                                       ReplayEditLabels.CONTEXT_KEY)) {
                                dataList = makeDBKeyData(item);
-                       }else{ //Draw
-                               
+                       } else { // Draw
+
                        }
-                       if(dataList.size() > 0 ){
-                               SqlManager.getInstance().insertRepalyTableItem(isSave, dbPath, dataList);
+                       if (dataList.size() > 0) {
+                               SqlManager.getInstance().insertRepalyTableItem(isSave, dbPath,
+                                               dataList);
                        }
                }
        }
-       
+
        public String getDBTime(String time) {
                String strTime = time;
                if (strTime.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
@@ -406,7 +404,7 @@ public class ReplayEditDialogDataManager {
                strTime += 10000;
                return strTime;
        }
-       
+
        private String getDBPoint(String point) {
                String strPoint = point;
                if (strPoint.contains(ReplayEditLabels.CONTEXT_VALUE_X)) {
@@ -421,259 +419,274 @@ public class ReplayEditDialogDataManager {
                return strPoint;
        }
 
-       
-       
-       private long getEventNanoTime(long time){
-               long mouseEventSec = (replayStartSecTime + insertSecTimeSequence);
-               long mouseDelaytime  = time - repalyStartTime;
-               if(mouseDelaytime == 0){
-                       return replayStartNanoTime;
-               }
-               System.out.println("mouseDelaytime : "+mouseDelaytime);
-               if((time - repalyStartTime) < 1){
-                       return replayStartNanoTime; 
-               }
-               long mouseDelaySec = (mouseEventSec - replayStartSecTime) * 1000000;
-               System.out.println("mouseDelaySec : "+mouseDelaySec);
-               long mouseEventNano = ((mouseDelaytime - mouseDelaySec) * 1000) +replayStartNanoTime;
-               System.out.println("replayStartNanoTime : "+replayStartNanoTime);
-               System.out.println("mouseEventNano : "+mouseEventNano);
-               
+       private long getEventNanoTime(long time) {
+               int startSec = AnalyzerManager.getProject().getProfileStartTime()
+                               .getSec();
+               int startNano = AnalyzerManager.getProject().getProfileStartTime()
+                               .getNano();
+               long startTime = startSec / 1000000 + startNano / 1000;
+
+               long mouseEventSec = (startSec + insertSecTimeSequence);
+               long mouseDelaytime = time - startTime;
+               if (mouseDelaytime == 0) {
+                       return startNano;
+               }
+               if ((time - startTime) < 1) {
+                       return startNano;
+               }
+               long mouseDelaySec = (mouseEventSec - startSec) * 1000000;
+               long mouseEventNano = ((mouseDelaytime - mouseDelaySec) * 1000)
+                               + startNano;
                return mouseEventNano;
        }
-       
-       private String getSecTime(){
-               long mouseDownEventSec = (replayStartSecTime + insertSecTimeSequence);
+
+       private String getSecTime() {
+               int startSec = AnalyzerManager.getProject().getProfileStartTime()
+                               .getSec();
+               long mouseDownEventSec = (startSec + insertSecTimeSequence);
                return Long.toString(mouseDownEventSec);
        }
-       
-       private String getMouseDownNanoTime(List<String> item){
-               String itemMouseDownTime = getDBTime(item.get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
-               long downTime = Long.parseLong(itemMouseDownTime); 
-               if(preMouseUpTime > 0 && downTime - preMouseUpTime > 1000000){
+
+       private String getMouseDownNanoTime(List<String> item) {
+               String itemMouseDownTime = getDBTime(item
+                               .get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
+               long downTime = Long.parseLong(itemMouseDownTime);
+               if (preMouseUpTime > 0 && downTime - preMouseUpTime > 1000000) {
                        long delayTime = (downTime - preMouseUpTime) / 1000000;
-                       insertSecTimeSequence += delayTime; 
+                       insertSecTimeSequence += delayTime;
                }
-               
+
                long mouseDownEventNano = getEventNanoTime(downTime);
-               while(mouseDownEventNano > 1000000000){
+               while (mouseDownEventNano > 1000000000) {
                        insertSecTimeSequence++;
                        mouseDownEventNano = getEventNanoTime(downTime);
                }
-               
+
                return Long.toString(mouseDownEventNano);
        }
-       
-       private String getMouseUpNanoTime(List<String> item){
-               String itemMouseDownTime = getDBTime(item.get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
-               String itemMouseUpTime = getDBTime(item.get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
-               long downTime = Long.parseLong(itemMouseDownTime); 
+
+       private String getMouseUpNanoTime(List<String> item) {
+               String itemMouseDownTime = getDBTime(item
+                               .get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
+               String itemMouseUpTime = getDBTime(item
+                               .get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
+               long downTime = Long.parseLong(itemMouseDownTime);
                long upTime = Long.parseLong(itemMouseUpTime);
-               
-               if(upTime - downTime > 1000000){
+
+               if (upTime - downTime > 1000000) {
                        long delayTime = (downTime - downTime) / 1000000;
-                       insertSecTimeSequence += delayTime; 
+                       insertSecTimeSequence += delayTime;
                }
-               
-               long mouseUpEventNano =getEventNanoTime(upTime);
-               while(mouseUpEventNano > 1000000000){
+
+               long mouseUpEventNano = getEventNanoTime(upTime);
+               while (mouseUpEventNano > 1000000000) {
                        insertSecTimeSequence++;
                        mouseUpEventNano = getEventNanoTime(upTime);
                }
-               
+
                preMouseUpTime = upTime;
                return Long.toString(mouseUpEventNano);
        }
-       
-       private String getKeyValue(List<String> item){
+
+       private String getKeyValue(List<String> item) {
                String keyValue = item.get(EVENT_VALUE1_TABLE_INDEX);
                int nKey = 0;
-               if(keyValue.equals(ReplayEditLabels.CONTEXT_KEY_MENU)){
+               if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_MENU)) {
                        nKey = 169;
-               }else if(keyValue.equals(ReplayEditLabels.CONTEXT_KEY_HOME)){
+               } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_HOME)) {
                        nKey = 139;
-               }else if(keyValue.equals(ReplayEditLabels.CONTEXT_KEY_BACK)){
+               } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_BACK)) {
                        nKey = 158;
-               }else if(keyValue.equals(ReplayEditLabels.CONTEXT_KEY_POWER)){
+               } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_POWER)) {
                        nKey = 116;
-               }else if(keyValue.equals(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN)){
+               } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN)) {
                        nKey = 115;
-               }else if(keyValue.equals(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP)){
+               } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP)) {
                        nKey = 114;
                }
                return Integer.toString(nKey);
        }
-       private List<List<String>> makeDBKeyData(List<String> item){
-               String itemMouseDownTime = getDBTime(item.get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
-               String itemMouseUpTime = getDBTime(item.get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
+
+       private List<List<String>> makeDBKeyData(List<String> item) {
+               String itemMouseDownTime = getDBTime(item
+                               .get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
+               String itemMouseUpTime = getDBTime(item
+                               .get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
                String mouseDownNanoTime = getMouseDownNanoTime(item);
                String mouseUpNanoTime = getMouseUpNanoTime(item);
                String itemValue1 = getKeyValue(item);
-               
-               System.out.println("item : "+item+" mouseDownNanoTime : "+mouseDownNanoTime+" mouseUpNanoTime : "+mouseUpNanoTime);
-               
+               int sec = Integer.parseInt(getSecTime());
+
                List<List<String>> dbKeyDataList = new ArrayList<List<String>>();
-               for(int i = 0; i < 4 ; i++){
+               for (int i = 0; i < 4; i++) {
                        List<String> keyData = new ArrayList<String>();
-                               if (i == 0) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("1");
-                                       keyData.add(Integer.toString(KEY));
-                                       keyData.add(itemValue1);
-                                       keyData.add("1");
-                               } else if (i == 1) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("1");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                               } else if (i == 2) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseUpTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseUpNanoTime);
-                                       keyData.add("1");
-                                       keyData.add(Integer.toString(KEY));
-                                       keyData.add(itemValue1);
-                                       keyData.add("0");
-                               } else if (i == 3) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseUpTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseUpNanoTime);
-                                       keyData.add("1");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                               }
-                               dbKeyDataList.add(keyData);
+                       if (i == 0) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("1");
+                               keyData.add(Integer.toString(KEY));
+                               keyData.add(itemValue1);
+                               keyData.add("1");
+                       } else if (i == 1) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("1");
+                               keyData.add("0");
+                               keyData.add("0");
+                               keyData.add("0");
+                       } else if (i == 2) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseUpTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseUpNanoTime);
+                               keyData.add("1");
+                               keyData.add(Integer.toString(KEY));
+                               keyData.add(itemValue1);
+                               keyData.add("0");
+                       } else if (i == 3) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseUpTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseUpNanoTime);
+                               keyData.add("1");
+                               keyData.add("0");
+                               keyData.add("0");
+                               keyData.add("0");
+                       }
+                       dbKeyDataList.add(keyData);
                }
                return dbKeyDataList;
        }
-       
-       private List<List<String>> makeDBTouchData(List<String> item){
-               String itemMouseDownTime = getDBTime(item.get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
-               String itemMouseUpTime = getDBTime(item.get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
+
+       private List<List<String>> makeDBTouchData(List<String> item) {
+               String itemMouseDownTime = getDBTime(item
+                               .get(EVENT_MOUSE_DOWN_TIME_TABLE_INDEX));
+               String itemMouseUpTime = getDBTime(item
+                               .get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
                String mouseDownNanoTime = getMouseDownNanoTime(item);
                String mouseUpNanoTime = getMouseUpNanoTime(item);
                String itemValue1 = item.get(EVENT_VALUE1_TABLE_INDEX);
                String itemValue2 = item.get(EVENT_VALUE2_TABLE_INDEX);
-               
-               System.out.println("item : "+item+" mouseDownNanoTime : "+mouseDownNanoTime+" mouseUpNanoTime : "+mouseUpNanoTime);
-               
+
+               int sec = Integer.parseInt(getSecTime());
                List<List<String>> dbKeyDataList = new ArrayList<List<String>>();
-               for(int i = 0; i < 7 ; i++){
+               for (int i = 0; i < 7; i++) {
                        List<String> keyData = new ArrayList<String>();
-                               if (i == 0) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("0");
-                                       keyData.add(Integer.toString(TOUCH));
-                                       keyData.add(Integer.toString(TOUCH_EVENT_CODE_MOUSED_DOWN_START));
-                                       keyData.add(Integer.toString(insertkeySequence++));
-                               } else if (i == 1) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("0");
-                                       keyData.add(Integer.toString(TOUCH));
-                                       keyData.add(Integer.toString(TOUCH_EVENT_CODE_SECOND_ITEM));
-                                       keyData.add(Integer.toString(TOUCH_EVENT_VALUE_SECOND_ITEM));
-                               } else if (i == 2) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("0");
-                                       keyData.add(Integer.toString(TOUCH));
-                                       keyData.add(Integer.toString(TOUCH_EVENT_CODE_X));
-                                       keyData.add(getDBPoint(itemValue1));
-                               } else if (i == 3) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("0");
-                                       keyData.add(Integer.toString(TOUCH));
-                                       keyData.add(Integer.toString(TOUCH_EVENT_CODE_Y));
-                                       keyData.add(getDBPoint(itemValue2));
-                               } else if (i == 4) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(8815));
-                                       keyData.add(itemMouseDownTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseDownNanoTime);
-                                       keyData.add("0");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                               } else if (i == 5) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(9164));
-                                       keyData.add(itemMouseUpTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseUpNanoTime);
-                                       keyData.add("0");
-                                       keyData.add(Integer.toString(TOUCH));
-                                       keyData.add(Integer.toString(TOUCH_EVENT_CODE_MOUSED_UP_START));
-                                       keyData.add("-1");
-                               }else if (i == 6) {
-                                       keyData.add(Integer.toString(insertDBRid++));
-                                       keyData.add(Integer.toString(MESSAGE_ID));
-                                       keyData.add(Integer.toString(9164));
-                                       keyData.add(itemMouseUpTime);
-                                       keyData.add(getSecTime());
-                                       keyData.add(mouseUpNanoTime);
-                                       keyData.add("0");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                                       keyData.add("0");
-                               }
-                               dbKeyDataList.add(keyData);
+                       if (i == 0) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("0");
+                               keyData.add(Integer.toString(TOUCH));
+                               keyData.add(Integer
+                                               .toString(TOUCH_EVENT_CODE_MOUSED_DOWN_START));
+                               keyData.add(Integer.toString(insertkeySequence++));
+                       } else if (i == 1) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("0");
+                               keyData.add(Integer.toString(TOUCH));
+                               keyData.add(Integer.toString(TOUCH_EVENT_CODE_SECOND_ITEM));
+                               keyData.add(Integer.toString(TOUCH_EVENT_VALUE_SECOND_ITEM));
+                       } else if (i == 2) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("0");
+                               keyData.add(Integer.toString(TOUCH));
+                               keyData.add(Integer.toString(TOUCH_EVENT_CODE_X));
+                               keyData.add(getDBPoint(itemValue1));
+                       } else if (i == 3) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("0");
+                               keyData.add(Integer.toString(TOUCH));
+                               keyData.add(Integer.toString(TOUCH_EVENT_CODE_Y));
+                               keyData.add(getDBPoint(itemValue2));
+                       } else if (i == 4) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(8815));
+                               keyData.add(itemMouseDownTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseDownNanoTime);
+                               keyData.add("0");
+                               keyData.add("0");
+                               keyData.add("0");
+                               keyData.add("0");
+                       } else if (i == 5) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(9164));
+                               keyData.add(itemMouseUpTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseUpNanoTime);
+                               keyData.add("0");
+                               keyData.add(Integer.toString(TOUCH));
+                               keyData.add(Integer.toString(TOUCH_EVENT_CODE_MOUSED_UP_START));
+                               keyData.add("-1");
+                       } else if (i == 6) {
+                               keyData.add(Integer.toString(sec + insertDBRid++));
+                               keyData.add(Integer.toString(MESSAGE_ID));
+                               keyData.add(Integer.toString(9164));
+                               keyData.add(itemMouseUpTime);
+                               keyData.add(getSecTime());
+                               keyData.add(mouseUpNanoTime);
+                               keyData.add("0");
+                               keyData.add("0");
+                               keyData.add("0");
+                               keyData.add("0");
+                       }
+                       dbKeyDataList.add(keyData);
                }
                return dbKeyDataList;
        }
-       
-       
+
        private List<List<String>> getTableItemsList() {
-               if(null == tableItemsList){
+               if (null == tableItemsList) {
                        tableItemsList = new ArrayList<List<String>>();
                }
                return tableItemsList;
        }
 
-       public void setTableItemsList(List<List<String>> tableItemsList) {
-               if(null == tableItemsList){
+       public void setTableItemsList(DATableComposite replayComp) {
+               if (null == tableItemsList) {
                        tableItemsList = new ArrayList<List<String>>();
                }
-               this.tableItemsList = tableItemsList;
+               for (int i = 0; i < replayComp.getTable().getItemCount(); i++) {
+                       List<String> text = new ArrayList<String>();
+                       int size = replayComp.getTable().getColumns().length;
+                       for (int j = 0; j < size + 1; j++) {
+                               text.add(replayComp.getTable().getItem(i).getText(j));
+                       }
+                       tableItemsList.add(text);
+               }
        }
 
        public DACustomButton getSaveButton() {
@@ -692,8 +705,4 @@ public class ReplayEditDialogDataManager {
                this.okButton = okButton;
        }
 
-
 }
-
-
-
index ebf6ea3..5ea2f21 100644 (file)
@@ -50,11 +50,11 @@ import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;
 
 public class ReplayEditTable extends DATableComposite {
        private String[] columnNames = null;
+       private final int tableTextOptionColumnIndex = 6;
+       protected DAPopupMenu eventTypePopupMenu = null;
+       protected DAPopupMenu eventKeyPopupMenu = null;
 
-       protected DAPopupMenu typePopupMenu = null;
-       protected DAPopupMenu keyValuePopupMenu = null;
-
-       private boolean mouseSelectedItem = false;
+       private boolean isMouseSelectedTableItem = false;
        private int mouseSelectedItemIndex = -1;
        private int mouseSelectedColumnIndex = -1;
        private int mouseSelectedPreColunmEndX = -1;
@@ -67,6 +67,9 @@ public class ReplayEditTable extends DATableComposite {
        private int selectedCutItemIndex = -1;
        private int selectedCopyItemIndex = -1;
 
+       private int nowMousePositionX = 0;
+       private int nowMousePositionY = 0;
+
        DAPopupMenuItem copyItem = null;
        DAPopupMenuItem cutItem = null;
        DAPopupMenuItem insertItem = null;
@@ -123,7 +126,6 @@ public class ReplayEditTable extends DATableComposite {
 
        public ReplayEditTable(Composite parent, int style) {
                super(parent, style);
-
                setItemSeqMenu();
                setTyepMenu();
                setKeyMenu();
@@ -163,9 +165,8 @@ public class ReplayEditTable extends DATableComposite {
                        case SWT.MouseExit:
                                break;
                        case SWT.MouseMove:
-                               upadteMouseOverSequenceColumn(item, event);
-                               upadteMouseOverColumn(item, event);
-                               updateTableItems();
+                               upadteMouseOverTableItemsStatus(item, event);
+                               updateMouseOverTableItemsText();
                                break;
                        case SWT.MouseDoubleClick:
                                break;
@@ -174,15 +175,15 @@ public class ReplayEditTable extends DATableComposite {
                        case SWT.MouseUp:
                                break;
                        case SWT.MouseDown:
-                               updateSelectedItemIndex(item, event);
+                               updateSelectedItemIndexValue(item, event);
                                switch (event.button) {
                                case MOUSE_LEFT: {
-                                       popupMenuMouseDownImage(item, event);
-                                       enableKeyInsert(item, event);
+                                       enablePopupMenuMouseDownIcon(item, event);
+                                       updateKeyboardInputStatus(item, event);
                                        break;
                                }
                                case MOUSE_RIGHT: {
-                                       popupMenuMouseDownSequenceColumn(item, event);
+                                       openPoppupMenuMouseDownSequenceColumn(item, event);
                                        break;
                                }
                                default: {
@@ -195,7 +196,6 @@ public class ReplayEditTable extends DATableComposite {
                        }
                }
        };
-       
 
        private List<String> getSelectedItemText(int index) {
                List<String> text = new ArrayList<String>();
@@ -267,29 +267,32 @@ public class ReplayEditTable extends DATableComposite {
                tableRedraw();
        }
 
-       
-       private String getMouseSelectedItemOptionText(){
-               return table.getItem(getMouseSelectedTableItemIndex()).getText(6);
+       private String getMouseSelectedItemOptionText() {
+               return table.getItem(getMouseSelectedTableItemIndex()).getText(
+                               tableTextOptionColumnIndex);
        }
-       
-       private void setMouseSelectedItemOptionText(String text){
-               table.getItem(getMouseSelectedTableItemIndex()).setText(6, text);
+
+       private void setMouseSelectedItemOptionText(String text) {
+               table.getItem(getMouseSelectedTableItemIndex()).setText(
+                               tableTextOptionColumnIndex, text);
        }
-       
-       
-       private int getMouseSelectedTableItemIndex(){
+
+       private int getMouseSelectedTableItemIndex() {
                return mouseSelectedItemIndex;
        }
-       private int getMouseSelectedTableColumnIndex(){
+
+       private int getMouseSelectedTableColumnIndex() {
                return mouseSelectedColumnIndex;
        }
-       
-       private String getMouseSelectedTableItemText(){
-               return table.getItem(getMouseSelectedTableItemIndex()).getText(getMouseSelectedTableColumnIndex());
+
+       private String getMouseSelectedTableItemText() {
+               return table.getItem(getMouseSelectedTableItemIndex()).getText(
+                               getMouseSelectedTableColumnIndex());
        }
-       
-       private void setMouseSelectedTableItemText(String text){
-               table.getItem(getMouseSelectedTableItemIndex()).setText(getMouseSelectedTableColumnIndex(), text);
+
+       private void setMouseSelectedTableItemText(String text) {
+               table.getItem(getMouseSelectedTableItemIndex()).setText(
+                               getMouseSelectedTableColumnIndex(), text);
        }
 
        private void setItemSeqMenu() {
@@ -302,8 +305,11 @@ public class ReplayEditTable extends DATableComposite {
                        @Override
                        public void widgetSelected(DAPopupMenuItem menuItem) {
                                copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex());
-                               if(copyItemText.get(6).contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)){
-                                       copyItemText.get(6).replace(ReplayEditDialogDataManager.SELECTED_ITEM_COPY, "");
+                               if (copyItemText.get(tableTextOptionColumnIndex).contains(
+                                               ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
+                                       copyItemText.get(tableTextOptionColumnIndex).replace(
+                                                       ReplayEditDialogDataManager.SELECTED_ITEM_COPY,
+                                                       CommonConstants.EMPTY);
                                }
                                if (selectedCopyItemIndex >= 0) {
                                        disableCopyItem(selectedCopyItemIndex);
@@ -311,10 +317,9 @@ public class ReplayEditTable extends DATableComposite {
                                } else {
                                        disableCopyItem(selectedCutItemIndex);
                                }
-                               
+
                                selectedCutItemIndex = getMouseSelectedTableItemIndex();
                                enableCopyItem();
-               //              testPrintItemsText();
                        }
                });
                copyItem = new DAPopupMenuItem(popupMenu);
@@ -323,8 +328,11 @@ public class ReplayEditTable extends DATableComposite {
                        @Override
                        public void widgetSelected(DAPopupMenuItem menuItem) {
                                copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex());
-                               if(copyItemText.get(6).contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)){
-                                       copyItemText.get(6).replace(ReplayEditDialogDataManager.SELECTED_ITEM_COPY, "");
+                               if (copyItemText.get(tableTextOptionColumnIndex).contains(
+                                               ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
+                                       copyItemText.get(tableTextOptionColumnIndex).replace(
+                                                       ReplayEditDialogDataManager.SELECTED_ITEM_COPY,
+                                                       CommonConstants.EMPTY);
                                }
                                if (selectedCutItemIndex >= 0) {
                                        disableCopyItem(selectedCutItemIndex);
@@ -332,11 +340,9 @@ public class ReplayEditTable extends DATableComposite {
                                } else {
                                        disableCopyItem(selectedCopyItemIndex);
                                }
-                               
+
                                selectedCopyItemIndex = getMouseSelectedTableItemIndex();
-                               System.out.println("selectedCopyItemIndex : "+selectedCopyItemIndex);
                                enableCopyItem();
-               //              testPrintItemsText();
                        }
                });
                pasteItem = new DAPopupMenuItem(popupMenu);
@@ -345,18 +351,19 @@ public class ReplayEditTable extends DATableComposite {
                        @Override
                        public void widgetSelected(DAPopupMenuItem menuItem) {
                                if (selectedCopyItemIndex >= 0) {
-                                       replaceTableItems(getMouseSelectedTableItemIndex(), copyItemText);
+                                       replaceTableItems(getMouseSelectedTableItemIndex(),
+                                                       copyItemText);
                                        updateTableSequenceNumber();
                                        disableCopyItem(getMouseSelectedTableItemIndex());
                                } else if (selectedCutItemIndex >= 0) {
-                                       replaceTableItems(getMouseSelectedTableItemIndex(),copyItemText);
+                                       replaceTableItems(getMouseSelectedTableItemIndex(),
+                                                       copyItemText);
                                        table.remove(selectedCutItemIndex);
                                        updateTableSequenceNumber();
                                        selectedCutItemIndex = -1;
                                }
                                updateVaildState();
                                tableRedraw();
-               //              testPrintItemsText();
                        }
                });
 
@@ -365,24 +372,26 @@ public class ReplayEditTable extends DATableComposite {
                insertItem.addListener(new DAPopupMenuListener() {
                        @Override
                        public void widgetSelected(DAPopupMenuItem menuItem) {
-                               if(getCopyItemIndex() > -1){
+                               if (getCopyItemIndex() > -1) {
                                        if (selectedCopyItemIndex >= 0) {
-                                               addTableItems(getMouseSelectedTableItemIndex(), copyItemText);
+                                               addTableItems(getMouseSelectedTableItemIndex(),
+                                                               copyItemText);
                                        } else if (selectedCutItemIndex >= 0) {
-                                               disableCopyItem(selectedCutItemIndex+1);
-                                               addTableItems(getMouseSelectedTableItemIndex(), copyItemText);
+                                               disableCopyItem(selectedCutItemIndex + 1);
+                                               addTableItems(getMouseSelectedTableItemIndex(),
+                                                               copyItemText);
                                                table.remove(selectedCutItemIndex - 1);
                                                updateTableSequenceNumber();
-                                               selectedCutItemIndex =-1;
+                                               selectedCutItemIndex = -1;
                                        }
                                } else {
-                                       addTableItems(getMouseSelectedTableItemIndex(),
+                                       addTableItems(
+                                                       getMouseSelectedTableItemIndex(),
                                                        getSelectedItemText(getMouseSelectedTableItemIndex()));
                                }
                                updateTableSequenceNumber();
                                updateVaildState();
                                tableRedraw();
-       //                      testPrintItemsText();
                        }
                });
                deleteItem = new DAPopupMenuItem(popupMenu);
@@ -394,16 +403,16 @@ public class ReplayEditTable extends DATableComposite {
                                updateTableSequenceNumber();
                                updateVaildState();
                                tableRedraw();
-       //                      testPrintItemsText();
                        }
                });
        }
 
        private void enableCopyItem() {
                String itemOption = getMouseSelectedItemOptionText();
-               if(!itemOption.contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)){
-                       setMouseSelectedItemOptionText(
-                                       itemOption + ReplayEditDialogDataManager.SELECTED_ITEM_COPY);   
+               if (!itemOption
+                               .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
+                       setMouseSelectedItemOptionText(itemOption
+                                       + ReplayEditDialogDataManager.SELECTED_ITEM_COPY);
                }
        }
 
@@ -417,15 +426,14 @@ public class ReplayEditTable extends DATableComposite {
                                        ReplayEditDialogDataManager.SELECTED_ITEM_COPY,
                                        CommonConstants.EMPTY);
                }
-               table.getItem(index).setText(6, itemOption);
-               System.out.println("disableCopyItem index : "+index+ "itemOption : "+itemOption);
+               table.getItem(index).setText(tableTextOptionColumnIndex, itemOption);
        }
 
        private void setTyepMenu() {
-               typePopupMenu = new ReplayEditPopupMenu(table);
-               typePopupMenu.setMouseListener();
-               typePopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
-               DAPopupMenuItem cutItem = new DAPopupMenuItem(typePopupMenu);
+               eventTypePopupMenu = new ReplayEditPopupMenu(table);
+               eventTypePopupMenu.setMouseListener();
+               eventTypePopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAPopupMenuItem cutItem = new DAPopupMenuItem(eventTypePopupMenu);
                cutItem.setText(ReplayEditLabels.CONTEXT_TOUCH);
                cutItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -433,7 +441,7 @@ public class ReplayEditTable extends DATableComposite {
                                updateSelectPopupMenu(ReplayEditLabels.CONTEXT_TOUCH);
                        }
                });
-               DAPopupMenuItem copyItem = new DAPopupMenuItem(typePopupMenu);
+               DAPopupMenuItem copyItem = new DAPopupMenuItem(eventTypePopupMenu);
                copyItem.setText(ReplayEditLabels.CONTEXT_KEY);
                copyItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -444,10 +452,10 @@ public class ReplayEditTable extends DATableComposite {
        }
 
        private void setKeyMenu() {
-               keyValuePopupMenu = new ReplayEditPopupMenu(table);
-               keyValuePopupMenu.setMouseListener();
-               keyValuePopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
-               DAPopupMenuItem menuItem = new DAPopupMenuItem(keyValuePopupMenu);
+               eventKeyPopupMenu = new ReplayEditPopupMenu(table);
+               eventKeyPopupMenu.setMouseListener();
+               eventKeyPopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+               DAPopupMenuItem menuItem = new DAPopupMenuItem(eventKeyPopupMenu);
                menuItem.setText(ReplayEditLabels.CONTEXT_KEY_MENU);
                menuItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -455,7 +463,7 @@ public class ReplayEditTable extends DATableComposite {
                                updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_MENU);
                        }
                });
-               DAPopupMenuItem homeItem = new DAPopupMenuItem(keyValuePopupMenu);
+               DAPopupMenuItem homeItem = new DAPopupMenuItem(eventKeyPopupMenu);
                homeItem.setText(ReplayEditLabels.CONTEXT_KEY_HOME);
                homeItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -463,7 +471,7 @@ public class ReplayEditTable extends DATableComposite {
                                updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_HOME);
                        }
                });
-               DAPopupMenuItem backItem = new DAPopupMenuItem(keyValuePopupMenu);
+               DAPopupMenuItem backItem = new DAPopupMenuItem(eventKeyPopupMenu);
                backItem.setText(ReplayEditLabels.CONTEXT_KEY_BACK);
                backItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -471,7 +479,7 @@ public class ReplayEditTable extends DATableComposite {
                                updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_BACK);
                        }
                });
-               DAPopupMenuItem powerItem = new DAPopupMenuItem(keyValuePopupMenu);
+               DAPopupMenuItem powerItem = new DAPopupMenuItem(eventKeyPopupMenu);
                powerItem.setText(ReplayEditLabels.CONTEXT_KEY_POWER);
                powerItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -479,7 +487,7 @@ public class ReplayEditTable extends DATableComposite {
                                updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_POWER);
                        }
                });
-               DAPopupMenuItem volumeUpItem = new DAPopupMenuItem(keyValuePopupMenu);
+               DAPopupMenuItem volumeUpItem = new DAPopupMenuItem(eventKeyPopupMenu);
                volumeUpItem.setText(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP);
                volumeUpItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -487,7 +495,7 @@ public class ReplayEditTable extends DATableComposite {
                                updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP);
                        }
                });
-               DAPopupMenuItem volumeDownItem = new DAPopupMenuItem(keyValuePopupMenu);
+               DAPopupMenuItem volumeDownItem = new DAPopupMenuItem(eventKeyPopupMenu);
                volumeDownItem.setText(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN);
                volumeDownItem.addListener(new DAPopupMenuListener() {
                        @Override
@@ -499,11 +507,11 @@ public class ReplayEditTable extends DATableComposite {
 
        private void setItemKeyText(Event event) {
                boolean iskeyInput = false;
-               if (mouseSelectedItem) {
+               if (isMouseSelectedTableItem) {
                        if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
                                        ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME)
-                                       || getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                                       ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
+                                       || getColumnName(getMouseSelectedTableColumnIndex())
+                                                       .equals(ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
                                if (KeyEvent.VK_0 <= event.character
                                                && event.character <= KeyEvent.VK_9) {
                                        iskeyInput = true;
@@ -531,10 +539,10 @@ public class ReplayEditTable extends DATableComposite {
 
                                setMouseSelectedTableItemText(inputString);
                                tableRedraw();
-                       } else if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                       ReplayEditLabels.TABLE_COLUMN_VALUE1)
-                                       || getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                                       ReplayEditLabels.TABLE_COLUMN_VALUE2)) {
+                       } else if (getColumnName(getMouseSelectedTableColumnIndex())
+                                       .equals(ReplayEditLabels.TABLE_COLUMN_VALUE1)
+                                       || getColumnName(getMouseSelectedTableColumnIndex())
+                                                       .equals(ReplayEditLabels.TABLE_COLUMN_VALUE2)) {
                                if (KeyEvent.VK_0 <= event.character
                                                && event.character <= KeyEvent.VK_9) {
                                        iskeyInput = true;
@@ -584,7 +592,8 @@ public class ReplayEditTable extends DATableComposite {
                                                getMouseSelectedTableColumnIndex() + 1,
                                                ReplayEditLabels.CONTEXT_KEY_MENU);
                                table.getItem(getMouseSelectedTableItemIndex()).setText(
-                                               getMouseSelectedTableColumnIndex() + 2, CommonConstants.DASH);
+                                               getMouseSelectedTableColumnIndex() + 2,
+                                               CommonConstants.DASH);
                        }
                } else if (text.contains(ReplayEditLabels.CONTEXT_TOUCH)) {
                        if (selectedPreTouchContext.size() > 3
@@ -614,36 +623,42 @@ public class ReplayEditTable extends DATableComposite {
                        selectedPreKeyContext.clear();
                        selectedPreKeyContext.add(Integer
                                        .toString(getMouseSelectedTableItemIndex()));
-                       selectedPreKeyContext.add(table.getItem(getMouseSelectedTableItemIndex())
-                                       .getText(getMouseSelectedTableColumnIndex()));
-                       selectedPreKeyContext.add(table.getItem(getMouseSelectedTableItemIndex())
-                                       .getText(getMouseSelectedTableColumnIndex() + 1));
-                       selectedPreKeyContext.add(table.getItem(getMouseSelectedTableItemIndex())
-                                       .getText(getMouseSelectedTableColumnIndex() + 2));
+                       selectedPreKeyContext.add(table.getItem(
+                                       getMouseSelectedTableItemIndex()).getText(
+                                       getMouseSelectedTableColumnIndex()));
+                       selectedPreKeyContext.add(table.getItem(
+                                       getMouseSelectedTableItemIndex()).getText(
+                                       getMouseSelectedTableColumnIndex() + 1));
+                       selectedPreKeyContext.add(table.getItem(
+                                       getMouseSelectedTableItemIndex()).getText(
+                                       getMouseSelectedTableColumnIndex() + 2));
                } else if (text.equals(ReplayEditLabels.CONTEXT_TOUCH)) {
                        selectedPreTouchContext.clear();
                        selectedPreTouchContext.add(Integer
                                        .toString(getMouseSelectedTableItemIndex()));
                        selectedPreTouchContext.add(table.getItem(
                                        getMouseSelectedTableItemIndex()).getText(
-                                                       getMouseSelectedTableColumnIndex()));
+                                       getMouseSelectedTableColumnIndex()));
                        selectedPreTouchContext.add(table.getItem(
                                        getMouseSelectedTableItemIndex()).getText(
-                                                       getMouseSelectedTableColumnIndex() + 1));
+                                       getMouseSelectedTableColumnIndex() + 1));
                        selectedPreTouchContext.add(table.getItem(
                                        getMouseSelectedTableItemIndex()).getText(
-                                                       getMouseSelectedTableColumnIndex() + 2));
+                                       getMouseSelectedTableColumnIndex() + 2));
                }
        }
 
        private void setPreSelectedContext(String text) {
                if (text.equals(ReplayEditLabels.CONTEXT_KEY)) {
                        table.getItem(getMouseSelectedTableItemIndex()).setText(
-                                       getMouseSelectedTableColumnIndex(), selectedPreKeyContext.get(1));
+                                       getMouseSelectedTableColumnIndex(),
+                                       selectedPreKeyContext.get(1));
                        table.getItem(getMouseSelectedTableItemIndex()).setText(
-                                       getMouseSelectedTableColumnIndex() + 1, selectedPreKeyContext.get(2));
+                                       getMouseSelectedTableColumnIndex() + 1,
+                                       selectedPreKeyContext.get(2));
                        table.getItem(getMouseSelectedTableItemIndex()).setText(
-                                       getMouseSelectedTableColumnIndex() + 2, selectedPreKeyContext.get(3));
+                                       getMouseSelectedTableColumnIndex() + 2,
+                                       selectedPreKeyContext.get(3));
                } else if (text.equals(ReplayEditLabels.CONTEXT_TOUCH)) {
                        table.getItem(getMouseSelectedTableItemIndex()).setText(
                                        getMouseSelectedTableColumnIndex(),
@@ -658,16 +673,15 @@ public class ReplayEditTable extends DATableComposite {
 
        }
 
-       private void upadteMouseOverColumn(GridItem item, Event event) {
+       private void upadteMouseOverTableItemsStatus(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 = getMouseSelectedTableColumnIndex();
-//             String selectedText = getMouseSelectedTableItemText();
 
                int selectedColumnIndex = getMouseColumnIdnex(item, event);
+
                String selectedText = item.getText(selectedColumnIndex);
 
                if (selectedText.equals(CommonConstants.DASH)) {
@@ -681,78 +695,63 @@ public class ReplayEditTable extends DATableComposite {
                } 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;
-                       }
-               }
                item.setChecked(selectedColumnIndex, true);
                tableRedraw();
        }
-       private void updateTableItems(){
-               
-               if(!mouseSelectedItem){
+
+       private void updateMouseOverTableItemsText() {
+               if (!isMouseSelectedTableItem) {
                        return;
                }
-               
-               if (!updateRollbackText()) {
-                       updateNextItemsSavedTime();
-               }
-               
+
+               updateRollbackText();
+               updateNextItemsSavedTime();
+
                updateVaildState();
-               mouseSelectedItem = false;
+               isMouseSelectedTableItem = false;
                tableRedraw();
-               
+
        }
 
        private boolean updateVaildItems() {
                int nSize = table.getItemCount();
                long preEventTime = 0;
                boolean isVaild = true;
-               System.out.println("--------------------");
                for (int i = 0; i < nSize; i++) {
                        long mouseDowntime = getLongTableTime(table.getItem(i).getText(1));
                        long mouseUptime = getLongTableTime(table.getItem(i).getText(2));
 
-                       System.out.println("mouseDowntime : " + mouseDowntime
-                                       + " mouseUptime : " + mouseUptime);
                        if (mouseUptime < mouseDowntime) {
                                isVaild = false;
-                               System.out.println("111 mouseUptime : " + mouseUptime
-                                               + " mouseDowntime : " + mouseDowntime);
-                       } else if (mouseUptime < preEventTime) {
+                       } else if (mouseDowntime < preEventTime) {
                                isVaild = false;
-                               System.out.println("222 mouseUptime : " + mouseUptime
-                                               + " preEventTime : " + preEventTime);
                        } else {
-                               String itemOption = table.getItem(i).getText(6);
+                               String itemOption = table.getItem(i).getText(
+                                               tableTextOptionColumnIndex);
                                if (itemOption
                                                .contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) {
                                        String removeItemOption = itemOption.replace(
                                                        ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE,
                                                        CommonConstants.EMPTY);
-                                       System.out
-                                                       .println("removeItemOption : " + removeItemOption);
-                                       table.getItem(i).setText(6, removeItemOption);
+                                       table.getItem(i).setText(tableTextOptionColumnIndex,
+                                                       removeItemOption);
                                }
                        }
                        preEventTime = mouseUptime;
 
                        if (!isVaild) {
-                               String itemOption = table.getItem(i).getText(6);
+                               String itemOption = table.getItem(i).getText(
+                                               tableTextOptionColumnIndex);
                                if (!itemOption
                                                .contains(ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE)) {
                                        table.getItem(i)
                                                        .setText(
-                                                                       6,
+                                                                       tableTextOptionColumnIndex,
                                                                        itemOption
                                                                                        + ReplayEditDialogDataManager.ITEM_TIME_VAILD_FALSE);
                                }
                        }
                }
-               testPrintItemsText();
                return isVaild;
        }
 
@@ -767,8 +766,8 @@ public class ReplayEditTable extends DATableComposite {
                        strTime = strTime.replace(CommonConstants.DOT,
                                        CommonConstants.EMPTY);
                }
-               if(strTime.length() == 1){
-                       strTime +=0;
+               if (strTime.length() == 1) {
+                       strTime += 0;
                }
                return Long.parseLong(strTime);
        }
@@ -797,6 +796,10 @@ public class ReplayEditTable extends DATableComposite {
                int nSize = table.getItemCount();
                int startItem = getMouseSelectedTableItemIndex();
                for (int i = startItem; i < nSize; i++) {
+                       if (!table.getItem(i).getText(tableTextOptionColumnIndex)
+                                       .contains(ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
+                               continue;
+                       }
                        long mouseDowntime = getLongTableTime(table.getItem(i).getText(1));
                        long mouseUptime = getLongTableTime(table.getItem(i).getText(2));
                        mouseDowntime += addTime;
@@ -810,18 +813,17 @@ public class ReplayEditTable extends DATableComposite {
                                table.getItem(i).setText(2, getStrTableTime(mouseUptime));
                        }
                }
-
        }
 
        private void updateNextItemsSavedTime() {
-               if (mouseSelectedItem) {
+               if (isMouseSelectedTableItem) {
                        String savedString = getMouseSelectedTableItemText();
                        if (savedString.length() > 0) {
                                if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
                                                ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME)) {
                                        addTableTime(true);
-                               } else if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                               ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
+                               } else if (getColumnName(getMouseSelectedTableColumnIndex())
+                                               .equals(ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
                                        addTableTime(false);
                                }
                        }
@@ -829,7 +831,7 @@ public class ReplayEditTable extends DATableComposite {
        }
 
        private boolean updateRollbackText() {
-               if (mouseSelectedItem) {
+               if (isMouseSelectedTableItem) {
                        String savedString = getMouseSelectedTableItemText();
                        boolean isResetText = false;
                        if (savedString.length() == 0) {
@@ -843,7 +845,7 @@ public class ReplayEditTable extends DATableComposite {
                                        if (getMouseSelectedTableItemIndex() > 0) {
                                                preItemmouseUpTime = table.getItem(
                                                                getMouseSelectedTableItemIndex() - 1).getText(
-                                                                               getMouseSelectedTableColumnIndex() + 1);
+                                                               getMouseSelectedTableColumnIndex() + 1);
                                        }
                                        String mouseDownTime = updateDotChartAtTime();
                                        int comparePreItemTime = compareTime(preItemmouseUpTime,
@@ -851,46 +853,29 @@ public class ReplayEditTable extends DATableComposite {
                                        if (comparePreItemTime >= 0) {
                                                isResetText = true;
                                        }
-//                                     String mouseUpTime = table.getItem(
-//                                                     mouseSelectedItemIndex - 1).getText(
-//                                                     mouseSelectedColumnIndex + 2);
-//                                     int compareSameItemTime = compareTime(mouseDownTime,
-//                                                     mouseUpTime);
-//                                     if (compareSameItemTime >= 0) {
-//                                             isResetText = true;
-//                                     }
-
-                               } else if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                               ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
+
+                               } else if (getColumnName(getMouseSelectedTableColumnIndex())
+                                               .equals(ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
                                        String mouseUpTime = updateDotChartAtTime();
                                        if (table.getItemCount() <= getMouseSelectedTableItemIndex()) {
                                                isResetText = false;
                                        } else {
                                                String sameItemMouseDownTime = table.getItem(
                                                                getMouseSelectedTableItemIndex()).getText(
-                                                                               getMouseSelectedTableColumnIndex()-1);
+                                                               getMouseSelectedTableColumnIndex() - 1);
                                                int compareSameItemTime = compareTime(
                                                                sameItemMouseDownTime, mouseUpTime);
                                                if (compareSameItemTime >= 0) {
                                                        isResetText = true;
                                                }
-
-//                                             String nextItemMouseDownTime = table.getItem(
-//                                                             mouseSelectedItemIndex).getText(
-//                                                             mouseSelectedColumnIndex);
-//                                             int compareNextItemTime = compareTime(mouseUpTime,
-//                                                             nextItemMouseDownTime);
-//                                             if (compareNextItemTime >= 0) {
-//                                                     isResetText = true;
-//                                             }
                                        }
-                               } else if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                               ReplayEditLabels.TABLE_COLUMN_VALUE1)) {
+                               } else if (getColumnName(getMouseSelectedTableColumnIndex())
+                                               .equals(ReplayEditLabels.TABLE_COLUMN_VALUE1)) {
                                        if (savedString.length() > 7) {
                                                isResetText = true;
                                        }
-                               } else if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
-                                               ReplayEditLabels.TABLE_COLUMN_VALUE2)) {
+                               } else if (getColumnName(getMouseSelectedTableColumnIndex())
+                                               .equals(ReplayEditLabels.TABLE_COLUMN_VALUE2)) {
                                        if (savedString.length() > 7) {
                                                isResetText = true;
                                        }
@@ -907,7 +892,6 @@ public class ReplayEditTable extends DATableComposite {
        private int compareTime(String firstTime, String secondTime) {
                StringBuffer firstTimeBuffer = new StringBuffer(firstTime);
                StringBuffer highTimeBuffer = new StringBuffer(secondTime);
-               System.out.println("firstTimeBuffer : "+firstTimeBuffer+" highTimeBuffer : "+highTimeBuffer);
                firstTimeBuffer.deleteCharAt(firstTime.length() - 1);
                firstTimeBuffer.deleteCharAt(firstTime.length() - 3);
                highTimeBuffer.deleteCharAt(secondTime.length() - 1);
@@ -939,8 +923,7 @@ public class ReplayEditTable extends DATableComposite {
                return chagneString;
        }
 
-       private void updateSelectedItemIndex(GridItem item, Event event) {
-
+       private void updateSelectedItemIndexValue(GridItem item, Event event) {
                GridColumn[] columns = table.getColumns();
                mouseSelectedItemIndex = -1;
                mouseSelectedColumnIndex = -1;
@@ -966,13 +949,10 @@ public class ReplayEditTable extends DATableComposite {
                }
        }
 
-       private void enableKeyInsert(GridItem item, Event event) {
-               if (!item.getText(6).contains(
+       private void updateKeyboardInputStatus(GridItem item, Event event) {
+               if (!item.getText(tableTextOptionColumnIndex).contains(
                                ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
                        deleteItem.setEnabled(false);
-               } else if (getMouseSelectedTableItemIndex() == 0
-                               && item.getText(getMouseSelectedTableColumnIndex()).contains(
-                                               ReplayEditLabels.CONTEXT_VALUE_S)) {
                        return;
                }
 
@@ -980,13 +960,13 @@ public class ReplayEditTable extends DATableComposite {
                if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
                                || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)
                                || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
-                       mouseSelectedItem = true;
+                       isMouseSelectedTableItem = true;
                        savedItemTextForReset = getMouseSelectedTableItemText();
                        setMouseSelectedTableItemText(CommonConstants.EMPTY);
                }
        }
 
-       private void popupMenuMouseDownImage(GridItem item, Event event) {
+       private void enablePopupMenuMouseDownIcon(GridItem item, Event event) {
                if (mouseSelectedPreColunmEndX <= event.x
                                && event.x <= mouseSelectedPreColunmEndX + 20
                                && getMouseSelectedTableItemIndex() != -1) {
@@ -995,12 +975,13 @@ public class ReplayEditTable extends DATableComposite {
                                        + mouseSelectedPreColunmEndX + 8;
 
                        popupPt.y = table.getShell().getBounds().y + table.getItemHeight()
-                                       * getMouseSelectedTableItemIndex() + 145;
+                                       * getMouseSelectedTableItemIndex() + 160;
 
-                       String selectedText = item.getText(getMouseSelectedTableColumnIndex());
+                       String selectedText = item
+                                       .getText(getMouseSelectedTableColumnIndex());
                        if (selectedText.contains(ReplayEditLabels.CONTEXT_TOUCH)
                                        || selectedText.contains(ReplayEditLabels.CONTEXT_KEY)) {
-                               typePopupMenu.open(typePopupMenu.getTopShell(), popupPt.x,
+                               eventTypePopupMenu.open(eventTypePopupMenu.getTopShell(), popupPt.x,
                                                popupPt.y);
                                savedSelectedContext(selectedText);
                        } else if (selectedText.contains(ReplayEditLabels.CONTEXT_KEY_MENU)
@@ -1012,7 +993,7 @@ public class ReplayEditTable extends DATableComposite {
                                                        .contains(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP)
                                        || selectedText
                                                        .contains(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN)) {
-                               keyValuePopupMenu.open(keyValuePopupMenu.getTopShell(),
+                               eventKeyPopupMenu.open(eventKeyPopupMenu.getTopShell(),
                                                popupPt.x, popupPt.y);
                        } else {
 
@@ -1020,8 +1001,8 @@ public class ReplayEditTable extends DATableComposite {
                }
        }
 
-       private void popupMenuMouseDownSequenceColumn(GridItem item, Event event) {
-               if (!item.getText(6).contains(
+       private void openPoppupMenuMouseDownSequenceColumn(GridItem item, Event event) {
+               if (!item.getText(tableTextOptionColumnIndex).contains(
                                ReplayEditDialogDataManager.MODIFIABILITY_TRUE)) {
                        if (selectedCutItemIndex > 0 || selectedCopyItemIndex > 0) {
                                insertItem.setEnabled(true);
@@ -1033,10 +1014,6 @@ public class ReplayEditTable extends DATableComposite {
                        pasteItem.setEnabled(false);
                        deleteItem.setEnabled(false);
 
-               } else if (getMouseSelectedTableItemIndex() == 0) {
-                       cutItem.setEnabled(false);
-                       deleteItem.setEnabled(false);
-                       pasteItem.setEnabled(false);
                } else if (getCopyItemIndex() > -1) {
                        copyItem.setEnabled(true);
                        cutItem.setEnabled(true);
@@ -1059,12 +1036,13 @@ public class ReplayEditTable extends DATableComposite {
                        popupMenu.closeChild();
                }
        }
-       
-       private int getCopyItemIndex(){
+
+       private int getCopyItemIndex() {
                int nSize = table.getItemCount();
                int index = -1;
                for (int i = 0; i < nSize; i++) {
-                       if(table.getItem(i).getText(6).contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)){
+                       if (table.getItem(i).getText(tableTextOptionColumnIndex)
+                                       .contains(ReplayEditDialogDataManager.SELECTED_ITEM_COPY)) {
                                index = i;
                                break;
                        }
@@ -1072,35 +1050,9 @@ public class ReplayEditTable extends DATableComposite {
                return index;
        }
 
-       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(0).trim();
-                       for (int i = 0; i < table.getItemCount(); i++) {
-                               if (Integer.parseInt(seq) == i) {
-                                       table.getItem(i).setChecked(6, true);
-                               } else {
-                                       table.getItem(i).setChecked(6, false);
-                               }
-                       }
-               } else {
-                       for (int i = 0; i < table.getItemCount(); i++) {
-                               table.getItem(i).setChecked(6, false);
-                       }
-               }
-               if (event.y > table.getItemHeight() * (table.getItemCount() + 1)) {
-                       for (int i = 0; i < table.getItemCount(); i++) {
-                               table.getItem(i).setChecked(6, false);
-                       }
-               }
-       }
-
        private int getMouseColumnIdnex(GridItem item, Event event) {
+               nowMousePositionX = event.x;
+               nowMousePositionY = event.y;
                GridColumn[] columns = table.getColumns();
                int size = columns.length;
                int preColunmStartX = 0;
@@ -1116,52 +1068,41 @@ public class ReplayEditTable extends DATableComposite {
        }
 
        private void tableRedraw() {
-               table.redraw();
-               setTableItemsList();
+               table.redraw(nowMousePositionX - 100, nowMousePositionY - 100, 100, 100, false);
        }
-       
-       private void updateVaildState(){
-               if(updateVaildItems()){
+
+       private void updateVaildState() {
+               if (updateVaildItems()) {
                        enableSaveButton();
-               }else{
+               } else {
                        disableSaveButton();
                }
                table.redraw();
        }
 
        private void enableSaveButton() {
-               if(null != ReplayEditDialogDataManager.getInstance().getOkButton()){
-                       ReplayEditDialogDataManager.getInstance().getOkButton().setButtonEnabled(true);
+               if (null != ReplayEditDialogDataManager.getInstance().getOkButton()) {
+                       ReplayEditDialogDataManager.getInstance().getOkButton()
+                                       .setButtonEnabled(true);
                }
-               if(null != ReplayEditDialogDataManager.getInstance().getSaveButton()){
-                       ReplayEditDialogDataManager.getInstance().getSaveButton().setButtonEnabled(true);
+               if (null != ReplayEditDialogDataManager.getInstance().getSaveButton()) {
+                       ReplayEditDialogDataManager.getInstance().getSaveButton()
+                                       .setButtonEnabled(true);
                }
        }
 
        private void disableSaveButton() {
-               if(null != ReplayEditDialogDataManager.getInstance().getOkButton()){
-                       ReplayEditDialogDataManager.getInstance().getOkButton().setButtonEnabled(false);
+               if (null != ReplayEditDialogDataManager.getInstance().getOkButton()) {
+                       ReplayEditDialogDataManager.getInstance().getOkButton()
+                                       .setButtonEnabled(false);
                }
-               if(null != ReplayEditDialogDataManager.getInstance().getSaveButton()){
-                       ReplayEditDialogDataManager.getInstance().getSaveButton().setButtonEnabled(false);
+               if (null != ReplayEditDialogDataManager.getInstance().getSaveButton()) {
+                       ReplayEditDialogDataManager.getInstance().getSaveButton()
+                                       .setButtonEnabled(false);
                }
 
        }
 
-       private void setTableItemsList() {
-               List<List<String>> gridItemTextList = new ArrayList<List<String>>();
-               for (int i = 0; i < table.getItemCount(); i++) {
-                       List<String> text = new ArrayList<String>();
-                       int size = table.getColumns().length;
-                       for (int j = 0; j < size + 1; j++) {
-                               text.add(table.getItem(i).getText(j));
-                       }
-                       gridItemTextList.add(text);
-               }
-               ReplayEditDialogDataManager.getInstance().setTableItemsList(
-                               gridItemTextList);
-       }
-
        @Override
        public void setColumns(String[] columnNames) {
                this.columnNames = columnNames;
@@ -1183,24 +1124,24 @@ public class ReplayEditTable extends DATableComposite {
                        return CommonConstants.EMPTY;
                }
        }
-       
-       public void testPrintItemsText(){
-               System.out.println("getMouseSelectedTableItemText() : "
-                               + getMouseSelectedTableItemText()
-                               + " getMouseSelectedTableItemIndex() : "
-                               + getMouseSelectedTableItemIndex()
-                               + " getMouseSelectedTableColumnIndex() : "
-                               + getMouseSelectedTableColumnIndex()
-                               + " getMouseSelectedItemOptionText() : "
-                               + getMouseSelectedItemOptionText());
-               int nSize = table.getItemCount();
-               for (int i = 0; i < nSize; i++) {
-                       System.out.print("index : "+i);
-                       for(int j = 0 ; j  <= table.getColumns().length ; j++){
-                               System.out.print("("+j+" : "+table.getItem(i).getText(j)+")");
-                       }
-                       System.out.println();
-               }
-       }
+
+       // public void testPrintItemsText(){
+       // System.out.println("getMouseSelectedTableItemText() : "
+       // + getMouseSelectedTableItemText()
+       // + " getMouseSelectedTableItemIndex() : "
+       // + getMouseSelectedTableItemIndex()
+       // + " getMouseSelectedTableColumnIndex() : "
+       // + getMouseSelectedTableColumnIndex()
+       // + " getMouseSelectedItemOptionText() : "
+       // + getMouseSelectedItemOptionText());
+       // int nSize = table.getItemCount();
+       // for (int i = 0; i < nSize; i++) {
+       // System.out.print("index : "+i);
+       // for(int j = 0 ; j <= table.getColumns().length ; j++){
+       // System.out.print("("+j+" : "+table.getItem(i).getText(j)+")");
+       // }
+       // System.out.println();
+       // }
+       // }
 
 }
index ca312f9..1e2d3c9 100644 (file)
@@ -47,6 +47,9 @@ public class ReplayEditTableData {
 
        private String getStrTime(Long time) {
                String reverseStrTime = reverseString(Long.toString(time));
+               if(reverseStrTime.length() == 6){
+                       reverseStrTime += 0;
+               }
                String strTime = CommonConstants.EMPTY;
                for (int i = 5; i < reverseStrTime.length(); i++) {
                        strTime += reverseStrTime.charAt(i);
@@ -54,7 +57,8 @@ public class ReplayEditTableData {
                                strTime += CommonConstants.DOT;
                        }
                }
-               return reverseString(strTime) + ReplayEditLabels.CONTEXT_VALUE_S;
+               String returnTime = reverseString(strTime) + ReplayEditLabels.CONTEXT_VALUE_S;
+               return returnTime;
        }
 
        private String reverseString(String str) {
@@ -64,6 +68,10 @@ public class ReplayEditTableData {
        public void setEventMouseUpTime(long eventMouseUpTime) {
                this.eventMouseUpTime = eventMouseUpTime;
        }
+       
+       public long getLongEventMouseUpTime() {
+               return this.eventMouseUpTime;
+       }
 
        public String getModifiabilityEvent() {
                if (modifiabilityEvent) {
index 6af174f..052462a 100644 (file)
@@ -44,7 +44,7 @@ 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;
+       private DATableComposite replayTable = null;
 
        int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
                        AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID,
@@ -77,26 +77,26 @@ public class ReplayEditTableView extends DAPageComposite {
                tableComp.setBackground(ColorResources.DIALOG_BG_UPPER);
 
                // Table
-               featuresTable = new ReplayEditTable(tableComp, SWT.BORDER
+               replayTable = 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(
+               replayTable.setTableName(ReplayEditLabels.TABLE_TITLE);
+               replayTable.setComparator(new DefaultTableComparator());
+               replayTable.setSortTypes(sortTypes);
+               replayTable.setColumns(columnNames);
+               replayTable.setColumnSize(columnSizes);
+               replayTable.setColumnVisibility(columnVisibility);
+               replayTable.setTableToolTipEnable(false);
+               replayTable.getTable().addSelectionListener(
                                featureTableSelectionListener);
-               featuresTable.getTable().addMouseListener(mouseListener);
+               replayTable.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);
+               replayTable.setLayoutData(data);
 
-               featuresTable.updateTable();
+               replayTable.updateTable();
        }
 
        private SelectionListener featureTableSelectionListener = new SelectionListener() {
@@ -127,5 +127,9 @@ public class ReplayEditTableView extends DAPageComposite {
                public void mouseDoubleClick(MouseEvent e) {
                }
        };
+       
+       public DATableComposite getReplayTable(){
+               return this.replayTable;
+       }
 
 }
\ No newline at end of file