Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java @ 1944:21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
flys-artifacts/trunk@3334 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 30 Nov 2011 10:10:42 +0000 |
parents | 7c52e9cb2a72 |
children | 65f9d707caff |
comparison
equal
deleted
inserted
replaced
1943:06d8d371d244 | 1944:21a4d2c677a1 |
---|---|
12 | 12 |
13 import org.w3c.dom.Document; | 13 import org.w3c.dom.Document; |
14 | 14 |
15 import de.intevation.artifacts.Artifact; | 15 import de.intevation.artifacts.Artifact; |
16 | 16 |
17 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | |
17 import de.intevation.artifactdatabase.state.Facet; | 18 import de.intevation.artifactdatabase.state.Facet; |
18 | 19 |
19 import de.intevation.flys.artifacts.FLYSArtifact; | 20 import de.intevation.flys.artifacts.FLYSArtifact; |
20 import de.intevation.flys.artifacts.WINFOArtifact; | 21 import de.intevation.flys.artifacts.WINFOArtifact; |
21 | 22 |
114 protected String getYAxisLabel() { | 115 protected String getYAxisLabel() { |
115 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); | 116 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
116 } | 117 } |
117 | 118 |
118 | 119 |
119 protected void adjustAxes(XYPlot plot) { | |
120 super.adjustAxes(plot); | |
121 | |
122 NumberAxis qAxis = new NumberAxis( | |
123 msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT)); | |
124 | |
125 plot.setRangeAxis(1, qAxis); | |
126 | |
127 Font font = plot.getRangeAxis(0).getLabelFont(); | |
128 qAxis.setLabelFont(font); | |
129 } | |
130 | |
131 | |
132 /** | 120 /** |
133 * Let one facet do its job. | 121 * Let one facet do its job. |
134 */ | 122 */ |
135 public void doOut( | 123 public void doOut( |
136 Artifact artifact, | 124 ArtifactAndFacet artifactFacet, |
137 Facet facet, | 125 Document attr, |
138 Document attr, | 126 boolean visible |
139 boolean visible | |
140 ) { | 127 ) { |
141 String name = facet.getName(); | 128 String name = artifactFacet.getFacetName(); |
142 | 129 |
143 logger.debug("CrossSectionGenerator.doOut: " + name); | 130 logger.debug("CrossSectionGenerator.doOut: " + name); |
144 | 131 |
145 if (name == null) { | 132 if (name == null) { |
146 logger.error("No facet name for doOut(). No output generated!"); | 133 logger.error("No facet name for doOut(). No output generated!"); |
147 return; | 134 return; |
148 } | 135 } |
149 | 136 |
150 FLYSArtifact flys = (FLYSArtifact) artifact; | |
151 Facet f = flys.getNativeFacet(facet); | |
152 | |
153 if (f == null) { | |
154 return; | |
155 } | |
156 | |
157 if (name.equals(CROSS_SECTION)) { | 137 if (name.equals(CROSS_SECTION)) { |
158 doCrossSectionOut( | 138 doCrossSectionOut( |
159 f.getData(artifact, context), | 139 artifactFacet.getData(context), |
160 f.getDescription(), | 140 artifactFacet.getFacetDescription(), |
161 attr, | 141 attr, |
162 visible); | 142 visible); |
163 } | 143 } |
164 else if (name.equals(CROSS_SECTION_WATER_LINE)) { | 144 else if (name.equals(CROSS_SECTION_WATER_LINE)) { |
165 doCrossSectionWaterLineOut( | 145 doCrossSectionWaterLineOut( |
166 f.getData(artifact, context), | 146 artifactFacet.getData(context), |
167 f.getDescription(), | 147 artifactFacet.getFacetDescription(), |
168 attr, | 148 attr, |
169 visible); | 149 visible); |
170 } | 150 } |
171 else { | 151 else { |
172 logger.warn("CrossSection.doOut: Unknown facet name: " + name); | 152 logger.warn("CrossSection.doOut: Unknown facet name: " + name); |