com.java4less.textprinter.ports
Class HDParallelPort

java.lang.Object
  |
  +--com.java4less.textprinter.PrinterPort
        |
        +--com.java4less.textprinter.ports.HDParallelPort

public class HDParallelPort
extends PrinterPort

Class used to access the printer using a the Java Communications API.
Note: although the communications api defines method for checking the printer state, the SUN implementations does not support them.


Field Summary
 boolean checkPrinterOnline
          check if printer is online
 int portMode
          set parallel port mode
 
Constructor Summary
HDParallelPort(java.lang.String port)
           
 
Method Summary
 void close()
          closes port
 void open()
          opens port
 void parallelEvent(ParallelPortEvent ev)
           
 void write(byte[] s, int len)
          Writes an array of bytes to the port
 void write(java.lang.String s)
          Writes a string to the port
 
Methods inherited from class com.java4less.textprinter.PrinterPort
getTimeout, isBusy, isInError, isOnline, isPaperOut, setTimeout, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

portMode

public int portMode
set parallel port mode


checkPrinterOnline

public boolean checkPrinterOnline
check if printer is online

Constructor Detail

HDParallelPort

public HDParallelPort(java.lang.String port)
Method Detail

open

public void open()
          throws TextPrinterException
opens port

Overrides:
open in class PrinterPort
TextPrinterException

close

public void close()
           throws TextPrinterException
closes port

Overrides:
close in class PrinterPort
TextPrinterException

write

public void write(java.lang.String s)
           throws TextPrinterException
Writes a string to the port

Overrides:
write in class PrinterPort
TextPrinterException

write

public void write(byte[] s,
                  int len)
           throws TextPrinterException
Writes an array of bytes to the port

Overrides:
write in class PrinterPort
TextPrinterException

parallelEvent

public void parallelEvent(ParallelPortEvent ev)