001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.plugins.eventbus.data.projection; 003 004import java.util.EventObject; 005import java.util.Objects; 006 007import org.openstreetmap.josm.data.projection.Projection; 008 009/** 010 * Event fired when the map projection changes. 011 */ 012public class ProjectionChangedEvent extends EventObject { 013 014 private static final long serialVersionUID = 1L; 015 016 private final Projection oldValue; 017 private final Projection newValue; 018 019 /** 020 * Constructs a new {@code ProjectionChangedEvent}. 021 * @param source object on which the Event initially occurred 022 * @param oldValue old projection 023 * @param newValue new projection 024 */ 025 public ProjectionChangedEvent(Object source, Projection oldValue, Projection newValue) { 026 super(source); 027 this.oldValue = Objects.requireNonNull(oldValue); 028 this.newValue = Objects.requireNonNull(newValue); 029 } 030 031 /** 032 * Returns the old projection. 033 * @return the old projection 034 */ 035 public final Projection getOldValue() { 036 return oldValue; 037 } 038 039 /** 040 * Returns the new projection. 041 * @return the new projection 042 */ 043 public final Projection getNewValue() { 044 return newValue; 045 } 046}