Changeset 33392 in osm for applications/editors/josm
- Timestamp:
- 2017-06-13T22:06:05+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreGrabber.java
r32556 r33392 32 32 url = getURLVector(lambertMin, lambertMax); 33 33 BufferedImage img = grab(url); 34 if (img == null) 35 throw new OsmTransferException(url.toString()); 34 36 ImageModifier imageModified; 35 37 if (wmsLayer.isRaster()) … … 37 39 else 38 40 imageModified = new VectorImageModifier(img, false); 39 return new GeorefImage(imageModified. bufferedImage, lambertMin, lambertMax, wmsLayer);41 return new GeorefImage(imageModified.getBufferedImage(), lambertMin, lambertMax, wmsLayer); 40 42 } catch (MalformedURLException e) { 41 43 throw (IOException) new IOException(tr("CadastreGrabber: Illegal url.")).initCause(e); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
r32556 r33392 17 17 import java.io.ObjectOutputStream; 18 18 import java.io.Serializable; 19 import java.util.Objects; 19 20 20 21 import javax.imageio.ImageIO; … … 46 47 47 48 public GeorefImage(BufferedImage img, EastNorth min, EastNorth max, WMSLayer wmsLayer) { 48 image = img;49 50 this.min = min;51 this.max = max;49 image = Objects.requireNonNull(img); 50 51 this.min = Objects.requireNonNull(min); 52 this.max = Objects.requireNonNull(max); 52 53 this.orgRaster[0] = min; 53 54 this.orgRaster[1] = new EastNorth(min.east(), max.north()); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/ImageModifier.java
r32556 r33392 8 8 import java.awt.image.DataBuffer; 9 9 import java.awt.image.IndexColorModel; 10 import java.util.Objects; 10 11 11 12 public abstract class ImageModifier { … … 17 18 protected int parcelColor = Color.RED.getRGB(); 18 19 19 p ublicBufferedImage bufferedImage;20 protected BufferedImage bufferedImage; 20 21 21 22 public static int[] cRoofColors = new int[] {-197380, -592138}; … … 160 161 } 161 162 163 /** 164 * Returns the buffered image. 165 * @return the buffered image 166 */ 167 public final BufferedImage getBufferedImage() { 168 return bufferedImage; 169 } 170 171 /** 172 * Sets the buffered image. 173 * @param bufferedImage the buffered image 174 */ 175 protected final void setBufferedImage(BufferedImage bufferedImage) { 176 this.bufferedImage = Objects.requireNonNull(bufferedImage); 177 } 162 178 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/RasterImageModifier.java
r32556 r33392 18 18 19 19 public RasterImageModifier(BufferedImage bi) { 20 bufferedImage = bi;20 setBufferedImage(bi); 21 21 transparencyEnabled = Main.pref.getBoolean("cadastrewms.backgroundTransparent"); 22 22 if (transparencyEnabled) … … 84 84 } 85 85 } 86 bufferedImage = bi;86 setBufferedImage(bi); 87 87 } 88 88 return; -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/VectorImageModifier.java
r32556 r33392 24 24 25 25 public VectorImageModifier(BufferedImage bi, boolean monocolor) { 26 bufferedImage = bi;26 setBufferedImage(bi); 27 27 if (Main.pref.getBoolean("cadastrewms.backgroundTransparent")) 28 28 makeTransparent(); … … 32 32 invertGrey(); 33 33 if (monocolor) 34 bufferedImage = convert8(convert4(bufferedImage));34 setBufferedImage(convert8(convert4(bufferedImage))); 35 35 } 36 36 … … 107 107 IndexColorModel icm2 = new IndexColorModel(colorModel.getPixelSize(), size, reds, greens, blues, 108 108 backgroundPixel); 109 bufferedImage = new BufferedImage(icm2, raster, bufferedImage.isAlphaPremultiplied(), null);109 setBufferedImage(new BufferedImage(icm2, raster, bufferedImage.isAlphaPremultiplied(), null)); 110 110 } 111 111 return;
Note:
See TracChangeset
for help on using the changeset viewer.