public static final String TEMP_FOLDER_NAME = "temp"; //$NON-NLS-1$\r
public static final String TEMP_FOLDER_RUN_PREFIX = ".RUN"; //$NON-NLS-1$\r
public static final String IMAGE_FOLDER_NAME = "img"; //$NON-NLS-1$\r
+ public static final String SMALL_IMAGE_FOLDER_NAME = "small"; //$NON-NLS-1$\r
public static final String ICON_WORKBENCH_FOLDER_NAME = "icons"; //$NON-NLS-1$\r
public static final String XML_FOLDER_NAME = "xml"; //$NON-NLS-1$\r
public static final String CONFIG_FOLDER_NAME = "config"; //$NON-NLS-1$\r
return false;\r
}\r
\r
- // HashMap<Long, String> apiHash =\r
- // LogSpliter.getCallStackApiByAddrMap();\r
HashMap<Long, CallStackUnit> apiHash = CallStackManager.getInstance()\r
.getCallStackApiByAddrMap();\r
try {\r
DBTableManager.TABLE_INDEX_PROFILING_DATA);\r
String tableName = profilingData.getTableName();\r
ResultSet rs = SqlManager.selectAllFromTable(tableName);\r
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance().getProfileDataMaker();\r
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+ .getProfileDataMaker();\r
if (null == rs || profiler == null) {\r
return false;\r
}\r
public static final int LOG_DEVICE = 9;
public static final int LOG_SAMPLE = 11;
public static final int LOG_THREAD = 12;
-// public static final int LOG_SYSTEM = 12;
+ // public static final int LOG_SYSTEM = 12;
public static final int LOG_CUSTOM_CHART = 13;
public static final int TYPE_CALLSTACK = 99;
public static final int UI_EVENT_Y = 15;
public static final int UI_EVENT_INFO1 = 16;
public static final int UI_EVENT_INFO2 = 17;
-
+
/* log user function : 4 */
public static final int USER_FUNCTION_BINARY_RANGE_START_INDEX = 12;
public static final int USER_FUNCTION_BINARY_RANGE_END_INDEX = 13;
public static final String FD_API_WAIT = "13"; //$NON-NLS-1$
public static final String FD_API_INTERNAL_USE = "14"; //$NON-NLS-1$
+ /* Log snapshot */
+ public static final int SNAPSHOT_IMAGE_PATH_INDEX = 12;
+
/* Log UserInterface Scene Transforms : 8 */
public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_SCENE_NAME_INDEX = 12;
public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME_INDEX = 13;
public static final int DEVICE_THREAD_COUNT_INDEX = 30;
public static final int DEVICE_THREAD_LOAD_INDEX = 31;
public static final int DEVICE_THREAD_RESERVED_INDEX = 32;
-
+
/* thread log : 12 */
public static final int THREAD_PTHREAD_ID_INDEX = 12;
public static final int THREAD_OSPTHREAD_ID_INDEX = 13;
public static final int THREAD_TYPE_INDEX = 14;
public static final int THREAD_API_TYPE_INDEX = 15;
-
+
public static final int THREAD_TYPE_PTHREAD = 0;
public static final int THREAD_TYPE_OSP = 1;
public static final int THREAD_TYPE_MAIN = 2;
-
+
public static final int THREAD_API_TYPE_NEW = 0;
public static final int THREAD_API_TYPE_START = 1;
public static final int THREAD_API_TYPE_STOP = 2;
public static final int THREAD_API_TYPE_INTERNAL_START = 6;
public static final int THREAD_API_TYPE_INTERNAL_STOP = 7;
public static final int THREAD_API_TYPE_OTHER = 8;
-
+
/* internal log */
public static final int INTERNAL_CALL = 1;
public static final int USER_CALL = 2;
packCount++;
for (int i = 0; i < size; i++) {
LogCenter logCenter = logcs.get(i);
+ Logs newLogs = new Logs(logCenter.getId());
Logs logs = logPack.getLogs(logCenter.getId());
- getLogPackage().putLogs(logs);
+ if (null != logs) {
+ newLogs.getLogs().addAll(logs.getCloneLogs());
+ getLogPackage().putLogs(logs);
+ }
} // for
} else {
Thread.sleep(AnalyzerConstants.LOG_CHECK_INTERVAL);
*/
package org.tizen.dynamicanalyzer.logparser;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.model.ImageInfo;
import org.tizen.dynamicanalyzer.model.LogCenter;
import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.ImageUtil;
+import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.SyncResult;
public class LogParser implements Runnable {
private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
private static boolean dropCallTraceLog = false;
private static LogQueue logQueue = null;
+ private int SMALL_IMG_WIDTH = 40;
+ private int SMALL_IMG_HEIGHT = 66;
+
+ private int DEFAULT_IMG_WIDTH = 480;
+ private int DEFAULT_IMG_HEIGHT = 800;
+
/** thread **/
// range of values??
private String pid = null;
/* user callstack create by entry and exit */
CallStackManager.getInstance().makeUserCallstack(slicedLog);
-
- } else if (log.length > 1) {
+ } else if (Integer.parseInt(logId) == LogCenterConstants.LOG_DEVICE) {
+ pushLog(logId, slicedLog, logPack);
+ } else {
+ if (Integer.parseInt(logId) == LogCenterConstants.LOG_SNAPSHOT) {
+ String remoteImgPath = new String(
+ slicedLog[LogCenterConstants.SNAPSHOT_IMAGE_PATH_INDEX]);
+ processImage(remoteImgPath);
+ }
pushLog(logId, slicedLog, logPack);
CallStackManager.getInstance().makeCallstackWithoutBacktrace(
slicedLog);
}
AnalyzerManager.getFailedChecker().check(slicedLog);
- } else {
- pushLog(logId, slicedLog, logPack);
}
}
AnalyzerManager.getProject().setLastLogNum(lastLogSeqNumber);
updateLog(logPack);
}
+ private void processImage(final String from) {
+ final String fileName = getImageName(from);
+ final String to = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator + fileName;
+
+ new Thread(null, new Runnable() {
+ @Override
+ public void run() {
+ SyncResult res = DACommunicator.pull(from, to);
+ if (null != res && SyncService.RESULT_OK == res.getCode()) {
+ DACommunicator.remove(from);
+ /* image resizing */
+ String smallImagePath = AnalyzerManager.getProject()
+ .getSavePath()
+ + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
+ + File.separator + fileName;
+ ImageUtil.resize(to, to, DEFAULT_IMG_WIDTH,
+ DEFAULT_IMG_HEIGHT);
+ ImageUtil.resize(to, smallImagePath, SMALL_IMG_WIDTH,
+ SMALL_IMG_HEIGHT);
+ } else {
+ System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
+
+ }
+
+ private String getImageName(String fullPath) {
+ String name = null;
+ name = fullPath
+ .substring(fullPath.lastIndexOf(CommonConstants.SLASH) + 1);
+ return name;
+ }
+
private void updateLog(LogPackage logPack) {
if (null == logPack || logPack.isEmpty()) {
return;
if (!AnalyzerManager.hasSampleThread()) {
AnalyzerManager.setSampleThread(true);
}
- System.out.println("sample get!");
- System.out.println(ToolbarArea.getInstance().getTime());
- System.out.println("sample time get!");
processUserProfiling(messages[1]);
break;
case AnalyzerConstants.MSG_DEVICE_LOG: /* device info : 4 */
case AnalyzerConstants.MSG_LOG: /* log : 5 */
- // if (AnalyzerConstants.MSG_LOG == messageIndex) {
- // System.out
- // .println("count " + messageCount + ": " + message);
- // }
+// if (AnalyzerConstants.MSG_LOG == messageIndex) {
+// System.out
+// .println("count " + messageCount + ": " + message);
+// }
buffer.add(messages[1]);
messageCount += 1;
break;
imgFolder.mkdirs();
}
+ File samallImage = new File(savePath + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
+ if (!samallImage.isDirectory()) {
+ samallImage.mkdirs();
+ }
+
initLogCenters(null);
AnalyzerManager.setProject(this);
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.FilePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
@Override
public void updateView(DASelectionData data) {
+ if (data.getViewId().equals(DATabComposite.ID)) {
+ return;
+ }
Grid fileChart = (Grid) data.getControl();
GridItem[] items = fileChart.getSelection();
GridItem item = items[0];
leftForm.setWeights(new int[] { 60, 40 });
rightForm = new SashForm(baseForm, SWT.VERTICAL);
- DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE, TAB_ID);
+ DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
class DuplicateUserCall {
private CallStackUnit dupCallstackUnit = null;
private int dupCallcount = 0;
-
+
public DuplicateUserCall(CallStackUnit callStackUnit) {
dupCallstackUnit = callStackUnit;
dupCallcount = 1;
}
-
+
public CallStackUnit getDupCallstackUnit() {
return dupCallstackUnit;
}
-
+
public int getDupCallCount() {
return dupCallcount;
}
-
+
public void increaseDupCallCount() {
dupCallcount++;
}
-
+
public void decreaseDupCallCount() {
dupCallcount--;
}
}
-
+
private static CallStackManager instance;
private HashMap<Long, CallStackUnit> callstackApiByAddrMap;
private HashMap<Integer, CallStackData> callstackDataBySeqMap;
private String userFunctionBin = null;
private HashMap<Integer, List<CallStackUnit>> userCallstackByTidMap;
private HashMap<Integer, DuplicateUserCall> dupUserCallByTidMap;
-
+
public static CallStackManager getInstance() {
if (null == instance) {
instance = new CallStackManager();
String strCallerAddr = input[LogCenterConstants.CALLER_PCADDR_INDEX];
String strSeq = input[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
-
+
int seq = Integer.parseInt(strSeq);
int tid = Integer.parseInt(strTid);
}
// insert call count
-// FunctionUsageProfiler profiler = AnalyzerManager
-// .getFunctionUserProfiler();
- ProfileDataMaker profiler = FunctionUsageProfiler.getInstance().getProfileDataMaker();
+ // FunctionUsageProfiler profiler = AnalyzerManager
+ // .getFunctionUserProfiler();
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMaker();
profiler.makeFupDataForCallTrace(selfCallstackUnit, input);
List<CallStackUnit> userCallstack = getUserCallstack(tid);
int size = userCallstack.size();
-
+
CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
if (null == callerCallstackUnit) {
String strCallerFuncName = SymbolManager.addr2func(binPath,
callerCsa.setFunctionStartAddr(callerCsa.getAddr());
callerCsa.setAddr(callerAddr);
} else {
- callerCsa.setFunctionStartAddr(userCallstack.get(size - 1).getAddr());
+ callerCsa.setFunctionStartAddr(userCallstack.get(
+ size - 1).getAddr());
userCallstack.set(size - 1, callerCsa);
}
}
CallStackUnit removeCallStackUnit = userCallstack.get(size - 1);
if (selfCallstackUnit.getFunctionName().equals(
removeCallStackUnit.getFunctionName())) {
-// if(selfCallstackUnit.getAddr() == removeCallStackUnit.getAddr()) {
+ // if(selfCallstackUnit.getAddr() ==
+ // removeCallStackUnit.getAddr()) {
userCallstack.remove(size - 1);
if (size - 2 > 0) {
CallStackUnit checkCallStackUnit = userCallstack
}
}
size = userCallstack.size();
- if(size > 0) {
- CallStackUnit prevCallstackUnit = userCallstack.get(size - 1);
- long prevSelfAddr = prevCallstackUnit.getFunctionStartAddr();
+ if (size > 0) {
+ CallStackUnit prevCallstackUnit = userCallstack
+ .get(size - 1);
+ long prevSelfAddr = prevCallstackUnit
+ .getFunctionStartAddr();
CallStackUnit callerCsa = addrMap.get(prevSelfAddr);
- if(null == callerCsa) {
+ if (null == callerCsa) {
prevCallstackUnit.setAddr(prevSelfAddr);
} else {
userCallstack.set(size - 1, callerCsa);
}
}
}
- if(AnalyzerManager.isOsp()) {
+ if (AnalyzerManager.isOsp()) {
String apiName = input[LogCenterConstants.APINAME_INDEX];
- if(apiName.equals("OspMain")) {
+ if (apiName.equals("OspMain")) {
LogParser.setDropCallTraceLog(true);
}
}
int seq = Integer.parseInt(strSeq);
int tid = Integer.parseInt(strTid);
- long callerAddr = Long.parseLong(strCallerAddr);
+ long callerAddr = 0;
+ if (!strCallerAddr.isEmpty()) {
+ callerAddr = Long.parseLong(strCallerAddr);
+ } else {
+ CallStackData callstackData = new CallStackData(seq);
+ getCallStackDataBySeqMap().put(seq, callstackData);
+ return;
+ }
- List<CallStackUnit> probeCallstack = new ArrayList<CallStackUnit>(getUserCallstack(tid));
+ // long callerAddr = 0;
+ // try
+ // {
+ // callerAddr = Long.parseLong(strCallerAddr);
+ // }catch (Exception e) {
+ // System.out.println();
+ // }
+
+ List<CallStackUnit> probeCallstack = new ArrayList<CallStackUnit>(
+ getUserCallstack(tid));
int size = probeCallstack.size();
-
+
CallStackData callstackData = new CallStackData(seq);
- if((size == 0) || (!AnalyzerManager.isInBinaryRange(strCallerAddr))) {
+ if ((size == 0) || (!AnalyzerManager.isInBinaryRange(strCallerAddr))) {
CallStackUnit callbackApi = new CallStackUnit(
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
String strCallerSymbol = getUserFunctionPosition()
+ AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ strCallerFuncName;
- callerCallstackUnit = new CallStackUnit(callerAddr, strCallerSymbol);
+ callerCallstackUnit = new CallStackUnit(callerAddr,
+ strCallerSymbol);
addrMap.put(callerAddr, callerCallstackUnit);
}
CallStackUnit topUserCallstack = probeCallstack.get(size - 1);
- if(callerCallstackUnit.getFunctionName().equals(
+ if (callerCallstackUnit.getFunctionName().equals(
topUserCallstack.getFunctionName())) {
probeCallstack.set(size - 1, callerCallstackUnit);
- }
- else {
- System.out.println("bug : probe caller is not the same as top of user callstack");
+ } else {
+ System.out
+ .println("bug : probe caller is not the same as top of user callstack");
}
}
-
+
size = probeCallstack.size();
for (int i = size - 1; i >= 0; i--) {
callstackData.getAddrs().add(probeCallstack.get(i).getAddr());
}
getCallStackDataBySeqMap().put(seq, callstackData);
-
+
}
-
+
// check irregular enter/exit log (multiple logs from 1 function call)
- public boolean isIrregularUserCall(String[] input) {
- HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
+ public boolean isIrregularUserCall(String[] input) {
+ HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
HashMap<Integer, DuplicateUserCall> dupUserCallMap = getDupUserCallByTidMap();
-
+
boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
String baseAddr = AnalyzerManager.getProject().getBaseAddress();
String binPath = AnalyzerManager.getProject().getBinaryPath();
if (null == binPath || binPath.isEmpty()) {
return false;
}
-
+
String strSelfAddr = input[LogCenterConstants.PCADDR_INDEX];
String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
-
+
int tid = Integer.parseInt(strTid);
long selfAddr = Long.parseLong(strSelfAddr);
String strEventType = input[LogCenterConstants.USER_FUNCTION_TYPE_INDEX];
int eventType = Integer.parseInt(strEventType);
- if(size > 0) {
+ if (size > 0) {
if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
- CallStackUnit topCallstackUnit = userCallstack.get(size -1);
- if(topCallstackUnit.equals(selfCallstackUnit)) {
+ CallStackUnit topCallstackUnit = userCallstack.get(size - 1);
+ if (topCallstackUnit.equals(selfCallstackUnit)) {
DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
- if(null == dupUserCall) {
+ if (null == dupUserCall) {
dupUserCall = new DuplicateUserCall(selfCallstackUnit);
dupUserCallMap.put(tid, dupUserCall);
} else {
- if(dupUserCall.getDupCallstackUnit().equals(selfCallstackUnit)) {
+ if (dupUserCall.getDupCallstackUnit().equals(
+ selfCallstackUnit)) {
dupUserCall.increaseDupCallCount();
} else {
- System.out.println("makeUserCallstack : dup callstack check error");
+ System.out
+ .println("makeUserCallstack : dup callstack check error");
}
}
return true;
}
} else if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
- if(null != dupUserCall) {
- if(dupUserCall.getDupCallstackUnit().equals(selfCallstackUnit)) {
+ if (null != dupUserCall) {
+ if (dupUserCall.getDupCallstackUnit().equals(
+ selfCallstackUnit)) {
dupUserCall.decreaseDupCallCount();
- if(0 == dupUserCall.getDupCallCount()) {
+ if (0 == dupUserCall.getDupCallCount()) {
dupUserCallMap.remove(tid);
}
} else {
- System.out.println("makeUserCallstack : dup callstack check error");
+ System.out
+ .println("makeUserCallstack : dup callstack check error");
}
return true;
}
return false;
}
-
public HashMap<Long, CallStackUnit> getCallStackApiByAddrMap() {
if (null == callstackApiByAddrMap) {
callstackApiByAddrMap = new HashMap<Long, CallStackUnit>();
}
return callstackDataBySeqMap;
}
-
+
public HashMap<Integer, DuplicateUserCall> getDupUserCallByTidMap() {
if (null == dupUserCallByTidMap) {
dupUserCallByTidMap = new HashMap<Integer, DuplicateUserCall>();
public String getUserFunctionPosition() {
if (userFunctionBin == null || userFunctionBin.isEmpty()) {
if (AnalyzerManager.isOsp()) {
- userFunctionBin = new String(DACommunicator.getSelectedApp().getExecPath()
- + ".exe"); //$NON-NLS-1$
+ userFunctionBin = new String(DACommunicator.getSelectedApp()
+ .getExecPath() + ".exe"); //$NON-NLS-1$
} else {
- userFunctionBin = new String(DACommunicator.getSelectedApp().getExecPath());
+ userFunctionBin = new String(DACommunicator.getSelectedApp()
+ .getExecPath());
}
}
return userFunctionBin;
return false;
}
- public boolean isUserCall(String input)
- {
+ public boolean isUserCall(String input) {
if (!input.contains(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC)) {
return true;
}
return false;
}
+
public String getPCAddrBySeq(int seq) {
HashMap<Integer, CallStackData> cdMap = getCallStackDataBySeqMap();
if (null == cdMap) {
public void widgetSelected(SelectionEvent e) {
AnalyzerManager.getCurrentPage().controlSelection(
DATabComposite.ID);
- table.setFocus();
- GridItem[] sels = table.getSelection();
+ GridItem[] sels = table.getSelection();
if (sels.length < 0) {
return;
}
import org.tizen.dynamicanalyzer.model.ImageInfo;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.timeline.DATimelineTabComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class ImageViewer extends Composite {
int ix = 1, iy = 1;
if (imgData.imgHeight > imgData.imgWidth) {
- ix = (bounds.width - imgData.imgWidth) / 2;
+ ix = (bounds.width - defaultChildWidth * 2) / 2;
} else {
- iy = (bounds.height - imgData.imgHeight) / 2;
+ iy = (bounds.height - defaultChildHeight * 2) / 2;
}
imgData.gc.drawImage(image, 0, 0, imgData.imgWidth, imgData.imgHeight,
} else if (state == MOUSE_RIGHT && rightEnable) {
Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_HOVER,
- rect.width, 0);
+ bounds.width - rect.width, 0);
} else if (state == MOUSE_DOWN_LEFT && leftEnable) {
imgData.gc.drawImage(ImageResources.SNAPSHOT_LEFT_PUSH, 0, 0);
} else if (state == MOUSE_DOWN_RIGHT && rightEnable) {
Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_PUSH,
- rect.width, 0);
+ bounds.width - rect.width, 0);
}
}
private void widgetSelected(String timeStr) {
long time = Long.parseLong(timeStr);
AnalyzerManager.getCurrentPage().updatePage(
- new DASelectionData(DATimelineTabComposite.ID, time, time,
+ new DASelectionData(DATabComposite.ID, time, time,
null, null));
}
private void leftArrowAction() {
List<ImageInfo> imageList = AnalyzerManager.getImageList();
ImageInfo imgInfo = imageList.get(--currentImageIndex);
+ System.out.println("left");
drawSnapshot(imgInfo.getTime());
widgetSelected(imgInfo.getTime());
}
return;
}
ImageInfo imgInfo = imageList.get(++currentImageIndex);
+ System.out.println("right");
drawSnapshot(imgInfo.getTime());
widgetSelected(imgInfo.getTime());
}
}
return;
}
- int x = (shellMaxWidth - childWidth) / 20;
- int y = (shellMaxHeight - childHeight) / 20;
+ int x = (shellMaxWidth - childWidth) / 10;
+ int y = (shellMaxHeight - childHeight) / 10;
childShellWidth += x;
childShellHeight += y;
@Override
public void createPartControl(Composite parent) {
- tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED, null);
+ tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED);
tabView.setTabWidth(120);
{
Composite timelinePage = new TimelinePage(
addView(leakView);
// INFO_VIEW_INDEX = 2;
- DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
addView(leakView);
// INFO_VIEW_INDEX = 2;
- DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
rightForm = new SashForm(baseForm, SWT.VERTICAL);
// INFO_VIEW_INDEX = 2;
- DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE, TAB_ID);
+ DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
public static final String ID = DATimelineTabComposite.class.getName();\r
\r
public DATimelineTabComposite(Composite parent, int style) {\r
- super(parent, style, ID);\r
+ super(parent, style);\r
}\r
\r
public void updateLog(LogPackage logPack) {\r
}\r
\r
public void updateView(DASelectionData data) {\r
-\r
+ if (data.getViewId().equals(SnapshotView.ID)) {\r
+ return;\r
+ }\r
RangeView rangeView = (RangeView) getTab(RangeView.ID);\r
SnapshotView snapshotView = (SnapshotView) getTab(SnapshotView.ID);\r
\r
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceView;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class TimelinePage extends DAPageComposite {
public static final String ID = TimelinePage.class.getName();
rightForm = new SashForm(leftForm, SWT.VERTICAL);
// index 1 : INFO_INDEX
- DATimelineTabComposite tabView = new DATimelineTabComposite(rightForm,
- SWT.NONE);
+// DATimelineTabComposite tabView = new DATimelineTabComposite(rightForm,
+// SWT.NONE);
+ DATabComposite tabView = new DATabComposite(rightForm,SWT.NONE);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class UIPage extends DAPageComposite {
-
SashForm baseForm;
SashForm upperForm;
SashForm bottomForm;
SWT.NONE);
addView(topLeftSencond);
- DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
private int tabWidth = LONG_TAB_WIDTH;
- public DATabComposite(Composite parent, int style, String ID) {
+ public DATabComposite(Composite parent, int style) {
super(parent, style);
childrenMap = new HashMap<String, Composite>();
buttonMap = new HashMap<String, DACustomButton>();
public class ImageUtil {
- public static void resize(String origFile, String newFile, int width,
+ public static void resize(String originFilePath, String newFilePath, int width,
+ int height) {
+ resize(originFilePath, newFilePath, width, height, null);
+ }
+
+ public static void resize(String originFilePath, String newFilePath, int width,
int height, Color color) {
BufferedImage bufferedImage = null;
BufferedImage targetBufferedImage = null;
- File image = new File(origFile);
- File destImage = new File(newFile);
+ File image = new File(originFilePath);
+ File destImage = new File(newFilePath);
try {
bufferedImage = ImageIO.read(image);
Image scaledImage = bufferedImage.getScaledInstance(width, height,
Image.SCALE_DEFAULT);
- targetBufferedImage = new BufferedImage(width, width,
+ targetBufferedImage = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics g = targetBufferedImage.getGraphics();
g.drawImage(scaledImage, 0, 0, null);
- g.setColor(color);
- g.drawLine(0, 0, 0, 49);
- g.drawLine(0, 0, 49, 0);
- g.drawLine(49, 0, 49, 49);
- g.drawLine(0, 49, 49, 49);
+ if (null != color) {
+ g.setColor(color);
+ g.drawLine(0, 0, 0, 49);
+ g.drawLine(0, 0, 49, 0);
+ g.drawLine(49, 0, 49, 49);
+ g.drawLine(0, 49, 49, 49);
+ }
g.dispose();
ImageIO.write(targetBufferedImage, "PNG", destImage); //$NON-NLS-1$