Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java @ 7052:7056fa3b1f75 generator-refactoring
Call processors from configuration.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 19 Sep 2013 11:50:36 +0200 |
parents | c4bacc5ddd9b |
children | f9d5020af0af |
comparison
equal
deleted
inserted
replaced
7051:c4bacc5ddd9b | 7052:7056fa3b1f75 |
---|---|
991 | 991 |
992 /** Add the acutal data to the diagram according to the processors. | 992 /** Add the acutal data to the diagram according to the processors. |
993 * For every outable facets, this function is | 993 * For every outable facets, this function is |
994 * called and handles the data accordingly. */ | 994 * called and handles the data accordingly. */ |
995 @Override | 995 @Override |
996 public void doOut(ArtifactAndFacet bundle, ThemeDocument theme, | 996 public void doOut( |
997 boolean visible) | 997 ArtifactAndFacet bundle, |
998 { | 998 ThemeDocument theme, |
999 boolean visible | |
1000 ) { | |
999 String facetName = bundle.getFacetName(); | 1001 String facetName = bundle.getFacetName(); |
1000 Facet facet = bundle.getFacet(); | 1002 Facet facet = bundle.getFacet(); |
1001 | 1003 |
1002 /* A conservative security check */ | 1004 /* A conservative security check */ |
1003 if (facetName == null || facet == null) { | 1005 if (facetName == null || facet == null) { |
1004 /* Can't happen,.. */ | 1006 /* Can't happen,.. */ |
1005 logger.error("doOut called with null facet."); | 1007 logger.error("doOut called with null facet."); |
1008 return; | |
1006 } | 1009 } |
1007 | 1010 |
1008 logger.debug("DoOut for facet: " + facetName); | 1011 logger.debug("DoOut for facet: " + facetName); |
1009 | 1012 |
1010 /* TODO Here should the configured processors come into play */ | 1013 for (DiagramAttributes.AxisProcessor ap: |
1011 List<Processor> processors = new ArrayList<Processor>(); | 1014 diagramAttributes.getAxesProcessors()) { |
1012 processors.add(new WOutProcessor()); | 1015 |
1013 processors.add(new QOutProcessor()); | 1016 Processor pr = ap.getProcessor(); |
1014 processors.add(new BedheightProcessor()); | 1017 |
1015 processors.add(new BedDiffYearProcessor()); | |
1016 processors.add(new BedDiffHeightYearProcessor()); | |
1017 | |
1018 for (Processor pr: processors) { | |
1019 if (pr.canHandle(facetName)) { | 1018 if (pr.canHandle(facetName)) { |
1020 // pr.doOut(this, bundle, theme, visible, 0); | 1019 // pr.doOut(this, bundle, theme, visible, 0); |
1021 } | 1020 } |
1022 } | 1021 } |
1023 } | 1022 } |