Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java @ 1364:9981ba2ee13a
Display the datacage button in the map toolbar.
flys-client/trunk@3063 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 24 Oct 2011 13:35:30 +0000 |
parents | 45b9b1fc26e2 |
children | 9aa1a453eed5 |
comparison
equal
deleted
inserted
replaced
1363:9da7fdfbb80e | 1364:9981ba2ee13a |
---|---|
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.types.SelectionType; | 5 import com.smartgwt.client.types.SelectionType; |
6 import com.smartgwt.client.util.SC; | 6 import com.smartgwt.client.util.SC; |
7 import com.smartgwt.client.widgets.Button; | |
7 import com.smartgwt.client.widgets.Canvas; | 8 import com.smartgwt.client.widgets.Canvas; |
8 import com.smartgwt.client.widgets.ImgButton; | 9 import com.smartgwt.client.widgets.ImgButton; |
9 import com.smartgwt.client.widgets.events.ClickEvent; | 10 import com.smartgwt.client.widgets.events.ClickEvent; |
10 import com.smartgwt.client.widgets.events.ClickHandler; | 11 import com.smartgwt.client.widgets.events.ClickHandler; |
11 import com.smartgwt.client.widgets.layout.HLayout; | |
12 | 12 |
13 import org.gwtopenmaps.openlayers.client.Map; | 13 import org.gwtopenmaps.openlayers.client.Map; |
14 import org.gwtopenmaps.openlayers.client.control.DragPan; | 14 import org.gwtopenmaps.openlayers.client.control.DragPan; |
15 import org.gwtopenmaps.openlayers.client.control.SelectFeature; | 15 import org.gwtopenmaps.openlayers.client.control.SelectFeature; |
16 import org.gwtopenmaps.openlayers.client.control.SelectFeatureOptions; | 16 import org.gwtopenmaps.openlayers.client.control.SelectFeatureOptions; |
18 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; | 18 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
19 import org.gwtopenmaps.openlayers.client.layer.Vector; | 19 import org.gwtopenmaps.openlayers.client.layer.Vector; |
20 import org.gwtopenmaps.openlayers.client.util.Attributes; | 20 import org.gwtopenmaps.openlayers.client.util.Attributes; |
21 | 21 |
22 import de.intevation.flys.client.client.FLYSConstants; | 22 import de.intevation.flys.client.client.FLYSConstants; |
23 import de.intevation.flys.client.client.ui.Toolbar; | |
23 import de.intevation.flys.client.client.utils.EnableDisableCmd; | 24 import de.intevation.flys.client.client.utils.EnableDisableCmd; |
24 | 25 |
25 | 26 |
26 /** | 27 /** |
27 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 28 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
28 */ | 29 */ |
29 public class MapToolbar extends HLayout { | 30 public class MapToolbar extends Toolbar { |
30 | 31 |
31 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); | 32 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
32 | 33 |
33 protected FloodMap floodMap; | 34 protected FloodMap floodMap; |
34 protected DragPan pan; | 35 protected DragPan pan; |
35 protected ZoomBox zoomBox; | 36 protected ZoomBox zoomBox; |
36 protected SelectFeature selectFeature; | 37 protected SelectFeature selectFeature; |
38 | |
39 protected Button datacageButton; | |
37 | 40 |
38 protected ImgButton zoomToMaxButton; | 41 protected ImgButton zoomToMaxButton; |
39 protected ImgButton zoomBoxButton; | 42 protected ImgButton zoomBoxButton; |
40 protected ImgButton zoomOutButton; | 43 protected ImgButton zoomOutButton; |
41 protected ImgButton panButton; | 44 protected ImgButton panButton; |
47 protected MeasureControl measureControl; | 50 protected MeasureControl measureControl; |
48 | 51 |
49 protected Canvas position; | 52 protected Canvas position; |
50 | 53 |
51 | 54 |
52 public MapToolbar(FloodMap floodMap, Canvas wrapper) { | 55 public MapToolbar(MapOutputTab mapTab, FloodMap floodMap, Canvas wrapper) { |
53 this(floodMap, wrapper, true); | 56 this(mapTab, floodMap, wrapper, true); |
54 } | 57 } |
55 | 58 |
56 | 59 |
57 public MapToolbar(FloodMap floodMap, Canvas wrapper, boolean digitize) { | 60 public MapToolbar(FloodMap floodMap, Canvas wrapper, boolean digitize) { |
58 super(); | 61 this(null, floodMap, wrapper, digitize); |
62 } | |
63 | |
64 | |
65 public MapToolbar( | |
66 MapOutputTab mapTab, | |
67 FloodMap floodMap, | |
68 Canvas wrapper, | |
69 boolean digitize) | |
70 { | |
71 super(mapTab); | |
59 | 72 |
60 setWidth100(); | 73 setWidth100(); |
61 setHeight(30); | 74 setHeight(30); |
62 setMembersMargin(10); | 75 setMembersMargin(10); |
63 setPadding(5); | 76 setPadding(5); |
77 measureControl = createMeasureControl(); | 90 measureControl = createMeasureControl(); |
78 position = createMousePosition(wrapper); | 91 position = createMousePosition(wrapper); |
79 removeButton = createRemoveFeatureControl(); | 92 removeButton = createRemoveFeatureControl(); |
80 elevationButton = createElevationControl(); | 93 elevationButton = createElevationControl(); |
81 | 94 |
95 if (mapTab != null) { | |
96 datacageButton = createDatacageControl(); | |
97 addMember(datacageButton); | |
98 } | |
99 | |
82 addMember(zoomToMaxButton); | 100 addMember(zoomToMaxButton); |
83 addMember(zoomBoxButton); | 101 addMember(zoomBoxButton); |
84 addMember(zoomOutButton); | 102 addMember(zoomOutButton); |
85 addMember(panButton); | 103 addMember(panButton); |
86 | 104 |
441 } | 459 } |
442 }; | 460 }; |
443 | 461 |
444 return new MeasureControl(floodMap, cmd); | 462 return new MeasureControl(floodMap, cmd); |
445 } | 463 } |
464 | |
465 | |
466 protected Button createDatacageControl() { | |
467 Button btn = new Button(MSG.databasket()); | |
468 btn.addClickHandler(new ClickHandler() { | |
469 public void onClick(ClickEvent evt) { | |
470 openDatacageWindow((MapOutputTab) getOutputTab()); | |
471 } | |
472 }); | |
473 | |
474 return btn; | |
475 } | |
446 } | 476 } |
447 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 477 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |