TWindowBackend
[nikiroo-utils.git] / src / jexer / event / TMouseEvent.java
index 59e35161095095af262672674147b330673b4de4..c29ebc3520d8db88dfd5107fd46aa50b598f5dd0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2016 Kevin Lamonte
+ * Copyright (C) 2017 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -135,6 +135,15 @@ public final class TMouseEvent extends TInputEvent {
         return absoluteX;
     }
 
+    /**
+     * Set absoluteX.
+     *
+     * @param absoluteX the new value
+     */
+    public void setAbsoluteX(final int absoluteX) {
+        this.absoluteX = absoluteX;
+    }
+
     /**
      * Mouse Y - absolute screen coordinate.
      */
@@ -149,6 +158,15 @@ public final class TMouseEvent extends TInputEvent {
         return absoluteY;
     }
 
+    /**
+     * Set absoluteY.
+     *
+     * @param absoluteY the new value
+     */
+    public void setAbsoluteY(final int absoluteY) {
+        this.absoluteY = absoluteY;
+    }
+
     /**
      * Mouse button 1 (left button).
      */
@@ -250,6 +268,17 @@ public final class TMouseEvent extends TInputEvent {
         this.mouseWheelDown     = mouseWheelDown;
     }
 
+    /**
+     * Create a duplicate instance.
+     *
+     * @return duplicate intance
+     */
+    public TMouseEvent dup() {
+        TMouseEvent mouse = new TMouseEvent(type, x, y, absoluteX, absoluteY,
+            mouse1, mouse2, mouse3, mouseWheelUp, mouseWheelDown);
+        return mouse;
+    }
+
     /**
      * Make human-readable description of this TMouseEvent.
      *