diff --git a/src/main/java/at/downardo/j3270Server/Field.java b/src/main/java/at/downardo/j3270Server/Field.java index 08151bb..3c9624a 100644 --- a/src/main/java/at/downardo/j3270Server/Field.java +++ b/src/main/java/at/downardo/j3270Server/Field.java @@ -42,6 +42,8 @@ public class Field { */ public String Name; + public boolean Hidden; + /** * * @param row @@ -49,15 +51,31 @@ public class Field { * @param content * @param write * @param intense + * @param hidden * @param name */ - public Field(int row, int col, String content, boolean write, boolean intense, String name) { + public Field(int row, int col, String content, boolean write, boolean intense, boolean hidden, String name) { Row = row; Col = col; Content = content; Write = write; Intense = intense; Name = name; + Hidden = hidden; + } + + /** + * @return the hidden + */ + public boolean isHidden() { + return Hidden; + } + + /** + * @param hidden the hidden to set + */ + public void setHidden(boolean hidden) { + Hidden = hidden; } /** diff --git a/src/main/java/at/downardo/j3270Server/Screen.java b/src/main/java/at/downardo/j3270Server/Screen.java index ea7de5b..d264ed1 100644 --- a/src/main/java/at/downardo/j3270Server/Screen.java +++ b/src/main/java/at/downardo/j3270Server/Screen.java @@ -64,7 +64,7 @@ public static Response ShowScreen(Screen screen, HashMap values, buffer.write(_t); } - for(int _t : Screen.sf(fld.isWrite(), fld.isIntense())){ + for(int _t : Screen.sf(fld.isWrite(), fld.isIntense(), fld.isHidden())){ buffer.write(_t); } @@ -140,9 +140,10 @@ public static int[] sba(int row, int col) { * sf is the "start field" 3280 command * @param write * @param intense + * @param hidden * @return */ - public static int[] sf(boolean write, boolean intense) { + public static int[] sf(boolean write, boolean intense, boolean hidden) { int[] _return = new int[2]; _return[0] = 0x1d; @@ -157,6 +158,12 @@ public static int[] sf(boolean write, boolean intense) { _return[1] |= 1 << 3; } + if(hidden) { + _return[1] |= 1 << 3; + _return[1] |= 1 << 2; + } + + _return[1] = Util.codes[_return[1]]; return _return; diff --git a/src/main/java/at/downardo/j3270Server/example/Example.java b/src/main/java/at/downardo/j3270Server/example/Example.java index 00a0225..e41bb8e 100644 --- a/src/main/java/at/downardo/j3270Server/example/Example.java +++ b/src/main/java/at/downardo/j3270Server/example/Example.java @@ -39,15 +39,21 @@ public void run() { EBCDIC.CODEPAGE = "CP1148"; Field[] fields = { - new Field(0,0,"HALLO WELT TEST €", false, true, ""), - new Field(1,0, "Name ....", false, true, ""), - new Field(1,13, "", true, false, "name") + new Field(0,0,"HALLO WELT TEST €", false, true, false, ""), + new Field(1,0, "Name ....", false, true, false, ""), + new Field(1,13, "", true, false, false, "name"), + new Field(2,0, "Password ", false, false, false, ""), + new Field(2, 13, "", true, false, true, "password"), + new Field(3,0, "Test", false, true, false, ""), + new Field(4,0, "Test", false, false, false, ""), + new Field(23,0, "PF3 Exit", false, true, false, "") + }; Field[] fields2 = { - new Field(0,0,"HALLO WELT TEST WORLD 2", false, true, ""), - new Field(1,0, "Name ....", false, true, ""), - new Field(1,13, "", false, false, "") + new Field(0,0,"HALLO WELT TEST WORLD 2", false, true, false, ""), + new Field(1,0, "Name ....", false, true, false, ""), + new Field(1,13, "", false, false, false, "") }; Screen screen = new Screen(fields); @@ -67,7 +73,7 @@ public void run() { fieldValues = r.Values; - System.out.println(fieldValues.get("name")); + System.out.println(fieldValues.get("password")); System.out.println(EBCDIC.CODEPAGE); if(r.AID == AID.AIDEnter) {