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

com.bytezone.dm3270.orders.ProgramTabOrder 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.9.1
Show newest version
package com.bytezone.dm3270.orders;

import com.bytezone.dm3270.display.DisplayScreen;
import com.bytezone.dm3270.display.Pen;

public class ProgramTabOrder extends Order {

  private Order previousOrder;

  public ProgramTabOrder(byte[] buffer, int offset) {
    assert buffer[offset] == Order.PROGRAM_TAB;

    this.buffer = new byte[1];
    this.buffer[0] = buffer[offset];
  }

  @Override
  public void process(DisplayScreen screen) {
    Pen pen = screen.getPen();

    // if the previous data was text then erase the remainder of the field
    if (previousOrder instanceof TextOrder) {
      pen.eraseEOF();
    }

    pen.tab();
  }

  @Override
  public boolean matchesPreviousOrder(Order previousOrder) {
    this.previousOrder = previousOrder;
    return false;     // we don't care if it matched, but we want to know what it was
  }

  @Override
  public String toString() {
    return "PT  :";
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy