public abstract class AbstractEmbosserWriter extends java.lang.Object implements EmbosserWriter
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractEmbosserWriter.Padding
Defines form feed padding style.
|
EmbosserProperties.PrintMode| Modifier and Type | Field and Description |
|---|---|
protected PageBreaks |
pagebreaks |
| Constructor and Description |
|---|
AbstractEmbosserWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
add(byte b)
Adds a byte to the EmbosserWriter output.
|
protected abstract void |
addAll(byte[] b)
Adds bytes to the EmbosserWriter output.
|
void |
close() |
int |
currentPage()
Gets the current page number, where the first page is 1.
|
protected void |
formFeed()
Performs a form feed on the EmbosserWriter
|
abstract LineBreaks |
getLinebreakStyle()
Gets the line break style for the EmbosserWriter
|
int |
getMaxHeight()
Gets the maximum page height in the current configuration
|
int |
getMaxWidth()
Gets the maximum row width in the current configuration
|
abstract AbstractEmbosserWriter.Padding |
getPaddingStyle()
Gets the form feed padding style for the EmbosserWriter
|
protected PageBreaks |
getPagebreakStyle() |
int |
getRowGap()
Gets the current row gap, measured as an integer
multiple of the dot-to-dot height.
|
abstract BrailleConverter |
getTable()
Gets the table for the EmbosserWriter
|
protected void |
init(EmbosserWriterProperties props) |
boolean |
isClosed()
Tests if embosser has been closed
|
boolean |
isOpen()
Returns true if embosser is open
|
protected void |
lineFeed()
Performs a line feed on the EmbosserWriter
|
void |
newLine()
Starts a new line
|
void |
newPage()
Starts a new page
|
void |
newSectionAndPage(boolean duplex)
Starts a new page on a blank sheet of paper
with the specified duplex settings.
|
void |
newVolumeSectionAndPage(boolean duplex)
Starts a new page on a blank sheet of paper in a new volume
with the specified duplex settings.
|
void |
open(boolean duplex)
Opens for writing using the default contract
|
void |
open(boolean duplex,
Contract contract)
Opens for writing
|
boolean |
pageIsEmpty()
Returns true if page is empty
|
void |
setRowGap(int value)
Sets the row gap for following calls to newLine
to the specified value, measured as an
integer multiple of the dot-to-dot height.
|
boolean |
supports8dot()
Returns true if this embosser supports 8 dot braille
|
boolean |
supportsAligning()
Returns true if this embosser supports aligning.
|
boolean |
supportsDuplex()
Returns true if this embosser supports duplex printing
|
boolean |
supportsPrintMode(EmbosserProperties.PrintMode mode)
Returns true if this embosser supports magazine layout.
|
boolean |
supportsVolumes()
Returns true if this embosser has some method for volume handling
|
boolean |
supportsZFolding()
Returns true if this embosser supports z-folding.
|
void |
write(java.lang.String braille)
Writes a string of braille to the embosser.
|
protected PageBreaks pagebreaks
public abstract LineBreaks getLinebreakStyle()
public abstract AbstractEmbosserWriter.Padding getPaddingStyle()
public abstract BrailleConverter getTable()
protected abstract void add(byte b)
throws java.io.IOException
b - the byte to addjava.io.IOException - if IO fails.protected abstract void addAll(byte[] b)
throws java.io.IOException
b - the bytes to addjava.io.IOException - if IO failsprotected void init(EmbosserWriterProperties props)
public void newLine()
throws java.io.IOException
EmbosserWriternewLine in interface EmbosserWriterjava.io.IOExceptionpublic void setRowGap(int value)
EmbosserWritersetRowGap in interface EmbosserWriterpublic int getRowGap()
EmbosserWritergetRowGap in interface EmbosserWriterpublic void open(boolean duplex)
throws java.io.IOException
EmbosserWriteropen in interface EmbosserWriterjava.io.IOException - if an I/O exception of some sort has occurredpublic void open(boolean duplex,
Contract contract)
throws java.io.IOException,
ContractNotSupportedException
EmbosserWriteropen in interface EmbosserWriterjava.io.IOException - if an I/O exception of some sort has occurredContractNotSupportedException - if the supplied contract is not supported, that is to say
if the contract does not contain information required by the implementationpublic int currentPage()
public boolean pageIsEmpty()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void write(java.lang.String braille)
throws java.io.IOException
EmbosserWriterwrite in interface EmbosserWriterbraille - characters in the range 0x2800 to 0x28FFjava.io.IOExceptionprotected void lineFeed()
throws java.io.IOException
java.io.IOException - if IO failsprotected void formFeed()
throws java.io.IOException
java.io.IOException - if IO failsprotected PageBreaks getPagebreakStyle()
public void newPage()
throws java.io.IOException
EmbosserWriternewPage in interface EmbosserWriterjava.io.IOExceptionpublic void newSectionAndPage(boolean duplex)
throws java.io.IOException
EmbosserWriternewSectionAndPage in interface EmbosserWriterjava.io.IOExceptionpublic void newVolumeSectionAndPage(boolean duplex)
throws java.io.IOException
EmbosserWriternewVolumeSectionAndPage in interface EmbosserWriterjava.io.IOExceptionpublic boolean isOpen()
EmbosserWriterisOpen in interface EmbosserWriterpublic boolean isClosed()
EmbosserWriterisClosed in interface EmbosserWriterpublic int getMaxHeight()
EmbosserWriterPropertiesgetMaxHeight in interface EmbosserWriterPropertiespublic int getMaxWidth()
EmbosserWriterPropertiesgetMaxWidth in interface EmbosserWriterPropertiespublic boolean supports8dot()
EmbosserPropertiessupports8dot in interface EmbosserPropertiespublic boolean supportsAligning()
EmbosserPropertiesgetMaxWidth.
Should return true for all physical embossers, since they all have
a finite row length.supportsAligning in interface EmbosserPropertiespublic boolean supportsDuplex()
EmbosserPropertiessupportsDuplex in interface EmbosserPropertiespublic boolean supportsVolumes()
EmbosserPropertiessupportsVolumes in interface EmbosserPropertiespublic boolean supportsZFolding()
EmbosserPropertiessupportsZFolding in interface EmbosserPropertiespublic boolean supportsPrintMode(EmbosserProperties.PrintMode mode)
EmbosserPropertiessupportsPrintMode in interface EmbosserProperties