Package org.daisy.dotify.api.embosser
Interface EmbosserWriter
-
- All Superinterfaces:
AutoCloseable,Closeable,EmbosserWriterProperties
- All Known Subinterfaces:
ContractEmbosserWriter
- All Known Implementing Classes:
AbstractEmbosserWriter,BufferedEmbosserWriter,BufferedVolumeEmbosser,ConfigurableEmbosser,FileToDeviceEmbosserWriter,IndexContractEmbosserWriter,IndexTransparentEmbosserWriter,MicroBrailleFileFormatWriter
public interface EmbosserWriter extends EmbosserWriterProperties, Closeable
Provides an embosser communication interface. Communication is flat. For example, only one of these should be called when starting a new page:- newPage
- newSectionAndPage
- newVolumeSectionAndPage
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetRowGap()Gets the current row gap, measured as an integer multiple of the dot-to-dot height.booleanisClosed()Tests if embosser has been closed.booleanisOpen()Returns true if embosser is open.voidnewLine()Starts a new line.voidnewPage()Starts a new page.voidnewSectionAndPage(boolean duplex)Starts a new page on a blank sheet of paper with the specified duplex settings.voidnewVolumeSectionAndPage(boolean duplex)Starts a new page on a blank sheet of paper in a new volume with the specified duplex settings.voidopen(boolean duplex)Opens for writing using the default contract.voidsetRowGap(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.voidwrite(String braille)Writes a string of braille to the embosser.-
Methods inherited from interface org.daisy.dotify.api.embosser.EmbosserWriterProperties
getMaxWidth, supportsAligning
-
-
-
-
Method Detail
-
write
void write(String braille) throws IOException
Writes a string of braille to the embosser. Values must be between 0x2800 and 0x28FF. An implementation may supply a complete row of braille in a single chunk. However, an implementation may also call this method repeatedly without any other calls in between.- Parameters:
braille- characters in the range 0x2800 to 0x28FF- Throws:
IOException- if an I/O error occurs
-
newLine
void newLine() throws IOExceptionStarts a new line.- Throws:
IOException- if an I/O error occurs
-
newPage
void newPage() throws IOExceptionStarts a new page.- Throws:
IOException- if an I/O error occurs
-
newSectionAndPage
void newSectionAndPage(boolean duplex) throws IOExceptionStarts a new page on a blank sheet of paper with the specified duplex settings.- Parameters:
duplex- if both sides of sheets should be used, false otherwise- Throws:
IOException- if an I/O error occurs
-
newVolumeSectionAndPage
void newVolumeSectionAndPage(boolean duplex) throws IOExceptionStarts a new page on a blank sheet of paper in a new volume with the specified duplex settings.- Parameters:
duplex- if both sides of sheets should be used, false otherwise- Throws:
IOException- if an I/O error occurs
-
open
void open(boolean duplex) throws IOException
Opens for writing using the default contract.- Parameters:
duplex- true if both sides of sheets should be used, false otherwise- Throws:
IOException- if an I/O error occurs
-
isOpen
boolean isOpen()
Returns true if embosser is open.- Returns:
- returns true if embosser is open, false otherwise
-
isClosed
boolean isClosed()
Tests if embosser has been closed.- Returns:
- returns true if the embosser has been open, but is now closed, false otherwise
-
setRowGap
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.- Parameters:
value- the row gap
-
getRowGap
int getRowGap()
Gets the current row gap, measured as an integer multiple of the dot-to-dot height.- Returns:
- returns the current row gap
-
-