|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.comm.CommPort
javax.comm.ParallelPort
A parallel communications port. ParallelPort describes
the low-level interface to a parallel communications port made available
by the underlying system. ParallelPort defines the minimum
required functionality for parallel communications ports.
CommPort,
CommPortIdentifier| Field Summary | |
static int |
LPT_MODE_ANY
Picks the best available mode. |
static int |
LPT_MODE_ECP
Enhanced capabilities port. |
static int |
LPT_MODE_EPP
Extended parallel port. |
static int |
LPT_MODE_NIBBLE
Nibble Mode. |
static int |
LPT_MODE_PS2
Byte mode. |
static int |
LPT_MODE_SPP
Compatibility mode. |
| Fields inherited from class javax.comm.CommPort |
name |
| Constructor Summary | |
ParallelPort()
|
|
| Method Summary | |
abstract void |
addEventListener(ParallelPortEventListener lsnr)
Registers a ParallelPortEventListener object for
ParallelPortEvents. |
abstract int |
getMode()
Gets the currently configured mode. |
abstract int |
getOutputBufferFree()
Gets the number of bytes available in the output buffer. |
abstract boolean |
isPaperOut()
Checks if the port is indicating an "Out of Paper" state. |
abstract boolean |
isPrinterBusy()
Checks if the port is indicating a "Printer Busy" state. |
abstract boolean |
isPrinterError()
Checks if the printer has encountered an error. |
abstract boolean |
isPrinterSelected()
Checks if the printer is in selected state. |
abstract boolean |
isPrinterTimedOut()
Checks if the printer has timed out. |
abstract void |
notifyOnBuffer(boolean notify)
Expresses interest in being notified when the output buffer is empty. |
abstract void |
notifyOnError(boolean notify)
Expresses interest in being notified of port errors. |
abstract void |
removeEventListener()
Deregisters event listener registered using addEventListener. |
abstract void |
restart()
Restarts output after an error. |
abstract int |
setMode(int mode)
Sets the printer port mode. |
abstract void |
suspend()
Suspends output. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int LPT_MODE_ANY
public static final int LPT_MODE_SPP
public static final int LPT_MODE_PS2
public static final int LPT_MODE_EPP
public static final int LPT_MODE_ECP
public static final int LPT_MODE_NIBBLE
| Constructor Detail |
public ParallelPort()
| Method Detail |
public abstract void addEventListener(ParallelPortEventListener lsnr)
throws java.util.TooManyListenersException
ParallelPortEventListener object for
ParallelPortEvents. Interest in specific events
may be expressed by using the notifyOnError and
notifyOnBuffer methods.
Only one listener per ParallelPort is supported.
Calling addEventListener multiple times will simply
replace the current ParallelPortEventListener object.
After the port is closed, no more event will be generated. Another
call to open() of the port's
CommPortIdentifier
object will return a new CommPort object, and the lsnr
has to be added again to the new CommPort object to
receive event from this port.
lsnr - A ParallelPortEventListener object
whose parallelEvent method will be called
to indicate an event.
java.util.TooManyListenersException - If an initial attempt to
attach a listener succeeds, subsequent
attempts will throw TooManyListenersException
without effecting the first listener.public abstract void removeEventListener()
addEventListener.
This is done automatically when a port is closed.
public abstract void notifyOnError(boolean notify)
notify - enable or disable error notification based on whether
notify is true or falsepublic abstract void notifyOnBuffer(boolean notify)
notify - true enables notification;
false disables notification.public abstract int getOutputBufferFree()
public abstract boolean isPaperOut()
public abstract boolean isPrinterBusy()
public abstract boolean isPrinterSelected()
Note: This method is platform dependent.
public abstract boolean isPrinterTimedOut()
Note: This method is platform dependent.
public abstract boolean isPrinterError()
Note: This method is platform dependent.
public abstract void restart()
public abstract void suspend()
public abstract int getMode()
public abstract int setMode(int mode)
throws UnsupportedCommOperationException
mode - one of LPT_MODE_ANY, LPT_MODE_SPP,
LPT_MODE_PS2, LPT_MODE_EPP, or LPT_MODE_ECP
UnsupportedCommOperationException - is thrown if the
mode is not supported by the underline driver.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||