commit e31860f264d1dd3b9d2c27d8c39bc04bb4c97ed9 from: marcus date: Mon Oct 24 07:34:40 2005 UTC for set window size commit - dc9d63ad580656174429e44368fa05c6f61fbd80 commit + e31860f264d1dd3b9d2c27d8c39bc04bb4c97ed9 blob - /dev/null blob + 672f7cdcf1cd607a0f8e196b75bc1da5c04a2c57 (mode 644) --- /dev/null +++ de/mud/jta/event/SetWindowSizeListener.java @@ -0,0 +1,42 @@ +/* + * This file is part of "JTA - Telnet/SSH for the JAVA(tm) platform". + * + * (c) Matthias L. Jugel, Marcus Meißner 1996-2005. All Rights Reserved. + * + * Please visit http://javatelnet.org/ for updates and contact. + * + * --LICENSE NOTICE-- + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * --LICENSE NOTICE-- + * + */ +package de.mud.jta.event; + +import de.mud.jta.PluginListener; + +import java.awt.Dimension; + +/** + * This is the interface for a window size listener. + *

+ * Maintainer: Matthias L. Jugel + * + * @version $Id: WindowSizeListener.java 499 2005-09-29 08:24:54Z leo $ + * @author Matthias L. Jugel, Marcus Mei�ner + */ +public interface SetWindowSizeListener extends PluginListener { + /** Set the current window size of the terminal in rows and columns. */ + public void setWindowSize(int columns, int rows); +} blob - /dev/null blob + d9b26d375f088b7a8e65eded1b6deee489bcd8af (mode 644) --- /dev/null +++ de/mud/jta/event/SetWindowSizeRequest.java @@ -0,0 +1,56 @@ +/* + * This file is part of "JTA - Telnet/SSH for the JAVA(tm) platform". + * + * (c) Matthias L. Jugel, Marcus Meißner 1996-2005. All Rights Reserved. + * + * Please visit http://javatelnet.org/ for updates and contact. + * + * --LICENSE NOTICE-- + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * --LICENSE NOTICE-- + * + */ +package de.mud.jta.event; + +import de.mud.jta.PluginMessage; +import de.mud.jta.PluginListener; +import de.mud.jta.event.SetWindowSizeListener; + +/** + * Request the current window size of the terminal. + *

+ * Maintainer: Matthias L. Jugel + * + * @version $Id: WindowSizeRequest.java 499 2005-09-29 08:24:54Z leo $ + * @author Matthias L. Jugel, Marcus Mei�ner + */ +public class SetWindowSizeRequest implements PluginMessage { + + private int columns, rows; + public SetWindowSizeRequest(int c, int r) { + rows = r; + columns = c; + } + /** + * Set the new size of the window + * @param pl the list of plugin message listeners + */ + public Object firePluginMessage(PluginListener pl) { + if(pl instanceof SetWindowSizeListener) { + ((SetWindowSizeListener)pl).setWindowSize(columns, rows); + } + return null; + } +}