FileChartBoard : changed board title string limit 87/28087/1
authorhyeran74.kim <hyeran74.kim@samsung.com>
Fri, 26 Sep 2014 02:22:06 +0000 (11:22 +0900)
committerhyeran74.kim <hyeran74.kim@samsung.com>
Fri, 26 Sep 2014 02:22:06 +0000 (11:22 +0900)
Change-Id: Id089eba0d42ebbdfa1c55d43f92c7ef19325de8d
Signed-off-by: hyeran74.kim <hyeran74.kim@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/DALimit.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileChartBoard.java

index 6c72778..f8b7c84 100644 (file)
@@ -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;
 }
index 650d25f..98bf0a1 100644 (file)
@@ -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