X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fevent%2FTResizeEvent.java;h=7977fcef8d9f334b5ab8322f10cef056f3aedcb0;hb=d4a29741fb714f71fd47c9c6e8ae93b57f015821;hp=aabf0514648b925e42db438010f47258f471a011;hpb=df8de03f80590dde35f26616db91ad6163007b7e;p=fanfix.git diff --git a/src/jexer/event/TResizeEvent.java b/src/jexer/event/TResizeEvent.java index aabf051..7977fce 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. + */ + private Type type; + + /** + * Get resize type. + * + * @return SCREEN or WIDGET + */ + public Type getType() { + return type; } /** - * The type of resize + * New width. + */ + private int width; + + /** + * Get the new width. + * + * @return width */ - public Type type; + public int getWidth() { + return width; + } /** - * New width + * New height. */ - public int width; + private int height; /** - * New height + * Get the new height. + * + * @return height */ - public int height; + public int getHeight() { + return height; + } /** - * Public contructor + * Public contructor. * * @param type the Type of resize, Screen or Widget * @param width the new width - * @param width the new height + * @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); } }