com.bytezone.dm3270.attributes.ExtendedHighlight Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dm3270-lib Show documentation
Show all versions of dm3270-lib Show documentation
This is a trimmed down version of https://github.com/dmolony/dm3270 to be used as
TN3270 client library
package com.bytezone.dm3270.attributes;
import com.bytezone.dm3270.display.ScreenContext;
public class ExtendedHighlight extends Attribute {
private static String[] highlights = {"xx", "Blink", "Reverse video", "bb", "Underscore"};
public ExtendedHighlight(byte value) {
super(AttributeType.HIGHLIGHT, Attribute.XA_HIGHLIGHTING, value);
}
@Override
public ScreenContext process(ScreenContext defaultContext, ScreenContext currentContext) {
return currentContext.withHighlight(attributeValue);
}
@Override
public String toString() {
String valueText = attributeValue == 0 ? "Reset" : highlights[attributeValue & 0x0F];
return String.format("%-12s : %02X %s", name(), attributeValue, valueText);
}
}