X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fevent%2FTResizeEvent.java;h=9ebadd73f5fcaf0053c63e16d38e231774b0b101;hb=daa4106c096cd4d2b92c3cbae6491edccd25fcc4;hp=101b8f3bd96ced30bb5413b0a905efeda87a4e2d;hpb=05dbb28d6e8613216f43e8d0fae487c1d9c2fcd3;p=fanfix.git diff --git a/src/jexer/event/TResizeEvent.java b/src/jexer/event/TResizeEvent.java index 101b8f3..9ebadd7 100644 --- a/src/jexer/event/TResizeEvent.java +++ b/src/jexer/event/TResizeEvent.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,58 +24,97 @@ * 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; /** * This class encapsulates a screen or window resize event. */ -public class TResizeEvent extends TInputEvent { +public final class TResizeEvent extends TInputEvent { /** * Resize events can be generated for either a total screen resize or a * widget/window resize. */ public enum Type { - Screen, - Widget + /** + * The entire screen size changed. + */ + SCREEN, + + /** + * A widget was resized. + */ + WIDGET } /** - * The type of resize + * The type of resize. */ - public Type type; + private Type type; /** - * New width + * Get resize type. + * + * @return SCREEN or WIDGET */ - public int width; + public Type getType() { + return type; + } /** - * New height + * New width. */ - public int height; + private int width; /** - * Public contructor + * Get the new width. + * + * @return width + */ + public int getWidth() { + return width; + } + + /** + * New height. + */ + private int height; + + /** + * Get the new height. + * + * @return height + */ + public int getHeight() { + return height; + } + + /** + * Public contructor. * * @param type the Type of resize, Screen or Widget * @param width the new width * @param height the new height */ - public TResizeEvent(Type type, int width, int height) { - this.type = type; - this.width = width; - this.height = height; + public TResizeEvent(final Type type, final int width, final int height) { + this.type = type; + this.width = width; + this.height = height; } /** - * Make human-readable description of this event + * Make human-readable description of this TResizeEvent. + * + * @return displayable String */ @Override public String toString() { - return String.format("Resize: %s width = %d height = %d", - type, width, height); + return String.format("Resize: %s width = %d height = %d", + type, width, height); } }