Commit 9104084ea23f4fd6fb92af014a3693df33dc82b6

Authored by perry.werneck@gmail.com
1 parent 9fb62a82

Atualizando documentação

Showing 1 changed file with 100 additions and 1 deletions   Show diff stats
src/java/terminal.java
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple 18 * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
19 * Place, Suite 330, Boston, MA, 02111-1307, USA 19 * Place, Suite 330, Boston, MA, 02111-1307, USA
20 * 20 *
21 - * Este programa está nomeado como lib3270.java e possui - linhas de código. 21 + * Este programa está nomeado como terminal.java e possui - linhas de código.
22 * 22 *
23 * Contatos: 23 * Contatos:
24 * 24 *
@@ -46,6 +46,9 @@ public class terminal @@ -46,6 +46,9 @@ public class terminal
46 * ready for reading. 46 * ready for reading.
47 * 47 *
48 * @param seconds Maximum time (in seconds) to wait for. 48 * @param seconds Maximum time (in seconds) to wait for.
  49 + *
  50 + * @return 0 for success, error code if not.
  51 + *
49 */ 52 */
50 public native int wait_for_ready(int seconds); 53 public native int wait_for_ready(int seconds);
51 54
@@ -98,23 +101,115 @@ public class terminal @@ -98,23 +101,115 @@ public class terminal
98 */ 101 */
99 public native String get_string_at(int row, int col, int sz); 102 public native String get_string_at(int row, int col, int sz);
100 103
  104 + /**
  105 + * Set terminal contents at position.
  106 + *
  107 + * @param row Row for starting of change.
  108 + * @param col Column for starting of change.
  109 + * @param str Text to set.
  110 + *
  111 + * @return 0 if ok, error code if not.
  112 + *
  113 + */
101 public native int set_string_at(int row, int col, String str); 114 public native int set_string_at(int row, int col, String str);
  115 +
  116 + /**
  117 + * Compare terminal contents.
  118 + *
  119 + * @param row Row for text to compare.
  120 + * @param col Column for text to compare.
  121 + * @param text String to compare.
  122 + *
  123 + * @return result of strcmp() from text and terminal contents.
  124 + *
  125 + */
102 public native int cmp_string_at(int row, int col, String text); 126 public native int cmp_string_at(int row, int col, String text);
  127 +
  128 +
103 public native int input_string(String str); 129 public native int input_string(String str);
104 130
105 // Cursor management 131 // Cursor management
  132 +
  133 + /**
  134 + * Move cursor to selected position.
  135 + *
  136 + * @param row Row of the new cursor position.
  137 + * @param col Column of the new cursor position.
  138 + *
  139 + * @return Address of current cursor position.
  140 + *
  141 + */
106 public native int set_cursor_position(int row, int col); 142 public native int set_cursor_position(int row, int col);
  143 +
  144 + /**
  145 + * Set cursor offset in the terminal buffer.
  146 + *
  147 + * @param addr New cursor offset.
  148 + *
  149 + * @return Original cursor offset.
  150 + *
  151 + */
107 public native int set_cursor_addr(int addr); 152 public native int set_cursor_addr(int addr);
  153 +
  154 + /**
  155 + * Get cursor offset
  156 + *
  157 + * @return Current cursor offset.
  158 + *
  159 + */
108 public native int get_cursor_addr(); 160 public native int get_cursor_addr();
109 161
110 // Keyboard actions 162 // Keyboard actions
  163 +
  164 + /**
  165 + * Send an "ENTER" action.
  166 + *
  167 + * @return reserved.
  168 + *
  169 + */
111 public native int enter(); 170 public native int enter();
  171 +
  172 + /**
  173 + * Send a pfkey to host.
  174 + *
  175 + * @param key PFkey number.
  176 + *
  177 + * @return reserved.
  178 + *
  179 + */
112 public native int pfkey(int key); 180 public native int pfkey(int key);
  181 +
  182 + /**
  183 + * Send a pakey to host.
  184 + *
  185 + * @param key PFkey number.
  186 + *
  187 + * @return reserved.
  188 + *
  189 + */
113 public native int pakey(int key); 190 public native int pakey(int key);
114 191
115 // Actions 192 // Actions
  193 +
  194 + /**
  195 + * quit remote pw3270 window.
  196 + * <p>
  197 + * Only valid if connected to a remote window
  198 + *
  199 + * @return reserved.
  200 + *
  201 + */
116 public native int quit(); 202 public native int quit();
  203 +
  204 + /**
  205 + * Erase from cursor position until the end of the field.
  206 + *
  207 + * @return reserved.
  208 + *
  209 + */
117 public native int erase_eof(); 210 public native int erase_eof();
  211 +
  212 +
118 public native int print(); 213 public native int print();
119 214
120 // Connect/Disconnect 215 // Connect/Disconnect
@@ -133,12 +228,16 @@ public class terminal @@ -133,12 +228,16 @@ public class terminal
133 * @param host Host URI. 228 * @param host Host URI.
134 * @param seconds How many seconds to wait for a connection. 229 * @param seconds How many seconds to wait for a connection.
135 * 230 *
  231 + * @return 0 if ok, error code if not.
  232 + *
136 */ 233 */
137 public native int connect(String host, int seconds); 234 public native int connect(String host, int seconds);
138 235
139 /** 236 /**
140 * Disconnect from host. 237 * Disconnect from host.
141 * 238 *
  239 + * @return 0 if ok, error code if not.
  240 + *
142 */ 241 */
143 public native int disconnect(); 242 public native int disconnect();
144 243