annotate src/econnect/wp3_3/client/core/ApplicationGrid.java @ 32:f635bbdc6a03

local KML display (beta)
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Fri, 30 Nov 2012 15:17:25 +0100
parents fef6080e83ad
children 18fc3a30e993
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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.core;
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 java.util.ArrayList;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
4 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
5 import java.util.List;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
6
32
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
7 import com.google.gwt.user.client.ui.FileUpload;
3
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.Grid;
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.HTML;
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.HasHorizontalAlignment;
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.Image;
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.ListBox;
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.MenuItem;
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.TextBox;
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.event.dom.client.ChangeEvent;
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.event.dom.client.ChangeHandler;
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.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
18 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
19 import com.google.gwt.event.dom.client.KeyCodes;
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.KeyUpEvent;
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.event.dom.client.KeyUpHandler;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
22 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
23 import com.google.gwt.user.client.Window;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
24 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
25 import com.google.gwt.core.client.JsArray;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
26 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
27 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
28 import com.google.gwt.dom.client.OptGroupElement;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
29 import com.google.gwt.dom.client.OptionElement;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
30 import com.google.gwt.dom.client.SelectElement;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
31 import com.google.gwt.dom.client.Style.Position;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
32 import com.google.gwt.dom.client.Style.Unit;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
33 import com.google.gwt.dom.client.Style.VerticalAlign;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
34 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
35 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
36
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
37 import econnect.wp3_3.client.widgets.map.Map;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
38 import econnect.wp3_3.client.widgets.table.StiTable;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
39 import econnect.wp3_3.client.widgets.timeplot.Timeplot;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
42 * Implementation of the Main Grid of the application where all widgets except tables will be embedded
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 public class ApplicationGrid extends Grid {
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
47 * The Java map object
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 private Map map;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
52 * The Java timeplot object
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 private Timeplot plot;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
57 * The Javascript core object
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 private StiCore core;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
62 * The Object that holds the history bar
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 private MenuBar history;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
67 * The actual history index
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
68 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
69 private int historyIndex;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
72 * The list of history items
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
73 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
74 private ArrayList<MenuItem> historyItems;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
75
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 * The image representing the back button
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
78 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
79 private Image back;
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 * The image representing the forward button
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
83 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
84 private Image forward;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
85
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 * The logo image
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 private Image logo;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
90
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 * The label image for the history
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
93 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
94 private Image historyLabel;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
95
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
96 private int width;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
97 private Grid links;
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 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
100 * Constructor for the main grid of the application
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
101 *
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
102 * @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
103 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
104 public ApplicationGrid( StiCore stiCore, StiTable table ){
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 int minWidth = 800;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
107 int minHeight = 600;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
108 int ph = 112;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
109
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
110 int docWidth = Document.get().getClientWidth();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
111
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
112 Grid mainGrid = new Grid(3,0);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
113
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
114 int height = (new Double(Document.get().getClientHeight()*0.5+ph)).intValue();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
115 int width = (new Double(height*4/3)).intValue();
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 if( height < minHeight ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
118 height = minHeight;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
119 width = minWidth;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
120 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
121
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
122 this.width = width;
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
123
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
124 this.core = stiCore;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
125 this.historyItems = new ArrayList<MenuItem>();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
126 this.resize(5,2);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
127 this.setCellSpacing(0);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
128 this.setCellPadding(0);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
129 //this.getElement().getStyle().setPosition(Position.ABSOLUTE);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
130 //this.getElement().getStyle().setPropertyPx("left", (docWidth-width)/2);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
131 this.getElement().getStyle().setPropertyPx("top", 120-39);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
132 //this.getElement().getStyle().setZIndex(1);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
133 this.getCellFormatter().getElement(2,1).setClassName("cellStyleTop");
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
134 this.getCellFormatter().getElement(3,0).setClassName("cellStyleLeft");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
135 RootPanel.get("mainContainer").add(this);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
136
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
137 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
138 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
139
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
140 final Grid headerGrid = 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
141 headerGrid.setWidth("100%");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
142
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
143 ArrayList<String> kmlLabels = new ArrayList<String>();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
144 ArrayList<Integer> kmlSources = new ArrayList<Integer>();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
145 ArrayList<Integer> kmlCategories = new ArrayList<Integer>();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
146 ArrayList<Integer> kmlLocations = new ArrayList<Integer>();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
147
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
148 //skruse: Fix for null values of kml* parameters
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
149 //TODO: This should allow an unlimited number of kmls and not an arbitrary limited set!
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
150
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
151 if( !(Window.Location.getParameter("kml1") == null) && !Window.Location.getParameter("kml1").equals("undefined") ){
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
152 kmlLabels.add(core.hexToAscii(Window.Location.getParameter("kml1")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
153 kmlSources.add(new Integer(Window.Location.getParameter("source1")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
154 kmlCategories.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
155 kmlLocations.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
156 }
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
157 if( !(Window.Location.getParameter("kml2") == null) && !Window.Location.getParameter("kml2").equals("undefined") ){
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
158 kmlLabels.add(core.hexToAscii(Window.Location.getParameter("kml2")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
159 kmlSources.add(new Integer(Window.Location.getParameter("source2")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
160 kmlCategories.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
161 kmlLocations.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
162 }
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
163 if( !(Window.Location.getParameter("kml3") == null) && !Window.Location.getParameter("kml3").equals("undefined") ){
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
164 kmlLabels.add(core.hexToAscii(Window.Location.getParameter("kml3")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
165 kmlSources.add(new Integer(Window.Location.getParameter("source3")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
166 kmlCategories.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
167 kmlLocations.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
168 }
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
169 if( !(Window.Location.getParameter("kml4") == null) && !Window.Location.getParameter("kml4").equals("undefined") ){
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
170 kmlLabels.add(core.hexToAscii(Window.Location.getParameter("kml4")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
171 kmlSources.add(new Integer(Window.Location.getParameter("source4")));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
172 kmlCategories.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
173 kmlLocations.add(new Integer(-1));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
174 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
175 int sources = core.getDatasources();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
176 if( sources > 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
177 final TextBox searchField = new TextBox();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
178 final Image openButton = new Image(constants.openImage());
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
179 openButton.getElement().addClassName("vCenter");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
180 final ListBox datasource = new ListBox(false);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
181 final List<ListBox> staticListBoxes = new ArrayList<ListBox>();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
182 final ArrayList<ArrayList<int[]>> entries = new ArrayList<ArrayList<int[]>>();
32
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
183 final FileUpload uploadKML = new FileUpload();
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
184 //skruse: The element will be accessed by its ID in the JS code
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
185 //either don't change this name, or change it also in STICore.js
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
186 uploadKML.getElement().setId("localKMLFileChooser");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
187 for( int i=0; i<sources; i++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
188 try {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
189 if( core.hasItems(i) ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
190 try {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
191 ListBox staticData = new ListBox();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
192 SelectElement select = staticData.getElement().cast();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
193 OptionElement blank = Document.get().createOptionElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
194 blank.setInnerText("select set ...");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
195 select.appendChild(blank);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
196 int categories = core.getCategories(i);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
197 ArrayList<int[]> values = new ArrayList<int[]>();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
198 for( int j=0; j<categories; j++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
199 try {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
200 OptGroupElement group = Document.get().createOptGroupElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
201 group.setLabel(core.getCategory(i,j));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
202 for (int k=0; k<core.getItemCount(i,j); k++) {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
203 OptionElement optElement = Document.get().createOptionElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
204 optElement.setInnerText(core.getLabel(i,j,k));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
205 for( int l=0; l<kmlLabels.size(); l++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
206 if( kmlLabels.get(l).equals(core.getLabel(i,j,k)) ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
207 kmlCategories.set(l,new Integer(j));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
208 kmlLocations.set(l,new Integer(k));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
209 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
210 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
211 group.appendChild(optElement);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
212 int[] pair = {j,k};
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
213 values.add(pair);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
214 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
215 select.appendChild(group);
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 catch( Exception e ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
218 continue;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
219 }
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 entries.add(values);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
222 staticListBoxes.add(staticData);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
223 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
224 catch( Exception e ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
225 continue;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
226 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
227 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
228 else {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
229 entries.add(null);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
230 staticListBoxes.add(null);
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 datasource.addItem(core.getDatasourceLabel(i));
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 catch( Exception e ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
235 continue;
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 if( datasource.getItemCount() > 0 ){
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
240 final Grid openPanel = new Grid(1,3);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
241 openPanel.setWidget(0, 0, datasource);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
242 if( staticListBoxes.get(0) == null ){
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
243 openPanel.setWidget(0, 1, searchField);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
244 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
245 else {
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
246 openPanel.setWidget(0, 1, staticListBoxes.get(0));
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
247 }
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
248 openPanel.setWidget(0, 2, openButton);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
249 openPanel.addStyleName("center");
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
250 headerGrid.setWidget(0, 0, openPanel);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
251
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
252 datasource.addChangeHandler(new ChangeHandler() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
253 public void onChange(ChangeEvent event) {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
254 int ds = datasource.getSelectedIndex();
32
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
255 String label = datasource.getItemText(ds);
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
256
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
257 if( ds == -1 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
258 return;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
259 }
32
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
260 //skruse: test for local KML loading (e.g. useful for the downloaded KMLs)
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
261 //TODO: if this remains in the code, the check below has
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
262 //to be improved (some constant somewhere)
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
263 if( label.equals("local KML") ){
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
264 openPanel.setWidget(0, 1, uploadKML);
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
265 }
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
266 else if( staticListBoxes.get(ds) == null ){
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
267 openPanel.setWidget(0, 1, searchField);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
268 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
269 else {
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
270 openPanel.setWidget(0, 1, staticListBoxes.get(ds));
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
271 }
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 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
274
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
275 class LoadDataHandler implements ClickHandler, KeyUpHandler {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
276 public void onClick(ClickEvent event) {
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
277 openButton.setUrl(constants.openDisabledImage());
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
278 loadData();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
279 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
280 public void onKeyUp(KeyUpEvent event) {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
281 if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
282 openButton.setUrl(constants.openDisabledImage());
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
283 loadData();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
284 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
285 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
286 private void loadData() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
287 int ds = datasource.getSelectedIndex();
32
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
288 String label = datasource.getItemText(ds);
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
289
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
290 if( core.isMaximumReached() ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
291 core.alert(textConstants.maxDatasources());
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 else if( staticListBoxes.get(ds) != null ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
294 if( staticListBoxes.get(ds).getSelectedIndex() > 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
295 int[] pair = entries.get(ds).get(staticListBoxes.get(ds).getSelectedIndex() - 1);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
296 core.openStaticKml(ds,pair[0],pair[1]);
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 }
32
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
299 //skruse: test for local KML loading (e.g. useful for the downloaded KMLs)
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
300 //TODO: if this remains in the code, the check below has
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
301 //to be improved (some constant somewhere)
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
302 else if( (label.equals("local KML")) && (uploadKML.getFilename() != "") ){
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
303 String fileName = uploadKML.getFilename();
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
304 core.openLocalKml( ds, fileName );
f635bbdc6a03 local KML display (beta)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 14
diff changeset
305 }
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
306 else if( !searchField.getText().equals("") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
307 core.openDynamicKml( ds, searchField.getText() );
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
308 }
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
309 openButton.setUrl(constants.openImage());
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
310 }
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
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
313 LoadDataHandler handler = new LoadDataHandler();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
314 openButton.addClickHandler(handler);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
315 searchField.addKeyUpHandler(handler);
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
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
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
320 Grid historyGrid = new Grid(1,3);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
321 historyLabel = new Image(constants.historyImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
322
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
323 history = new MenuBar(true);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
324 history.setAnimationEnabled(true);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
325 history.addStyleName("zHigh");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
326 addHistoryItem(0);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
327 historyGrid.setWidget(0, 1, historyLabel);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
328 headerGrid.setWidget(0, 1, historyGrid);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
329
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
330 historyLabel.setTitle(textConstants.history());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
331 historyLabel.addClickHandler(new ClickHandler() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
332 public void onClick(ClickEvent event) {
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
333 if( !RootPanel.get("mainContainer").remove(history) ){
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
334 RootPanel.get("mainContainer").add(history,0,0);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
335 historyLabel.setUrl(constants.historyOverImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
336 int left = historyLabel.getAbsoluteLeft() + historyLabel.getOffsetWidth()/2 - history.getOffsetWidth()/2;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
337 int top = historyLabel.getAbsoluteTop() + historyLabel.getOffsetHeight();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
338 RootPanel.get("mainContainer").setWidgetPosition(history,left,top);
3
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 historyLabel.setUrl(constants.historyImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
342 }
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 historyLabel.getElement().addClassName("vCenter");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
346
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
347 headerGrid.getCellFormatter().setHorizontalAlignment(0,0,HasHorizontalAlignment.ALIGN_LEFT);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
348 headerGrid.getCellFormatter().setHorizontalAlignment(0,1,HasHorizontalAlignment.ALIGN_RIGHT);
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 back = new Image(constants.backwardDisabledImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
351 back.getElement().addClassName("vCenter");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
352 back.setTitle(textConstants.back());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
353 forward = new Image(constants.forwardDisabledImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
354 forward.getElement().addClassName("vCenter");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
355 forward.setTitle(textConstants.forward());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
356 historyGrid.setWidget(0, 0, back);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
357 historyGrid.setWidget(0, 2, forward);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
358
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
359 back.addClickHandler(new ClickHandler() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
360 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
361 if( historyIndex > 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
362 core.switchThroughHistory(historyIndex-1);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
363 historyIndex--;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
364 setHistoryStyle(historyIndex+1,historyIndex);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
365 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
366 }
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 forward.addClickHandler(new ClickHandler() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
370 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
371 if( historyIndex < core.getHistoryLength()-1 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
372 core.switchThroughHistory(historyIndex+1);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
373 historyIndex++;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
374 setHistoryStyle(historyIndex-1,historyIndex);
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 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
378
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
379 this.setWidget(2, 1, headerGrid);
3
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 widgets = new Grid(2,1);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
382 this.setWidget(3, 1, widgets);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
383 widgets.setCellPadding(0);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
384 widgets.setCellSpacing(0);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
385
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
386 DivElement mapWindow = Document.get().createDivElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
387 mapWindow.setId("mapWindow");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
388 mapWindow.setClassName("mapWindow");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
389 mapWindow.getStyle().setPropertyPx("height", height-ph);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
390 mapWindow.getStyle().setPropertyPx("width", width);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
391 mapWindow.getStyle().setProperty("position", "relative");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
392 DivElement mapDiv = Document.get().createDivElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
393 mapDiv.setId("map");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
394 mapDiv.getStyle().setPropertyPx("height", height-ph);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
395 mapDiv.getStyle().setPropertyPx("width", width);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
396 //mapDiv.getStyle().setProperty("position", "absolute");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
397 mapWindow.appendChild(mapDiv);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
398 widgets.getCellFormatter().getElement(0,0).setInnerHTML(mapWindow.getString());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
399 this.map = new Map(core,"mapWindow","map");
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 DivElement plotWindow = Document.get().createDivElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
402 plotWindow.setId("plotWindow");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
403 plotWindow.getStyle().setPropertyPx("width", width);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
404 plotWindow.getStyle().setPropertyPx("height", ph);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
405 DivElement plotDiv = Document.get().createDivElement();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
406 plotDiv.setId("plot");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
407 plotDiv.getStyle().setPropertyPx("width", width);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
408 plotWindow.appendChild(plotDiv);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
409 widgets.getCellFormatter().getElement(1,0).setInnerHTML(plotWindow.getString());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
410 this.plot = new Timeplot(core,"plotWindow","plot");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
411
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
412 final Grid controls = new Grid(4,1);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
413 controls.setCellSpacing(0);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
414 controls.setCellPadding(0);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
415 controls.setWidth("100%");
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 final Image mapControl = new Image(constants.globeImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
418 mapControl.setTitle(textConstants.mapControls());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
419 controls.setWidget(0, 0, mapControl);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
420
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
421 final Image plotControl = new Image(constants.timeImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
422 plotControl.setTitle(textConstants.plotControls());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
423 controls.setWidget(3, 0, plotControl);
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 final Grid plotControls = this.plot.initPlotControls();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
426 final Grid mapControls = this.map.initMapControls();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
427
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
428 controls.setWidget(1, 0, mapControls);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
429 controls.setWidget(2, 0, plotControls);
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 controls.getCellFormatter().getElement(0,0).getStyle().setHeight(25,Unit.PX);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
432 controls.getCellFormatter().getElement(1,0).getStyle().setVerticalAlign(VerticalAlign.TOP);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
433 controls.getCellFormatter().getElement(2,0).getStyle().setVerticalAlign(VerticalAlign.BOTTOM);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
434 controls.getCellFormatter().getElement(3,0).getStyle().setHeight(25,Unit.PX);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
435 this.getCellFormatter().setHorizontalAlignment(2,0,HasHorizontalAlignment.ALIGN_RIGHT);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
436
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
437
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
438 this.setWidget(3,0,controls);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
439 controls.setSize("100%",height+"px");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
440
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
441 // Increased to 8 by DARIAH-DE SUBGOE sfu
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
442 Grid linkList = new Grid(1,8);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
443
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
444 this.logo = new Image(constants.logoImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
445 this.logo.addStyleName("logo");
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
446 this.setWidget(0,0,this.logo);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
447
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
448 this.getCellFormatter().getElement(0,0).setAttribute("colspan", "2");
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
449 this.getCellFormatter().getElement(0,1).removeFromParent();
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
450
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
451 HTML informationLink = new HTML("&nbsp;e4D&nbsp;&ndash;&nbsp;Info");
4
517a6422d1bd done all the GeoBrowser changes
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 3
diff changeset
452 informationLink.setTitle("e4D&nbsp;-&nbsp;Info");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
453 informationLink.addClickHandler(new ClickHandler(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
454 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
455 Window.open("http://wp1187670.wp212.webpack.hosteurope.de/e4d/?page_id=2", "_blank", "");
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 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
458 informationLink.setStyleName("headerLink");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
459 linkList.setWidget(0, 0, informationLink);
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
460
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
461 HTML helpLink = new HTML("&nbsp;Help");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
462 helpLink.setTitle("Help");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
463 helpLink.addClickHandler(new ClickHandler(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
464 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
465 Window.open("http://wp1187670.wp212.webpack.hosteurope.de/e4d/?page_id=23", "_blank", "");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
466 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
467 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
468 helpLink.setStyleName("headerLink");
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
469
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
470
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
471 HTML contactLink = new HTML("&nbsp;Contact");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
472 contactLink.setTitle("Contact");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
473 contactLink.addClickHandler(new ClickHandler(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
474 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
475 Window.open("http://wp1187670.wp212.webpack.hosteurope.de/e4d/?page_id=4", "_blank", "");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
476 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
477 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
478 contactLink.setStyleName("headerLink");
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
479 linkList.setWidget(0, 1, contactLink);
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
480
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
481 HTML clearLink = new HTML("&nbsp;Clear Data");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
482 clearLink.setTitle("Clear Data");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
483 clearLink.addClickHandler(new ClickHandler(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
484 public void onClick(ClickEvent event) {
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
485 // Changed to root URL for DARIAH-EU SUBGOE sfu
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
486 // Window.Location.assign(Window.Location.getHref());
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
487 Window.open("http://dev2.dariah.eu/e4d/", "_self", "");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
488 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
489 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
490 clearLink.setStyleName("headerLink");
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
491 linkList.setWidget(0, 2, clearLink);
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
492
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
493 HTML uploadLink = new HTML("&nbsp;Upload Data");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
494 uploadLink.setTitle("Upload Data");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
495 uploadLink.setStyleName("headerLink");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
496 uploadLink.addClickHandler(new ClickHandler(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
497 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
498 Window.open("http://wp1187670.wp212.webpack.hosteurope.de/e4d/?page_id=11", "_blank", "");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
499 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
500 });
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
501 linkList.setWidget(0, 3, uploadLink);
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
502
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
503 // Newly inserted by DARIAH-DE SUBGOE sfu
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
504 HTML dataSheetLink = new HTML("&nbsp;Data Editor");
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
505 dataSheetLink.setTitle("Data Editor");
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
506 dataSheetLink.addClickHandler(new ClickHandler(){
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
507 public void onClick(ClickEvent event) {
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
508 Window.open("http://ref.dariah.eu/workflow/", "_blank", "");
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
509 }
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
510 });
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
511 dataSheetLink.setStyleName("headerLink");
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
512 linkList.setWidget(0, 4, dataSheetLink);
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
513
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
514 ClickHandler magneticClick = new ClickHandler(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
515 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
516 if( core.getDataSets().length() > 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
517 String link = Window.Location.getHref() + "?";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
518 for( int i=0; i<core.getDataSets().length(); i++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
519 if( i>0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
520 link += "\n&";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
521 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
522 String name = core.getDataSets().get(i).getTermIdentifier();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
523 link += "kml"+(i+1)+"="+core.asciiToHex(name);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
524 link += "&source"+(i+1)+"="+core.getDataSets().get(i).getSource();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
525 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
526 link += "\n&minTime=" + plot.getJsTimeplot().minTime();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
527 link += "&maxTime=" + plot.getJsTimeplot().maxTime();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
528 if( plot.getJsTimeplot().minSelTime() != null ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
529 link += "\n&minSelTime=" + plot.getJsTimeplot().minSelTime();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
530 link += "&maxSelTime=" + plot.getJsTimeplot().maxSelTime();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
531 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
532 link += "\n&mapId=" + map.getJsMap().baseLayerIndex();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
533 link += "&zoom=" + map.getJsMap().getZoom();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
534 link += "&centerLon=" + map.getJsMap().centerLon();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
535 link += "&centerLat=" + map.getJsMap().centerLat();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
536 link += "&connections=" + map.getJsMap().getConnections();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
537 Window.open(link,"_blank","");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
538 core.alert("e4D Magnetic Link opened in new tab!\n(Currently considered are: loaded datasets, map settings, temporal range, temporal selection)\n\n"+link);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
539 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
540 else {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
541 core.alert("Link could not be created; no datasets available.");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
542 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
543 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
544 };
11
f0365f1b90ec - added new link to DARIAH datasheet editor
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents: 4
diff changeset
545
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
546 HTML magneticLink = new HTML("&nbsp;Magnetic Link");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
547 magneticLink.setStyleName("headerLink");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
548 magneticLink.addClickHandler(magneticClick);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
549 linkList.setWidget(0, 5, magneticLink);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
550
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
551 Image link = new Image(constants.linkImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
552 link.addStyleName("link");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
553 link.setTitle("Create Magnetic Link");
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
554 linkList.setWidget(0, 6, link);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
555
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
556 linkList.getElement().getStyle().setPosition(Position.ABSOLUTE);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
557 linkList.getElement().getStyle().setPropertyPx("right", 0);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
558 linkList.getElement().setPropertyString("align", "right");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
559 linkList.getElement().getStyle().setPropertyPx("top", 0);
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
560 RootPanel.get("mainContainer").add(linkList);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
561
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
562 this.setWidget(1,1,linkList);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
563 this.links = linkList;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
564
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
565 link.addClickHandler(magneticClick);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
566
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
567 core.setElements( this.getMap().getJsMap(), this.getPlot().getJsTimeplot() );
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
568 StiCore.exportStaticMethods(table,this,this.getPlot(),this.getMap());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
569
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
570 table.setTop( 40 );
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
571 table.setWidth("100%");
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
572
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
573 for( int i=0; i<kmlLabels.size(); i++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
574 if( kmlSources.get(i).intValue() == 0 && kmlCategories.get(i) > -1 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
575 core.openStaticKml(kmlSources.get(i), kmlCategories.get(i), kmlLocations.get(i));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
576 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
577 else if( kmlSources.get(i).intValue() < 4 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
578 core.openDynamicKml(kmlSources.get(i),kmlLabels.get(i));
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
579 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
580 else {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
581 core.alert("Unable to load \""+kmlLabels.get(i)+"\"!");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
582 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
583 }
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
584
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
585 this.setWidget(4, 0, table);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
586 this.getCellFormatter().getElement(4,0).setAttribute("colspan", "2");
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
587 this.getCellFormatter().getElement(4,1).removeFromParent();
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
588 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
589
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
590 public void setDefinedBounds(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
591 int zoom = 0;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
592 float cLon = 0, cLat = 0;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
593 int mapId = 0;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
594 if( !Window.Location.getParameter("zoom").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
595 zoom = new Integer(Window.Location.getParameter("zoom")).intValue();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
596 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
597 if( !Window.Location.getParameter("centerLon").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
598 cLon = new Float(Window.Location.getParameter("centerLon")).floatValue();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
599 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
600 if( !Window.Location.getParameter("centerLat").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
601 cLat = new Float(Window.Location.getParameter("centerLat")).floatValue();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
602 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
603 if( !Window.Location.getParameter("mapId").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
604 mapId = new Integer(Window.Location.getParameter("mapId")).intValue();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
605 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
606 if( zoom != 0 || cLon != 0 || cLat != 0 || mapId != 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
607 this.getMap().getJsMap().configure(zoom, cLon, cLat, mapId);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
608 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
609 String minSelTime = null, maxSelTime = null;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
610 if( !Window.Location.getParameter("minSelTime").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
611 minSelTime = Window.Location.getParameter("minSelTime");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
612 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
613 if( !Window.Location.getParameter("maxSelTime").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
614 maxSelTime = Window.Location.getParameter("maxSelTime");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
615 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
616 if( minSelTime != null && maxSelTime != null ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
617 this.getPlot().getJsTimeplot().selectTimerange(minSelTime,maxSelTime);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
618 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
619 if( !Window.Location.getParameter("connections").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
620 int connections = new Integer(Window.Location.getParameter("connections")).intValue();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
621 if( connections == 1 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
622 this.getMap().getJsMap().setConnections(connections);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
623 this.getMap().setConImage(true);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
624 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
625 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
626 String minTime = null, maxTime = null;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
627 if( !Window.Location.getParameter("minTime").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
628 minTime = Window.Location.getParameter("minTime");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
629 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
630 if( !Window.Location.getParameter("maxTime").equals("undefined") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
631 maxTime = Window.Location.getParameter("maxTime");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
632 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
633 if( minTime != null && maxTime != null ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
634 this.core.refineByTime(minTime,maxTime);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
635 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
636 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
637 /*
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
638 public String asciiToHex(String text){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
639 String[] ascii = { "!","#","$","%","&","'","(",")","*","+",",","/",":",";","=","?","@","[","]", " " };
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
640 String[] hex = { "%21","%23","%24","$","%26","%27","%28","%29","%2a","%2b","%2c","%2f","%3a","%3b","%3d","%3f","%40","%5b","%5d","%20"};
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
641 for( int i=0; i<ascii.length; i++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
642 text = text.replaceAll(ascii[i],hex[i]);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
643 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
644 text = text.replaceAll("$","%25");
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
645 return text;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
646 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
647
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
648 public String hexToAscii(String text){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
649 String[] ascii = { "!","#","$","%","&","'","(",")","*","+",",","/",":",";","=","?","@","[","]", " " };
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
650 String[] hex = { "%21","%23","%24","%25","%26","%27","%28","%29","%2a","%2b","%2c","%2f","%3a","%3b","%3d","%3f","%40","%5b","%5d","%20"};
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
651 for( int i=0; i<ascii.length; i++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
652 text = text.replaceAll(hex[i],ascii[i]);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
653 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
654 return text;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
655 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
656 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
657 public void resize(){
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
658 /*
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
659 int w = Document.get().getClientWidth();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
660 RootPanel.get("mainContainer").setWidgetPosition(this.logo,(w-width)/2-40,8);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
661 RootPanel.get("mainContainer").setWidgetPosition(this,(w-width)/2,120-39);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
662 int left = this.getElement().getOffsetLeft() + this.getElement().getOffsetWidth() - this.links.getElement().getOffsetWidth();
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
663 RootPanel.get("mainContainer").setWidgetPosition(this.links,left,0);
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
664 */
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
665 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
666
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
667 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
668 * Sets the style of the history panel
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
669 *
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
670 * @param oldIndex last active history entry
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
671 * @param newIndex actual active history entry
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
672 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
673 public void setHistoryStyle( int oldIndex, int newIndex ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
674 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
675 if( oldIndex == -1 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
676 oldIndex = historyIndex;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
677 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
678 if( newIndex == core.getHistoryLength()-1 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
679 forward.setUrl(constants.forwardDisabledImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
680 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
681 else {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
682 forward.setUrl(constants.forwardImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
683 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
684 if( newIndex == 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
685 back.setUrl(constants.backwardDisabledImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
686 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
687 else {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
688 back.setUrl(constants.backwardImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
689 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
690 MenuItem oldItem = (MenuItem) historyItems.get(oldIndex);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
691 oldItem.setHTML( oldItem.getHTML().replaceFirst("bold","normal") );
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
692 MenuItem newItem = (MenuItem) historyItems.get(newIndex);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
693 newItem.setHTML( newItem.getHTML().replaceFirst("normal","bold") );
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
694 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
695
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
696 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
697 * Adds an item to the history panel
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
698 *
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
699 * @param index index in the corresponding javascript array source
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
700 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
701 public void addHistoryItem( final int index ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
702 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
703 for( int i=historyItems.size(); i>index; i-- ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
704 this.history.removeItem( (MenuItem) historyItems.get(i-1) );
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
705 this.historyItems.remove(i-1);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
706 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
707 String text = "<span style='font-weight:bold;'>";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
708 JsArray<DataSet> sets = core.getHistoryDataSets(index);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
709 for( int j=0; j<sets.length(); j++ ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
710 DataSet set = sets.get(j);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
711 text += set.getTermIdentifier();
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
712 if( j+1 < sets.length() ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
713 text += ", ";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
714 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
715 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
716 if( text.equals("<span style='font-weight:bold;'>") ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
717 text += "empty";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
718 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
719 else {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
720 text += " ("+(new Date()).toString()+")";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
721 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
722 text += "</span>";
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
723 MenuItem item = new MenuItem(text,true,new Command() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
724 public void execute() {
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
725 core.switchThroughHistory(index);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
726 setHistoryStyle(-1,index);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
727 historyIndex = index;
14
fef6080e83ad removed unused libraries
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents: 11
diff changeset
728 RootPanel.get("mainContainer").remove(history);
3
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
729 historyLabel.setUrl(constants.historyImage());
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
730 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
731 });
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
732 historyItems.add(item);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
733 this.history.addItem(item);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
734 historyIndex = index;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
735 if( index > 0 ){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
736 setHistoryStyle(index-1,index);
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
737 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
738 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
739
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
740 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
741 * Getter for the Java timeplot element
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
742 *
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
743 * @return the Java timeplot element
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
744 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
745 public Timeplot getPlot(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
746 return this.plot;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
747 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
748
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
749 /**
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
750 * Getter for the Java map element
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
751 *
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
752 * @return the Java map element
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
753 */
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
754 public Map getMap(){
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
755 return this.map;
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
756 }
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
757
cf06b77a8bbd Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff changeset
758 }