[Title] input data corrupt bug fix
authorLee <jy.exe.lee@samsung.com>
Tue, 27 Nov 2012 07:30:09 +0000 (16:30 +0900)
committerLee <jy.exe.lee@samsung.com>
Tue, 27 Nov 2012 07:30:09 +0000 (16:30 +0900)
[Desc.] data making thread input corrupt bug fix
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/Logs.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAAnimation.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/RecorderXml.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/XmlData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ImageUtil.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ImageUtils.java [deleted file]

index 41ce889..360414f 100644 (file)
@@ -42,6 +42,7 @@ public class Logs {
                return logCenterId;
        }
 
+       // getLogs -> getRawLogs
        public List<List<String>> getLogs() {
                if (null == logs) {
                        logs = new ArrayList<List<String>>();
@@ -49,13 +50,23 @@ public class Logs {
                return logs;
        }
 
-       public void setLogs(List<List<String>> input)
-       {
+       public void setLogs(List<List<String>> input) {
                logs = input;
        }
 
-       public void setLogCenterId(int id)
-       {
+       public void setLogCenterId(int id) {
                logCenterId = id;
        }
+
+       // cloneLogs -> getLogs
+       public List<List<String>> getCloneLogs() {
+               List<List<String>> newLogs = new ArrayList<List<String>>();
+               int size = logs.size();
+               for (int i = 0; i < size; i++) {
+                       List<String> newLog = new ArrayList<String>();
+                       newLog.addAll(logs.get(i));
+                       newLogs.add(newLog);
+               }
+               return newLogs;
+       }
 }
index dbda9c7..30d009c 100644 (file)
@@ -86,7 +86,7 @@ public class FileChartView extends DAView {
                if (null == logs || logs.getLogs().size() == 0) {
                        return;
                }
-               List<List<String>> inputs = logs.getLogs();
+               List<List<String>> inputs = logs.getCloneLogs();
                FileChartManager.getInstance().getLogListQueue().putLog(inputs);
        }
 
index 9b02a6d..68a03c3 100644 (file)
@@ -1,3 +1,29 @@
+/*
+ *  Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
 package org.tizen.dynamicanalyzer.ui.widgets;
 
 import java.util.ArrayList;
index 03b34d6..8796064 100755 (executable)
@@ -1,11 +1,11 @@
 /*
- * SLPUnitTest
+ * Dynamic Analyzer
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * SangHyun Lee <sanghyunnim.lee@samsung.com>
  * Gun Kim <gune.kim@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
  * JuYoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
index 1ad0534..2f658fc 100644 (file)
@@ -1,11 +1,11 @@
 /*
- * SLPUnitTest
+ * Dynamic Analyzer
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
- * SangHyun Lee <sanghyunnim.lee@samsung.com>
  * Gun Kim <gune.kim@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
  * JuYoung Kim <j0.kim@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
index b92d8ae..8e3b6c6 100644 (file)
@@ -35,6 +35,9 @@ import java.io.IOException;
 
 import javax.imageio.ImageIO;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+
 public class ImageUtil {
 
        public static void resize(String origFile, String newFile, int width,
@@ -73,4 +76,77 @@ public class ImageUtil {
                }
        }
 
+       // FIXME : refactoring
+       public static ImageData rotate(ImageData srcData, int direction) {
+               int bytesPerPixel = srcData.bytesPerLine / srcData.width;
+               int destBytesPerLine = (direction == SWT.DOWN) ? srcData.width
+                               * bytesPerPixel : srcData.height * bytesPerPixel;
+               byte[] newData = new byte[(direction == SWT.DOWN) ? srcData.height
+                               * destBytesPerLine : srcData.width * destBytesPerLine];
+               int width = 0, height = 0;
+               for (int srcY = 0; srcY < srcData.height; srcY++) {
+                       for (int srcX = 0; srcX < srcData.width; srcX++) {
+                               int destX = 0, destY = 0, destIndex = 0, srcIndex = 0;
+                               switch (direction) {
+                               case SWT.LEFT: // left 90 degrees
+                                       destX = srcY;
+                                       destY = srcData.width - srcX - 1;
+                                       width = srcData.height;
+                                       height = srcData.width;
+                                       break;
+                               case SWT.RIGHT: // right 90 degrees
+                                       destX = srcData.height - srcY - 1;
+                                       destY = srcX;
+                                       width = srcData.height;
+                                       height = srcData.width;
+                                       break;
+                               case SWT.DOWN: // 180 degrees
+                                       destX = srcData.width - srcX - 1;
+                                       destY = srcData.height - srcY - 1;
+                                       width = srcData.width;
+                                       height = srcData.height;
+                                       break;
+                               }
+                               destIndex = (destY * destBytesPerLine)
+                                               + (destX * bytesPerPixel);
+                               srcIndex = (srcY * srcData.bytesPerLine)
+                                               + (srcX * bytesPerPixel);
+                               System.arraycopy(srcData.data, srcIndex, newData, destIndex,
+                                               bytesPerPixel);
+                       }
+               }
+               // destBytesPerLine is used as scanlinePad to ensure that no padding is
+               // required
+               return new ImageData(width, height, srcData.depth, srcData.palette,
+                               srcData.scanlinePad, newData);
+       }
+
+       public static ImageData flip(ImageData srcData, boolean vertical) {
+               int bytesPerPixel = srcData.bytesPerLine / srcData.width;
+               int destBytesPerLine = srcData.width * bytesPerPixel;
+               byte[] newData = new byte[srcData.data.length];
+               for (int srcY = 0; srcY < srcData.height; srcY++) {
+                       for (int srcX = 0; srcX < srcData.width; srcX++) {
+                               int destX = 0, destY = 0, destIndex = 0, srcIndex = 0;
+                               if (vertical) {
+                                       destX = srcX;
+                                       destY = srcData.height - srcY - 1;
+                               } else {
+                                       destX = srcData.width - srcX - 1;
+                                       destY = srcY;
+                               }
+                               destIndex = (destY * destBytesPerLine)
+                                               + (destX * bytesPerPixel);
+                               srcIndex = (srcY * srcData.bytesPerLine)
+                                               + (srcX * bytesPerPixel);
+                               System.arraycopy(srcData.data, srcIndex, newData, destIndex,
+                                               bytesPerPixel);
+                       }
+               }
+               // destBytesPerLine is used as scanlinePad to ensure that no padding is
+               // required
+               return new ImageData(srcData.width, srcData.height, srcData.depth,
+                               srcData.palette, srcData.scanlinePad, newData);
+       }
+
 }
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ImageUtils.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ImageUtils.java
deleted file mode 100644 (file)
index 3fd1dcb..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.tizen.dynamicanalyzer.utils;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.ImageData;
-
-public class ImageUtils {
-       public static ImageData rotate(ImageData srcData, int direction) {
-               int bytesPerPixel = srcData.bytesPerLine / srcData.width;
-               int destBytesPerLine = (direction == SWT.DOWN) ? srcData.width
-                               * bytesPerPixel : srcData.height * bytesPerPixel;
-               byte[] newData = new byte[(direction == SWT.DOWN) ? srcData.height
-                               * destBytesPerLine : srcData.width * destBytesPerLine];
-               int width = 0, height = 0;
-               for (int srcY = 0; srcY < srcData.height; srcY++) {
-                       for (int srcX = 0; srcX < srcData.width; srcX++) {
-                               int destX = 0, destY = 0, destIndex = 0, srcIndex = 0;
-                               switch (direction) {
-                               case SWT.LEFT: // left 90 degrees
-                                       destX = srcY;
-                                       destY = srcData.width - srcX - 1;
-                                       width = srcData.height;
-                                       height = srcData.width;
-                                       break;
-                               case SWT.RIGHT: // right 90 degrees
-                                       destX = srcData.height - srcY - 1;
-                                       destY = srcX;
-                                       width = srcData.height;
-                                       height = srcData.width;
-                                       break;
-                               case SWT.DOWN: // 180 degrees
-                                       destX = srcData.width - srcX - 1;
-                                       destY = srcData.height - srcY - 1;
-                                       width = srcData.width;
-                                       height = srcData.height;
-                                       break;
-                               }
-                               destIndex = (destY * destBytesPerLine)
-                                               + (destX * bytesPerPixel);
-                               srcIndex = (srcY * srcData.bytesPerLine)
-                                               + (srcX * bytesPerPixel);
-                               System.arraycopy(srcData.data, srcIndex, newData, destIndex,
-                                               bytesPerPixel);
-                       }
-               }
-               // destBytesPerLine is used as scanlinePad to ensure that no padding is
-               // required
-               return new ImageData(width, height, srcData.depth, srcData.palette,
-                               srcData.scanlinePad, newData);
-       }
-
-       public static ImageData flip(ImageData srcData, boolean vertical) {
-               int bytesPerPixel = srcData.bytesPerLine / srcData.width;
-               int destBytesPerLine = srcData.width * bytesPerPixel;
-               byte[] newData = new byte[srcData.data.length];
-               for (int srcY = 0; srcY < srcData.height; srcY++) {
-                       for (int srcX = 0; srcX < srcData.width; srcX++) {
-                               int destX = 0, destY = 0, destIndex = 0, srcIndex = 0;
-                               if (vertical) {
-                                       destX = srcX;
-                                       destY = srcData.height - srcY - 1;
-                               } else {
-                                       destX = srcData.width - srcX - 1;
-                                       destY = srcY;
-                               }
-                               destIndex = (destY * destBytesPerLine)
-                                               + (destX * bytesPerPixel);
-                               srcIndex = (srcY * srcData.bytesPerLine)
-                                               + (srcX * bytesPerPixel);
-                               System.arraycopy(srcData.data, srcIndex, newData, destIndex,
-                                               bytesPerPixel);
-                       }
-               }
-               // destBytesPerLine is used as scanlinePad to ensure that no padding is
-               // required
-               return new ImageData(srcData.width, srcData.height, srcData.depth,
-                               srcData.palette, srcData.scanlinePad, newData);
-       }
-
-}