Changeset 15734 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-01-19T21:21:54+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r15733 r15734 655 655 final TileSourceDisplaySettings displaySettings = ((AbstractTileSourceLayer<?>) layer).getDisplaySettings(); 656 656 if (EastNorth.ZERO.equals(displaySettings.getDisplacement())) { 657 final boolean hasPreviousOffset = displaySettings.getPreviousOffsetBookmark() != null; 657 658 cb.setSelected(false); 658 cb.setEnabled(false); // TODO: allow reselecting checkbox and thereby setting the old offset again 659 cb.setToolTipText(tr("layer is without a user-defined offset")); 659 cb.setEnabled(hasPreviousOffset); 660 cb.setToolTipText(tr("layer is without a user-defined offset") + 661 (hasPreviousOffset ? " " + tr("(click to activate previous offset)") : "")); 660 662 } else { 661 663 cb.setSelected(true); … … 1126 1128 // reset layer offset 1127 1129 if (l instanceof AbstractTileSourceLayer<?>) { 1128 AbstractTileSourceLayer<?> abstractTileSourceLayer = (AbstractTileSourceLayer<?>) l;1129 OffsetBookmark offsetBookmark = abstractTileSourceLayer.getDisplaySettings().getOffsetBookmark();1130 final TileSourceDisplaySettings displaySettings = ((AbstractTileSourceLayer<?>) l).getDisplaySettings(); 1131 final OffsetBookmark offsetBookmark = displaySettings.getOffsetBookmark(); 1130 1132 if (offsetBookmark != null) { 1131 abstractTileSourceLayer.getDisplaySettings().setOffsetBookmark(null);1133 displaySettings.setOffsetBookmark(null); 1132 1134 MainApplication.getMenu().imageryMenu.refreshOffsetMenu(); 1135 } else { 1136 displaySettings.setOffsetBookmark(displaySettings.getPreviousOffsetBookmark()); 1133 1137 } 1134 1138 } -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java
r15733 r15734 67 67 private boolean showErrors; 68 68 69 private OffsetBookmark previousOffsetBookmark; 69 70 private OffsetBookmark offsetBookmark; 70 71 /** … … 216 217 */ 217 218 public void setOffsetBookmark(OffsetBookmark offsetBookmark) { 219 if (this.offsetBookmark != null) { 220 this.previousOffsetBookmark = this.offsetBookmark; 221 } 218 222 this.offsetBookmark = offsetBookmark; 219 223 if (offsetBookmark == null) { … … 230 234 public OffsetBookmark getOffsetBookmark() { 231 235 return this.offsetBookmark; 236 } 237 238 /** 239 * Gets the offset bookmark previously in use. 240 * @return the previously used offset bookmark, may be null 241 */ 242 public OffsetBookmark getPreviousOffsetBookmark() { 243 return previousOffsetBookmark; 232 244 } 233 245
Note:
See TracChangeset
for help on using the changeset viewer.