001// License: GPL. For details, see Readme.txt file.
002package org.openstreetmap.gui.jmapviewer.events;
003
004import java.util.EventObject;
005
006/**
007 * Used for passing events between UI components and other
008 * objects that register as a JMapViewerEventListener
009 *
010 * @author Jason Huntley
011 *
012 */
013public class JMVCommandEvent extends EventObject {
014    public static enum COMMAND {
015        MOVE,
016        ZOOM
017    }
018
019    private COMMAND command;
020    /**
021     *
022     */
023    private static final long serialVersionUID = 8701544867914969620L;
024
025    public JMVCommandEvent(COMMAND cmd, Object source) {
026        super(source);
027
028        setCommand(cmd);
029    }
030
031    public JMVCommandEvent(Object source) {
032        super(source);
033    }
034
035    /**
036     * @return the command
037     */
038    public COMMAND getCommand() {
039        return command;
040    }
041
042    /**
043     * @param command the command to set
044     */
045    public void setCommand(COMMAND command) {
046        this.command = command;
047    }
048}