Changeset 13453 in josm for trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
- Timestamp:
- 2018-02-24T18:58:28+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r13435 r13453 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.DataSet.DownloadPolicy; 66 67 import org.openstreetmap.josm.data.osm.DataSet.UploadPolicy; 67 68 import org.openstreetmap.josm.data.osm.DataSetMerger; … … 421 422 public Icon getIcon() { 422 423 ImageProvider base = getBaseIconProvider().setMaxSize(ImageSizes.LAYER); 423 if (isUploadDiscouraged() || data.getUploadPolicy() == UploadPolicy.BLOCKED) { 424 if (data.getDownloadPolicy() != null && data.getDownloadPolicy() != DownloadPolicy.NORMAL) { 425 base.addOverlay(new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.0, 1.0, 0.5)); 426 } 427 if (data.getUploadPolicy() != null && data.getUploadPolicy() != UploadPolicy.NORMAL) { 424 428 base.addOverlay(new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)); 425 429 } … … 428 432 // If the layer is being uploaded then change the default icon to a clock 429 433 base = new ImageProvider("clock").setMaxSize(ImageSizes.LAYER); 430 } else if (is ReadOnly()) {434 } else if (isLocked()) { 431 435 // If the layer is read only then change the default icon to a lock 432 436 base = new ImageProvider("lock").setMaxSize(ImageSizes.LAYER); … … 940 944 941 945 @Override 946 public boolean isDownloadable() { 947 return data.getDownloadPolicy() != DownloadPolicy.BLOCKED && !isLocked(); 948 } 949 950 @Override 942 951 public boolean isUploadable() { 943 return data.getUploadPolicy() != UploadPolicy.BLOCKED ;952 return data.getUploadPolicy() != UploadPolicy.BLOCKED && !isLocked(); 944 953 } 945 954 … … 1031 1040 } 1032 1041 1033 /**1034 * Determines if upload is being discouraged.1035 * (i.e. this dataset contains private data which should not be uploaded)1036 * @return {@code true} if upload is being discouraged, {@code false} otherwise1037 */1038 1042 @Override 1039 1043 public final boolean isUploadDiscouraged() { … … 1174 1178 1175 1179 @Override 1176 public void setReadOnly() {1177 data. setReadOnly();1178 } 1179 1180 @Override 1181 public void un setReadOnly() {1182 data.un setReadOnly();1183 } 1184 1185 @Override 1186 public boolean is ReadOnly() {1187 return data.is ReadOnly();1180 public void lock() { 1181 data.lock(); 1182 } 1183 1184 @Override 1185 public void unlock() { 1186 data.unlock(); 1187 } 1188 1189 @Override 1190 public boolean isLocked() { 1191 return data.isLocked(); 1188 1192 } 1189 1193
Note:
See TracChangeset
for help on using the changeset viewer.