comparison artifacts/src/main/java/org/dive4elements/river/exports/process/AnnotationProcessor.java @ 7075:253d80af5b7f generator-refactoring

More Processor refactoring - Unify aandf aaf and bundle variable names to bundle - Factor out diagram inversion code - Add function with new signature to BedDiffYear and QOut processors
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 20 Sep 2013 16:25:43 +0200
parents eb24d5203d17
children 41567bf1e131
comparison
equal deleted inserted replaced
7074:a2abd87c0d3b 7075:253d80af5b7f
30 Logger.getLogger(AnnotationProcessor.class); 30 Logger.getLogger(AnnotationProcessor.class);
31 31
32 @Override 32 @Override
33 public void doOut( 33 public void doOut(
34 DiagramGenerator generator, 34 DiagramGenerator generator,
35 ArtifactAndFacet aaf, 35 ArtifactAndFacet bundle,
36 ThemeDocument theme, 36 ThemeDocument theme,
37 boolean visible) { 37 boolean visible) {
38 if (!visible) { 38 if (!visible) {
39 // Nothing to do 39 // Nothing to do
40 return; 40 return;
41 } 41 }
42 CallContext context = generator.getCallContext(); 42 CallContext context = generator.getCallContext();
43 if (!(aaf.getData(context) instanceof RiverAnnotation)) { 43 if (!(bundle.getData(context) instanceof RiverAnnotation)) {
44 // Just a bit defensive should not happen 44 // Just a bit defensive should not happen
45 logger.error("Incompatible facet in doOut"); 45 logger.error("Incompatible facet in doOut");
46 return; 46 return;
47 } 47 }
48 RiverAnnotation ra = (RiverAnnotation)aaf.getData(context); 48 RiverAnnotation ra = (RiverAnnotation)bundle.getData(context);
49 ra.setTheme(theme); 49 ra.setTheme(theme);
50 ra.setLabel(aaf.getFacetDescription()); 50 ra.setLabel(bundle.getFacetDescription());
51 generator.addAnnotations(ra); 51 generator.addAnnotations(ra);
52 } 52 }
53 53
54 @Override 54 @Override
55 public void doOut( 55 public void doOut(
56 XYChartGenerator generator, 56 XYChartGenerator generator,
57 ArtifactAndFacet aaf, 57 ArtifactAndFacet bundle,
58 ThemeDocument theme, 58 ThemeDocument theme,
59 boolean visible, 59 boolean visible,
60 int index) 60 int index)
61 { 61 {
62 if (!visible) { 62 if (!visible) {
63 // Nothing to do 63 // Nothing to do
64 return; 64 return;
65 } 65 }
66 CallContext context = generator.getCallContext(); 66 CallContext context = generator.getCallContext();
67 if (!(aaf.getData(context) instanceof RiverAnnotation)) { 67 if (!(bundle.getData(context) instanceof RiverAnnotation)) {
68 // Just a bit defensive should not happen 68 // Just a bit defensive should not happen
69 logger.error("Incompatible facet in doOut"); 69 logger.error("Incompatible facet in doOut");
70 return; 70 return;
71 } 71 }
72 RiverAnnotation ra = (RiverAnnotation)aaf.getData(context); 72 RiverAnnotation ra = (RiverAnnotation)bundle.getData(context);
73 ra.setTheme(theme); 73 ra.setTheme(theme);
74 ra.setLabel(aaf.getFacetDescription()); 74 ra.setLabel(bundle.getFacetDescription());
75 generator.addAnnotations(ra); 75 generator.addAnnotations(ra);
76 } 76 }
77 77
78 @Override 78 @Override
79 public boolean canHandle(String facetType) { 79 public boolean canHandle(String facetType) {

http://dive4elements.wald.intevation.org