diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 534:e08777967bad

Added a first implementation of a MousePositionPanel - work is not finished yet. flys-client/trunk@2025 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 27 May 2011 15:38:24 +0000
parents 34103ab9fe60
children 75df57220104
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Fri May 27 13:48:25 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java	Fri May 27 15:38:24 2011 +0000
@@ -2,7 +2,9 @@
 
 import com.google.gwt.core.client.GWT;
 
+import com.smartgwt.client.core.Rectangle;
 import com.smartgwt.client.widgets.Button;
+import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
@@ -29,13 +31,20 @@
 
     protected CollectionView view;
 
-    protected Button datacage;
+    protected ChartOutputTab chartTab;
 
 
-    public ChartToolbar(CollectionView view) {
+    protected Button datacage;
+
+    protected MousePositionPanel position;
+
+
+
+    public ChartToolbar(CollectionView view, ChartOutputTab chartTab) {
         super();
 
-        this.view = view;
+        this.view     = view;
+        this.chartTab = chartTab;
 
         datacage = new Button(MSG.databasket());
         datacage.addClickHandler(new ClickHandler() {
@@ -45,6 +54,13 @@
             }
         });
 
+        // TODO determine the correct viewport of the chart!
+        position = new MousePositionPanel(
+            chartTab.getChartPanel(),
+            new Rectangle(65, 35, 50, 70));
+        chartTab.getChartPanel().addMouseMoveHandler(position);
+        chartTab.getChartPanel().addResizedHandler(position);
+
         initLayout();
     }
 
@@ -61,7 +77,15 @@
         setPadding(5);
         setBorder("1px solid black");
 
+        // TODO do this dynamic
+        Label spacer = new Label();
+        spacer.setWidth("450px");
+        datacage.setWidth("95px");
+        position.setWidth("150px");
+
         addMember(datacage);
+        addMember(spacer);
+        addMember(position);
     }
 
 

http://dive4elements.wald.intevation.org