package de.ugoe.cs.quest.eventcore.gui;

/**
 * TODO comment
 * 
 * @version $Revision: $ $Date: $
 * @author 2011, last modified by $Author: $
 */
public abstract class MouseButtonInteraction extends MouseInteraction {

    /**  */
    private static final long serialVersionUID = 1L;

    /** */
    public static enum Button {
        LEFT, MIDDLE, RIGHT, X;
    }

    /** the button used for mouse interaction */
    private Button button;

    /**
     * 
     */
    public MouseButtonInteraction(Button button) {
        this.button = button;
    }

    /**
     * @return Returns the button.
     */
    public Button getButton() {
        return button;
    }
    
    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof MouseButtonInteraction) {
            return getButton().equals(((MouseButtonInteraction) obj).getButton());
        }
        return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        return getButton().hashCode();
    }
}
