changeset 2982:d2a54ae0016b

Switched from 2 columns and 3 rows to 3 columns and 2 rows in sq chart overview. flys-client/trunk@4981 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 13 Jul 2012 10:09:20 +0000
parents d700f6492386
children 725470fc57d2
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/OverviewOutputTab.java
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Jul 13 10:06:38 2012 +0000
+++ b/flys-client/ChangeLog	Fri Jul 13 10:09:20 2012 +0000
@@ -1,3 +1,8 @@
+2012-07-13  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/OverviewOutputTab.java:
+	  Switched row count and column count.
+
 2012-07-13	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	 * src/main/java/de/intevation/flys/client/server/auth/DefaultUser.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/OverviewOutputTab.java	Fri Jul 13 10:06:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/OverviewOutputTab.java	Fri Jul 13 10:09:20 2012 +0000
@@ -88,7 +88,7 @@
 
                 // This is for 3, 6 or 9 charts only! 
                 // TODO: Calculate the height.
-                charts[i][j].setHeight("30%");
+                charts[i][j].setHeight("50%");
 
                 String type =
                     ((OutputMode)relModes.values()
@@ -112,7 +112,10 @@
     @Override
     public void onResized(ResizedEvent event) {
         for (int i = 0; i < charts.length; i++) {
-            columns[i].setWidth(root.getWidth()/2);
+            // This is for 3, 6 or 9 charts only! 
+            // TODO: Calculate the width.
+            columns[i].setWidth(root.getWidth()/3);
+
             for (int j = 0; j < charts[i].length; j++) {
                 String type =
                     ((OutputMode)relModes.values()
@@ -140,7 +143,7 @@
      * @param count all fields
      * @return the column count
      */
-    protected int getColumnCount(int count) {
+    protected int getRowCount(int count) {
         if (count <= 3) {
             return 1;
         }
@@ -159,15 +162,15 @@
      * @param count all fields
      * @return the row count
      */
-    protected int getRowCount(int count) {
+    protected int getColumnCount(int count) {
         if(count <= 3) {
             return count;
         }
         else if(count > 3 && count < 9) {
-            return ((count + (count % 2))/getColumnCount(count));
+            return ((count + (count % 2))/getRowCount(count));
         }
         else {
-            return (count + (3 - (count % 3))/getColumnCount(count));
+            return (count + (3 - (count % 3))/getRowCount(count));
         }
     }
 

http://dive4elements.wald.intevation.org