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
EmbosserWriter
newLine
in interface EmbosserWriter
java.io.IOException
public void setRowGap(int value)
EmbosserWriter
setRowGap
in interface EmbosserWriter
public int getRowGap()
EmbosserWriter
getRowGap
in interface EmbosserWriter
public void open(boolean duplex) throws java.io.IOException
EmbosserWriter
open
in interface EmbosserWriter
java.io.IOException
- if an I/O exception of some sort has occurredpublic void open(boolean duplex, Contract contract) throws java.io.IOException, ContractNotSupportedException
EmbosserWriter
open
in interface EmbosserWriter
java.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.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void write(java.lang.String braille) throws java.io.IOException
EmbosserWriter
write
in interface EmbosserWriter
braille
- characters in the range 0x2800 to 0x28FFjava.io.IOException
protected 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
EmbosserWriter
newPage
in interface EmbosserWriter
java.io.IOException
public void newSectionAndPage(boolean duplex) throws java.io.IOException
EmbosserWriter
newSectionAndPage
in interface EmbosserWriter
java.io.IOException
public void newVolumeSectionAndPage(boolean duplex) throws java.io.IOException
EmbosserWriter
newVolumeSectionAndPage
in interface EmbosserWriter
java.io.IOException
public boolean isOpen()
EmbosserWriter
isOpen
in interface EmbosserWriter
public boolean isClosed()
EmbosserWriter
isClosed
in interface EmbosserWriter
public int getMaxHeight()
EmbosserWriterProperties
getMaxHeight
in interface EmbosserWriterProperties
public int getMaxWidth()
EmbosserWriterProperties
getMaxWidth
in interface EmbosserWriterProperties
public boolean supports8dot()
EmbosserProperties
supports8dot
in interface EmbosserProperties
public boolean supportsAligning()
EmbosserProperties
getMaxWidth
.
Should return true for all physical embossers, since they all have
a finite row length.supportsAligning
in interface EmbosserProperties
public boolean supportsDuplex()
EmbosserProperties
supportsDuplex
in interface EmbosserProperties
public boolean supportsVolumes()
EmbosserProperties
supportsVolumes
in interface EmbosserProperties
public boolean supportsZFolding()
EmbosserProperties
supportsZFolding
in interface EmbosserProperties
public boolean supportsPrintMode(EmbosserProperties.PrintMode mode)
EmbosserProperties
supportsPrintMode
in interface EmbosserProperties