Mercurial > hg > STI-GWT
annotate src/econnect/wp3_3/client/widgets/map/Map.java @ 61:eac73bf1ce6e CellTable
add overlay functionality (beta)
author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 14 Dec 2012 16:33:36 +0100 |
parents | cf06b77a8bbd |
children | d69066d16e45 |
rev | line source |
---|---|
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
1 package econnect.wp3_3.client.widgets.map; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
2 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
3 import com.google.gwt.user.client.Command; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
4 import com.google.gwt.user.client.ui.AbsolutePanel; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
5 import com.google.gwt.user.client.ui.Button; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
6 import com.google.gwt.user.client.ui.Grid; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
7 import com.google.gwt.user.client.ui.Image; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
8 import com.google.gwt.user.client.ui.Label; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
9 import com.google.gwt.user.client.ui.RadioButton; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
10 import com.google.gwt.user.client.ui.RootPanel; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
11 import com.google.gwt.user.client.ui.SimplePanel; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
12 import com.google.gwt.user.client.ui.TextArea; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
13 import com.google.gwt.user.client.ui.TextBox; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
14 import com.google.gwt.user.client.ui.VerticalPanel; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
15 import com.google.gwt.user.client.ui.MenuBar; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
16 import com.google.gwt.core.client.GWT; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
17 import com.google.gwt.dom.client.DivElement; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
18 import com.google.gwt.dom.client.Document; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
19 import com.google.gwt.event.dom.client.ClickEvent; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
20 import com.google.gwt.event.dom.client.ClickHandler; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
21 import com.google.gwt.i18n.client.DateTimeFormat; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
22 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
23 import econnect.wp3_3.client.core.ApplicationConstants; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
24 import econnect.wp3_3.client.core.DataObject; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
25 import econnect.wp3_3.client.core.StiConstants; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
26 import econnect.wp3_3.client.slider.JsSlider; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
27 import econnect.wp3_3.client.slider.Slider; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
28 import econnect.wp3_3.client.core.StiCore; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
29 import econnect.wp3_3.client.widgets.map.StiMap; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
30 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
31 import java.util.Date; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
32 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
33 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
34 * Implementation of the Java component of the map widget |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
35 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
36 public class Map { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
37 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
38 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
39 * The Javascript map object |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
40 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
41 private StiMap jsMap; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
42 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
43 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
44 * The active map control element |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
45 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
46 private MapControl activeControl; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
47 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
48 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
49 * The sti core component |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
50 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
51 StiCore core; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
52 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
53 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
54 * The navigation control |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
55 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
56 private MapControl navigate; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
57 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
58 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
59 * The slider component of the map controls |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
60 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
61 private Slider zoomBar; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
62 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
63 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
64 * The sliders maximum value |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
65 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
66 private int max = 1000; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
67 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
68 private Image connections; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
69 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
70 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
71 * Constructor for the map widget java component |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
72 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
73 * @param core object to allow interaction with all javascript components |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
74 * @param window id of the window to embed the map widget |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
75 * @param container id of the container, the window will be added |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
76 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
77 public Map( StiCore core, String window, String container ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
78 this.core = core; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
79 this.jsMap = StiMap.createStiMap(core, window, container); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
80 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
81 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
82 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
83 * initializes the controls needed for map interaction |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
84 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
85 * @return a grid of control elements |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
86 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
87 public Grid initMapControls(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
88 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
89 final ApplicationConstants constants = (ApplicationConstants) GWT.create(ApplicationConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
90 final StiConstants textConstants = (StiConstants) GWT.create(StiConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
91 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
92 this.navigate = new MapControl( this, constants.navigateClickImage(), constants.navigateImage(), "navigate", textConstants.navigate() ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
93 //MapControl add = new MapControl( this, constants.addClickImage(), constants.addImage(), "add", textConstants.addElement() ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
94 MapControl polygonDrilldown = new MapControl( this, constants.polygonClickImage(), constants.polygonImage(), "polygon", textConstants.polygonDrilldown() ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
95 MapControl circleDrilldown = new MapControl( this, constants.circleClickImage(), constants.circleImage(), "circle", textConstants.circleDrilldown() ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
96 MapControl countryDrilldown = new MapControl( this, constants.countryClickImage(), constants.countryImage(), "country", textConstants.countryDrilldown() ); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
97 this.navigate.activate(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
98 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
99 this.connections = new Image(constants.connectionsImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
100 this.connections.setTitle(textConstants.showConnections()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
101 this.connections.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
102 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
103 boolean active = jsMap.connectionsClick(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
104 setConImage(active); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
105 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
106 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
107 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
108 VerticalPanel drilldown = new VerticalPanel(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
109 drilldown.add(polygonDrilldown.getButton()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
110 drilldown.add(circleDrilldown.getButton()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
111 drilldown.add(countryDrilldown.getButton()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
112 drilldown.setStyleName("center"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
113 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
114 final MenuBar mapsMenu = new MenuBar(true); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
115 final Image maps = new Image(constants.mapsImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
116 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
117 mapsMenu.setAnimationEnabled(true); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
118 for( int i=0; i<this.jsMap.getMapCount(); i++ ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
119 final int index = i; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
120 mapsMenu.addItem(this.jsMap.getMapName(i), new Command() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
121 public void execute() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
122 jsMap.setMap(index); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
123 RootPanel.get().remove(mapsMenu); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
124 maps.setUrl(constants.mapsImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
125 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
126 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
127 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
128 mapsMenu.addStyleName("zHigh"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
129 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
130 maps.setTitle(textConstants.mapLayers()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
131 maps.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
132 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
133 if( !RootPanel.get().remove(mapsMenu) ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
134 maps.setUrl(constants.mapsClickImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
135 int left = maps.getParent().getAbsoluteLeft() + maps.getParent().getOffsetWidth() + 3; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
136 int top = maps.getAbsoluteTop(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
137 RootPanel.get().add(mapsMenu, left, top); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
138 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
139 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
140 maps.setUrl(constants.mapsImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
141 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
142 } |
61
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
143 }); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
144 |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
145 //TODO: add correct (better) image |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
146 final Image overlay = new Image(constants.addImage()); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
147 final MenuBar overlayMenu = new MenuBar(true); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
148 |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
149 overlayMenu.setAnimationEnabled(true); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
150 //TODO: add overlays from data |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
151 //for( int i=0; i<this.jsMap.getMapCount(); i++ ){ |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
152 // final int index = i; |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
153 overlayMenu.addItem("Limes", new Command() { |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
154 public void execute() { |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
155 jsMap.setOverlay(0); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
156 RootPanel.get().remove(overlayMenu); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
157 overlay.setUrl(constants.addImage()); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
158 } |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
159 }); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
160 //} |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
161 overlayMenu.addStyleName("zHigh"); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
162 |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
163 overlay.setTitle(textConstants.overlayLayers()); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
164 overlay.addClickHandler(new ClickHandler() { |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
165 public void onClick(ClickEvent event) { |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
166 if( !RootPanel.get().remove(overlay) ){ |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
167 //TODO: set correct (better) image |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
168 overlay.setUrl(constants.addClickImage()); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
169 int left = overlay.getParent().getAbsoluteLeft() + overlay.getParent().getOffsetWidth() + 3; |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
170 int top = overlay.getAbsoluteTop(); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
171 RootPanel.get().add(overlayMenu, left, top); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
172 } |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
173 else { |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
174 overlay.setUrl(constants.addImage()); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
175 } |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
176 } |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
177 }); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
178 |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
179 final Grid controlGrid = new Grid(6,1); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
180 controlGrid.setWidget(1, 0, maps); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
181 controlGrid.setWidget(2, 0, this.navigate.getButton()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
182 controlGrid.setWidget(3, 0, drilldown); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
183 // controlGrid.setWidget(4, 0, add.getButton()); |
61
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
184 controlGrid.setWidget(4, 0, overlay); |
eac73bf1ce6e
add overlay functionality (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
185 controlGrid.setWidget(5, 0, connections); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
186 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
187 final int levels = this.jsMap.getNumZoomLevels(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
188 DivElement zoomDiv = Document.get().createDivElement(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
189 zoomBar = new Slider(zoomDiv,"vertical"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
190 zoomBar.getSlider().setMaximum(max); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
191 zoomBar.getSlider().setValue(Math.round(this.jsMap.getZoom()/levels*max)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
192 zoomBar.getSlider().addChangeListener(jsMap,Document.get(),true); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
193 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
194 final JsSlider slider = zoomBar.getSlider(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
195 Image zoomIn = new Image(constants.zoomInImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
196 zoomIn.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
197 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
198 float zoom = ((float)slider.getValue() + (float)max/levels) / max; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
199 if( zoom > 1.0f ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
200 zoom = 1.0f; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
201 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
202 jsMap.zoom(zoom); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
203 slider.setValue(Math.round(jsMap.getZoom()/levels*max)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
204 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
205 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
206 Image zoomOut = new Image(constants.zoomOutImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
207 zoomOut.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
208 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
209 float zoom = ((float)slider.getValue() - (float)max/levels) / max; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
210 if( zoom < 0.0f ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
211 zoom = 0.0f; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
212 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
213 jsMap.zoom(zoom); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
214 slider.setValue(Math.round(jsMap.getZoom()/levels*max)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
215 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
216 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
217 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
218 SimplePanel zoom = new SimplePanel(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
219 zoom.getElement().appendChild(zoomDiv); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
220 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
221 AbsolutePanel zoomPanel = new AbsolutePanel(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
222 zoomPanel.addStyleName("sliderStyle"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
223 zoomPanel.addStyleName("cellStyle"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
224 zoomPanel.addStyleName("center"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
225 zoomPanel.add(zoomIn,2,0); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
226 zoomPanel.add(zoom,0,10); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
227 zoomPanel.add(zoomOut,2,84); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
228 zoomIn.addStyleName("zHigh"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
229 zoomOut.addStyleName("zHigh"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
230 zoomPanel.setTitle(textConstants.mapZoom()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
231 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
232 controlGrid.setWidget(0, 0, zoomPanel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
233 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
234 return controlGrid; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
235 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
236 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
237 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
238 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
239 * creates the add element context div |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
240 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
241 * @param lon longitude value to fill the corresponding textbox |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
242 * @param lat latitude value to fill the corresponding textbox |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
243 * @param left left style value of the clicked point inside the window |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
244 * @param top top style value of the clicked point inside the window |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
245 * @param width width of the window |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
246 * @param height height of the window |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
247 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
248 @SuppressWarnings("deprecation") |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
249 public void setAddElementContext( double lon, double lat, int left, int top, int width, int height ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
250 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
251 final StiConstants textConstants = (StiConstants) GWT.create(StiConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
252 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
253 Label header = new Label(textConstants.addElementBlank()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
254 header.setStyleName("addTitle"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
255 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
256 Label nameLabel = new Label(textConstants.name()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
257 final TextBox name = new TextBox(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
258 nameLabel.setStyleName("addItem"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
259 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
260 Label descriptionLabel = new Label(textConstants.description()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
261 descriptionLabel.setStyleName("addItem"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
262 final TextArea description = new TextArea(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
263 description.setVisibleLines(5); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
264 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
265 Label dateLabel = new Label(textConstants.date()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
266 dateLabel.setStyleName("addItem"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
267 Label actualDateLabel = new Label(textConstants.actualTime()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
268 actualDateLabel.setStyleName("addActualTime"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
269 Label formatLabel = new Label("(yyyy/MM/dd HH:mm:ss)"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
270 formatLabel.setStyleName("addActualTime"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
271 final TextBox defineDateBox = new TextBox(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
272 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
273 final RadioButton actualDate = new RadioButton("dateRadioGroup"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
274 RadioButton defineDate = new RadioButton("dateRadioGroup"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
275 actualDate.setChecked(true); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
276 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
277 Grid dateGrid = new Grid(3,2); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
278 dateGrid.setWidget(0, 0, actualDate); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
279 dateGrid.setWidget(1, 0, defineDate); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
280 dateGrid.setWidget(0, 1, actualDateLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
281 dateGrid.setWidget(1, 1, defineDateBox); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
282 dateGrid.setWidget(2, 1, formatLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
283 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
284 Label placeLabel = new Label(textConstants.placename()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
285 placeLabel.setStyleName("addItem"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
286 final TextBox placeName = new TextBox(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
287 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
288 Label latitudeLabel = new Label(textConstants.latitude()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
289 latitudeLabel.setStyleName("addItem"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
290 final TextBox latitude = new TextBox(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
291 latitude.setText((new Double(lat)).toString()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
292 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
293 Label longitudeLabel = new Label(textConstants.longitude()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
294 longitudeLabel.setStyleName("addItem"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
295 final TextBox longitude = new TextBox(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
296 longitude.setText((new Double(lon)).toString()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
297 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
298 Grid inputGrid = new Grid(6,2); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
299 inputGrid.setWidget(0, 0, nameLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
300 inputGrid.setWidget(1, 0, descriptionLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
301 inputGrid.setWidget(2, 0, dateLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
302 inputGrid.setWidget(3, 0, placeLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
303 inputGrid.setWidget(4, 0, latitudeLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
304 inputGrid.setWidget(5, 0, longitudeLabel); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
305 inputGrid.setWidget(0, 1, name); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
306 inputGrid.setWidget(1, 1, description); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
307 inputGrid.setWidget(2, 1, dateGrid); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
308 inputGrid.setWidget(3, 1, placeName); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
309 inputGrid.setWidget(4, 1, latitude); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
310 inputGrid.setWidget(5, 1, longitude); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
311 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
312 final String yearPattern = "yyyy"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
313 final String monthPattern = "yyyy/MM"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
314 final String datePattern = "yyyy/MM/dd"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
315 final String dateTimePattern = "yyyy/MM/dd HH:mm:ss"; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
316 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
317 final Grid grid = new Grid(3,1); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
318 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
319 Button searchButton = new Button(textConstants.addElementBlank()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
320 searchButton.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
321 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
322 String dataName = name.getText(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
323 String dataDescription = description.getText(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
324 String dataPlace = placeName.getText(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
325 String dataDate; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
326 int granularity = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
327 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
328 Date d = new Date(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
329 if( !actualDate.isChecked() ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
330 String input = defineDateBox.getText(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
331 if( input.indexOf(":") != -1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
332 d = DateTimeFormat.getFormat(dateTimePattern).parse(input); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
333 granularity = core.getSecondGranularity(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
334 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
335 else if( input.indexOf("/") != -1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
336 if( input.indexOf("/") == input.lastIndexOf("/") ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
337 d = DateTimeFormat.getFormat(monthPattern).parse(input); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
338 granularity = core.getMonthGranularity(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
339 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
340 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
341 d = DateTimeFormat.getFormat(datePattern).parse(input); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
342 granularity = core.getDateGranularity(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
343 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
344 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
345 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
346 d = DateTimeFormat.getFormat(yearPattern).parse(input); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
347 granularity = core.getYearGranularity(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
348 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
349 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
350 dataDate = (new Long(d.getTime())).toString(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
351 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
352 catch( IllegalArgumentException e ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
353 core.alert("Enter a valid date format!"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
354 return; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
355 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
356 double dataLongitude, dataLatitude; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
357 try { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
358 dataLongitude = Double.parseDouble(longitude.getText()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
359 dataLatitude = Double.parseDouble(latitude.getText()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
360 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
361 catch( NumberFormatException e ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
362 return; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
363 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
364 DataObject object = DataObject.createDataObject(dataName, dataDescription, dataPlace, dataDate, granularity, dataLongitude, dataLatitude); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
365 core.addElement(object); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
366 RootPanel.get().remove(grid); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
367 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
368 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
369 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
370 Button cancelButton = new Button(textConstants.cancel()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
371 cancelButton.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
372 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
373 RootPanel.get().remove(grid); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
374 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
375 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
376 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
377 Grid buttons = new Grid(1,2); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
378 buttons.setWidget(0, 0, searchButton); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
379 buttons.setWidget(0, 1, cancelButton); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
380 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
381 grid.setWidget(0, 0, header); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
382 grid.setWidget(1, 0, inputGrid); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
383 grid.setWidget(2, 0, buttons); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
384 grid.setStyleName("center"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
385 grid.addStyleName("zHigh"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
386 grid.addStyleName("addPanel"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
387 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
388 RootPanel.get().add(grid,0,0); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
389 int addLeft = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
390 int addTop = top - 10; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
391 if( width - left - grid.getOffsetWidth() - 10 < 0 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
392 addLeft = left - grid.getOffsetWidth() - 10; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
393 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
394 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
395 addLeft = left + 10; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
396 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
397 RootPanel.get().add(grid, addLeft, addTop); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
398 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
399 this.switchToNavigation(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
400 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
401 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
402 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
403 public void switchToNavigation(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
404 this.activeControl.deactivate(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
405 this.navigate.activate(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
406 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
407 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
408 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
409 * Getter for the corresponding Javascript component of the Map |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
410 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
411 * @return the Javascript component of the Map |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
412 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
413 public StiMap getJsMap(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
414 return this.jsMap; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
415 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
416 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
417 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
418 * sets value of corresponding zoom slider |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
419 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
420 * @param value value to set |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
421 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
422 public void setValue( float value ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
423 zoomBar.getSlider().setValue(Math.round(max*value)); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
424 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
425 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
426 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
427 * Getter for the active map control element |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
428 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
429 * @return active map control |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
430 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
431 public MapControl getActiveControl(){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
432 return this.activeControl; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
433 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
434 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
435 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
436 * Setter for the active map control element |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
437 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
438 * @param control active map control to set |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
439 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
440 public void setActiveControl(MapControl control) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
441 this.activeControl = control; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
442 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
443 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
444 public void setConImage(boolean active) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
445 final StiConstants textConstants = (StiConstants) GWT.create(StiConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
446 final ApplicationConstants constants = (ApplicationConstants) GWT.create(ApplicationConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
447 if( active ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
448 connections.setTitle(textConstants.hideConnections()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
449 connections.setUrl(constants.connectionsClickImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
450 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
451 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
452 connections.setTitle(textConstants.showConnections()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
453 connections.setUrl(constants.connectionsImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
454 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
455 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
456 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
457 } |