[Title] add feature replay editor
authorHyunjong,park <phjwithyou.park@samsung.com>
Tue, 10 Dec 2013 05:27:26 +0000 (14:27 +0900)
committerHyunjong,park <phjwithyou.park@samsung.com>
Tue, 10 Dec 2013 05:27:26 +0000 (14:27 +0900)
[Desc.] selected mouse point by snapshot
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/DBTableManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditDialogDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapshotDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditSnapshotTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/replayEditor/ReplayEditTable.java

index b1d2e3e..43d8223 100644 (file)
@@ -68,7 +68,7 @@ public class DBTableManager {
        public static int TABLE_COUNT = 12;
 
        public static final String EMPTY = CommonConstants.EMPTY;
-       public static final String TEXT = "VARCHAR(128)";//$NON-NLS-1$
+       public static final String TEXT = "VARCHAR(256)";//$NON-NLS-1$
        public static final String INTEGER = "INTEGER";//$NON-NLS-1$
        public static final String LONG = "bigint";//$NON-NLS-1$
        public static final String NOT_NULL = "not null";//$NON-NLS-1$
index 78481ca..858f237 100755 (executable)
@@ -283,6 +283,7 @@ public class SqlManager {
                                        System.out.println("query : " + createTableQuery);
                                }
                                stat.executeUpdate(createTableQuery);
+                               executeCreateIndexTable(stat, tableName, "time");//$NON-NLS-1$//$NON-NLS-2$
                        }
                } catch (SQLException e) {
                        e.printStackTrace();
@@ -362,7 +363,6 @@ public class SqlManager {
                                        System.out.println("table create failed..."
                                                        + info.getTableName());
                                }
-                               executeCreateIndexTable(stat, info.getTableName(), "time");//$NON-NLS-1$//$NON-NLS-2$
                        }
                } catch (SQLException e) {
                        e.printStackTrace();
index 7977ece..f06c16b 100644 (file)
@@ -387,6 +387,9 @@ public class FileDataMaker {
        }
 
        private void chartFilteringByPId() {
+               if(null == board || null == board.getChartComposite()){
+                       return;
+               }
                int selectedPid = ToolbarArea.getInstance().getSelectedPid();
                boolean isCheck = false;
 
index b2cbb19..77aaea1 100644 (file)
@@ -549,6 +549,9 @@ public class NetworkDataMaker {
        }
 
        private void chartFilteringByPId() {
+               if (null == board || null == board.getChartComposite()) {
+                       return;
+               }
                int selectedPid = ToolbarArea.getInstance().getSelectedPid();
                boolean isCheck = false;
 
index 3cbad1c..d0acc2f 100644 (file)
@@ -415,7 +415,7 @@ public class ReplayEditDialogDataManager {
                        strPoint = strPoint.replace(ReplayEditLabels.CONTEXT_VALUE_Y,
                                        CommonConstants.EMPTY);
                }
-               return strPoint;
+               return strPoint.trim();
        }
 
        public long getTimeValue(long sec, long nano) {
@@ -539,8 +539,8 @@ public class ReplayEditDialogDataManager {
                                .get(EVENT_MOUSE_UP_TIME_TABLE_INDEX));
                DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
                DATime mouseUpTime = getDATimeValue(Long.parseLong(itemMouseUpTime));
-               String itemValue1 = item.get(EVENT_VALUE1_TABLE_INDEX);
-               String itemValue2 = item.get(EVENT_VALUE2_TABLE_INDEX);
+               String itemValue1 = item.get(EVENT_VALUE1_TABLE_INDEX).trim();
+               String itemValue2 = item.get(EVENT_VALUE2_TABLE_INDEX).trim();
 
                List<List<String>> dbKeyDataList = new ArrayList<List<String>>();
                for (int i = 0; i < 7; i++) {
index 2726260..5839f8d 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.toolbar.replayEditor;
 
+import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.SnapshotConstants;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
@@ -54,8 +56,11 @@ public class ReplayEditSnapshotDialog extends DAMessageBox {
        private int[] columnSizes = { SnapshotConstants.DEFAULT_IMAGE_WIDTH + 15 };
        private boolean[] columnVisibility = { true };
 
-       public ReplayEditSnapshotDialog(Shell parent) {
+       protected GridItem item = null;
+
+       public ReplayEditSnapshotDialog(Shell parent, GridItem item) {
                super(parent);
+               this.item = item;
        }
 
        protected boolean run() {
@@ -115,12 +120,30 @@ public class ReplayEditSnapshotDialog extends DAMessageBox {
 
                @Override
                public void mouseUp(MouseEvent e) {
-                       // TODO Auto-generated method stub
+                       Point DisplyPt = Display.getCurrent().getCursorLocation();
+                       int tableX = snapShotTable.getTable().getShell().getBounds().x;
+                       int tableY = snapShotTable.getTable().getShell().getBounds().y;
+                       int imgClickX = DisplyPt.x - tableX - 5;
+                       int imgClickY = DisplyPt.y - tableY - 55;
+                       int drawImagWidth = SnapshotConstants.DEFAULT_IMAGE_WIDTH;
+                       int drawImagHeight = SnapshotConstants.DEFAULT_IMAGE_HEIGHT - 20;
+                       int imgWidth = 720;
+                       int imgHeight = 1280;
+
+                       if ((0 <= imgClickX && imgClickX <= drawImagWidth)
+                                       && (0 <= imgClickY && imgClickY <= drawImagHeight)) {
+                               int x = (imgClickX * imgWidth) / drawImagWidth;
+                               int y = ((imgClickY * imgHeight) / drawImagHeight) + 40;
+                               // System.out.println("x : " + x + " y : " + y);
+                               item.setText(4, "x : " + Integer.toString(x));
+                               item.setText(5, "y : " + Integer.toString(y));
+                               shell.dispose();
+                       }
+
                }
 
                @Override
                public void mouseDown(MouseEvent e) {
-                       // TODO Auto-generated method stub
                }
 
                @Override
index 7b4884c..3eff4fb 100644 (file)
@@ -33,10 +33,7 @@ import java.util.List;
 import org.eclipse.nebula.widgets.grid.GridColumn;
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.model.ImageInfo;
@@ -93,68 +90,8 @@ public class ReplayEditSnapshotTable extends DATableComposite {
 
        public ReplayEditSnapshotTable(Composite parent, int style) {
                super(parent, style);
-
-               table.addListener(SWT.Dispose, tableMouseListener);
-               table.addListener(SWT.MouseEnter, tableMouseListener);
-               table.addListener(SWT.MouseExit, tableMouseListener);
-               table.addListener(SWT.MouseMove, tableMouseListener);
-               table.addListener(SWT.MouseHover, tableMouseListener);
-               table.addListener(SWT.MouseUp, tableMouseListener);
-               table.addListener(SWT.MouseDown, tableMouseListener);
-               table.addListener(SWT.MouseDoubleClick, tableMouseListener);
-
-               table.getShell().getDisplay().addFilter(SWT.KeyUp, new Listener() {
-                       @Override
-                       public void handleEvent(Event event) {
-
-                       }
-               });
        }
 
-       private Listener tableMouseListener = new Listener() {
-               @Override
-               public void handleEvent(Event event) {
-                       final int MOUSE_LEFT = 1;
-                       final int MOUSE_RIGHT = 3;
-                       GridItem item = table.getItem(new Point(event.x, event.y));
-
-                       if (null == item) {
-                               return;
-                       }
-                       switch (event.type) {
-                       case SWT.Dispose:
-                               break;
-                       case SWT.MouseEnter:
-                               break;
-                       case SWT.MouseExit:
-                               break;
-                       case SWT.MouseMove:
-                               break;
-                       case SWT.MouseDoubleClick:
-                               break;
-                       case SWT.MouseHover:
-                               break;
-                       case SWT.MouseUp:
-                               break;
-                       case SWT.MouseDown:
-                               switch (event.button) {
-                               case MOUSE_LEFT: {
-                                       break;
-                               }
-                               case MOUSE_RIGHT: {
-                                       break;
-                               }
-                               default: {
-                                       break;
-                               }
-                               }
-                               break;
-                       default:
-                               break;
-                       }
-               }
-       };
-
        @Override
        public void setColumns(String[] columnNames) {
                int size = columnNames.length;
index 8c3e65b..ab87987 100644 (file)
@@ -1011,7 +1011,7 @@ public class ReplayEditTable extends DATableComposite {
                        int selectedIndexPosition = table.getSelectionIndex()
                                        - table.getVerticalBar().getSelection();
                        MousePt.y = tablePt.y + table.getItemHeight()
-                                       * selectedIndexPosition + 140;
+                                       * selectedIndexPosition + 135;
                        String selectedText = item
                                        .getText(getMouseSelectedTableColumnIndex());
                        if (selectedText.contains(ReplayEditLabels.CONTEXT_TOUCH)
@@ -1033,7 +1033,7 @@ public class ReplayEditTable extends DATableComposite {
                        } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
                                        || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
                                ReplayEditSnapshotDialog dialog = new ReplayEditSnapshotDialog(
-                                               table.getShell());
+                                               table.getShell(), item);
                                dialog.open();
                        } else {