Changeset 22794 in osm for applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
- Timestamp:
- 2010-08-26T19:47:34+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r22779 r22794 53 53 */ 54 54 public class WMSLayer extends Layer implements PreferenceChangedListener { 55 55 56 protected static final Icon icon = 56 57 new ImageIcon(Toolkit.getDefaultToolkit().createImage(WMSPlugin.class.getResource("/images/wms_small.png"))); … … 67 68 protected int minZoom = 3; 68 69 69 protected boolean deltaChanged;70 70 protected double dx = 0.0; 71 71 protected double dy = 0.0; … … 77 77 protected final int serializeFormatVersion = 5; 78 78 protected boolean autoDownloadEnabled = true; 79 protected boolean settingsChanged; 79 80 80 81 // Image index boundary for current view … … 86 87 private volatile int bottomEdge; 87 88 88 89 // Request queue 89 90 private final List<WMSRequest> requestQueue = new ArrayList<WMSRequest>(); 90 91 private final List<WMSRequest> finishedRequests = new ArrayList<WMSRequest>(); … … 202 203 203 204 @Override public void paint(Graphics2D g, final MapView mv, Bounds b) { 204 deltaChanged = false;205 205 if(baseURL == null) return; 206 206 if (usesInvalidUrl && !isInvalidUrlConfirmed) return; 207 208 settingsChanged = false; 207 209 208 210 ProjectionBounds bounds = mv.getProjectionBounds(); … … 261 263 262 264 public void displace(double dx, double dy) { 263 deltaChanged = true;265 settingsChanged = true; 264 266 this.dx += dx; 265 267 this.dy += dy; … … 280 282 public int getImageY(int imageIndex) { 281 283 return (int)(imageIndex * imageSize * (getPPD() / pixelPerDegree) + dy * getPPD()); 284 } 285 286 public int getImageWidth(int xIndex) { 287 int overlap = (int)(WMSPlugin.PROP_OVERLAP.get()?WMSPlugin.PROP_OVERLAP_EAST.get() * imageSize * getPPD() / pixelPerDegree / 100:0); 288 return getImageX(xIndex + 1) - getImageX(xIndex) + overlap; 289 } 290 291 public int getImageHeight(int yIndex) { 292 int overlap = (int)(WMSPlugin.PROP_OVERLAP.get()?WMSPlugin.PROP_OVERLAP_NORTH.get() * imageSize * getPPD() / pixelPerDegree / 100:0); 293 return getImageY(yIndex + 1) - getImageY(yIndex) + overlap; 282 294 } 283 295 … … 514 526 resolution = mv.getDist100PixelText(); 515 527 pixelPerDegree = getPPD(); 528 settingsChanged = true; 516 529 mv.repaint(); 517 530 } … … 627 640 ois.close(); 628 641 fis.close(); 642 settingsChanged = true; 629 643 mv.repaint(); 630 644 } … … 743 757 requestQueueLock.lock(); 744 758 try { 745 return !finishedRequests.isEmpty() || deltaChanged;759 return !finishedRequests.isEmpty() || settingsChanged; 746 760 } finally { 747 761 requestQueueLock.unlock(); … … 753 767 cancelGrabberThreads(true); 754 768 startGrabberThreads(); 755 } 756 } 769 } else if ( 770 event.getKey().equals(WMSPlugin.PROP_OVERLAP.getKey()) 771 || event.getKey().equals(WMSPlugin.PROP_OVERLAP_EAST.getKey()) 772 || event.getKey().equals(WMSPlugin.PROP_OVERLAP_NORTH.getKey())) { 773 for (int i=0; i<images.length; i++) { 774 for (int k=0; k<images[i].length; k++) { 775 images[i][k] = new GeorefImage(this); 776 } 777 } 778 779 settingsChanged = true; 780 } 781 } 782 757 783 }
Note:
See TracChangeset
for help on using the changeset viewer.