[SRADA-676] Change colors of Heap Allocation chart
authorjaeyong lee <jae-yong.lee@samsung.com>
Tue, 14 Jun 2016 04:05:54 +0000 (13:05 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Tue, 14 Jun 2016 09:47:23 +0000 (18:47 +0900)
Change-Id: Ia6d72050b0221b9eb8ef850016c59b273f2e66dd

org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartSeries.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/memory/chart/HeapMemoryChart.java

index 2f3ccc8..54be301 100644 (file)
@@ -743,7 +743,13 @@ public class DAChartRenderer {
                        } else {
                                gc.setBackground(col);
                        }
+                       
+                       double alpha = series.getAlpha() + 0.3;
+                       if(alpha > 1) {
+                               alpha = 1;
+                       }
 
+                       gc.setAlpha((int) (255 * alpha));
                        int startColumnX = startX + (i / seriesCountPerColumn)
                                        * (preTextWidthMargin + textWidthMax);
                        gc.fillRoundRectangle(startColumnX + DAChartPlotTooltip.TOOLTIP_MARGIN, y
@@ -755,6 +761,7 @@ public class DAChartRenderer {
                                        DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH);
                        gc.setBackground(tooltip.getBackgroundColor());
 
+                       gc.setAlpha(255);
                        gc.setForeground(tooltip.getTextColor());
                        gc.drawText(tooltipTexts.get(i), startColumnX + DAChartPlotTooltip.TOOLTIP_MARGIN
                                        + DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
@@ -1041,8 +1048,9 @@ public class DAChartRenderer {
                }
 
                Color color = series.getColor();
+               double alpha = series.getAlpha();
                gc.setAntialias(SWT.ON);
-               gc.setAlpha((int) (255 * 0.2));
+               gc.setAlpha((int) (255 * alpha));
                gc.setForeground(color);
                gc.setBackground(color);
 
index 9548e7c..445c2e3 100644 (file)
@@ -65,6 +65,7 @@ public class DAChartSeries {
        private List<DAChartSeriesItem> seriesItems = Collections.synchronizedList(new ArrayList<DAChartSeriesItem>());
        private Color color;
        private Color secondColor;
+       private double alpha = 0.2;
        private double barWidth = SERIES_DEFAULT_BAR_WIDTH;
        private int barAlign = SERIES_BAR_ALIGN_LEFT;
        private double maxX = 0;
@@ -86,6 +87,12 @@ public class DAChartSeries {
                this(name, style);
                this.color = color;
        }
+       
+       public DAChartSeries(String name, int style, Color color, double alpha) {
+               this(name, style);
+               this.color = color;
+               this.alpha = alpha; 
+       } 
 
        public DAChartSeries(String name, int style, Color color, boolean disableTooltip) {
                this(name, style, color);
@@ -96,6 +103,10 @@ public class DAChartSeries {
                this(name, style, color);
                this.setSecondColor(secondColor);
        }
+       
+       public double getAlpha() {
+               return alpha;
+       }
 
        public String getName() {
                return name;
index 5eeb8c9..966c954 100644 (file)
@@ -86,13 +86,13 @@ public class HeapMemoryChart extends MemoryChart {
                if(libId == appAllocSeriesID) {\r
                        totalSeries = new DAChartSeries(\r
                                        TimelineChartLabels.HEAP_CHART_SERIES_NAME_TOTAL_ALLOCATION,\r
-                                       DAChartSeries.SERIES_STYLE_AREA, ColorResources.CHART_SERIES_EMERALD);\r
+                                       DAChartSeries.SERIES_STYLE_AREA, ColorResources.CHART_SERIES_YELLOW);\r
                        chart.addSeries(totalSeries);\r
                }\r
                \r
                appSeries = new DAChartSeries(\r
                                getLibName(libName),\r
-                               DAChartSeries.SERIES_STYLE_AREA, ColorResources.CHART_SERIES_BLUE);\r
+                               DAChartSeries.SERIES_STYLE_AREA, ColorResources.CHART_SERIES_YELLOW, 0.5);\r
                chart.addSeries(appSeries);\r
        }\r
        \r