Changeset 10577 in josm
- Timestamp:
- 2016-07-20T22:41:37+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r10462 r10577 168 168 private ImageryBounds bounds; 169 169 /** projections supported by WMS servers */ 170 private List<String> serverProjections ;170 private List<String> serverProjections = Collections.emptyList(); 171 171 /** description of the imagery entry, should contain notes what type of data it is */ 172 172 private String description; … … 271 271 } 272 272 } 273 if ( i.serverProjections != null &&!i.serverProjections.isEmpty()) {273 if (!i.serverProjections.isEmpty()) { 274 274 StringBuilder val = new StringBuilder(); 275 275 for (String p : i.serverProjections) { … … 537 537 } 538 538 539 /** 540 * Sets the pixel per degree value. 541 * @param ppd The ppd value 542 * @see #getPixelPerDegree() 543 */ 539 544 public void setPixelPerDegree(double ppd) { 540 545 this.pixelPerDegree = ppd; … … 612 617 } 613 618 619 /** 620 * Set the attribution text 621 * @param text The text 622 * @see #getAttributionText(int, ICoordinate, ICoordinate) 623 */ 614 624 public void setAttributionText(String text) { 615 625 attributionText = text; 616 626 } 617 627 618 public void setAttributionImageURL(String text) { 619 attributionImageURL = text; 620 } 621 622 public void setAttributionImage(String text) { 623 attributionImage = text; 624 } 625 626 public void setAttributionLinkURL(String text) { 627 attributionLinkURL = text; 628 } 629 628 /** 629 * Set the attribution image 630 * @param url The url of the image. 631 * @see #getAttributionImageURL() 632 */ 633 public void setAttributionImageURL(String url) { 634 attributionImageURL = url; 635 } 636 637 /** 638 * Set the image for the attribution 639 * @param res The image resource 640 * @see #getAttributionImage() 641 */ 642 public void setAttributionImage(String res) { 643 attributionImage = res; 644 } 645 646 /** 647 * Sets the URL the attribution should link to. 648 * @param url The url. 649 * @see #getAttributionLinkURL() 650 */ 651 public void setAttributionLinkURL(String url) { 652 attributionLinkURL = url; 653 } 654 655 /** 656 * Sets the text to display to the user as terms of use. 657 * @param text The text 658 * @see #getTermsOfUseText() 659 */ 630 660 public void setTermsOfUseText(String text) { 631 661 termsOfUseText = text; 632 662 } 633 663 664 /** 665 * Sets a url that links to the terms of use text. 666 * @param text The url. 667 * @see #getTermsOfUseURL() 668 */ 634 669 public void setTermsOfUseURL(String text) { 635 670 termsOfUseURL = text; … … 664 699 } 665 700 666 if (serverProjections == null || serverProjections.isEmpty()) {701 if (serverProjections.isEmpty()) { 667 702 serverProjections = new ArrayList<>(); 668 703 Matcher m = Pattern.compile(".*\\{PROJ\\(([^)}]+)\\)\\}.*").matcher(url.toUpperCase(Locale.ENGLISH)); … … 701 736 } 702 737 738 /** 739 * Store the id of this info to the preferences and clear it afterwards. 740 */ 703 741 public void clearId() { 704 742 if (this.id != null) { … … 735 773 } 736 774 775 /** 776 * Gets the pixel per degree value 777 * @return The ppd value. 778 */ 737 779 public double getPixelPerDegree() { 738 780 return this.pixelPerDegree; … … 848 890 */ 849 891 public List<String> getServerProjections() { 850 if (serverProjections == null)851 return Collections.emptyList();852 892 return Collections.unmodifiableList(serverProjections); 853 893 } 854 894 895 /** 896 * Sets the list of collections the server supports 897 * @param serverProjections The list of supported projections 898 */ 855 899 public void setServerProjections(Collection<String> serverProjections) { 900 CheckParameterUtil.ensureParameterNotNull(serverProjections, "serverProjections"); 856 901 this.serverProjections = new ArrayList<>(serverProjections); 857 902 } … … 866 911 } 867 912 913 /** 914 * Gets a unique toolbar key to store this layer as toolbar item 915 * @return The kay. 916 */ 868 917 public String getToolbarName() { 869 918 String res = name; … … 874 923 } 875 924 925 /** 926 * Gets the name that should be displayed in the menu to add this imagery layer. 927 * @return The text. 928 */ 876 929 public String getMenuName() { 877 930 String res = name; … … 1020 1073 } 1021 1074 1075 /** 1076 * Gets the flag if epsg 4326 to 3857 is supported 1077 * @return The flag. 1078 */ 1022 1079 public boolean isEpsg4326To3857Supported() { 1023 1080 return isEpsg4326To3857Supported; 1024 1081 } 1025 1082 1083 /** 1084 * Sets the flag that epsg 4326 to 3857 is supported 1085 * @param isEpsg4326To3857Supported The flag. 1086 */ 1026 1087 public void setEpsg4326To3857Supported(boolean isEpsg4326To3857Supported) { 1027 1088 this.isEpsg4326To3857Supported = isEpsg4326To3857Supported; 1028 1089 } 1029 1090 1091 /** 1092 * Gets the flag if the georeference is valid. 1093 * @return <code>true</code> if it is valid. 1094 */ 1030 1095 public boolean isGeoreferenceValid() { 1031 1096 return isGeoreferenceValid; 1032 1097 } 1033 1098 1099 /** 1100 * Sets an indicator that the georeference is valid 1101 * @param isGeoreferenceValid <code>true</code> if it is marked as valid. 1102 */ 1034 1103 public void setGeoreferenceValid(boolean isGeoreferenceValid) { 1035 1104 this.isGeoreferenceValid = isGeoreferenceValid; … … 1067 1136 n.defaultMinZoom = i.defaultMinZoom; 1068 1137 } 1069 if (i.serverProjections != null) { 1070 n.serverProjections = i.serverProjections; 1071 } 1138 n.setServerProjections(i.getServerProjections()); 1072 1139 n.url = i.url; 1073 1140 n.imageryType = i.imageryType;
Note:
See TracChangeset
for help on using the changeset viewer.