Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ThemeNavigationPanel.java @ 527:902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
flys-client/trunk@2007 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 25 May 2011 16:23:16 +0000 |
parents | |
children | 0ba7c43e7b62 |
rev | line source |
---|---|
527
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui.chart; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import com.google.gwt.core.client.GWT; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import com.smartgwt.client.types.Alignment; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import com.smartgwt.client.widgets.Label; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.Canvas; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.events.ClickEvent; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import com.smartgwt.client.widgets.events.ClickHandler; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.layout.HLayout; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.flys.client.client.event.OnMoveEvent; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.flys.client.client.event.OnMoveHandler; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 /** |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 */ |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 public class ThemeNavigationPanel extends Canvas { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 public static final int PANEL_MARGIN = 5; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 public static final int BUTTON_HEIGHT = 20; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 public static final int BUTTON_MARGIN = 5; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 protected List<OnMoveHandler> handlers; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public ThemeNavigationPanel() { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 this.handlers = new ArrayList<OnMoveHandler>(); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 setWidth100(); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 setHeight(BUTTON_HEIGHT); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 setMargin(PANEL_MARGIN); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 HLayout layout = new HLayout(); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 layout.setWidth100(); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 layout.setHeight(BUTTON_HEIGHT); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 layout.setMembersMargin(BUTTON_MARGIN); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 Canvas cu = createButton("CU", OnMoveEvent.TOP); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 Canvas u = createButton("U", OnMoveEvent.UP); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 Canvas d = createButton("D", OnMoveEvent.DOWN); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 Canvas cd = createButton("CD", OnMoveEvent.BOTTOM); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 layout.addMember(cu); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 layout.addMember(u); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 layout.addMember(d); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 layout.addMember(cd); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 addChild(layout); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 protected Canvas createButton(final String type, final int moveType) { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 Label b = new Label(type); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 b.setBackgroundColor("#BED730"); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 b.setBorder("1px solid black"); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 b.setWidth(40); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 b.setHeight(BUTTON_HEIGHT); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 b.setAlign(Alignment.CENTER); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 b.addClickHandler(new ClickHandler() { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 public void onClick(ClickEvent event) { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 fireOnMoveEvent(moveType); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 }); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 return b; |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 protected void addOnMoveHandler(OnMoveHandler handler) { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 if (handler != null) { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 handlers.add(handler); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 protected void fireOnMoveEvent(int type) { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 OnMoveEvent event = new OnMoveEvent(type); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 for (OnMoveHandler handler: handlers) { |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 handler.onMove(event); |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 } |
902609b5cc79
Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |