Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java @ 538:75df57220104
Adapted the MousePositionPanel to use the Transform2D object for computing the chart coordinates from image coordinates.
flys-client/trunk@2036 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 01 Jun 2011 09:03:18 +0000 |
parents | e08777967bad |
children | fea93eebd2fa |
comparison
equal
deleted
inserted
replaced
537:d2c37ba78feb | 538:75df57220104 |
---|---|
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; | |
6 import com.smartgwt.client.widgets.Button; | 5 import com.smartgwt.client.widgets.Button; |
7 import com.smartgwt.client.widgets.Label; | 6 import com.smartgwt.client.widgets.Label; |
8 import com.smartgwt.client.widgets.layout.HLayout; | 7 import com.smartgwt.client.widgets.layout.HLayout; |
9 import com.smartgwt.client.widgets.events.ClickEvent; | 8 import com.smartgwt.client.widgets.events.ClickEvent; |
10 import com.smartgwt.client.widgets.events.ClickHandler; | 9 import com.smartgwt.client.widgets.events.ClickHandler; |
41 | 40 |
42 | 41 |
43 public ChartToolbar(CollectionView view, ChartOutputTab chartTab) { | 42 public ChartToolbar(CollectionView view, ChartOutputTab chartTab) { |
44 super(); | 43 super(); |
45 | 44 |
46 this.view = view; | 45 this.view = view; |
47 this.chartTab = chartTab; | 46 this.chartTab = chartTab; |
48 | 47 |
49 datacage = new Button(MSG.databasket()); | 48 datacage = new Button(MSG.databasket()); |
49 position = new MousePositionPanel(chartTab); | |
50 | |
50 datacage.addClickHandler(new ClickHandler() { | 51 datacage.addClickHandler(new ClickHandler() { |
51 public void onClick(ClickEvent event) { | 52 public void onClick(ClickEvent event) { |
52 GWT.log("Clicked 'datacage' button."); | 53 GWT.log("Clicked 'datacage' button."); |
53 openDatacageWindow(getArtifact()); | 54 openDatacageWindow(getArtifact()); |
54 } | 55 } |
55 }); | 56 }); |
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); | |
63 | 57 |
64 initLayout(); | 58 initLayout(); |
65 } | 59 } |
66 | 60 |
67 | 61 |
77 setPadding(5); | 71 setPadding(5); |
78 setBorder("1px solid black"); | 72 setBorder("1px solid black"); |
79 | 73 |
80 // TODO do this dynamic | 74 // TODO do this dynamic |
81 Label spacer = new Label(); | 75 Label spacer = new Label(); |
82 spacer.setWidth("450px"); | 76 spacer.setWidth("100px"); |
83 datacage.setWidth("95px"); | 77 datacage.setWidth("95px"); |
84 position.setWidth("150px"); | 78 position.setWidth("200px"); |
79 position.setLayoutAlign(com.smartgwt.client.types.Alignment.RIGHT); | |
85 | 80 |
86 addMember(datacage); | 81 addMember(datacage); |
87 addMember(spacer); | 82 addMember(spacer); |
88 addMember(position); | 83 addMember(position); |
89 } | 84 } |