/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2006-2008, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotools.gui.swing.map.map2d.stream.event;
import java.util.EventObject;
import org.geotools.gui.swing.map.map2d.stream.NavigableMap2D;
import org.geotools.gui.swing.map.map2d.stream.handler.NavigationHandler;
/**
* Selection Event generated by a SelectableMap2D
*
* @author Johann Sorel
*
* @source $URL$
*/
public class NavigationEvent extends EventObject{
private final NavigationHandler oldhandler;
private final NavigationHandler newhandler;
/**
* create a Map2DNavigationEvent
* @param map : Map2D source componant
* @param oldhandler : old NavigationHandler, can't be null
* @param newhandler : new NavigationHandler, can't be null
*/
public NavigationEvent(NavigableMap2D map, NavigationHandler oldhandler, NavigationHandler newhandler){
super(map);
this.oldhandler = oldhandler;
this.newhandler = newhandler;
}
/**
* get the new navigationHandler
* @return NavigationHandler, can't be null
*/
public NavigationHandler getHandler() {
return newhandler;
}
/**
* get the previous navigationHandler
* @return NavigationHandler, can't be null
*/
public NavigationHandler getPreviousHandler() {
return oldhandler;
}
}