Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java @ 2438:e0f4ea518d59
Query GetFeatureInfo for active layers only.
flys-client/trunk@4106 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 01 Mar 2012 15:07:04 +0000 |
parents | 71ba43bd0e3f |
children |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java Thu Mar 01 13:24:52 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/ThemeList.java Thu Mar 01 15:07:04 2012 +0000 @@ -2,6 +2,7 @@ import java.io.Serializable; +import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -29,6 +30,24 @@ } + public List<Theme> getActiveThemes() { + List<Theme> active = new ArrayList<Theme>(); + List<Theme> all = getThemes(); + + if (all == null || all.isEmpty()) { + return active; + } + + for (Theme theme: all) { + if (theme.getActive() == 1) { + active.add(theme); + } + } + + return active; + } + + public int getThemeCount() { return themes.size(); }