001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.plugins.eventbus.data;
003
004import java.util.EventObject;
005
006/**
007 * Event fired when the command queue (undo/redo) size changes.
008 */
009public class CommandQueueEvent extends EventObject {
010
011    private static final long serialVersionUID = 1L;
012
013    private final int queueSize;
014    private final int redoSize;
015
016    /**
017     * Constructs a new {@code CommandQueueEvent}.
018     * @param source object on which the Event initially occurred
019     * @param queueSize Undo stack size
020     * @param redoSize Redo stack size
021     */
022    public CommandQueueEvent(Object source, int queueSize, int redoSize) {
023        super(source);
024        this.queueSize = queueSize;
025        this.redoSize = redoSize;
026    }
027
028    /**
029     * Returns Undo stack size.
030     * @return Undo stack size
031     */
032    public final int getQueueSize() {
033        return queueSize;
034    }
035
036    /**
037     * Returns Redo stack size.
038     * @return Redo stack size
039     */
040    public final int getRedoSize() {
041        return redoSize;
042    }
043}