ZenScript main repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DMouseEvent.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package org.openzen.drawablegui;
  7. /**
  8. *
  9. * @author Hoofdgebruiker
  10. */
  11. public class DMouseEvent {
  12. public static final int BUTTON1 = 1;
  13. public static final int BUTTON2 = 2;
  14. public static final int BUTTON3 = 4;
  15. public static final int ALT = 256;
  16. public static final int CTRL = 512;
  17. public static final int SHIFT = 1024;
  18. public static final int META = 2048;
  19. public static final int ALT_GRAPH = 4096;
  20. public final int x;
  21. public final int y;
  22. public final int modifiers;
  23. public final int deltaZ;
  24. public final int clickCount;
  25. public DMouseEvent(int x, int y, int modifiers, int deltaZ, int clickCount) {
  26. this.x = x;
  27. this.y = y;
  28. this.modifiers = modifiers;
  29. this.deltaZ = deltaZ;
  30. this.clickCount = clickCount;
  31. }
  32. public boolean isSingleClick() {
  33. return clickCount == 1;
  34. }
  35. public boolean isDoubleClick() {
  36. return clickCount == 2;
  37. }
  38. public boolean isTripleClick() {
  39. return clickCount == 3;
  40. }
  41. public boolean has(int modifiers) {
  42. return (this.modifiers & modifiers) == modifiers;
  43. }
  44. }