return logCenterId;
}
+ // getLogs -> getRawLogs
public List<List<String>> getLogs() {
if (null == logs) {
logs = new ArrayList<List<String>>();
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;
+ }
}
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);
}
+/*
+ * 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;
/*
- * 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");
/*
- * 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");
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,
}
}
+ // 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);
+ }
+
}
+++ /dev/null
-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);
- }
-
-}