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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 DUIWindow window;
  21. public final int x;
  22. public final int y;
  23. public final int modifiers;
  24. public final int deltaZ;
  25. public final int clickCount;
  26. public DMouseEvent(DUIWindow window, int x, int y, int modifiers, int deltaZ, int clickCount) {
  27. this.window = window;
  28. this.x = x;
  29. this.y = y;
  30. this.modifiers = modifiers;
  31. this.deltaZ = deltaZ;
  32. this.clickCount = clickCount;
  33. }
  34. public boolean isSingleClick() {
  35. return clickCount == 1;
  36. }
  37. public boolean isDoubleClick() {
  38. return clickCount == 2;
  39. }
  40. public boolean isTripleClick() {
  41. return clickCount == 3;
  42. }
  43. public boolean has(int modifiers) {
  44. return (this.modifiers & modifiers) == modifiers;
  45. }
  46. }