comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelRecommendationInfo.java @ 8875:8d1df8639563

Fixed: strange tweak in w-diferences panel always returned staticwkms factory instead of the original one. In sinfo we need the original one though.
author gernotbelger
date Thu, 08 Feb 2018 18:46:34 +0100
parents fa168fb02a65
children e3c2ae1887e8
comparison
equal deleted inserted replaced
8874:7ebe5d463740 8875:8d1df8639563
13 import org.dive4elements.river.client.shared.model.Recommendation; 13 import org.dive4elements.river.client.shared.model.Recommendation;
14 14
15 import com.google.gwt.core.client.GWT; 15 import com.google.gwt.core.client.GWT;
16 16
17 /** 17 /**
18 * Factored out code from the old WaterlevelTwinPanel; contains some evil hacks about the involved artifact factories. See original comments below...
19 *
18 * @author Gernot Belger 20 * @author Gernot Belger
19 */ 21 */
20 public final class WaterlevelRecommendationInfo implements IDatacageTwinPanelInfo { 22 public final class WaterlevelRecommendationInfo implements IDatacageTwinPanelInfo {
21 23
22 private String outs; 24 private final String outs;
23 25
24 public WaterlevelRecommendationInfo(String outs ) { 26 /**
27 * @param tweakFactory See evil hack below
28 */
29 public WaterlevelRecommendationInfo(final String outs) {
25 this.outs = outs; 30 this.outs = outs;
26 } 31 }
27 32
28 @Override 33 @Override
29 public String getFactory() { 34 public String getFactory(final String originalFactory) {
30 // FIXME: why are the factory here and the one used in createDataString different? 35 // FIXME: why are the factory here and the one used in createDataString different?
31 // Probably also because of the 'throw all this code away comment' 36 // Probably also because of the 'throw all this code away comment'
32 return "waterlevel"; 37 return "waterlevel";
33 } 38 }
34 39
35 @Override 40 @Override
36 public String getDataStringFactory() { 41 public String getDataStringFactory(final Recommendation recommendation) {
37 return "staticwkms"; 42 return "staticwkms";
38 } 43 }
39 44
40 @Override 45 @Override
41 public void adjustRecommendation(Recommendation recommendation) { 46 public void adjustRecommendation(final Recommendation recommendation) {
47
42 // XXX: THIS IS AN EVIL HACK TO MAKE W-DIFFERENCES WORK AGAIN! 48 // XXX: THIS IS AN EVIL HACK TO MAKE W-DIFFERENCES WORK AGAIN!
43 // TODO: Throw all this code away and do it with server side recommendations! 49 // TODO: Throw all this code away and do it with server side recommendations!
44 recommendation.setTargetOut("w_differences"); 50 recommendation.setTargetOut("w_differences");
45 51
46 if (recommendation.getIDs() != null) { 52 if (recommendation.getIDs() != null) {
62 } 68 }
63 } 69 }
64 70
65 @Override 71 @Override
66 public String getOuts() { 72 public String getOuts() {
67 return outs; 73 return this.outs;
68 } 74 }
69 } 75 }

http://dive4elements.wald.intevation.org