1 /* This file is part of "Telnet Floyd". 2 * 3 * (c) Radek Polak 2003-2004. All Rights Reserved. 4 * 5 * Please visit project homepage at http://phoenix.inf.upol.cz/~polakr 6 * 7 * --LICENSE NOTICE-- 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * --LICENSE NOTICE-- 22 * 23 */ 24 25 package telnet; 26 27 /** 28 * Class that represent user action. Example action is e.g. action 29 * "connect to host 127.0.0.1" or "enter string logout". Each action has up to 30 * 4 parameters. First is label that tells us what to do. This number is stored 31 * in variable "funct". Other three parameters can be passed to the method, that 32 * executes actions (see MidletTerminal.keyPressed function). 33 */ 34 35 public class Action { 36 37 public final static String INPUT_DIALOG = "input dialog"; 38 public final static String KEY_PRESSED = "key pressed"; 39 public final static String KEY_TYPED = "key typed"; 40 public final static String TYPE_STRING = "type string"; 41 public final static String ENTER_STRING = "enter string"; 42 public final static String SHOW_HELP = "show help"; 43 public final static String SCROLL_UP = "scroll up"; 44 public final static String SCROLL_DOWN = "scroll down"; 45 public final static String SCROLL_LEFT = "scroll left"; 46 public final static String SCROLL_RIGH = "scroll right"; 47 public final static String SET_SCREEN_SIZE = "set size"; 48 public final static String CONNECT = "connect"; 49 public final static String TRAFFIC = "traffic"; 50 public final static String BG_COLOR = "back color"; 51 public final static String FG_COLOR = "fore color"; 52 public final static String VIEW_CONSOLE = "view console"; 53 public final static String SET_SCOLLBACK_SIZE = "set scrollback size"; 54 public final static String SCOLLBACK_UP = "scrollback up"; 55 public final static String SCOLLBACK_DOWN = "scrollback down"; 56 public final static String SHOW_TERMINAL_SIZE = "show terminal size"; 57 public final static String SET_SLEEP_TIME = "set sleep time"; 58 public final static String KEEP_CONNECTION_TIME = "keep connection time"; 59 public final static String EXIT_APP = "exit this application"; 60 61 public final static int INPUT_DIALOG_HASH = 619943518; 62 public final static int KEY_PRESSED_HASH = -1709828255; 63 public final static int KEY_TYPED_HASH = 846825321; 64 public final static int TYPE_STRING_HASH = 800818103; 65 public final static int ENTER_STRING_HASH = -578494887; 66 public final static int SHOW_HELP_HASH = -1961870716; 67 public final static int SCROLL_UP_HASH = 417730766; 68 public final static int SCROLL_DOWN_HASH = 2006803989; 69 public final static int SCROLL_LEFT_HASH = 2007032186; 70 public final static int SCROLL_RIGH_HASH = 2094116617; 71 public final static int SET_SCREEN_SIZE_HASH = 1357349119; 72 public final static int CONNECT_HASH = 951351530; 73 public final static int TRAFFIC_HASH = -1067310595; 74 public final static int BG_COLOR_HASH = 916242154; 75 public final static int FG_COLOR_HASH = -62074113; 76 public final static int VIEW_CONSOLE_HASH = 525682396; 77 public final static int SET_SCOLLBACK_SIZE_HASH = 513124271; 78 public final static int SCOLLBACK_UP_HASH = -1553380089; 79 public final static int SCOLLBACK_DOWN_HASH = 1849849870; 80 public final static int SHOW_TERMINAL_SIZE_HASH = -2023294142; 81 public final static int SET_SLEEP_TIME_HASH = -1895224076; 82 public final static int KEEP_CONNECTION_TIME_HASH = 656383028; 83 public final static int EXIT_APP_HASH = -514479728; 84 85 public String funct,arg0,arg1,arg2; 86 87 public Action( String funct ) { 88 this( funct, "", "", "" ); 89 } 90 91 public Action( String funct, String arg0 ) { 92 this( funct, arg0, "", "" ); 93 } 94 95 public Action( String funct, String arg0, String arg1 ) { 96 this( funct, arg0, arg1, "" ); 97 } 98 99 public Action( String funct, String arg0, String arg1, String arg2 ) { 100 this.funct = funct; 101 this.arg0 = arg0; 102 this.arg1 = arg1; 103 this.arg2 = arg2; 104 } 105 } |