Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 276:f4c8ce11df33
UI stub for data cage
flys-client/trunk@1902 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 11 May 2011 14:34:15 +0000 |
parents | 7e484390d191 |
children | b493d606fdef |
comparison
equal
deleted
inserted
replaced
275:8264b02091ef | 276:f4c8ce11df33 |
---|---|
5 import com.google.gwt.core.client.GWT; | 5 import com.google.gwt.core.client.GWT; |
6 | 6 |
7 import com.smartgwt.client.widgets.Canvas; | 7 import com.smartgwt.client.widgets.Canvas; |
8 import com.smartgwt.client.widgets.Img; | 8 import com.smartgwt.client.widgets.Img; |
9 import com.smartgwt.client.widgets.Label; | 9 import com.smartgwt.client.widgets.Label; |
10 import com.smartgwt.client.widgets.IButton; | |
11 | |
10 import com.smartgwt.client.widgets.layout.HLayout; | 12 import com.smartgwt.client.widgets.layout.HLayout; |
11 import com.smartgwt.client.widgets.layout.VLayout; | 13 import com.smartgwt.client.widgets.layout.VLayout; |
14 | |
15 import com.smartgwt.client.widgets.events.ClickEvent; | |
16 import com.smartgwt.client.widgets.events.ClickHandler; | |
17 import com.smartgwt.client.widgets.events.CloseClickHandler; | |
18 import com.smartgwt.client.widgets.events.CloseClientEvent; | |
12 | 19 |
13 import de.intevation.flys.client.shared.model.Collection; | 20 import de.intevation.flys.client.shared.model.Collection; |
14 import de.intevation.flys.client.shared.model.OutputMode; | 21 import de.intevation.flys.client.shared.model.OutputMode; |
15 import de.intevation.flys.client.client.Config; | 22 import de.intevation.flys.client.client.Config; |
16 | 23 |
24 import de.intevation.flys.client.shared.model.Artifact; | |
17 | 25 |
18 /** | 26 /** |
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 27 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
20 */ | 28 */ |
21 public class ChartOutputTab extends OutputTab { | 29 public class ChartOutputTab extends OutputTab { |
35 * | 43 * |
36 * @param title The title of this tab. | 44 * @param title The title of this tab. |
37 * @param collection The Collection which this chart belongs to. | 45 * @param collection The Collection which this chart belongs to. |
38 * @param mode The OutputMode. | 46 * @param mode The OutputMode. |
39 */ | 47 */ |
40 public ChartOutputTab(String title, Collection collection, OutputMode mode){ | 48 public ChartOutputTab( |
49 String title, | |
50 Collection collection, | |
51 OutputMode mode, | |
52 CollectionView collectionView | |
53 ){ | |
41 super(title, collection, mode); | 54 super(title, collection, mode); |
42 | 55 |
43 tbarPanel = new Canvas(); | 56 tbarPanel = new Canvas(); |
44 left = new Canvas(); | 57 left = new Canvas(); |
45 right = new Canvas(); | 58 right = new Canvas(); |
61 hLayout.addMember(left); | 74 hLayout.addMember(left); |
62 hLayout.addMember(right); | 75 hLayout.addMember(right); |
63 | 76 |
64 right.addChild(createChartPanel()); | 77 right.addChild(createChartPanel()); |
65 left.addChild(createThemeControlPanel()); | 78 left.addChild(createThemeControlPanel()); |
66 tbarPanel.addChild(createTBarPanel()); | 79 tbarPanel.addChild( |
80 createTBarPanel(collectionView)); | |
67 | 81 |
68 vLayout.addMember(tbarPanel); | 82 vLayout.addMember(tbarPanel); |
69 vLayout.addMember(hLayout); | 83 vLayout.addMember(hLayout); |
70 | 84 |
71 setPane(vLayout); | 85 setPane(vLayout); |
72 } | 86 } |
73 | 87 |
74 | 88 |
75 protected Canvas createTBarPanel() { | 89 protected Canvas createTBarPanel( |
76 Label label = new Label("Werkzeugleiste"); | 90 final CollectionView collectionView |
77 label.setHeight(25); | 91 ) { |
78 label.setMargin(5); | 92 HLayout hLayout = new HLayout(); |
93 hLayout.setWidth100(); | |
94 hLayout.setHeight100(); | |
95 hLayout.setMembersMargin(10); | |
79 | 96 |
80 return label; | 97 IButton datacage = new IButton("Datenkorb"); |
98 datacage.setHeight(25); | |
99 datacage.setMargin(5); | |
100 | |
101 hLayout.addMember(datacage); | |
102 datacage.addClickHandler(new ClickHandler() { | |
103 public void onClick(ClickEvent event) { | |
104 GWT.log("Clicked 'datacage' button."); | |
105 openDatacageWindow( | |
106 collectionView.getArtifact()); | |
107 } | |
108 }); | |
109 | |
110 return hLayout; | |
111 } | |
112 | |
113 protected void openDatacageWindow(Artifact artifact) { | |
114 final DatacageWindow dc = new DatacageWindow(artifact); | |
115 dc.addCloseClickHandler(new CloseClickHandler() { | |
116 public void onCloseClick(CloseClientEvent event) { | |
117 dc.destroy(); | |
118 } | |
119 }); | |
120 dc.show(); | |
81 } | 121 } |
82 | 122 |
83 | 123 |
84 protected Canvas createChartPanel() { | 124 protected Canvas createChartPanel() { |
85 Img chart = getChartImg(); | 125 Img chart = getChartImg(); |