comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java @ 8910:d9c89651bd67

Area chart layers may now have an 'arebgpattern'. Real pattern yet to be defined.
author gernotbelger
date Thu, 22 Feb 2018 18:46:37 +0100
parents 5e38e2924c07
children 924cd9943337
comparison
equal deleted inserted replaced
8909:31dff17c6828 8910:d9c89651bd67
292 return vl; 292 return vl;
293 } 293 }
294 294
295 // Done via array to keep the order. 295 // Done via array to keep the order.
296 String[] sets = {"showlines", 296 String[] sets = {"showlines",
297 "showborder",
297 "showpoints", 298 "showpoints",
298 "linetype", 299 "linetype",
299 "linesize", 300 "linesize",
300 "linecolor", 301 "linecolor",
301 "font", 302 "font",
370 * @param value The current value. 371 * @param value The current value.
371 * 372 *
372 * @return The dynamic form for the attribute property. 373 * @return The dynamic form for the attribute property.
373 */ 374 */
374 protected DynamicForm createPropertyUI( 375 protected DynamicForm createPropertyUI(
376 // FIXME: display name (which comes from the server side) is not used but i10n happens on client side,,
375 String dname, 377 String dname,
376 String name, 378 String name,
377 String type, 379 String type,
378 String value) 380 String value)
379 { 381 {
533 valueIcons.put("20,5,15,5", "20-5-15-5"); 535 valueIcons.put("20,5,15,5", "20-5-15-5");
534 f.setValueIcons(valueIcons); 536 f.setValueIcons(valueIcons);
535 f.setValueMap(valueMap); 537 f.setValueMap(valueMap);
536 f.setValue(value); 538 f.setValue(value);
537 } 539 }
540 else if (type.equals("areapattern")) {
541 f = createAreaPetternUi(name, value);
542 }
538 else if (type.equals("font")) { 543 else if (type.equals("font")) {
539 f = new SelectItem(name, MSG.getString(name)); 544 f = new SelectItem(name, MSG.getString(name));
540 LinkedHashMap<String, String> valueMap = 545 LinkedHashMap<String, String> valueMap =
541 new LinkedHashMap<String, String>(); 546 new LinkedHashMap<String, String>();
542 valueMap.put( 547 valueMap.put(
584 }); 589 });
585 590
586 return df; 591 return df;
587 } 592 }
588 593
594
595 private FormItem createAreaPetternUi(String name, String value) {
596 final FormItem f = new SelectItem(name, MSG.getString(name));
597
598 f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/areapattern-");
599 f.setImageURLSuffix(".png");
600 f.setValueIconHeight(20);
601 f.setValueIconWidth(80);
602
603 final LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
604 final Map<String, String> valueIcons = new LinkedHashMap<String, String>();
605
606 // FIXME: ugly, using knowledge of available patterns at this point, creating redundancy with AreaFillPattern enum.
607 // But the whole code does it like that, so this is 'flys style'
608 final String[] patterns = new String[] {"pattern1", "x"};
609 for (int i = 0; i < patterns.length; i++) {
610 final String pattern = patterns[i];
611
612 valueMap.put(pattern, "");
613 valueIcons.put(pattern, pattern);
614 }
615
616 f.setValueIcons(valueIcons);
617 f.setValueMap(valueMap);
618 f.setValue(value);
619 return f;
620 }
589 621
590 protected FormItem createLineSizeUI(FormItem f) { 622 protected FormItem createLineSizeUI(FormItem f) {
591 LinkedHashMap<String, String> valueIcons = 623 LinkedHashMap<String, String> valueIcons =
592 new LinkedHashMap<String, String>(); 624 new LinkedHashMap<String, String>();
593 f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-"); 625 f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-");

http://dive4elements.wald.intevation.org