comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.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 519023ce3500
children 280c5b44f219
comparison
equal deleted inserted replaced
8855:d7c005e12af0 8856:5e38e2924c07
71 ListGridField nfield = new ListGridField("name", "Pegel"); 71 ListGridField nfield = new ListGridField("name", "Pegel");
72 ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60); 72 ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60);
73 ListGridField efield = new ListGridField("kmend", "Ende [km]", 60); 73 ListGridField efield = new ListGridField("kmend", "Ende [km]", 60);
74 ListGridField stfield = new ListGridField("station", "Station [km]"); 74 ListGridField stfield = new ListGridField("station", "Station [km]");
75 ListGridField lfield = new ListGridField("infolink", "Info"); 75 ListGridField lfield = new ListGridField("infolink", "Info");
76 ListGridField cfield = new ListGridField("curvelink", MSG.gauge_curve_link()); 76 ListGridField cfield = new ListGridField(
77 "curvelink", MSG.gauge_curve_link());
77 cfield.addRecordClickHandler(this); 78 cfield.addRecordClickHandler(this);
78 79
79 this.setShowRecordComponents(true); 80 this.setShowRecordComponents(true);
80 this.setShowRecordComponentsByCell(true); 81 this.setShowRecordComponentsByCell(true);
81 this.setFields(nfield, sfield, efield, stfield, lfield, cfield); 82 this.setFields(nfield, sfield, efield, stfield, lfield, cfield);
133 Double ldto = null; 134 Double ldto = null;
134 135
135 for (int j = dl.size()-1; j >= 0; --j) { 136 for (int j = dl.size()-1; j >= 0; --j) {
136 Data d = dl.get(j); 137 Data d = dl.get(j);
137 String label = d.getLabel(); 138 String label = d.getLabel();
138 GWT.log("GaugeListGrid - setData - label " + label + " " + d.getStringValue()); 139 GWT.log("GaugeListGrid - setData - label "
140 + label + " " + d.getStringValue());
139 if (label.equals("ld_from")) { 141 if (label.equals("ld_from")) {
140 ldfrom = getDoubleValue(d); 142 ldfrom = getDoubleValue(d);
141 } 143 }
142 else if (label.equals("ld_to")) { 144 else if (label.equals("ld_to")) {
143 ldto = getDoubleValue(d); 145 ldto = getDoubleValue(d);
159 Double ldto = null; 161 Double ldto = null;
160 162
161 for (int j = dl.size()-1; j >= 0; --j) { 163 for (int j = dl.size()-1; j >= 0; --j) {
162 Data d = dl.get(j); 164 Data d = dl.get(j);
163 String label = d.getLabel(); 165 String label = d.getLabel();
164 GWT.log("GaugeListGrid - setData - label " + label + " " + d.getStringValue()); 166 GWT.log("GaugeListGrid - setData - label "
167 + label + " " + d.getStringValue());
165 if (label.equals("ld_from")) { 168 if (label.equals("ld_from")) {
166 ldfrom = getDoubleValue(d); 169 ldfrom = getDoubleValue(d);
167 } 170 }
168 else if (label.equals("ld_to")) { 171 else if (label.equals("ld_to")) {
169 ldto = getDoubleValue(d); 172 ldto = getDoubleValue(d);
178 else if (state.equals("state.winfo.location")) { 181 else if (state.equals("state.winfo.location")) {
179 getLocations("ld_locations", locations, dl); 182 getLocations("ld_locations", locations, dl);
180 openOnLocations(locations); 183 openOnLocations(locations);
181 return; 184 return;
182 } 185 }
183 else if (state.equals("state.winfo.reference.curve.input.start")) { 186 else if (state
187 .equals("state.winfo.reference.curve.input.start")
188 ) {
184 getLocations("reference_startpoint", locations, dl); 189 getLocations("reference_startpoint", locations, dl);
185 } 190 }
186 else if (state.equals("state.winfo.reference.curve.input.end")) { 191 else if (state
192 .equals("state.winfo.reference.curve.input.end")
193 ) {
187 getLocations("reference_endpoint", locations, dl); 194 getLocations("reference_endpoint", locations, dl);
188 } 195 }
189 else if (state.equals("state.winfo.historicalq.reference_gauge")) { 196 else if (state
197 .equals("state.winfo.historicalq.reference_gauge")
198 ) {
190 for (int j = dl.size()-1; j >= 0; --j) { 199 for (int j = dl.size()-1; j >= 0; --j) {
191 Data d = dl.get(j); 200 Data d = dl.get(j);
192 String label = d.getLabel(); 201 String label = d.getLabel();
193 if (label.equals("reference_gauge")) { 202 if (label.equals("reference_gauge")) {
194 String tmp = d.getStringValue(); 203 String tmp = d.getStringValue();
273 else { 282 else {
274 collapseRecord(item); 283 collapseRecord(item);
275 } 284 }
276 } 285 }
277 else if (item.getKmStart() != null && item.getKmEnd() != null) { 286 else if (item.getKmStart() != null && item.getKmEnd() != null) {
278 // as getStart()/getEnd() return Double objects, they can be null and 287 // as getStart()/getEnd() return Double objects,
288 // they can be null and
279 // can cause NPEs when comparing with double... strange... 289 // can cause NPEs when comparing with double... strange...
280 GWT.log("GaugeListGrid - openOnDistance item " + item.getKmStart() + " " + item.getKmEnd()); 290 GWT.log("GaugeListGrid - openOnDistance item "
291 + item.getKmStart() + " " + item.getKmEnd());
281 if ((start >= item.getKmStart() && start <= item.getKmEnd()) || 292 if ((start >= item.getKmStart() && start <= item.getKmEnd()) ||
282 (end >= item.getKmStart() && end <= item.getKmEnd()) || 293 (end >= item.getKmStart() && end <= item.getKmEnd()) ||
283 (start <= item.getKmStart() && end >= item.getKmEnd())) { 294 (start <= item.getKmStart() && end >= item.getKmEnd())) {
284 expandRecord(item); 295 expandRecord(item);
285 } 296 }
453 @Override 464 @Override
454 public String getCellCSSText(ListGridRecord record, int rowNum, 465 public String getCellCSSText(ListGridRecord record, int rowNum,
455 int colNum) { 466 int colNum) {
456 if (colNum == ABFLUSSTAFEL_COLUMN) { 467 if (colNum == ABFLUSSTAFEL_COLUMN) {
457 // display the ablfusstafel cell like a link 468 // display the ablfusstafel cell like a link
458 return "text-decoration: underline; color: #0000EE; cursor: pointer;"; 469 return "text-decoration: underline; color: #0000EE; "
470 + "cursor: pointer;";
459 } 471 }
460 else { 472 else {
461 return super.getCellCSSText(record, rowNum, colNum); 473 return super.getCellCSSText(record, rowNum, colNum);
462 } 474 }
463 } 475 }

http://dive4elements.wald.intevation.org