[Title] Multi column added
authorLee <jy.exe.lee@samsung.com>
Thu, 29 Nov 2012 05:34:54 +0000 (14:34 +0900)
committerLee <jy.exe.lee@samsung.com>
Thu, 29 Nov 2012 05:34:54 +0000 (14:34 +0900)
[Desc.] multi column
[Issue] redmine # 5077

16 files changed:
org.tizen.dynamicanalyzer/.classpath
org.tizen.dynamicanalyzer/build.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ColumnData.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/SummaryLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/SummaryLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageViewer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/SnapshotView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/DAPageComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/range/FunctionUsageProfilingView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ColumnGroupRenderer.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/FunctionUsageProfilingTableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/FunctionUsageProfilingView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfilingTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableHeaderRenderer.java

index be21a73..e431430 100644 (file)
@@ -7,9 +7,9 @@
        <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.core_5.3.1.201109151620.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.debug.edc_2.0.0.201109151658.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.dsf_2.2.0.201109151620.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.nebula.widgets.grid_1.0.0.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.eclipse.nebula.effects.stw.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/jcommon-1.0.17.jar"/>
        <classpathentry kind="lib" path="lib/sdblib.jar"/>
+       <classpathentry kind="lib" path="lib/org.eclipse.nebula.widgets.grid_1.0.0.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index 6db7ff5..4e16085 100644 (file)
@@ -12,5 +12,4 @@ bin.includes = .,\
                Link/,\\r
                .settings/,\\r
                .project,\\r
-               .classpath,\\r
-\r
+               .classpath,\
\ No newline at end of file
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ColumnData.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/ColumnData.java
new file mode 100644 (file)
index 0000000..10776f3
--- /dev/null
@@ -0,0 +1,44 @@
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ColumnData {
+       private String text = null;
+       private int width = 0;
+       private List<ColumnData> children = null;
+
+       public ColumnData(String columnName) {
+               text = columnName;
+               children = new ArrayList<ColumnData>();
+       }
+
+       public ColumnData(String columnName, int width) {
+               text = columnName;
+               this.width = width;
+               children = new ArrayList<ColumnData>();
+       }
+
+       public String getText() {
+               return text;
+       }
+
+       public List<ColumnData> getChildren() {
+               return children;
+       }
+
+       public boolean isParent() {
+               if (children.isEmpty()) {
+                       return false;
+               }
+               return true;
+       }
+
+       public void setWidth(int width) {
+               this.width = width;
+       }
+
+       public int getWidth() {
+               return width;
+       }
+}
index b11dbc1..0eacc0e 100644 (file)
@@ -37,14 +37,11 @@ public class SummaryLabels extends NLS {
        public static String FUNCTION_USAGE_PROFILER_DEPENDENT_LIB;
 
        public static String FUNCTION_USER_PROFILING_VIEW_TITLE;
-       public static String FUNCTION_USER_PROFILING_VIEW_CALL_COUNT;
-       public static String FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_RATE;
-       public static String FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_TIME;
-       public static String FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_RATE;
-       public static String FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_TIME;
        public static String FUNCTION_USER_PROFILING_VIEW_NAME;
-       public static String FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_ELASPED_TIME;
-       public static String FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_ELASPED_TIME;
+       public static String FUNCTION_USER_PROFILING_VIEW_CPU_TIME;
+       public static String FUNCTION_USER_PROFILING_VIEW_CPU_RATE;
+       public static String FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME;
+       public static String FUNCTION_USER_PROFILING_VIEW_CALL_COUNT;
 
        public static String WARNING_CASE_BRIEF_DUPLICATE;
        public static String WARNING_CASE_BRIEF_NO_OPERATION;
index 1bd5fd1..0310b01 100644 (file)
@@ -11,15 +11,11 @@ FUNCTION_USAGE_PROFILER_APPLICATION=Application
 FUNCTION_USAGE_PROFILER_DEPENDENT_LIB=Dependent library
 
 FUNCTION_USER_PROFILING_VIEW_TITLE=Function Usage Profiling
-FUNCTION_USER_PROFILING_VIEW_CALL_COUNT=Call count
-FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_RATE=Excl. CPU rate
-FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_TIME=Excl. CPU time
-FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_RATE=Incl. CPU rate
-FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_TIME=Incl. CPU time
 FUNCTION_USER_PROFILING_VIEW_NAME=Library or function name
-FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_ELASPED_TIME=Excl. elapsed time
-FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_ELASPED_TIME=Incl. elapsed time
-
+FUNCTION_USER_PROFILING_VIEW_CPU_RATE=CPU rate
+FUNCTION_USER_PROFILING_VIEW_CPU_TIME=CPU time
+FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME=Elapsed time
+FUNCTION_USER_PROFILING_VIEW_CALL_COUNT=Call count
 
 WARNING_CASE_BRIEF_DUPLICATE=Duplicate file open.
 WARNING_CASE_BRIEF_NO_OPERATION=File closed without changes.
index a438faa..6c216b3 100644 (file)
@@ -264,7 +264,7 @@ public class ImageViewer extends Composite {
                                        err.printStackTrace();
                                        img = ImageResources.NO_IMAGE;
                                } catch (Exception e) {
-                                       e.printStackTrace();
+                                       System.out.println("Wait for receiving image : " + path);
                                        img = ImageResources.NO_IMAGE;
                                }
                                if (img.isDisposed()) {
index 832a3aa..0a143d0 100644 (file)
@@ -58,7 +58,7 @@ public class SnapshotView extends DAView {
        CircularGraph processGraph;
        FourBarGraph cpuGrp;
        private static String rss = "0"; //$NON-NLS-1$
-       private static String time = "0"; //$NON-NLS-1$
+//     private static String time = "0"; //$NON-NLS-1$
        private static List<Long> cpuUsage;
        private static long maxCpuUsage = 100;
        private static long maxMem = 100;
@@ -83,7 +83,6 @@ public class SnapshotView extends DAView {
                data.width = 218;
                data.height = 218;
                snapshot.setLayoutData(data);
-               // FIXME : not supported
                snapshot.setEnable(true);
 
                // process graph
@@ -170,7 +169,7 @@ public class SnapshotView extends DAView {
                rss = input.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX + 1);
 
                long totalMem = AnalyzerManager.getProject().getSystemMemorySize();
-               time = input.get(LogCenterConstants.TIME_INDEX + 1);
+//             time = input.get(LogCenterConstants.TIME_INDEX + 1);
                // cpuUsage = cpus;
                maxMem = totalMem;
                processMem = Long.parseLong(rss);
@@ -198,7 +197,7 @@ public class SnapshotView extends DAView {
                                processGraph.update(maxMem, processMem);
                                cpuGrp.setMaxSize(maxCpuUsage);
                                cpuGrp.setCurrentValue(cpuUsage);
-                               snapshot.drawSnapshot(time);
+                               snapshot.drawSnapshot(Long.toString(startTime));
                        }
                });
        }
@@ -224,14 +223,14 @@ public class SnapshotView extends DAView {
 
                rss = input.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX);
                long totalMem = AnalyzerManager.getProject().getSystemMemorySize();
-               time = input.get(LogCenterConstants.TIME_INDEX);
+//             time = input.get(LogCenterConstants.TIME_INDEX);
                maxMem = totalMem;
                processMem = Long.parseLong(rss);
        }
 
        @Override
        public void clear() {
-               time = "0"; //$NON-NLS-1$
+//             time = "0"; //$NON-NLS-1$
                cpuUsage.clear();
                maxMem = 100;
                processMem = 0;
index fc2ab4b..72d9751 100644 (file)
@@ -82,13 +82,13 @@ public class DAPageComposite extends Composite implements ViewAction {
                }
        }
 
-       public void updatePage(DASelectionData data) {
+       public void updatePage(final DASelectionData data) {
                String viewId = data.getViewId();
                int size = views.size();
                for (int i = 0; i < size; i++) {
                        String key = views.get(i).getClass().getName();
                        if (key != null && !key.equals(viewId)) {
-                               ViewAction view = viewMap.get(key);
+                               final ViewAction view = viewMap.get(key);
                                if (null != view) {
                                        view.updateView(data);
                                }
index 35132f3..40150fb 100644 (file)
@@ -44,24 +44,24 @@ public class FunctionUsageProfilingView extends DAView {
        private ProfilingTable treeComp = null;
        int[] innerMaxWeight = { 100, 0 };
        int[] outerMaxWeight = { 0, 100 };
-       
+
        private String[] columnNames = {
                        SummaryLabels.FUNCTION_USER_PROFILING_VIEW_NAME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_TIME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_RATE,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_TIME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_RATE,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_RATE,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_RATE,
                        SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CALL_COUNT,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_ELASPED_TIME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_ELASPED_TIME };
-       private int[] columnSizes = { 200, 0, 0, 0, 0, 0, 0, 0 };
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME };
+//     private int[] columnSizes = { 200, 0, 0, 0, 0, 0, 0, 0 };
        private boolean[] columnVisibility = { true, true, true, true, true, true,
                        true, true };
        int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
-                       AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM };
+                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+                       AnalyzerConstants.SORT_TYPE_NUM };
        int[] sourceColumns = { ProfilingData.NAME_INDEX,
                        ProfilingData.EXCOUNT_INDEX, ProfilingData.EXCOUNT_INDEX,
                        ProfilingData.INCOUNT_INDEX, ProfilingData.INCOUNT_INDEX,
@@ -87,7 +87,7 @@ public class FunctionUsageProfilingView extends DAView {
                treeComp.setSortTypes(sortTypes);
                treeComp.setSourceColumns(sourceColumns);
                treeComp.setColumns(columnNames);
-               treeComp.setColumnSize(columnSizes);
+               // treeComp.setColumnSize(columnSizes);
                treeComp.setColumnVisibility(columnVisibility);
                treeComp.setTableToolTipEnable(false);
                treeComp.setTableName("R_Function Usage");
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ColumnGroupRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ColumnGroupRenderer.java
new file mode 100644 (file)
index 0000000..ea61ffe
--- /dev/null
@@ -0,0 +1,56 @@
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
+import org.eclipse.nebula.widgets.grid.internal.DefaultColumnGroupHeaderRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+
+public class ColumnGroupRenderer extends DefaultColumnGroupHeaderRenderer {
+
+       int leftMargin = 6;
+
+       int rightMargin = 6;
+
+       int topMargin = 3;
+
+       int bottomMargin = 3;
+
+       int arrowMargin = 6;
+
+       int imageSpacing = 3;
+
+       @Override
+       public boolean notify(int arg0, Point arg1, Object arg2) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public void paint(GC gc, Object arg1) {
+               GridColumnGroup column = (GridColumnGroup) arg1;
+               gc.setBackground(ColorResources.TABLE_HEADER_BG);
+               Rectangle rect = getBounds();
+               gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
+               gc.setForeground(ColorResources.TABLE_LINE);
+               gc.drawLine(rect.x - 1, rect.y, rect.x - 1, rect.y + rect.height);
+               gc.drawLine(rect.x - 1, rect.y - 1 + rect.height, rect.x + rect.width,
+                               rect.y - 1 + rect.height);
+
+               gc.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
+               gc.setFont(FontResources.TABLE_HEADER);
+               String inputText = column.getText();
+               Point textSize = gc.textExtent(inputText, SWT.DRAW_MNEMONIC);
+               int textWidth = textSize.x;
+
+               int y = getBounds().y + getBounds().height - bottomMargin
+                               - gc.getFontMetrics().getHeight();
+
+               int x = rect.x + (rect.width - textWidth) / 2;
+               gc.drawString(inputText, x, y, true);
+       }
+
+}
index 6fda198..6753d3f 100644 (file)
@@ -166,7 +166,7 @@ public class FunctionUsageProfilingTableCellRenderer extends
                        }
                }
 
-               if (getColumn() == 2 || getColumn() == 4) {
+               if (getColumn() == 2 || getColumn() == 5) {
                        if (drawAsSelected) {
                                gc.setForeground(ColorResources.PROFILING_GRAPH_SELECTION_COLOR_START);
                                gc.setBackground(ColorResources.PROFILING_GRAPH_SELECTION_COLOR_END);
index 47961ec..a537b0d 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.summary.profiling;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.model.ColumnData;
 import org.tizen.dynamicanalyzer.model.DAView;
 import org.tizen.dynamicanalyzer.nl.SummaryLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
@@ -42,24 +46,25 @@ public class FunctionUsageProfilingView extends DAView {
        private ProfilingTable treeComp = null;
        int[] innerMaxWeight = { 100, 0 };
        int[] outerMaxWeight = { 0, 100 };
-       
+       List<ColumnData> columnData = null;
+
        private String[] columnNames = {
                        SummaryLabels.FUNCTION_USER_PROFILING_VIEW_NAME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_TIME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_RATE,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_TIME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_CPU_RATE,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CALL_COUNT,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE_ELASPED_TIME,
-                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_ELASPED_TIME };
-       private int[] columnSizes = { 200, 0, 0, 0, 0, 0, 0, 0 };
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_RATE,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_RATE,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME,
+                       SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CALL_COUNT };
+       private int[] columnSizes = { 260, 0, 0, 0, 0, 0, 0, 0 };
        private boolean[] columnVisibility = { true, true, true, true, true, true,
                        true, true };
        int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
-                       AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
                        AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
-                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM };
+                       AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+                       AnalyzerConstants.SORT_TYPE_NUM };
        int[] sourceColumns = { ProfilingData.NAME_INDEX,
                        ProfilingData.EXCOUNT_INDEX, ProfilingData.EXCOUNT_INDEX,
                        ProfilingData.INCOUNT_INDEX, ProfilingData.INCOUNT_INDEX,
@@ -84,13 +89,43 @@ public class FunctionUsageProfilingView extends DAView {
                treeComp.setTree(true);
                treeComp.setSortTypes(sortTypes);
                treeComp.setSourceColumns(sourceColumns);
-               treeComp.setColumns(columnNames);
+               createColumnData();
+               treeComp.setColumns(columnData);
+               // treeComp.setColumns(columnNames);
                treeComp.setColumnSize(columnSizes);
                treeComp.setColumnVisibility(columnVisibility);
                treeComp.setTableToolTipEnable(false);
                treeComp.setTableName(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
        }
 
+       private void createColumnData() {
+               int columnIndex = 0;
+               columnData = new ArrayList<ColumnData>();
+               ColumnData data0 = new ColumnData(columnNames[columnIndex++]);
+               columnData.add(data0);
+
+               ColumnData data1 = new ColumnData("Exclusive");
+               ColumnData data1Child1 = new ColumnData(columnNames[columnIndex++]);
+               ColumnData data1Child2 = new ColumnData(columnNames[columnIndex++]);
+               ColumnData data1Child3 = new ColumnData(columnNames[columnIndex++]);
+               data1.getChildren().add(data1Child1);
+               data1.getChildren().add(data1Child2);
+               data1.getChildren().add(data1Child3);
+               columnData.add(data1);
+
+               ColumnData data2 = new ColumnData("Inclusive");
+               ColumnData data2Child1 = new ColumnData(columnNames[columnIndex++]);
+               ColumnData data2Child2 = new ColumnData(columnNames[columnIndex++]);
+               ColumnData data2Child3 = new ColumnData(columnNames[columnIndex++]);
+               data2.getChildren().add(data2Child1);
+               data2.getChildren().add(data2Child2);
+               data2.getChildren().add(data2Child3);
+               columnData.add(data2);
+
+               ColumnData data3 = new ColumnData(columnNames[columnIndex++]);
+               columnData.add(data3);
+       }
+
        @Override
        public void updateView() {
                treeComp.updateTree();
index 1817a24..742f8be 100644 (file)
@@ -29,7 +29,9 @@ package org.tizen.dynamicanalyzer.ui.summary.profiling;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.nebula.widgets.grid.Grid;
 import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
 import org.eclipse.nebula.widgets.grid.GridItem;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.MouseEvent;
@@ -44,6 +46,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.ColumnData;
 import org.tizen.dynamicanalyzer.model.TreeInput;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
@@ -57,6 +60,7 @@ public class ProfilingTable extends DATreeComposite {
        public ProfilingTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
                setComparator(new TreeDataComparator());
+//             createColumnData();
 
                comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
                comparator.setColumn(2);
@@ -129,34 +133,61 @@ public class ProfilingTable extends DATreeComposite {
                });
        }
 
-       @Override
-       public void setColumns(String[] columnNames) {
-               int size = columnNames.length;
+       public void setColumns(List<ColumnData> columnData) {
+               int size = columnData.size();
+               int index = 0;
                for (int i = 0; i < size; i++) {
-                       GridColumn column = new GridColumn(tree, SWT.NONE);
-                       column.setText(columnNames[i]);
-                       if (treeTable && i == 0) {
-                               column.setTree(true);
+                       if (columnData.get(i).isParent()) {
+                               GridColumnGroup columnGroup = new GridColumnGroup(tree,
+                                               SWT.NONE);
+                               columnGroup.setHeaderRenderer(new ColumnGroupRenderer());
+                               columnGroup.setText(columnData.get(i).getText());
+                               List<ColumnData> children = columnData.get(i).getChildren();
+                               int childSize = children.size();
+                               for (int ii = 0; ii < childSize; ii++) {
+                                       createColumn(columnGroup, children.get(ii), index++);
+                               }
+                       } else {
+                               createColumn(tree, columnData.get(i), index++);
                        }
-                       column.setCellRenderer(new FunctionUsageProfilingTableCellRenderer());
-                       column.setHeaderRenderer(new DATableHeaderRenderer());
+               }
+       }
+
+       private void createColumn(Object parent, ColumnData data, int index) {
+               GridColumn column = null;
+               if (parent instanceof GridColumnGroup) {
+                       GridColumnGroup group = (GridColumnGroup) parent;
+                       column = new GridColumn(group, SWT.NONE);
+               } else {
+                       Grid table = (Grid) parent;
+                       column = new GridColumn(table, SWT.NONE);
+               }
+
+               column.setCellRenderer(new FunctionUsageProfilingTableCellRenderer());
+               column.setHeaderRenderer(new DATableHeaderRenderer());
+               column.setText(data.getText());
+               if (data.getWidth() == 0) {
                        column.pack();
+               } else {
+                       column.setWidth(data.getWidth());
+               }
+               if (treeTable && index == 0) {
+                       column.setTree(true);
+               }
 
-                       if (null != comparator && null != sourceColumns
-                                       && null != sortTypes) {
-                               final int type = sortTypes[i];
-                               final int sourceColumn = sourceColumns[i];
-                               final int columnIndex = i;
-                               column.addSelectionListener(new SelectionAdapter() {
-                                       public void widgetSelected(SelectionEvent event) {
-                                               comparator.setType(type);
-                                               comparator.setColumn(columnIndex);
-                                               comparator.setSourceColumn(sourceColumn);
-                                               comparator.reverseDirection();
-                                               updateTree();
-                                       }
-                               });
-                       }
+               if (null != comparator && null != sourceColumns && null != sortTypes) {
+                       final int type = sortTypes[index];
+                       final int sourceColumn = sourceColumns[index];
+                       final int columnIndex = index;
+                       column.addSelectionListener(new SelectionAdapter() {
+                               public void widgetSelected(SelectionEvent event) {
+                                       comparator.setType(type);
+                                       comparator.setColumn(columnIndex);
+                                       comparator.setSourceColumn(sourceColumn);
+                                       comparator.reverseDirection();
+                                       updateTree();
+                               }
+                       });
                }
        }
 
@@ -236,6 +267,7 @@ public class ProfilingTable extends DATreeComposite {
                text.add(input.getName()); // must add 0 column data empty
                text.add(exTime);
                text.add(exRate + " " + CommonConstants.PERCENT); //$NON-NLS-1$
+               text.add(exeTime);
                if (inputType == AnalyzerConstants.FUPD_DEPENDENT_LIB) {
                        text.add("-");
                        text.add("-");
@@ -243,9 +275,8 @@ public class ProfilingTable extends DATreeComposite {
                        text.add(inTime);
                        text.add(inRate + " " + CommonConstants.PERCENT); //$NON-NLS-1$
                }
-               text.add(callCount);
-               text.add(exeTime);
                text.add(inExeTime);
+               text.add(callCount);
 
                TreeInput output = new TreeInput();
                output.setText(text);
@@ -275,7 +306,8 @@ public class ProfilingTable extends DATreeComposite {
        @Override
        public List<TreeInput> makeTreeInput() {
                List<TreeInput> output = new ArrayList<TreeInput>();
-               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance().getProfileDataMaker();
+               ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+                               .getProfileDataMaker();
                ProfilingData appBin = profiler.getAppBin();
                if (null != appBin) {
                        TreeInput appBinInput = makeInput(appBin,
index b4f8c82..0b17e63 100644 (file)
@@ -72,8 +72,6 @@ public class TimelinePage extends DAPageComposite {
                rightForm = new SashForm(leftForm, SWT.VERTICAL);
 
                // index 1 : INFO_INDEX
-//             DATimelineTabComposite tabView = new DATimelineTabComposite(rightForm,
-//                             SWT.NONE);
                DATabComposite tabView = new DATabComposite(rightForm,SWT.NONE);
                addView(tabView);
                {
index 0d6a0ff..55fedc8 100644 (file)
@@ -44,10 +44,15 @@ import org.tizen.dynamicanalyzer.model.DAView;
 import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+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;
 import org.tizen.dynamicanalyzer.ui.widgets.table.TableComparator;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class CallTraceView extends DAView {
        public static final String ID = CallTraceView.class.getName();
@@ -61,8 +66,8 @@ public class CallTraceView extends DAView {
                        AnalyzerConstants.SORT_TYPE_STRING };
        int[] sourceColumns = { LogCenterConstants.TIME_INDEX,
                        LogCenterConstants.APINAME_INDEX };
-       int[] innerMaxWeight = {0, 100};
-       int[] outerMaxWeight = {0, 100};
+       int[] innerMaxWeight = { 0, 100 };
+       int[] outerMaxWeight = { 0, 100 };
 
        public CallTraceView(Composite parent, int style) {
                super(parent, style);
@@ -83,7 +88,7 @@ public class CallTraceView extends DAView {
                tableComp.setColumns(columnNames);
                tableComp.setColumnSize(columnSizes);
                tableComp.setColumnVisibility(columnVisibility);
-               
+
                setMaxWeight(innerMaxWeight, outerMaxWeight);
        }
 
@@ -133,6 +138,17 @@ public class CallTraceView extends DAView {
                                sel.put(seq, seq);
                        }
                }
+
+               /* only callstack update */
+               // timeline view and tabcomp top view : callstack
+               if (selData.getViewId().equals(TimelineView.ID)) {
+                       DATabComposite tabView = (DATabComposite) AnalyzerUtil.getView(
+                                       TimelinePage.ID, DATabComposite.ID);
+                       Composite comp = tabView.getTopComposite();
+                       if (comp instanceof CallstackView) {
+                               ((CallstackView) comp).updateView();
+                       }
+               }
        }
 
        @Override
@@ -171,5 +187,4 @@ public class CallTraceView extends DAView {
                }
        }
 
-
 }
index b9479fd..824e677 100644 (file)
@@ -32,12 +32,12 @@ import org.eclipse.nebula.widgets.grid.internal.SortArrowRenderer;
 import org.eclipse.nebula.widgets.grid.internal.TextUtils;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 
-
 public class DATableHeaderRenderer extends DefaultColumnHeaderRenderer {
 
        int leftMargin = 6;
@@ -82,8 +82,8 @@ public class DATableHeaderRenderer extends DefaultColumnHeaderRenderer {
                Rectangle r = getBounds();
                gc.fillRectangle(r.x, r.y, r.width, r.height);
                gc.setForeground(ColorResources.TABLE_LINE);
-               gc.drawLine(r.x -1, r.y, r.x -1, r.y + r.height);
-               gc.drawLine(r.x -1, r.y + r.height, r.x + r.width, r.y + r.height);
+               gc.drawLine(r.x - 1, r.y, r.x - 1, r.y + r.height);
+               gc.drawLine(r.x - 1, r.y + r.height, r.x + r.width, r.y + r.height);
 
                int pushedDrawingOffset = 0;
                if (drawSelected) {
@@ -110,13 +110,14 @@ public class DATableHeaderRenderer extends DefaultColumnHeaderRenderer {
                // font color
                gc.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
                gc.setFont(FontResources.TABLE_HEADER);
+               String inputText = TextUtils.getShortString(gc, column.getText(), width);
+               Point textSize = gc.textExtent(inputText, SWT.DRAW_MNEMONIC);
 
-               int y = getBounds().y + getBounds().height - bottomMargin
-                               - gc.getFontMetrics().getHeight();
+               int textX = r.x + (r.width - textSize.x) / 2;
+               int y = getBounds().y + (getBounds().height - textSize.y) / 2;
 
                gc.drawString(TextUtils.getShortString(gc, column.getText(), width),
-                               getBounds().x + x + pushedDrawingOffset, y
-                                               + pushedDrawingOffset, true);
+                               textX + pushedDrawingOffset, y + pushedDrawingOffset, true);
 
                if (column.getSort() != SWT.NONE) {
                        arrowRenderer.setSelected(column.getSort() == SWT.UP);