[Title]chart update & thread page update
authoryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Wed, 1 Aug 2012 12:51:05 +0000 (21:51 +0900)
committeryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Wed, 1 Aug 2012 12:51:05 +0000 (21:51 +0900)
[Type]feature
[Module]pageChart, thread page
[Priority]high
[CQ#]
[Redmine#]6184,5322
[Problem]
[Cause]
[Solution]
[TestCase]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/CommonPageLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/CommonPageLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageChartGraphSeries.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageChartGraphSeriesItem.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageChartItem.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/pageInfo/PageDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/threadPage/ThreadAPIListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/threadPage/ThreadPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/threadPage/ThreadPageDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAPageChart/DAPageChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAPageChart/DAPageChartTimelineCellRenderer.java

index 892eb92..c99231c 100644 (file)
@@ -14,6 +14,7 @@ public class CommonPageLabels extends NLS {
        public static String COMMON_DATA_COLUMN_RETURN;
        public static String COMMON_DATA_COLUMN_ERRNO;
        public static String COMMON_DATA_COLUMN_APITYPE;
+       public static String PAGE_CHART_SERIES_NAME;
        
        static {
                // initialize resource bundle
index 52c2d57..180d1e1 100644 (file)
@@ -6,4 +6,5 @@ COMMON_DATA_COLUMN_PARAMETER=Parameter
 COMMON_DATA_COLUMN_THREADID=Thread ID
 COMMON_DATA_COLUMN_RETURN=Return
 COMMON_DATA_COLUMN_ERRNO=errno
-COMMON_DATA_COLUMN_APITYPE=API Type
\ No newline at end of file
+COMMON_DATA_COLUMN_APITYPE=API Type
+PAGE_CHART_SERIES_NAME=Page
\ No newline at end of file
index 284bab5..c9d2695 100644 (file)
@@ -1,5 +1,8 @@
 package org.tizen.dynamicanalyzer.ui.views.pageInfo;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.swt.graphics.Color;
 
 public class PageChartGraphSeries {
@@ -9,29 +12,38 @@ public class PageChartGraphSeries {
        public static final int PAGECHART_GRAPHITEM_STATUS_LINE = 1 << 3;
        public static final int PAGECHART_GRAPHITEM_STATUS_AREA = 1 << 4;
        //evnet added option
-       public static final int PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_START = 1 << 5;
-       public static final int PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_END = 1 << 6;
 
        private String name;
-       private long x; // time
-       private long y; // value
-       private Color eventColor;
        private int style;
+       private List<PageChartGraphSeriesItem> seriesItems = new ArrayList<PageChartGraphSeriesItem>();
+//     private long x; // time
+//     private long y; // value
+       private Color eventColor;
 
-       public PageChartGraphSeries(long x, long y, Color eventColor, int chartStyle) {
-               this.x = x;
-               this.y = y;
+//     public PageChartGraphSeries(long x, long y, Color eventColor, int chartStyle) {
+//             this.x = x;
+//             this.y = y;
+//             this.eventColor = eventColor;
+//             this.style = chartStyle;
+//     }
+       
+       public PageChartGraphSeries(int chartStyle, Color eventColor) {
+               
                this.eventColor = eventColor;
-               this.setStyle(chartStyle);
+               this.style = chartStyle;
        }
-
-       public long getY() {
-               return y;
+       
+       public PageChartGraphSeries(int chartStyle) {
+               this.setStyle(chartStyle);
        }
 
-       public void setY(int y) {
-               this.y = y;
-       }
+//     public long getY() {
+//             return y;
+//     }
+//
+//     public void setY(int y) {
+//             this.y = y;
+//     }
 
        public Color getEventColor() {
                return eventColor;
@@ -41,13 +53,13 @@ public class PageChartGraphSeries {
                this.eventColor = eventColor;
        }
 
-       public long getX() {
-               return x;
-       }
-
-       public void setX(long x) {
-               this.x = x;
-       }
+//     public long getX() {
+//             return x;
+//     }
+//
+//     public void setX(long x) {
+//             this.x = x;
+//     }
 
        public String getName() {
                return name;
@@ -68,4 +80,38 @@ public class PageChartGraphSeries {
        public void addStyle(int style) {
                this.style |= style;
        }
+       
+       public PageChartGraphSeriesItem get(int itemIndex){
+               if(null != seriesItems && seriesItems.size() > itemIndex){
+                       return seriesItems.get(itemIndex);
+               }
+               else{
+                       return null;
+               }
+       }
+       
+       public int getSize(){
+               return seriesItems.size();
+       }
+       public List<PageChartGraphSeriesItem> gets(){
+               return seriesItems;
+       }
+       
+       public void add(PageChartGraphSeriesItem item){
+               seriesItems.add(item);
+       }
+       
+       public void add(long x, long y, Color color){
+               
+               seriesItems.add(new PageChartGraphSeriesItem(x,y,color));
+       }
+       
+       public void add(long x, long y){
+               
+               seriesItems.add(new PageChartGraphSeriesItem(x,y,null));
+       }
+       
+       public void clear(){
+               seriesItems.clear();
+       }
 }
index eeb9a88..eec77bf 100644 (file)
@@ -3,14 +3,25 @@ package org.tizen.dynamicanalyzer.ui.views.pageInfo;
 import org.eclipse.swt.graphics.Color;
 
 public class PageChartGraphSeriesItem {
+       public static final int PAGECHART_GRAPHITEM_STYLE_NONE = 0;
+       public static final int PAGECHART_GRAPHITEM_STYLE_EVENT_PERIOD_START = 1;
+       public static final int PAGECHART_GRAPHITEM_STYLE_EVENT_PERIOD_END = 2;
+       
        private long x;
        private long y;
        private Color eventColor;
+       private int itemStyle = PAGECHART_GRAPHITEM_STYLE_NONE;
        
        public PageChartGraphSeriesItem(long x, long y, Color eventColor){
-               this.setX(x);
-               this.setY(y);
-               this.setEventColor(eventColor);
+               this.x = x;
+               this.y = y;
+               this.eventColor = eventColor;
+       }
+
+       //event series only
+       public PageChartGraphSeriesItem(long x, long y, Color eventColor, int itemStyle){
+               this(x,y,eventColor);
+               this.itemStyle = itemStyle;
        }
 
        public long getX() {
@@ -36,6 +47,12 @@ public class PageChartGraphSeriesItem {
        public void setEventColor(Color eventColor) {
                this.eventColor = eventColor;
        }
-       
-       
+
+       public int getItemStyle() {
+               return itemStyle;
+       }
+
+       public void setItemStyle(int itemStyle) {
+               this.itemStyle = itemStyle;
+       }
 }
index be315f1..d78262c 100644 (file)
@@ -15,20 +15,20 @@ public class PageChartItem {
        private GridItem gridItem = null;
 
        private List<PageChartItem> children = new ArrayList<PageChartItem>();
-       private List<PageChartGraphSeries> graphItems = new ArrayList<PageChartGraphSeries>();
+       private List<PageChartGraphSeries> seriesList = new ArrayList<PageChartGraphSeries>();
 
        public PageChartItem(final DAPageChart chart, final String text) {
                // super(chart, SWT.NONE);
                // TODO Auto-generated constructor stub
                this.chart = chart;
                this.text = text;
-               this.chart.AddItem(this);
+               this.chart.addItem(this);
                Display.getDefault().syncExec(new Runnable() {
                        @Override
                        public void run() {
                                gridItem = new GridItem(chart.GetInnerChart(), SWT.NONE);
                                gridItem.setText(text);
-                               gridItem.setData("graphItems", graphItems); //$NON-NLS-1$
+                               gridItem.setData("seriesList", seriesList); //$NON-NLS-1$
                                gridItem.setData("children", children); //$NON-NLS-1$
                        }
                });
@@ -38,15 +38,15 @@ public class PageChartItem {
                        PageChartGraphSeries graphItem) {
                this(chart, text);
                // TODO Auto-generated constructor stub
-               graphItems.add(graphItem);
+               seriesList.add(graphItem);
        }
 
        public PageChartItem(final PageChartItem parent, final String text) {
                // super(chart, SWT.NONE);
                // TODO Auto-generated constructor stub
-               this.chart = parent.GetChart();
+               this.chart = parent.getChart();
                this.parent = parent;
-               parent.AddChild(this);
+               parent.addChild(this);
                this.text = text;
                Display.getDefault().syncExec(new Runnable() {
                        @Override
@@ -63,68 +63,82 @@ public class PageChartItem {
                this(parent, text);
 
                // TODO Auto-generated constructor stub
-               graphItems.add(graphItem);
+               seriesList.add(graphItem);
        }
-
-       public String GetText() {
+       
+       public String getText() {
                return text;
        }
 
-       public void SetText(String text) {
+       public void setText(String text) {
                this.text = text;
        }
 
-       public DAPageChart GetChart() {
+       public DAPageChart getChart() {
                return chart;
        }
+       
+       public void setChart(DAPageChart chart){
+               this.chart = chart;
+               
+               for(int i=0; i < children.size(); i++){
+                       children.get(i).setChart(this.chart);
+               }
+       }
 
-       public PageChartItem GetParent() {
+       public PageChartItem getParent() {
                return parent;
        }
+       
+       public void setParent(PageChartItem parent) {
+               this.parent = parent;
+       }
 
-       private PageChartItem AddChild(PageChartItem child) {
+       public PageChartItem addChild(PageChartItem child) {
                children.add(child);
+               child.setParent(this);
+               child.setChart(this.chart);
 
-               while (null != parent) {
-                       parent.AddGraphItems(child.GetGraphItem());
-                       parent = parent.parent;
-               }
+//             while (null != parent) {
+//                     parent.addSeriesList(child.getSeriesList());
+//                     parent = parent.parent;
+//             }
                // FIXME : redraw
                // chart.printItems();
                chart.redraw();
                return this;
        }
 
-       public List<PageChartItem> GetChildren() {
+       public List<PageChartItem> getChildren() {
                return children;
        }
 
-       public List<PageChartGraphSeries> GetGraphItem() {
-               return graphItems;
+       public List<PageChartGraphSeries> getSeriesList() {
+               return seriesList;
        }
 
-       public void AddGraphItem(PageChartGraphSeries item) {
+       public void addSeries(PageChartGraphSeries series) {
                int i;
-               for (i = graphItems.size(); i > 0; i--) {
-                       if (graphItems.get(i - 1).getX() <= item.getX())
-                               break;
-               }
-               graphItems.add(i, item);
-
-               PageChartItem parent = this.parent;
-               while (null != parent) {
-                       parent.AddGraphItem(item);
-                       parent = parent.parent;
-               }
+//             for (i = seriesList.size(); i > 0; i--) {
+//                     if (seriesList.get(i - 1).getX() <= item.getX())
+//                             break;
+//             }
+               seriesList.add(series);
+
+//             PageChartItem parent = this.parent;
+//             while (null != parent) {
+//                     parent.addSeries(item);
+//                     parent = parent.parent;
+//             }
 
                // FIXME : redraw
                // chart.printItems();
                chart.redraw();
        }
 
-       public void AddGraphItems(List<PageChartGraphSeries> items) {
+       public void addSeriesList(List<PageChartGraphSeries> items) {
                for (int i = 0; i < items.size(); i++) {
-                       AddGraphItem(items.get(i));
+                       addSeries(items.get(i));
                }
                // FIXME : redraw
                // chart.printItems();
index d0da270..d81645a 100644 (file)
@@ -3,15 +3,17 @@ package org.tizen.dynamicanalyzer.ui.views.pageInfo;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.swt.graphics.Color;
 import org.tizen.dynamicanalyzer.ColorResources;
 import org.tizen.dynamicanalyzer.constants.LogCenterConstants;
 import org.tizen.dynamicanalyzer.model.FailedData;
 import org.tizen.dynamicanalyzer.model.LogPackage;
+import org.tizen.dynamicanalyzer.nl.CommonPageLabels;
 import org.tizen.dynamicanalyzer.ui.widgets.DAPageChart.DAPageChart;
 
 public abstract class PageDataManager {
        protected List<PageDataItem> rows = new ArrayList<PageDataItem>();
-       protected PageDataColumn column = RegistePageDataColumn();
+       protected PageDataColumn column = registePageDataColumn();
 
        // private List<WarningData> warning = null;
        protected List<FailedData> failed = null;
@@ -29,8 +31,41 @@ public abstract class PageDataManager {
        public static int PAGE_COLUMN_RETURN = 6;
        public static int PAGE_COLUMN_ERRNO = 7;
        public static int PAGE_COLUMN_APITYPE = 8;
+       
+       public static final String SERIES_NAME_PAGE_DATA = CommonPageLabels.PAGE_CHART_SERIES_NAME;
+       private static Color DEFAULT_COLOR_OPEN = ColorResources.BLUE; 
+       private static Color DEFAULT_COLOR_CLOSE = ColorResources.BLUE;
+       private static Color DEFAULT_COLOR_OTHER = ColorResources.BLUE;
+       
+       private Color openEventColor = DEFAULT_COLOR_OPEN;
+       private Color closeEventColor = DEFAULT_COLOR_CLOSE;
+       private Color otherEventColor = DEFAULT_COLOR_OTHER;
+       
+       public void setOpenEventColor(Color color){
+               openEventColor = color;
+       }
+       
+       public Color getOpenEventColor(){
+               return openEventColor;
+       }
+       
+       public void setCloseEventColor(Color color){
+               closeEventColor = color;
+       }
+       
+       public Color getCloseEventColor(){
+               return closeEventColor;
+       }
+       
+       public void setOtherEventColor(Color color){
+               otherEventColor = color;
+       }
+       
+       public Color getOtherEventColor(){
+               return otherEventColor;
+       }
 
-       public void SetPageChart(DAPageChart pageChart) {
+       public void setPageChart(DAPageChart pageChart) {
                this.pageChart = pageChart;
        }
 
@@ -40,7 +75,7 @@ public abstract class PageDataManager {
                this.secondKeyIndex = secondKeyIndex;
        }
 
-       private void AddErrorData(FailedData data) {
+       private void addErrorData(FailedData data) {
                if (null == failed)
                        failed = new ArrayList<FailedData>();
                failed.add(data);
@@ -52,12 +87,12 @@ public abstract class PageDataManager {
        // warning.add(data);
        // }
 
-       protected int AddPageDataItem(PageDataItem data) {
+       protected int addPageDataItem(PageDataItem data) {
                rows.add(data);
                return rows.size() - 1;
        }
 
-       private int FindInsertIndex(PageDataItem data, int Index) {
+       private int findInsertIndex(PageDataItem data, int Index) {
                int ret = rows.size() - 1;
                switch (column.GetColumnAttribute(Index)) {
                case PageDataColumn.COLUMN_ATTRIBUTE_INT:
@@ -90,12 +125,12 @@ public abstract class PageDataManager {
                return ret;
        }
 
-       protected void AddPageDataItemBySortIndex(PageDataItem data, int Index) {
+       protected void addPageDataItemBySortIndex(PageDataItem data, int Index) {
                int insertIndex;
                if (null == rows)
                        rows = new ArrayList<PageDataItem>();
                for (int i = rows.size() - 1; i >= 0; i--) {
-                       insertIndex = FindInsertIndex(data, Index);
+                       insertIndex = findInsertIndex(data, Index);
                        if (insertIndex >= 0 && insertIndex <= rows.size())
                                rows.add(insertIndex, data);
                }
@@ -105,71 +140,154 @@ public abstract class PageDataManager {
                this.column = column;
        }
 
-       private boolean isItemExist(PageChartItem item, String key) { // FIXME
-               if (null == item)
-                       return false;
-               if (item.GetText().compareTo(key) == 0)
-                       return true;
-               else
-                       return false;
+       private int findChartItem(List<PageChartItem> items, String key) { // FIXME
+               if (null == items)
+                       return -1;
+               int itemSize = items.size();
+               for (int i = 0; i < itemSize; i++) {
+                       PageChartItem item = items.get(i);
+                       if (item.getText().compareTo(key) == 0)
+                               return i;
+               }
+               return -1;
        }
 
-       public void AddPageChartItem(PageDataItem dataItem, int itemIndex) {
+       public void addPageChartItem(PageDataItem dataItem, int itemIndex) {
                List<PageChartItem> items = pageChart.GetItems();
-               int itemSize = items.size();
-               int graphItemStyle = PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT;
+               int itemSize = 0;
+               
+               int graphSeriesItemStyle = PageChartGraphSeriesItem.PAGECHART_GRAPHITEM_STYLE_NONE;
+               Color eventColor;
+               
                if(dataItem.GetText(PAGE_COLUMN_APITYPE).matches(LogCenterConstants.FD_API_TYPE_OPEN)){
-                       graphItemStyle |= PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_START;
+                       graphSeriesItemStyle = PageChartGraphSeriesItem.PAGECHART_GRAPHITEM_STYLE_EVENT_PERIOD_START;
+                       eventColor = openEventColor;
                }
                else if(dataItem.GetText(PAGE_COLUMN_APITYPE).matches(LogCenterConstants.FD_API_TYPE_CLOSE)){
-                       graphItemStyle |= PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_END;
+                       graphSeriesItemStyle = PageChartGraphSeriesItem.PAGECHART_GRAPHITEM_STYLE_EVENT_PERIOD_END;
+                       eventColor = closeEventColor;
+               }
+               else{
+                       eventColor = otherEventColor;
                }
-               PageChartGraphSeries graphItem = new PageChartGraphSeries(
-                               Long.parseLong(dataItem.GetText(PAGE_COLUMN_TIME)),itemIndex,
-                               ColorResources.BLUE,graphItemStyle);
-               PageChartItem newItem = null;
 
-               if (null != items && 0 != itemSize) {
-                       for (int i = 0; i < itemSize; i++) {
-                               PageChartItem item = items.get(i);
-                               if (true == isItemExist(item, dataItem.GetText(PAGE_COLUMN_KEY))) {
-                                       if (true == useSecondKey) {
-                                               List<PageChartItem> children = item.GetChildren();
-                                               int childrenSize = children.size();
-                                               for (int j = 0; j < childrenSize; j++) {
-                                                       PageChartItem child = children.get(j);
-                                                       if (true == isItemExist(child,
-                                                                       dataItem.GetText(secondKeyIndex))) {
-                                                               child.AddGraphItem(graphItem);
-                                                               return;
-                                                       }
-                                               }
-                                               newItem = new PageChartItem(item,
-                                                               dataItem.GetText(secondKeyIndex), graphItem);
-                                               // item.AddChild(newItem);
-                                               return;
-                                       } else {
-                                               item.AddGraphItem(graphItem);
-                                               return;
-                                       }
+               PageChartGraphSeriesItem seriesItem = new PageChartGraphSeriesItem(Long.parseLong(dataItem.GetText(PAGE_COLUMN_TIME)),itemIndex, eventColor, graphSeriesItemStyle);
+               String itemName = dataItem.GetText(PAGE_COLUMN_KEY);
+               int chartItemIndex = findChartItem(items, itemName);
+               PageChartItem findItem = null;
+               if (0 <= chartItemIndex) {
+                       findItem = items.get(chartItemIndex);
+               }
+               PageChartGraphSeries firstItemSeries;
+               if(null != findItem){
+                       if (true == useSecondKey) {
+                               String childItemName = dataItem.GetText(secondKeyIndex);
+                               List<PageChartItem> children = findItem.getChildren();
+                               int secondChartItemIndex =findChartItem(children, childItemName);
+                               PageChartItem secondFindItem = null;
+                               if (0 <= secondChartItemIndex) {
+                                       secondFindItem = children.get(secondChartItemIndex);
+                               }
+                               PageChartGraphSeries secondItemseries = null;
+                               if(secondFindItem !=null){
+                                       secondItemseries = secondFindItem.getSeriesList().get(0);
+                                       secondItemseries.add(seriesItem);
+                                       //                                                              return;
+                               }
+                               else{
+                                       //FIXME :
+                                       //create new child item
+                                       secondItemseries = new PageChartGraphSeries(PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT);
+                                       secondItemseries.add(seriesItem);
+                                       //                                                      children.add(new PageChartItem(findItem, childItemName, secondItemseries));
+                                       new PageChartItem(findItem, childItemName, secondItemseries);
+                                       //add series item to paret
                                }
                        }
+                       firstItemSeries = findItem.getSeriesList().get(0);
+                       firstItemSeries.add(seriesItem);
+               }
+               else{
+                       firstItemSeries = new PageChartGraphSeries(PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT);
+                       firstItemSeries.add(seriesItem);
+                       PageChartItem firstItem = new PageChartItem(pageChart, itemName, firstItemSeries);
+                       //                                      pageChart.addItem(firstItem);
+                       if (true == useSecondKey) {
+                               String childItemName = dataItem.GetText(secondKeyIndex);
+                               PageChartGraphSeries secondItemseries = new PageChartGraphSeries(PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT);
+                               secondItemseries.add(seriesItem);
+                               new PageChartItem(firstItem, childItemName, secondItemseries);
+                       }
                }
 
-               if (true == useSecondKey) {
-                       newItem = new PageChartItem(new PageChartItem(pageChart,
-                                       dataItem.GetText(PAGE_COLUMN_KEY)),
-                                       dataItem.GetText(secondKeyIndex), graphItem);
-               } else
-                       newItem = new PageChartItem(pageChart,
-                                       dataItem.GetText(PAGE_COLUMN_KEY), graphItem);
-               // pageChart.AddItem(newItem);
+               
+                       
+                       
+//                     itemSize = items.size();
+//                     for (int i = 0; i < itemSize; i++) {
+//                             PageChartItem item = items.get(i);
+//                             if (true == isItemExist(item, dataItem.GetText(PAGE_COLUMN_KEY))) {
+//                                     if (true == useSecondKey) {
+//                                             
+//                                     }
+//                     }
+//             }
+//             
+//             List<PageChartItem> items = pageChart.GetItems();
+//             int itemSize = items.size();
+//             int graphItemStyle = PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT;
+//             if(dataItem.GetText(PAGE_COLUMN_APITYPE).matches(LogCenterConstants.FD_API_TYPE_OPEN)){
+//                     graphItemStyle |= PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_START;
+//             }
+//             else if(dataItem.GetText(PAGE_COLUMN_APITYPE).matches(LogCenterConstants.FD_API_TYPE_CLOSE)){
+//                     graphItemStyle |= PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_END;
+//             }
+//             PageChartGraphSeries graphItem = new PageChartGraphSeries(
+//                             Long.parseLong(dataItem.GetText(PAGE_COLUMN_TIME)),itemIndex,
+//                             ColorResources.BLUE,graphItemStyle);
+//             PageChartItem newItem = null;
+//
+//             if (null != items && 0 != itemSize) {
+//                     for (int i = 0; i < itemSize; i++) {
+//                             PageChartItem item = items.get(i);
+//                             if (true == isItemExist(item, dataItem.GetText(PAGE_COLUMN_KEY))) {
+//                                     if (true == useSecondKey) {
+//                                             List<PageChartItem> children = item.GetChildren();
+//                                             int childrenSize = children.size();
+//                                             for (int j = 0; j < childrenSize; j++) {
+//                                                     PageChartItem child = children.get(j);
+//                                                     if (true == isItemExist(child,
+//                                                                     dataItem.GetText(secondKeyIndex))) {
+//                                                             child.AddGraphItem(graphItem);
+//                                                             return;
+//                                                     }
+//                                             }
+//                                             newItem = new PageChartItem(item,
+//                                                             dataItem.GetText(secondKeyIndex), graphItem);
+//                                             // item.AddChild(newItem);
+//                                             return;
+//                                     } else {
+//                                             item.AddGraphItem(graphItem);
+//                                             return;
+//                                     }
+//                             }
+//                     }
+//             }
+//
+//             if (true == useSecondKey) {
+//                     newItem = new PageChartItem(new PageChartItem(pageChart,
+//                                     dataItem.GetText(PAGE_COLUMN_KEY)),
+//                                     dataItem.GetText(secondKeyIndex), graphItem);
+//             } else
+//                     newItem = new PageChartItem(pageChart,
+//                                     dataItem.GetText(PAGE_COLUMN_KEY), graphItem);
+//             // pageChart.AddItem(newItem);
                return;
 
        }
 
-       public void ParsePageData(LogPackage logPack) {
-               List<List<String>> inputs = GetLogsFromLogPackage(logPack);
+       public void parsePageData(LogPackage logPack) {
+               List<List<String>> inputs = getLogsFromLogPackage(logPack);
                int size;
                if (null == inputs || 0 == (size = inputs.size())) {
                        return;
@@ -179,19 +297,19 @@ public abstract class PageDataManager {
                        List<String> input = inputs.get(i);
 
                        // error check
-                       if (true == ErrorCheck(input)) {
+                       if (true == errorCheck(input)) {
                                FailedData ffd = new FailedData(input);
-                               AddErrorData(ffd);
+                               addErrorData(ffd);
                                continue;
                        }
 
                        // add page data
-                       PageDataItem item = MakePageData(input);
-                       int itemIndex = AddPageDataItem(item);
+                       PageDataItem item = makePageData(input);
+                       int itemIndex = addPageDataItem(item);
 
                        // add page chart data
                        if (null != pageChart) {
-                               AddPageChartItem(item, itemIndex);
+                               addPageChartItem(item, itemIndex);
                        }
                }
        }
@@ -219,11 +337,11 @@ public abstract class PageDataManager {
        // chartItems
        // }
        
-       public PageDataColumn GetPageDataColumn(){
+       public PageDataColumn getPageDataColumn(){
                return column;
        }
        
-       public List<String> GetColumnNames(){
+       public List<String> getColumnNames(){
                if(null == column){
                        return null;
                }
@@ -232,7 +350,7 @@ public abstract class PageDataManager {
                return nameList;
        }
        
-       public String[] GetColumnNamesToArray(){
+       public String[] getColumnNamesToArray(){
                if(null == column){
                        return null;
                }
@@ -244,7 +362,7 @@ public abstract class PageDataManager {
                return names;
        }
        
-       public List<Integer> GetColumnTypes(){
+       public List<Integer> getColumnTypes(){
                if(null == column){
                        return null;
                }
@@ -252,7 +370,7 @@ public abstract class PageDataManager {
                return typeList;
        }
        
-       public Integer[] GetColumnTypesToArray(){
+       public Integer[] getColumnTypesToArray(){
                if(null == column){
                        return null;
                }
@@ -262,21 +380,21 @@ public abstract class PageDataManager {
                return types;
        }
        
-       public PageDataItem GetPageDataItem(int index){
+       public PageDataItem getPageDataItem(int index){
                if(index < rows.size()){
                        return rows.get(index);
                }
                return null;
        }
 
-       public abstract PageDataColumn RegistePageDataColumn();
+       public abstract PageDataColumn registePageDataColumn();
 
-       public abstract List<List<String>> GetLogsFromLogPackage(LogPackage logPack);
+       public abstract List<List<String>> getLogsFromLogPackage(LogPackage logPack);
 
-       public abstract PageDataItem MakePageData(List<String> input);
+       public abstract PageDataItem makePageData(List<String> input);
 
        // public abstract PageChartDataItem MakePageChartData(PageDataItem);
        // //FIXME
-       public abstract boolean ErrorCheck(List<String> input);
+       public abstract boolean errorCheck(List<String> input);
        // public abstract boolean WarningCheck(List<String> input);
 }
index 0307d2c..328e162 100644 (file)
@@ -2,7 +2,6 @@ package org.tizen.dynamicanalyzer.ui.views.threadPage;
 
 import java.util.List;
 
-import org.eclipse.nebula.widgets.grid.Grid;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -11,14 +10,12 @@ import org.tizen.dynamicanalyzer.ColorResources;
 import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
 import org.tizen.dynamicanalyzer.model.DASelectionData;
 import org.tizen.dynamicanalyzer.model.DAView;
-import org.tizen.dynamicanalyzer.nl.FilePageLabels;
 import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
 import org.tizen.dynamicanalyzer.ui.views.filePage.FileApiListView;
 import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartGraphSeries;
 import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartItem;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
 import org.tizen.dynamicanalyzer.ui.widgets.DAPageAPIListTable.DAPageAPIListTable;
-import org.tizen.dynamicanalyzer.ui.widgets.DATable.DATableComposite;
 
 public class ThreadAPIListView extends DAView {
 
@@ -40,7 +37,7 @@ public class ThreadAPIListView extends DAView {
                tableComp = new DAPageAPIListTable(contents, SWT.NONE, SWT.SINGLE
                                | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
                tableComp.setColumns(ThreadPageDataManager.getInstance()
-                               .GetColumnNamesToArray());
+                               .getColumnNamesToArray());
                tableComp.setColumnSize(columnSizes);
 
                tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
@@ -58,20 +55,22 @@ public class ThreadAPIListView extends DAView {
                if (null == item || !(item instanceof PageChartItem)) {
                        return;
                }
-               List<PageChartGraphSeries> graphItems = item.GetGraphItem();
+               List<PageChartGraphSeries> seriesList = item.getSeriesList();
 
-               if (null == graphItems) {
+               if (null == seriesList) {
                        return;
                }
 
                tableComp.clear();
 
-               for (int i = 0; i < graphItems.size(); i++) {
-                       PageChartGraphSeries graphItem = graphItems.get(i);
-                       int dataItemIndex = (int) graphItem.getY();
+               for (int i = 0; i < seriesList.size(); i++) {
+                       PageChartGraphSeries graphSeries = seriesList.get(i);
+                       for(int j = 0; j < graphSeries.getSize(); j++){
+                       int dataItemIndex = (int) graphSeries.get(j).getY();
 
                        tableComp.addItem(ThreadPageDataManager.getInstance()
-                                       .GetPageDataItem(dataItemIndex));
+                                       .getPageDataItem(dataItemIndex));
+                       }
                }
                // FIXME
                tableComp.updateTable();
index f55dc17..177e6d5 100644 (file)
@@ -78,10 +78,10 @@ public class ThreadPage extends DAPageComposite {
                // }
                // });
 
-               tManager.SetPageChart((DAPageChart) threadChartView.getControl());
+               tManager.setPageChart((DAPageChart) threadChartView.getControl());
        }
 
        public void updateLog(LogPackage logPack) {
-               tManager.ParsePageData(logPack);
+               tManager.parsePageData(logPack);
        }
 }
index 69d29cf..6d556aa 100644 (file)
@@ -49,7 +49,7 @@ public class ThreadPageDataManager extends PageDataManager {
        }
 
        @Override
-       public PageDataColumn RegistePageDataColumn() {
+       public PageDataColumn registePageDataColumn() {
                // TODO Auto-generated method stub
                PageDataColumn pageColumn = new PageDataColumn(
                                THREAD_PAGE_COLUMN_COUNT, columnNames, columnAttribute);
@@ -57,7 +57,7 @@ public class ThreadPageDataManager extends PageDataManager {
        }
 
        @Override
-       public List<List<String>> GetLogsFromLogPackage(LogPackage logPack) {
+       public List<List<String>> getLogsFromLogPackage(LogPackage logPack) {
                // TODO Auto-generated method stub
                Logs logs = logPack.getLogs(LogCenterConstants.LOG_RESOURCE);
                if (null == logs || logs.getLogs().size() == 0) {
@@ -84,7 +84,7 @@ public class ThreadPageDataManager extends PageDataManager {
        }
 
        @Override
-       public PageDataItem MakePageData(List<String> input) {
+       public PageDataItem makePageData(List<String> input) {
                // TODO Auto-generated method stub
                PageDataItem data = new PageDataItem(column);
                // key(object address)
@@ -121,7 +121,7 @@ public class ThreadPageDataManager extends PageDataManager {
        // //FIXME
        // }
        @Override
-       public boolean ErrorCheck(List<String> input) {
+       public boolean errorCheck(List<String> input) {
                // TODO Auto-generated method stub
                return false;
        }
index 6afef9c..0c64e22 100644 (file)
@@ -24,6 +24,7 @@ import org.tizen.dynamicanalyzer.ColorResources;
 import org.tizen.dynamicanalyzer.FontResources;
 import org.tizen.dynamicanalyzer.nl.DAPageChartLabels;
 import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartGraphSeries;
+import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartGraphSeriesItem;
 import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartItem;
 import org.tizen.dynamicanalyzer.ui.widgets.DATable.DATableEmptyColumnHeaderRenderer;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
@@ -118,8 +119,10 @@ public class DAPageChart extends Composite {
                SetColumns(parent, ColumnHeaderText);
        }
 
-       public void AddItem(PageChartItem item) {
+       public void addItem(PageChartItem item) {
                items.add(item);
+//             item.setParent(null);
+//             item.setChart(this);
                // printItem(items, 0);
                redraw();
                // FIXME : redraw
@@ -131,27 +134,34 @@ public class DAPageChart extends Composite {
 
        public void printItem(List<PageChartItem> items, int depth) {
                PageChartItem item;
-               PageChartGraphSeries graphItem;
-               List<PageChartGraphSeries> graphItems;
+               PageChartGraphSeries series;
+               List<PageChartGraphSeries> seriesList;
+               PageChartGraphSeriesItem sereisItem;
+               List<PageChartGraphSeriesItem> seriesItems;
                if (items != null && items.size() != 0) {
                        for (int i = 0; i < items.size(); i++) {
                                for (int j = 0; j < depth; j++) {
                                        System.out.print(" -"); //$NON-NLS-1$
                                }
                                item = items.get(i);
-                               System.out.print(item.GetText() + " : <"); //$NON-NLS-1$
-                               graphItems = item.GetGraphItem();
-                               if (graphItems != null && graphItems.size() != 0) {
-                                       for (int k = 0; k < graphItems.size(); k++) {
-                                               graphItem = graphItems.get(k);
-                                               System.out.print(graphItem.getY()
-                                                               + ", "); //$NON-NLS-1$
+                               System.out.print(item.getText() + " : <"); //$NON-NLS-1$
+                               seriesList = item.getSeriesList();
+                               if (seriesList != null && seriesList.size() != 0) {
+                                       for (int k = 0; k < seriesList.size(); k++) {
+                                               series = seriesList.get(k);
+                                               seriesItems = series.gets();
+                                               System.out.print("["+series.getName()+" : ");
+                                               for(int l = 0; l<seriesItems.size(); l++){
+                                                       System.out.print(seriesItems.get(l).getY()
+                                                                       + ", "); //$NON-NLS-1$
+                                               }
+                                               System.out.print("]");
                                        }
                                }
                                System.out.println(">"); //$NON-NLS-1$
-                               if (item.GetChildren() != null
-                                               && item.GetChildren().size() != 0) {
-                                       printItem(item.GetChildren(), depth + 1);
+                               if (item.getChildren() != null
+                                               && item.getChildren().size() != 0) {
+                                       printItem(item.getChildren(), depth + 1);
                                }
                        }
                } else {
index c25d4f9..d2fc2b0 100644 (file)
@@ -10,6 +10,7 @@ import org.tizen.dynamicanalyzer.ColorResources;
 import org.tizen.dynamicanalyzer.nl.DAPageChartLabels;
 import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
 import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartGraphSeries;
+import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartGraphSeriesItem;
 import org.tizen.dynamicanalyzer.ui.views.pageInfo.PageChartItem;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
@@ -43,64 +44,70 @@ public class DAPageChartTimelineCellRenderer extends DefaultCellRenderer {
 
                List<PageChartItem> children = (List<PageChartItem>) item
                                .getData("children"); //$NON-NLS-1$
-               List<PageChartGraphSeries> graphItems = (List<PageChartGraphSeries>) item
-                               .getData("graphItems"); //$NON-NLS-1$
+               List<PageChartGraphSeries> seriesList = (List<PageChartGraphSeries>) item
+                               .getData("seriesList"); //$NON-NLS-1$
 
-               PageChartGraphSeries graphItem;
-               int graphItemSize;
+               PageChartGraphSeries series;
+               List<PageChartGraphSeriesItem> seriesItems;
+               PageChartGraphSeriesItem seriesItem;
+               int seriesSize;
+               int seriesItemSize = 0;
                long startPeriodTime = 0;
-               if (null != graphItems) {
-                       graphItemSize = graphItems.size();
+               if (null != seriesList) {
+                       seriesSize = seriesList.size();
                        // draw period
                        boolean bPeriodStart = false;
-                       for (int i = 0; i < graphItemSize; i++) {
-                               graphItem = graphItems.get(i);
-                               if((graphItem.getStyle() & PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_START) != 0){
-                                       bPeriodStart = true;
-                                       startPeriodTime = graphItem.getX();
-                                       for(; i < graphItemSize; i++){
-                                               graphItem = graphItems.get(i);
-                                               if((graphItem.getStyle() & PageChartGraphSeries.PAGECHART_GRAPHITEM_STATUS_EVENT_PERIOD_END) != 0){
-                                                       long endPeriodTime = graphItem.getX();
+                       for (int i = 0; i < seriesSize; i++) {
+                               series = seriesList.get(i);
+                               seriesItems = series.gets();
+                               seriesItemSize = seriesItems.size();
+                               for(int j=0; j<seriesItemSize; j++){
+                                       seriesItem = seriesItems.get(j);
+                                       if(seriesItem.getItemStyle() == PageChartGraphSeriesItem.PAGECHART_GRAPHITEM_STYLE_EVENT_PERIOD_START){
+                                               bPeriodStart = true;
+                                               startPeriodTime = seriesItem.getX();
+                                       }
+                                       for(; j < seriesItemSize; j++){
+                                               seriesItem = seriesItems.get(j);
+                                               if(seriesItem.getItemStyle() == PageChartGraphSeriesItem.PAGECHART_GRAPHITEM_STYLE_EVENT_PERIOD_END){
+                                                       long endPeriodTime = seriesItem.getX();
                                                        if(endPeriodTime > startTime){
                                                                drawPeriod(gc, startPeriodTime, endPeriodTime, true);
                                                        }
                                                        bPeriodStart = false;
-                                                       break;
-                                               }
-                                               else{
-                                                       continue;
                                                }
                                        }
-//                                     if(bPeriodStart == true){
-//                                             drawPeriod(gc, startPeriodTime, lastTime, false);
-//                                             bPeriodStart = false;
-//                                     }
                                }
                        }
-                       if (bPeriodStart == true && graphItemSize > 1) {
+                       if (bPeriodStart == true && seriesItemSize > 1) {
                                drawPeriod(gc, startPeriodTime, lastTime, false);
-//                             drawPeriod(gc, graphItems.get(0).getX(),
-//                                             graphItems.get(graphItemSize - 1).getX(), false);
+//                             drawPeriod(gc, seriesList.get(0).getX(),
+//                                             seriesList.get(seriesSize - 1).getX(), false);
                        }
                        
                        // draw event
-                       for (int i = 0; i < graphItemSize; i++) {
-                               graphItem = graphItems.get(i);
-                               long eventTime = graphItem.getX();
-                               if (eventTime > startTime) {
-                                       drawEvent(gc, graphItem);
+                       for (int i = 0; i < seriesSize; i++) {
+                               series = seriesList.get(i);
+                               seriesItems = series.gets();
+                               seriesItemSize = seriesItems.size();
+                               for(int j = 0; j<seriesItemSize; j++){
+                                       seriesItem = seriesItems.get(j);
+                                       long eventTime = seriesItem.getX();
+                                       
+                                       if (eventTime > startTime) {
+                                               drawEvent(gc, seriesItem);
+                                       }
                                }
                        }
                }
        }
 
-       public void drawEvent(GC gc, PageChartGraphSeries graphItem) {
+       public void drawEvent(GC gc, PageChartGraphSeriesItem seriesItem) {
                if (null == r)
                        r = getBounds();
                int pixcelX = DAPageChartTimelineRendererHelper.getPixcelXFromTime(
-                               graphItem.getX(), startTime, scale, r);
-               gc.setBackground(ColorResources.BLUE);
+                               seriesItem.getX(), startTime, scale, r);
+               gc.setBackground(seriesItem.getEventColor());
                gc.fillRectangle(pixcelX, r.y + 2, 2, r.height - 4);
        }