Changeset 13559 in josm for trunk/src/org
- Timestamp:
- 2018-03-25T03:25:55+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
r13486 r13559 10 10 11 11 import org.openstreetmap.josm.actions.downloadtasks.DownloadReferrersTask; 12 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;12 import org.openstreetmap.josm.data.osm.DownloadPolicy; 13 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 14 import org.openstreetmap.josm.gui.MainApplication; -
trunk/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java
r13497 r13559 11 11 import org.openstreetmap.josm.Main; 12 12 import org.openstreetmap.josm.data.osm.DataSet; 13 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;13 import org.openstreetmap.josm.data.osm.DownloadPolicy; 14 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 15 import org.openstreetmap.josm.io.OnlineResource; -
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r13486 r13559 16 16 import org.openstreetmap.josm.Main; 17 17 import org.openstreetmap.josm.data.osm.DataSet; 18 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;18 import org.openstreetmap.josm.data.osm.DownloadPolicy; 19 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 20 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; -
trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java
r13486 r13559 10 10 import org.openstreetmap.josm.actions.OsmPrimitiveAction; 11 11 import org.openstreetmap.josm.data.osm.DataSet; 12 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;12 import org.openstreetmap.josm.data.osm.DownloadPolicy; 13 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 14 import org.openstreetmap.josm.data.osm.Relation; -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r13497 r13559 107 107 108 108 /** 109 * Download policy.110 *111 * Determines if download from the OSM server is intended, discouraged, or disabled / blocked.112 * @see UploadPolicy113 * @since 13453114 */115 public enum DownloadPolicy {116 /**117 * Normal dataset, download intended.118 */119 NORMAL("true"),120 /**121 * Download blocked.122 * Download options completely disabled. Intended for private layers, see #8039.123 */124 BLOCKED("never");125 126 final String xmlFlag;127 128 DownloadPolicy(String xmlFlag) {129 this.xmlFlag = xmlFlag;130 }131 132 /**133 * Get the corresponding value of the <code>upload='...'</code> XML-attribute134 * in the .osm file.135 * @return value of the <code>download</code> attribute136 */137 public String getXmlFlag() {138 return xmlFlag;139 }140 141 /**142 * Returns the {@code DownloadPolicy} for the given <code>upload='...'</code> XML-attribute143 * @param xmlFlag <code>download='...'</code> XML-attribute to convert144 * @return {@code DownloadPolicy} value145 * @throws IllegalArgumentException for invalid values146 */147 public static DownloadPolicy of(String xmlFlag) {148 for (DownloadPolicy policy : values()) {149 if (policy.getXmlFlag().equalsIgnoreCase(xmlFlag)) {150 return policy;151 }152 }153 throw new IllegalArgumentException(xmlFlag);154 }155 }156 157 /**158 * Upload policy.159 *160 * Determines if upload to the OSM server is intended, discouraged, or disabled / blocked.161 * @see DownloadPolicy162 */163 public enum UploadPolicy {164 /**165 * Normal dataset, upload intended.166 */167 NORMAL("true"),168 /**169 * Upload discouraged, for example when using or distributing a private dataset.170 */171 DISCOURAGED("false"),172 /**173 * Upload blocked.174 * Upload options completely disabled. Intended for special cases175 * where a warning dialog is not enough, see #12731.176 *177 * For the user, it shouldn't be too easy to disable this flag.178 */179 BLOCKED("never");180 181 final String xmlFlag;182 183 UploadPolicy(String xmlFlag) {184 this.xmlFlag = xmlFlag;185 }186 187 /**188 * Get the corresponding value of the <code>upload='...'</code> XML-attribute189 * in the .osm file.190 * @return value of the <code>upload</code> attribute191 */192 public String getXmlFlag() {193 return xmlFlag;194 }195 196 /**197 * Returns the {@code UploadPolicy} for the given <code>upload='...'</code> XML-attribute198 * @param xmlFlag <code>upload='...'</code> XML-attribute to convert199 * @return {@code UploadPolicy} value200 * @throws IllegalArgumentException for invalid values201 * @since 13434202 */203 public static UploadPolicy of(String xmlFlag) {204 for (UploadPolicy policy : values()) {205 if (policy.getXmlFlag().equalsIgnoreCase(xmlFlag)) {206 return policy;207 }208 }209 throw new IllegalArgumentException(xmlFlag);210 }211 }212 213 /**214 109 * Maximum number of events that can be fired between beginUpdate/endUpdate to be send as single events (ie without DatasetChangedEvent) 215 110 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserModel.java
r13486 r13559 8 8 9 9 import org.openstreetmap.josm.data.osm.DataSet; 10 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;10 import org.openstreetmap.josm.data.osm.DownloadPolicy; 11 11 import org.openstreetmap.josm.data.osm.Relation; 12 12 import org.openstreetmap.josm.data.osm.RelationMember; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorAction.java
r13509 r13559 10 10 import org.openstreetmap.josm.Main; 11 11 import org.openstreetmap.josm.data.osm.DataSet; 12 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;12 import org.openstreetmap.josm.data.osm.DownloadPolicy; 13 13 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 14 14 import org.openstreetmap.josm.gui.dialogs.relation.MemberTable; -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r13558 r13559 64 64 import org.openstreetmap.josm.data.osm.DataSelectionListener; 65 65 import org.openstreetmap.josm.data.osm.DataSet; 66 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;67 import org.openstreetmap.josm.data.osm. DataSet.UploadPolicy;66 import org.openstreetmap.josm.data.osm.DownloadPolicy; 67 import org.openstreetmap.josm.data.osm.UploadPolicy; 68 68 import org.openstreetmap.josm.data.osm.DataSetMerger; 69 69 import org.openstreetmap.josm.data.osm.DatasetConsistencyTest; -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r13453 r13559 28 28 import org.openstreetmap.josm.data.osm.Changeset; 29 29 import org.openstreetmap.josm.data.osm.DataSet; 30 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;31 import org.openstreetmap.josm.data.osm. DataSet.UploadPolicy;30 import org.openstreetmap.josm.data.osm.DownloadPolicy; 31 import org.openstreetmap.josm.data.osm.UploadPolicy; 32 32 import org.openstreetmap.josm.data.osm.Node; 33 33 import org.openstreetmap.josm.data.osm.NodeData; -
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r13485 r13559 18 18 import org.openstreetmap.josm.data.osm.Changeset; 19 19 import org.openstreetmap.josm.data.osm.DataSet; 20 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;21 import org.openstreetmap.josm.data.osm. DataSet.UploadPolicy;20 import org.openstreetmap.josm.data.osm.DownloadPolicy; 21 import org.openstreetmap.josm.data.osm.UploadPolicy; 22 22 import org.openstreetmap.josm.data.osm.INode; 23 23 import org.openstreetmap.josm.data.osm.IPrimitive; -
trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
r13485 r13559 24 24 import org.openstreetmap.josm.data.coor.LatLon; 25 25 import org.openstreetmap.josm.data.osm.DataSet; 26 import org.openstreetmap.josm.data.osm.D ataSet.DownloadPolicy;27 import org.openstreetmap.josm.data.osm. DataSet.UploadPolicy;26 import org.openstreetmap.josm.data.osm.DownloadPolicy; 27 import org.openstreetmap.josm.data.osm.UploadPolicy; 28 28 import org.openstreetmap.josm.data.osm.OsmPrimitive; 29 29 import org.openstreetmap.josm.data.osm.Relation;
Note:
See TracChangeset
for help on using the changeset viewer.