Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityDataFacet.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 4b00ee858964 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
26 | 26 |
27 private static final long serialVersionUID = 1L; | 27 private static final long serialVersionUID = 1L; |
28 | 28 |
29 private static Logger log = Logger.getLogger(BedQualityDataFacet.class); | 29 private static Logger log = Logger.getLogger(BedQualityDataFacet.class); |
30 | 30 |
31 private String valueName; /* Name of the ResultValue underlying this facet */ | 31 private String valueName; /* Name of ResultValue underlying this facet */ |
32 private String valueType; /* Type of the ResultValue underlying this facet */ | 32 private String valueType; /* Type of ResultValue underlying this facet */ |
33 | 33 |
34 public BedQualityDataFacet() { | 34 public BedQualityDataFacet() { |
35 // required for clone operation deepCopy() | 35 // required for clone operation deepCopy() |
36 } | 36 } |
37 | 37 |
38 public BedQualityDataFacet(int idx, String name, String description, | 38 public BedQualityDataFacet( |
39 ComputeType type, String stateId, String hash, String valueName, String valueType) { | 39 int idx, |
40 String name, | |
41 String description, | |
42 ComputeType type, | |
43 String stateId, | |
44 String hash, | |
45 String valueName, | |
46 String valueType | |
47 ) { | |
40 super(idx, name, description, type, hash, stateId); | 48 super(idx, name, description, type, hash, stateId); |
41 this.valueName = valueName; | 49 this.valueName = valueName; |
42 this.valueType = valueType; | 50 this.valueType = valueType; |
43 this.metaData.put("X", "chart.longitudinal.section.xaxis.label"); | 51 this.metaData.put("X", "chart.longitudinal.section.xaxis.label"); |
44 if (!valueName.equals("porosity") && !valueName.equals("density")) { | 52 if (!valueName.equals("porosity") && !valueName.equals("density")) { |
45 this.metaData.put("Y", "chart.bedquality.yaxis.label.diameter"); | 53 this.metaData.put("Y", "chart.bedquality.yaxis.label.diameter"); |
46 } else { | 54 } else { |
47 this.metaData.put("Y", "chart.bedquality.yaxis.label." + valueName); | 55 this.metaData.put( |
56 "Y", "chart.bedquality.yaxis.label." + valueName); | |
48 } | 57 } |
49 } | 58 } |
50 | 59 |
51 @Override | 60 @Override |
52 public Object getData(Artifact artifact, CallContext context) { | 61 public Object getData(Artifact artifact, CallContext context) { |
53 log.debug("Get bedquality data: " + valueName + " - " + valueType); | 62 log.debug("Get bedquality data: " + valueName + " - " + valueType); |
54 | 63 |
55 D4EArtifact flys = (D4EArtifact) artifact; | 64 D4EArtifact flys = (D4EArtifact) artifact; |
56 | 65 |
57 CalculationResult res = (CalculationResult) flys.compute(context, hash, | 66 CalculationResult res = (CalculationResult)flys.compute( |
58 stateId, type, false); | 67 context, hash, stateId, type, false); |
59 | 68 |
60 int ndx = index >> 8; | 69 int ndx = index >> 8; |
61 BedQualityResultValue value = | 70 BedQualityResultValue value = |
62 ((BedQualityResult[]) res.getData())[ndx].getValue(valueName, valueType); | 71 ((BedQualityResult[]) res.getData())[ndx].getValue( |
72 valueName, valueType); | |
63 | 73 |
64 if (value == null) { | 74 if (value == null) { |
65 /* Other facets check this so we do too */ | 75 /* Other facets check this so we do too */ |
66 return null; | 76 return null; |
67 } | 77 } |