comparison 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
comparison
equal deleted inserted replaced
533:34103ab9fe60 534:e08777967bad
1 package de.intevation.flys.client.client.ui.chart; 1 package de.intevation.flys.client.client.ui.chart;
2 2
3 import com.google.gwt.core.client.GWT; 3 import com.google.gwt.core.client.GWT;
4 4
5 import com.smartgwt.client.core.Rectangle;
5 import com.smartgwt.client.widgets.Button; 6 import com.smartgwt.client.widgets.Button;
7 import com.smartgwt.client.widgets.Label;
6 import com.smartgwt.client.widgets.layout.HLayout; 8 import com.smartgwt.client.widgets.layout.HLayout;
7 import com.smartgwt.client.widgets.events.ClickEvent; 9 import com.smartgwt.client.widgets.events.ClickEvent;
8 import com.smartgwt.client.widgets.events.ClickHandler; 10 import com.smartgwt.client.widgets.events.ClickHandler;
9 import com.smartgwt.client.widgets.events.CloseClickHandler; 11 import com.smartgwt.client.widgets.events.CloseClickHandler;
10 import com.smartgwt.client.widgets.events.CloseClientEvent; 12 import com.smartgwt.client.widgets.events.CloseClientEvent;
27 public static final int PANEL_HEIGHT = 30; 29 public static final int PANEL_HEIGHT = 30;
28 30
29 31
30 protected CollectionView view; 32 protected CollectionView view;
31 33
34 protected ChartOutputTab chartTab;
35
36
32 protected Button datacage; 37 protected Button datacage;
33 38
39 protected MousePositionPanel position;
34 40
35 public ChartToolbar(CollectionView view) { 41
42
43 public ChartToolbar(CollectionView view, ChartOutputTab chartTab) {
36 super(); 44 super();
37 45
38 this.view = view; 46 this.view = view;
47 this.chartTab = chartTab;
39 48
40 datacage = new Button(MSG.databasket()); 49 datacage = new Button(MSG.databasket());
41 datacage.addClickHandler(new ClickHandler() { 50 datacage.addClickHandler(new ClickHandler() {
42 public void onClick(ClickEvent event) { 51 public void onClick(ClickEvent event) {
43 GWT.log("Clicked 'datacage' button."); 52 GWT.log("Clicked 'datacage' button.");
44 openDatacageWindow(getArtifact()); 53 openDatacageWindow(getArtifact());
45 } 54 }
46 }); 55 });
56
57 // TODO determine the correct viewport of the chart!
58 position = new MousePositionPanel(
59 chartTab.getChartPanel(),
60 new Rectangle(65, 35, 50, 70));
61 chartTab.getChartPanel().addMouseMoveHandler(position);
62 chartTab.getChartPanel().addResizedHandler(position);
47 63
48 initLayout(); 64 initLayout();
49 } 65 }
50 66
51 67
59 setHeight(PANEL_HEIGHT); 75 setHeight(PANEL_HEIGHT);
60 setMembersMargin(10); 76 setMembersMargin(10);
61 setPadding(5); 77 setPadding(5);
62 setBorder("1px solid black"); 78 setBorder("1px solid black");
63 79
80 // TODO do this dynamic
81 Label spacer = new Label();
82 spacer.setWidth("450px");
83 datacage.setWidth("95px");
84 position.setWidth("150px");
85
64 addMember(datacage); 86 addMember(datacage);
87 addMember(spacer);
88 addMember(position);
65 } 89 }
66 90
67 91
68 protected void openDatacageWindow(Artifact artifact) { 92 protected void openDatacageWindow(Artifact artifact) {
69 final DatacageWindow dc = new DatacageWindow(artifact); 93 final DatacageWindow dc = new DatacageWindow(artifact);

http://dive4elements.wald.intevation.org