All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bytezone.dm3270.attributes.ExtendedHighlight Maven / Gradle / Ivy

Go to download

This is a trimmed down version of https://github.com/dmolony/dm3270 to be used as TN3270 client library

There is a newer version: 0.15-lib
Show newest version
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);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy