From f441ca5302e64eb7ff0a331f8ddf88b191c48be6 Mon Sep 17 00:00:00 2001 From: "yeongtaik.byeon" Date: Thu, 16 Aug 2012 18:09:10 +0900 Subject: [PATCH] [Title]create custom chart [Type]update [Module] [Priority]normal [CQ#] [Redmine#]6438 [Problem] [Cause] [Solution] [TestCase] --- .../timeline/chart/DACPUFrequencyChart.java | 33 ++++++++++++---- .../timeline/chart/DAFileChart.java | 45 ++++++++++++++++++--- .../timeline/chart/DAHeapChart.java | 38 +++++++++++++++--- .../timeline/chart/DAProcessMemoryChart.java | 45 ++++++++++++++++++--- .../timeline/chart/DASystemMemoryChart.java | 46 +++++++++++++++++++--- 5 files changed, 176 insertions(+), 31 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUFrequencyChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUFrequencyChart.java index 6516239..afac34a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUFrequencyChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUFrequencyChart.java @@ -24,12 +24,17 @@ import java.util.List; import org.eclipse.swt.widgets.Composite; import org.jfree.data.xy.XYSeries; +import org.tizen.dynamicanalyzer.ColorResources; +import org.tizen.dynamicanalyzer.constants.TimelineConstants; import org.tizen.dynamicanalyzer.model.LogPackage; +import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart; +import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries; public class DACPUFrequencyChart extends DATimelineChart { private static DACPUFrequencyChart instance = null; - + private DACustomChartSeries frequencySeries; + public static DACPUFrequencyChart getInstance() { if (instance == null) { instance = new DACPUFrequencyChart(); @@ -37,10 +42,26 @@ public class DACPUFrequencyChart extends DATimelineChart { return instance; } + + private DACPUFrequencyChart() { + chartType = TimelineConstants.CHART_TYPE_CPU_FREQUENCY; + chartName = TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE; + + frequencySeries = new DACustomChartSeries( + TimelineChartLabels.CPU_FREQUENCY_CHART_FREQUENCY, + DACustomChartSeries.SERIES_STYLE_LINE, + ColorResources.SERIESE_COLOR_CPU_FREQ); + } + @Override public DACustomChart createDAChart(Composite parent) { - // TODO Auto-generated method stub - return null; + chart = new DACustomChart(parent, chartName); + + chart.addSeries(frequencySeries); + + setChartStyle(); + + return chart; } @Override @@ -63,14 +84,12 @@ public class DACPUFrequencyChart extends DATimelineChart { @Override public void update() { - // TODO Auto-generated method stub - + chart.redraw(); } @Override public void clear() { - // TODO Auto-generated method stub - + frequencySeries.clear(); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAFileChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAFileChart.java index 4266009..3c6c5e7 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAFileChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAFileChart.java @@ -24,12 +24,20 @@ import java.util.List; import org.eclipse.swt.widgets.Composite; import org.jfree.data.xy.XYSeries; +import org.tizen.dynamicanalyzer.ColorResources; +import org.tizen.dynamicanalyzer.constants.TimelineConstants; import org.tizen.dynamicanalyzer.model.LogPackage; +import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart; +import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries; public class DAFileChart extends DATimelineChart { private static DAFileChart instance = null; + private DACustomChartSeries readSeries; + private DACustomChartSeries writeSeries; + private DACustomChartSeries fdCountSeries; + public static DAFileChart getInstance() { if (instance == null) { instance = new DAFileChart(); @@ -37,10 +45,35 @@ public class DAFileChart extends DATimelineChart { return instance; } + + private DAFileChart() { + chartType = TimelineConstants.CHART_TYPE_FILE; + chartName = TimelineChartLabels.FILE_CHART_TITLE; + + readSeries = new DACustomChartSeries( + TimelineChartLabels.FILE_CHART_SERIES_NAME_READ, + DACustomChartSeries.SERIES_STYLE_BAR, + ColorResources.SERIESE_COLOR_FILE_READ); + writeSeries = new DACustomChartSeries( + TimelineChartLabels.FILE_CHART_SERIES_NAME_WRITE, + DACustomChartSeries.SERIES_STYLE_BAR, + ColorResources.SERIESE_COLOR_FILE_WRITE); + fdCountSeries = new DACustomChartSeries( + TimelineChartLabels.FILE_CHART_SERIES_NAME_FD_COUNT, + DACustomChartSeries.SERIES_STYLE_LINE, + ColorResources.SERIESE_COLOR_FILE_FD); + } + @Override public DACustomChart createDAChart(Composite parent) { - // TODO Auto-generated method stub - return null; + chart = new DACustomChart(parent, chartName); + + chart.addSeries(readSeries); + chart.addSeries(writeSeries); + chart.addSeries(fdCountSeries); + + setChartStyle(); + return chart; } @Override @@ -63,14 +96,14 @@ public class DAFileChart extends DATimelineChart { @Override public void update() { - // TODO Auto-generated method stub - + chart.redraw(); } @Override public void clear() { - // TODO Auto-generated method stub - + readSeries.clear(); + writeSeries.clear(); + fdCountSeries.clear(); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAHeapChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAHeapChart.java index 2ed981e..b8ed8a8 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAHeapChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAHeapChart.java @@ -24,12 +24,19 @@ import java.util.List; import org.eclipse.swt.widgets.Composite; import org.jfree.data.xy.XYSeries; +import org.tizen.dynamicanalyzer.ColorResources; +import org.tizen.dynamicanalyzer.constants.TimelineConstants; import org.tizen.dynamicanalyzer.model.LogPackage; +import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart; +import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries; public class DAHeapChart extends DATimelineChart { private static DAHeapChart instance = null; + private DACustomChartSeries totalAllocationSeries; + private DACustomChartSeries userAllocationSeries; + public static DAHeapChart getInstance() { if (instance == null) { instance = new DAHeapChart(); @@ -37,10 +44,30 @@ public class DAHeapChart extends DATimelineChart { return instance; } + + private DAHeapChart() { + chartType = TimelineConstants.CHART_TYPE_HEAP; + chartName = TimelineChartLabels.HEAP_CHART_TITLE; + + totalAllocationSeries = new DACustomChartSeries( + TimelineChartLabels.HEAP_CHART_SERIES_NAME_PLATFORM_ALLOCATION, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_HEAP_SYSTEM); + userAllocationSeries = new DACustomChartSeries( + TimelineChartLabels.HEAP_CHART_SERIES_NAME_USER_ALLOCATION, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_HEAP_USER); + } + @Override public DACustomChart createDAChart(Composite parent) { - // TODO Auto-generated method stub - return null; + chart = new DACustomChart(parent, chartName); + + chart.addSeries(totalAllocationSeries); + chart.addSeries(userAllocationSeries); + + setChartStyle(); + return chart; } @Override @@ -63,14 +90,13 @@ public class DAHeapChart extends DATimelineChart { @Override public void update() { - // TODO Auto-generated method stub - + chart.redraw(); } @Override public void clear() { - // TODO Auto-generated method stub - + totalAllocationSeries.clear(); + userAllocationSeries.clear(); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAProcessMemoryChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAProcessMemoryChart.java index 7807f52..15d0653 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAProcessMemoryChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DAProcessMemoryChart.java @@ -24,12 +24,20 @@ import java.util.List; import org.eclipse.swt.widgets.Composite; import org.jfree.data.xy.XYSeries; +import org.tizen.dynamicanalyzer.ColorResources; +import org.tizen.dynamicanalyzer.constants.TimelineConstants; import org.tizen.dynamicanalyzer.model.LogPackage; +import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart; +import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries; public class DAProcessMemoryChart extends DATimelineChart { private static DAProcessMemoryChart instance = null; + private DACustomChartSeries VSSMemorySeries; + private DACustomChartSeries RSSMemorySeries; + private DACustomChartSeries PSSMemorySeries; + public static DAProcessMemoryChart getInstance() { if (instance == null) { instance = new DAProcessMemoryChart(); @@ -37,10 +45,35 @@ public class DAProcessMemoryChart extends DATimelineChart { return instance; } + + private DAProcessMemoryChart() { + chartType = TimelineConstants.CHART_TYPE_PROCESS_MEMORY; + chartName = TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE; + + VSSMemorySeries = new DACustomChartSeries( + TimelineChartLabels.PROCESS_MEMORY_CHART_VSS, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_PROCESS_VSS); + RSSMemorySeries = new DACustomChartSeries( + TimelineChartLabels.PROCESS_MEMORY_CHART_RSS, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_PROCESS_RSS); + PSSMemorySeries = new DACustomChartSeries( + TimelineChartLabels.PROCESS_MEMORY_CHART_PSS, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_PROCESS_PSS); + } + @Override public DACustomChart createDAChart(Composite parent) { - // TODO Auto-generated method stub - return null; + chart = new DACustomChart(parent, chartName); + + chart.addSeries(VSSMemorySeries); + chart.addSeries(RSSMemorySeries); + chart.addSeries(PSSMemorySeries); + + setChartStyle(); + return chart; } @Override @@ -63,14 +96,14 @@ public class DAProcessMemoryChart extends DATimelineChart { @Override public void update() { - // TODO Auto-generated method stub - + chart.redraw(); } @Override public void clear() { - // TODO Auto-generated method stub - + VSSMemorySeries.clear(); + RSSMemorySeries.clear(); + PSSMemorySeries.clear(); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DASystemMemoryChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DASystemMemoryChart.java index 689e310..cb512b5 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DASystemMemoryChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DASystemMemoryChart.java @@ -24,12 +24,20 @@ import java.util.List; import org.eclipse.swt.widgets.Composite; import org.jfree.data.xy.XYSeries; +import org.tizen.dynamicanalyzer.ColorResources; +import org.tizen.dynamicanalyzer.constants.TimelineConstants; import org.tizen.dynamicanalyzer.model.LogPackage; +import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart; +import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries; public class DASystemMemoryChart extends DATimelineChart { private static DASystemMemoryChart instance = null; + private DACustomChartSeries processSeries; + private DACustomChartSeries systemSeries; + private DACustomChartSeries totalSeries; + public static DASystemMemoryChart getInstance() { if (instance == null) { instance = new DASystemMemoryChart(); @@ -37,10 +45,36 @@ public class DASystemMemoryChart extends DATimelineChart { return instance; } + + private DASystemMemoryChart() { + chartType = TimelineConstants.CHART_TYPE_SYSTEM_MEMORY; + chartName = TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE; + + processSeries = new DACustomChartSeries( + TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_PROC_RESIDENT, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_MEMORY_APP_USED); + systemSeries = new DACustomChartSeries( + TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_SYSTEM, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_MEMORY_SYS_USED); + totalSeries = new DACustomChartSeries( + TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_TOTAL, + DACustomChartSeries.SERIES_STYLE_AREA, + ColorResources.SERIESE_COLOR_MEMORY_SYS_MAX); + } + @Override public DACustomChart createDAChart(Composite parent) { - // TODO Auto-generated method stub - return null; + chart = new DACustomChart(parent, chartName); + + chart.addSeries(processSeries); + chart.addSeries(systemSeries); + chart.addSeries(totalSeries); + + setChartStyle(); + + return chart; } @Override @@ -63,14 +97,14 @@ public class DASystemMemoryChart extends DATimelineChart { @Override public void update() { - // TODO Auto-generated method stub - + chart.redraw(); } @Override public void clear() { - // TODO Auto-generated method stub - + processSeries.clear(); + systemSeries.clear(); + totalSeries.clear(); } @Override -- 2.7.4