sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/ThreadColorPalette.java
equal
deleted
inserted
replaced
20 import org.eclipse.swt.graphics.RGB; |
20 import org.eclipse.swt.graphics.RGB; |
21 |
21 |
22 public class ThreadColorPalette extends TableColorPalette { |
22 public class ThreadColorPalette extends TableColorPalette { |
23 |
23 |
24 @Override |
24 @Override |
25 public RGB getConstantRGB(Object entry) { |
25 public RGB getConstantRGB(final Object entry) { |
26 |
26 |
27 assert (entry instanceof String); |
27 assert (entry instanceof String); |
28 //threadName = sample.thread.process.name + "::" + sample.thread.threadName + "_" + sample.thread.threadId; |
28 //threadName = sample.thread.process.name + "::" + sample.thread.threadName + "_" + sample.thread.threadId; |
29 |
29 |
30 String string = (String)entry; |
30 String string = (String)entry; |
31 |
31 |
32 int lastIndexOf = string.lastIndexOf("_"); |
32 int lastIndexOf = string.lastIndexOf('_'); |
33 |
33 |
34 |
34 |
35 String threadName[] = string.substring(0, lastIndexOf).split("::"); //$NON-NLS-1$ //$NON-NLS-2$ |
35 String threadName[] = string.substring(0, lastIndexOf).split("::"); //$NON-NLS-1$ //$NON-NLS-2$ |
36 |
36 |
37 int length = threadName.length; |
37 int length = threadName.length; |
46 assert (threadName.length == 2); |
46 assert (threadName.length == 2); |
47 |
47 |
48 String pro_string = threadName[0]; |
48 String pro_string = threadName[0]; |
49 String thr_string = threadName[1]; |
49 String thr_string = threadName[1]; |
50 int mark; |
50 int mark; |
51 if (pro_string.indexOf(".") != -1) //$NON-NLS-1$ |
51 if (pro_string.indexOf('.') != -1){ //$NON-NLS-1$ |
52 mark = pro_string.indexOf("."); //EKA2 //$NON-NLS-1$ |
52 mark = pro_string.indexOf('.'); //EKA2 //$NON-NLS-1$ |
53 else if (pro_string.indexOf('[') != -1) |
53 }else if (pro_string.indexOf('[') != -1){ |
54 mark = pro_string.indexOf('['); //EKA1 |
54 mark = pro_string.indexOf('['); //EKA1 |
55 else |
55 }else{ |
56 return null; |
56 return null; |
57 |
57 } |
58 pro_string = pro_string.substring(0, mark); |
58 pro_string = pro_string.substring(0, mark); |
59 |
59 |
60 if (pro_string.equalsIgnoreCase("EKern") && thr_string.toUpperCase().startsWith("NULL")) { //$NON-NLS-1$ //$NON-NLS-2$ |
60 if (pro_string.equalsIgnoreCase("EKern") && thr_string.toUpperCase().startsWith("NULL")) { //$NON-NLS-1$ //$NON-NLS-2$ |
61 return new RGB(192,192,192); // AWT Color.lightGray |
61 return new RGB(192,192,192); // AWT Color.lightGray |
62 } |
62 } |