Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java @ 4474:bd78d2b0e309
Map print settings can now be configured via settings window.
Configurable for now are page layout (A0 or A4), caption text and
comment text.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sun, 11 Nov 2012 14:44:12 +0100 |
parents | 6db783627137 |
children | 6fb4e29a2a9b |
comparison
equal
deleted
inserted
replaced
4473:6db783627137 | 4474:bd78d2b0e309 |
---|---|
651 return btn; | 651 return btn; |
652 } | 652 } |
653 | 653 |
654 | 654 |
655 protected ImgButton createMapPrintSettingsControl() { | 655 protected ImgButton createMapPrintSettingsControl() { |
656 final MapToolbar mtb = this; | |
656 ImgButton btn = createButton(MSG.printMapSettings(), new ClickHandler() { | 657 ImgButton btn = createButton(MSG.printMapSettings(), new ClickHandler() { |
657 @Override | 658 @Override |
658 public void onClick(ClickEvent event) { | 659 public void onClick(ClickEvent event) { |
659 MapPrintSettingsWindow mpsw = | 660 MapPrintSettingsWindow mpsw = |
660 new MapPrintSettingsWindow(outputTab.getCollection()); | 661 new MapPrintSettingsWindow(outputTab.getCollection(), mtb); |
661 outputTab.getCollectionView().addChild(mpsw); | 662 outputTab.getCollectionView().addChild(mpsw); |
662 } | 663 } |
663 }); | 664 }); |
664 return btn; | 665 return btn; |
665 } | 666 } |
691 return epsgLabel; | 692 return epsgLabel; |
692 } | 693 } |
693 | 694 |
694 @Override | 695 @Override |
695 public void onMapZoom(MapZoomListener.MapZoomEvent e) { | 696 public void onMapZoom(MapZoomListener.MapZoomEvent e) { |
696 printMapLink.setSource(createPrintUrl()); | 697 updatePrintUrl(); |
697 } | 698 } |
698 | 699 |
699 protected void appendPrintSettingsToUrl(Collection collection, StringBuilder url) { | 700 protected void appendPrintSettingsToUrl(Collection collection, StringBuilder url) { |
700 Settings settings = collection.getSettings("print-settings"); | 701 Settings settings = collection.getSettings("print-settings"); |
701 if (settings != null) { | 702 if (settings != null) { |
702 List<Property> properties = settings.getSettings("default"); | 703 List<Property> properties = settings.getSettings("default"); |
703 for (Property prop : properties) { | 704 for (Property prop : properties) { |
704 GWT.log("prop=" + prop.getName()); | |
705 PropertySetting props = (PropertySetting)prop; | 705 PropertySetting props = (PropertySetting)prop; |
706 if (props.getName().equals("page-format")) { | 706 url.append("&"); |
707 | 707 url.append(props.getName()); |
708 } | 708 url.append("="); |
709 else if (props.getName().equals("page-title")) { | 709 url.append(props.getValue()); |
710 url.append("&page-title="); | 710 } |
711 url.append(props.getValue()); | 711 } |
712 GWT.log(props.getName() + "=" + props.getValue()); | 712 } |
713 } | 713 |
714 } | 714 public void updatePrintUrl() { |
715 } | 715 printMapLink.setSource(createPrintUrl()); |
716 } | 716 } |
717 | 717 |
718 public String createPrintUrl() { | 718 public String createPrintUrl() { |
719 MapOutputTab ot = (MapOutputTab)getOutputTab(); | 719 MapOutputTab ot = (MapOutputTab)getOutputTab(); |
720 Collection collection = ot.getCollection(); | 720 Collection collection = ot.getCollection(); |