changeset 2936:a805118fffa6

Fixed zooming in navigatable charts. flys-client/trunk@4885 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 06 Jul 2012 11:38:56 +0000
parents 6cf983dd4f8a
children a30d77d86386
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java
diffstat 4 files changed, 31 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Jul 03 15:29:33 2012 +0000
+++ b/flys-client/ChangeLog	Fri Jul 06 11:38:56 2012 +0000
@@ -1,3 +1,15 @@
+2012-07-06  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java:
+	  Added method to deselect active controls. Currently only zoom control is
+	  deselected.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java:
+	  Changed type of tool bar to 'ChartToolbar'.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java:
+	  Deselect controls on navigate and return chart in 'getChartPanel'.
+
 2012-07-03  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java	Tue Jul 03 15:29:33 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java	Fri Jul 06 11:38:56 2012 +0000
@@ -76,7 +76,7 @@
     protected ChartThemePanel ctp;
 
     /** The canvas that wraps the chart toolbar. */
-    protected Canvas tbarPanel;
+    protected ChartToolbar tbarPanel;
 
     /** The canvas that wraps the theme editor. */
     protected Canvas left;
@@ -629,7 +629,7 @@
     }
 
 
-    public Map getChartAttributes() {
+    public Map <String, String> getChartAttributes() {
         Map<String, String> attr = new HashMap<String, String>();
 
         Canvas chart = getChartPanel();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Tue Jul 03 15:29:33 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Fri Jul 06 11:38:56 2012 +0000
@@ -288,5 +288,9 @@
         downloadPDF.setSource(chartTab.getExportUrl(-1, -1, "pdf"));
         downloadSVG.setSource(chartTab.getExportUrl(-1, -1, "svg"));
     }
+
+    public void deselectControls() {
+        zoombox.deselect();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java	Tue Jul 03 15:29:33 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java	Fri Jul 06 11:38:56 2012 +0000
@@ -107,6 +107,7 @@
 
         lower.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent ce) {
+                tbarPanel.deselectControls();
                 updateChartDown();
                 currentkm.setValue(collectionView.getCurrentKm());
             }
@@ -114,6 +115,7 @@
 
         upper.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent ce) {
+                tbarPanel.deselectControls();
                 updateChartUp();
                 currentkm.setValue(collectionView.getCurrentKm());
             }
@@ -125,6 +127,7 @@
                     return;
                 }
                 if(kpe.getForm().validate() && kpe.getItem().getValue() != null) {
+                    tbarPanel.deselectControls();
                     try {
                         String s = kpe.getItem().getValue().toString();
                         Double d = new Double(s);
@@ -175,6 +178,16 @@
 
     }
 
+   /**
+     * Returns the existing chart panel.
+     *
+     * @return the existing chart panel.
+     */
+    @Override
+    public Canvas getChartPanel() {
+        return chart;
+    }
+
     /**
      * Builds the URL that points to the chart image.
      *
@@ -224,7 +237,6 @@
             }
             imgUrl += "&currentKm=" + collectionView.getCurrentKm();
         }
-        GWT.log(imgUrl);
 
         return imgUrl;
     }

http://dive4elements.wald.intevation.org