All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.lessvoid.nifty.slick2d.input.events.AbstractMouseEventButton Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package de.lessvoid.nifty.slick2d.input.events;

/**
 * This is the basic mouse event for all mouse events that involve a mouse button. In addition to the normal abstract
 * mouse event this one is able to store the button that was used.
 *
 * @author Martin Karing <[email protected]>
 */
public abstract class AbstractMouseEventButton extends AbstractMouseEvent {
  /**
   * The ID of the button that was used.
   */
  private final int button;

  /**
   * Create the mouse event that involves a mouse button.
   *
   * @param x           the x coordinate of the event location
   * @param y           the y coordinate of the event location
   * @param mouseButton the mouse button that was used
   */
  protected AbstractMouseEventButton(final int x, final int y, final int mouseButton) {
    super(x, y);
    button = mouseButton;
  }

  /**
   * Get the ID of the button that was stored.
   *
   * @return the button ID
   */
  protected final int getButton() {
    return button;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy