Changeset 19949 in osm
- Timestamp:
- 2010-02-09T19:42:26+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
r19894 r19949 35 35 36 36 private JCheckBox drawBoundaries = new JCheckBox(tr("Draw boundaries of downloaded data.")); 37 38 private JComboBox imageInterpolationMethod = new JComboBox(); 37 39 38 40 private JCheckBox disableImageCropping = new JCheckBox(tr("Disable image cropping during georeferencing.")); … … 121 123 drawBoundaries.setToolTipText(tr("Draw a rectangle around downloaded data from WMS server.")); 122 124 cadastrewms.add(drawBoundaries, GBC.eop().insets(0, 0, 0, 5)); 125 126 // option to select image zooming interpolation method 127 JLabel jLabelImageZoomInterpolation = new JLabel(tr("Image zoom interpolation:")); 128 cadastrewms.add(jLabelImageZoomInterpolation, GBC.std().insets(0, 0, 10, 0)); 129 imageInterpolationMethod.addItem(tr("Nearest-Neighbor (fastest) [ Default ]")); 130 imageInterpolationMethod.addItem(tr("Bilinear (fast)")); 131 imageInterpolationMethod.addItem(tr("Bicubic (slow)")); 132 String savedImageInterpolationMethod = Main.pref.get("cadastrewms.imageInterpolation", "standard"); 133 if (savedImageInterpolationMethod.equals("bilinear")) 134 imageInterpolationMethod.setSelectedIndex(1); 135 else if (savedImageInterpolationMethod.equals("bicubic")) 136 imageInterpolationMethod.setSelectedIndex(2); 137 else 138 imageInterpolationMethod.setSelectedIndex(0); 139 cadastrewms.add(imageInterpolationMethod, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 200, 5)); 123 140 124 141 // separator … … 242 259 Main.pref.put("cadastrewms.brightness", Float.toString((float)sliderTrans.getValue()/10)); 243 260 Main.pref.put("cadastrewms.drawBoundaries", drawBoundaries.isSelected()); 261 if (imageInterpolationMethod.getSelectedIndex() == 2) 262 Main.pref.put("cadastrewms.imageInterpolation", "bicubic"); 263 else if (imageInterpolationMethod.getSelectedIndex() == 1) 264 Main.pref.put("cadastrewms.imageInterpolation", "bilinear"); 265 else 266 Main.pref.put("cadastrewms.imageInterpolation", "standard"); 244 267 if (grabMultiplier1.isSelected()) 245 268 Main.pref.put("cadastrewms.scale", Scale.X1.toString()); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java
r19702 r19949 10 10 import java.awt.Image; 11 11 import java.awt.Point; 12 import java.awt.RenderingHints; 12 13 import java.awt.Toolkit; 13 14 import java.awt.image.BufferedImage; … … 234 235 public void paint(Graphics2D g, final MapView mv, Bounds bounds) { 235 236 synchronized(this){ 237 Object savedInterpolation = g.getRenderingHint(RenderingHints.KEY_INTERPOLATION); 238 if (savedInterpolation == null) savedInterpolation = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR; 239 String interpolation = Main.pref.get("cadastrewms.imageInterpolation", "Standard"); 240 if (interpolation.equals("bilinear")) 241 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); 242 else if (interpolation.equals("bicubic")) 243 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); 244 else 245 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); 236 246 for (GeorefImage img : images) 237 247 img.paint(g, mv, CadastrePlugin.backgroundTransparent, 238 248 CadastrePlugin.transparency, CadastrePlugin.drawBoundaries); 249 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, savedInterpolation); 239 250 } 240 251 if (this.isRaster) {
Note:
See TracChangeset
for help on using the changeset viewer.