X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fevent%2FTMouseEvent.java;h=09ace1da0d97a20ff925857ad0b288c5b1be34e4;hb=7b5261bc5b641e0769902f014e3b21f61050b02b;hp=fd0eedef2537bedff59628ee26ce52ecee924f9e;hpb=9edb442b712de01d1b7af81d1d57a29c2c6e7871;p=nikiroo-utils.git diff --git a/src/jexer/event/TMouseEvent.java b/src/jexer/event/TMouseEvent.java index fd0eede..09ace1d 100644 --- a/src/jexer/event/TMouseEvent.java +++ b/src/jexer/event/TMouseEvent.java @@ -1,16 +1,11 @@ /** * Jexer - Java Text User Interface * - * Version: $Id$ - * - * Author: Kevin Lamonte, kevin.lamonte@gmail.com - * * License: LGPLv3 or later * - * Copyright: This module is licensed under the GNU Lesser General - * Public License Version 3. Please see the file "COPYING" in this - * directory for more information about the GNU Lesser General Public - * License Version 3. + * This module is licensed under the GNU Lesser General Public License + * Version 3. Please see the file "COPYING" in this directory for more + * information about the GNU Lesser General Public License Version 3. * * Copyright (C) 2015 Kevin Lamonte * @@ -29,6 +24,9 @@ * http://www.gnu.org/licenses/, or write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA + * + * @author Kevin Lamonte [kevin.lamonte@gmail.com] + * @version 1 */ package jexer.event; @@ -37,97 +35,102 @@ package jexer.event; */ public class TMouseEvent extends TInputEvent { + /** + * The type of event generated. + */ public enum Type { - /** - * Mouse motion. X and Y will have screen coordinates. - */ - MOUSE_MOTION, - - /** - * Mouse button down. X and Y will have screen coordinates. - */ - MOUSE_DOWN, - - /** - * Mouse button up. X and Y will have screen coordinates. - */ - MOUSE_UP + /** + * Mouse motion. X and Y will have screen coordinates. + */ + MOUSE_MOTION, + + /** + * Mouse button down. X and Y will have screen coordinates. + */ + MOUSE_DOWN, + + /** + * Mouse button up. X and Y will have screen coordinates. + */ + MOUSE_UP } /** * Type of event, one of MOUSE_MOTION, MOUSE_UP, or MOUSE_DOWN, or - * KEYPRESS + * KEYPRESS. */ public Type type; /** - * Mouse X - relative coordinates + * Mouse X - relative coordinates. */ public int x; /** - * Mouse Y - relative coordinates + * Mouse Y - relative coordinates. */ public int y; /** - * Mouse X - absolute screen coordinates + * Mouse X - absolute screen coordinates. */ public int absoluteX; /** - * Mouse Y - absolute screen coordinate + * Mouse Y - absolute screen coordinate. */ public int absoluteY; /** - * Mouse button 1 (left button) + * Mouse button 1 (left button). */ public boolean mouse1; /** - * Mouse button 2 (right button) + * Mouse button 2 (right button). */ public boolean mouse2; /** - * Mouse button 3 (middle button) + * Mouse button 3 (middle button). */ public boolean mouse3; /** - * Mouse wheel UP (button 4) + * Mouse wheel UP (button 4). */ public boolean mouseWheelUp; /** - * Mouse wheel DOWN (button 5) + * Mouse wheel DOWN (button 5). */ public boolean mouseWheelDown; /** - * Public contructor + * Public contructor. * * @param type the type of event, MOUSE_MOTION, MOUSE_DOWN, or MOUSE_UP */ - public TMouseEvent(Type type) { - this.type = type; + public TMouseEvent(final Type type) { + this.type = type; } /** - * Make human-readable description of this event + * Make human-readable description of this TMouseEvent. + * + * @return displayable String */ @Override - public String toString() { - return String.format("Mouse: %s x %d y %d absoluteX %d absoluteY %d 1 %s 2 %s 3 %s DOWN %s UP %s", - type, - x, y, - absoluteX, absoluteY, - mouse1, - mouse2, - mouse3, - mouseWheelUp, - mouseWheelDown); + public final String toString() { + return String.format("Mouse: %s x %d y %d absoluteX %d absoluteY %d 1 %s 2 %s 3 %s DOWN %s UP %s", + type, + x, y, + absoluteX, absoluteY, + mouse1, + mouse2, + mouse3, + mouseWheelUp, + mouseWheelDown); } }