[Title] Fix bug on frame time chart
authorkamuru <kamuru@kamuru-Samsung-Desktop-System.(none)>
Sat, 9 Nov 2013 13:47:47 +0000 (22:47 +0900)
committerkamuru <kamuru@kamuru-Samsung-Desktop-System.(none)>
Sat, 9 Nov 2013 13:47:47 +0000 (22:47 +0900)
[Desc.] Fix bug that draw yellow bar at the first time on frame time chart
[Issue]

org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartPlot.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DAChartRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java

index c42948e..28db9e2 100644 (file)
@@ -65,12 +65,12 @@ public class DAChartPlot {
        private String secondAxisUnit;
        private UnitType axisUnitType = UnitType.DECIMAL;
        
-       private double underBoundValue;
+       private double boundValue = -1;
        public void setBoundValue(double value) {
-               underBoundValue = value;
+               boundValue = value;
        }
        public double getBoundValue() {
-               return underBoundValue;
+               return boundValue;
        }
        
        private BoundType boundType;
index 825039b..7f3fe71 100644 (file)
@@ -690,7 +690,6 @@ public class DAChartRenderer {
                }
                
                double maxY = getMaxYToDraw(series, index);
-               double boundValue = plot.getBoundValue();
                for (int i = index; i < seriesItemSize; i++) {
                        seriesItem = seriesItems.get(i);
 
@@ -728,12 +727,11 @@ public class DAChartRenderer {
                        } else {
                                DAChartPlot.BoundType boundType = plot.getBoundType();
                                if(boundType != null) {
+                                       double boundValue = plot.getBoundValue();
                                        if(boundType == DAChartPlot.BoundType.UNDER) {
-                                               if(seriesItem.getY() < boundValue) {
-                                                       gc.setBackground(ColorResources.DARK_YELLOW);
-                                               }
+                                               gc.setBackground(ColorResources.DARK_YELLOW);
                                        } else {
-                                               if(seriesItem.getY() > boundValue) {
+                                               if(boundValue != -1 && seriesItem.getY() > boundValue) {
                                                        gc.setBackground(ColorResources.DARK_YELLOW);
                                                }
                                        }
index 90049b6..68ae3e4 100644 (file)
@@ -92,7 +92,6 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener,
                                                if (boundLineWidth == LINE_MAX_WIDTH) {
                                                        String boundText = String.valueOf(boundValue)
                                                                        + plot.getAxisUnit();
-                                                       plot.setBoundValue(boundValue);
                                                        chart.redrawForce();
                                                        int boundTextHeight = e.gc.textExtent(boundText).y;
                                                        int boundTextPosition;
@@ -241,6 +240,7 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener,
                                        position = UPPER_LINE_INIT_POSITION + 0.01;
                                }
                                boundValue = Math.round(plot.getVisibleEndY() * (1 - position));
+                               plot.setBoundValue(boundValue);
                        }
 
                } else {