- Timestamp:
- 2015-07-27T16:45:58+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r8615 r8625 1152 1152 if (evt.getPropertyName().equals(Layer.VISIBLE_PROP)) { 1153 1153 repaint(); 1154 } else if (evt.getPropertyName().equals(Layer.OPACITY_PROP)) { 1154 } else if (evt.getPropertyName().equals(Layer.OPACITY_PROP) || 1155 evt.getPropertyName().equals(Layer.FILTER_STATE_PROP)) { 1155 1156 Layer l = (Layer) evt.getSource(); 1156 1157 if (l.isVisible()) { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r8620 r8625 17 17 import java.awt.event.MouseAdapter; 18 18 import java.awt.event.MouseEvent; 19 import java.awt.image.BufferedImage; 19 20 import java.awt.image.ImageObserver; 20 21 import java.io.File; … … 1017 1018 continue; 1018 1019 } 1020 1021 // applying all filters to this layer 1022 img = applyImageProcessors((BufferedImage) img); 1023 1019 1024 Rectangle sourceRect = tileToRect(tile); 1020 1025 if (borderRect != null && !sourceRect.intersects(borderRect)) { -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r8568 r8625 22 22 import java.text.AttributedCharacterIterator; 23 23 import java.text.AttributedString; 24 import java.util.ArrayList; 24 25 import java.util.Hashtable; 25 26 import java.util.List; … … 55 56 public static final IntegerProperty PROP_FADE_AMOUNT = new IntegerProperty("imagery.fade_amount", 0); 56 57 public static final IntegerProperty PROP_SHARPEN_LEVEL = new IntegerProperty("imagery.sharpen_level", 0); 58 59 private final List<ImageProcessor> imageProcessors = new ArrayList<>(); 57 60 58 61 public static Color getFadeColor() { … … 249 252 BufferedImageOp op = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null); 250 253 return op.filter(tmp, null); 254 } 255 256 /** 257 * This method adds the {@link ImageProcessor} to this Layer 258 * 259 * @param processor that processes the image 260 * 261 * @return true if processor was added, false otherwise 262 */ 263 public boolean addImageProcessor(ImageProcessor processor) { 264 return imageProcessors.add(processor); 265 } 266 267 /** 268 * This method removes given {@link ImageProcessor} from this layer 269 * 270 * @param processor which is needed to be removed 271 * 272 * @return true if processor was removed 273 */ 274 public boolean removeImageProcessor(ImageProcessor processor) { 275 return imageProcessors.remove(processor); 276 } 277 278 /** 279 * This method gets all {@link ImageProcessor}s of the layer 280 * 281 * @return list of image processors without removed one 282 */ 283 public List<ImageProcessor> getImageProcessors() { 284 return imageProcessors; 285 } 286 287 /** 288 * Applies all the chosen {@link ImageProcessor}s to the image 289 * 290 * @param img - image which should be changed 291 * 292 * @return the new changed image 293 */ 294 public BufferedImage applyImageProcessors(BufferedImage img) { 295 for (ImageProcessor processor : imageProcessors) { 296 img = processor.process(img); 297 } 298 return img; 251 299 } 252 300 -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r8542 r8625 86 86 public static final String OPACITY_PROP = Layer.class.getName() + ".opacity"; 87 87 public static final String NAME_PROP = Layer.class.getName() + ".name"; 88 public static final String FILTER_STATE_PROP = Layer.class.getName() + ".filterstate"; 88 89 89 90 public static final int ICON_SIZE = 16; … … 314 315 315 316 /** 317 * Sets new state to the layer after applying {@link ImageProcessor}. 318 */ 319 public void setFilterStateChanged() { 320 fireFilterStateChanged(); 321 } 322 323 /** 316 324 * Toggles the visibility state of this layer. 317 325 */ … … 356 364 protected void fireOpacityChanged(double oldValue, double newValue) { 357 365 propertyChangeSupport.firePropertyChange(OPACITY_PROP, oldValue, newValue); 366 } 367 368 /** 369 * fires a property change for the property {@link #FILTER_STATE_PROP}. 370 */ 371 protected void fireFilterStateChanged() { 372 propertyChangeSupport.firePropertyChange(FILTER_STATE_PROP, null, null); 358 373 } 359 374 -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r8620 r8625 64 64 * Register a session layer exporter. 65 65 * 66 * The exporter class must have a none-argument constructor with layerClass as formal parameter type.66 * The exporter class must have a one-argument constructor with layerClass as formal parameter type. 67 67 */ 68 68 public static void registerSessionLayerExporter(Class<? extends Layer> layerClass, Class<? extends SessionLayerExporter> exporter) { … … 93 93 * Constructs a new {@code SessionWriter}. 94 94 * @param layers The ordered list of layers to save 95 * @param active The index of active layer in {@code layers} (starts to0). Ignored if set to -195 * @param active The index of active layer in {@code layers} (starts at 0). Ignored if set to -1 96 96 * @param exporters The exporters to use to save layers 97 97 * @param zip {@code true} if a joz archive has to be created, {@code false otherwise}
Note:
See TracChangeset
for help on using the changeset viewer.