Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java @ 524:ba238f917b94
The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
flys-client/trunk@2003 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 25 May 2011 13:42:04 +0000 |
parents | 0785a8ba5e6d |
children | 96e60e0a4345 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java Wed May 25 11:34:34 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java Wed May 25 13:42:04 2011 +0000 @@ -17,6 +17,8 @@ import de.intevation.flys.client.shared.model.Facet; import de.intevation.flys.client.shared.model.FacetRecord; import de.intevation.flys.client.shared.model.OutputMode; +import de.intevation.flys.client.shared.model.Theme; +import de.intevation.flys.client.shared.model.ThemeList; import de.intevation.flys.client.client.FLYSConstants; @@ -119,10 +121,23 @@ protected void updateGrid() { clearGrid(); - List<Facet> facets = mode.getFacets(); + ThemeList themeList = collection.getThemeList(mode.getName()); - for (Facet facet: facets) { - list.addData(new FacetRecord(facet)); + if (themeList == null) { + GWT.log("ERROR: No theme list."); + return; + } + + int count = themeList.getThemeCount(); + + for (int i = 1; i <= count; i++) { + Theme theme = themeList.getThemeAt(i); + + if (theme == null) { + continue; + } + + list.addData(new FacetRecord(theme)); } }