Skip to content

Commit

Permalink
Field Type Hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Downarowicz committed Feb 27, 2022
1 parent 5838983 commit 8413a88
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
20 changes: 19 additions & 1 deletion src/main/java/at/downardo/j3270Server/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,40 @@ public class Field {
*/
public String Name;

public boolean Hidden;

/**
*
* @param row
* @param col
* @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;
}

/**
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/at/downardo/j3270Server/Screen.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static Response ShowScreen(Screen screen, HashMap<String, String> 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);
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
20 changes: 13 additions & 7 deletions src/main/java/at/downardo/j3270Server/example/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 8413a88

Please sign in to comment.