From: hyeran74.kim Date: Fri, 26 Sep 2014 02:22:06 +0000 (+0900) Subject: FileChartBoard : changed board title string limit X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95ef0739b44ab8889e5a9b8ac4bc0732ddf297b3;p=sdk%2Ftools%2Fdynamic-analyzer.git FileChartBoard : changed board title string limit Change-Id: Id089eba0d42ebbdfa1c55d43f92c7ef19325de8d Signed-off-by: hyeran74.kim --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java index 6c72778..f8b7c84 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java @@ -62,5 +62,5 @@ public class DALimit { // File Analysis public static final int MAX_FILE_STATUS_COUNT = ((int) Math.pow(2, 10))*100; // 102400 // 102400 public static final int MAX_FILE_ACCESS_COUNT = ((int) Math.pow(2, 10))*100; // 102400 // 102400 - public static final int MAX_STRING_LENGTH = 12; + public static final int MAX_STRING_LENGTH = 16; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartBoard.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartBoard.java index 650d25f..98bf0a1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartBoard.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartBoard.java @@ -198,6 +198,7 @@ public class FileChartBoard extends DAChartBoard { processName = DACommunicator.getProcessNameFromTarget(pid); } if(processName!=null){ + processName = splitTitle(processName, DALimit.MAX_STRING_LENGTH); title.append(processName + CommonConstants.NEW_LINE); }else{ title.append("unKnown process" + CommonConstants.NEW_LINE); @@ -215,15 +216,7 @@ public class FileChartBoard extends DAChartBoard { initFileChart(chart, false); } else { // parent chart row String fileName = fileChart.getFileName(); - String title = fileName; - int maxLen = DALimit.MAX_STRING_LENGTH; - if (fileName.length() > maxLen && fileName.length() < maxLen * 2) { - title = fileName.substring(0, maxLen) + CommonConstants.NEW_LINE - + fileName.substring(maxLen, fileName.length()); - } else if (fileName.length() >= maxLen *2) { - title = fileName.substring(0, maxLen) + CommonConstants.NEW_LINE - + fileName.substring(maxLen, maxLen*2 - 1) + "..."; - } + String title = splitTitle(fileName, DALimit.MAX_STRING_LENGTH); item = new DAChartBoardItem(this, title); item.setData(new FileSelectedData(fileChart.getFilePath(), fileChart.getPid(), fileChart.getTid(), fileChart.getFd(), @@ -235,6 +228,14 @@ public class FileChartBoard extends DAChartBoard { fileChart.setItem(item); chart.redraw(); } + + private String splitTitle(String name, int maxLen) { + String title = name; + if (name.length() > maxLen ) { + title = name.substring(0, maxLen) + "..."; + } + return title; + } /** * update file open status