Class AbstractEmbosserWriter

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractEmbosserWriter

        public AbstractEmbosserWriter()
    • Method Detail

      • getLinebreakStyle

        public abstract LineBreaks getLinebreakStyle()
        Gets the line break style for the EmbosserWriter
        Returns:
        returns the line break style for the EmbosserWriter
      • getPaddingStyle

        public abstract AbstractEmbosserWriter.Padding getPaddingStyle()
        Gets the form feed padding style for the EmbosserWriter
        Returns:
        returns the padding style for the EmbosserWriter
      • getTable

        public abstract BrailleConverter getTable()
        Gets the table for the EmbosserWriter
        Returns:
        returns the table for the EmbosserWriter
      • add

        protected abstract void add​(byte b)
                             throws java.io.IOException
        Adds a byte to the EmbosserWriter output.
        Parameters:
        b - the byte to add
        Throws:
        java.io.IOException - if IO fails.
      • addAll

        protected abstract void addAll​(byte[] b)
                                throws java.io.IOException
        Adds bytes to the EmbosserWriter output.
        Parameters:
        b - the bytes to add
        Throws:
        java.io.IOException - if IO fails
      • newLine

        public void newLine()
                     throws java.io.IOException
        Description copied from interface: EmbosserWriter
        Starts a new line
        Specified by:
        newLine in interface EmbosserWriter
        Throws:
        java.io.IOException
      • setRowGap

        public void setRowGap​(int value)
        Description copied from interface: EmbosserWriter
        Sets the row gap for following calls to newLine to the specified value, measured as an integer multiple of the dot-to-dot height.
        Specified by:
        setRowGap in interface EmbosserWriter
      • getRowGap

        public int getRowGap()
        Description copied from interface: EmbosserWriter
        Gets the current row gap, measured as an integer multiple of the dot-to-dot height.
        Specified by:
        getRowGap in interface EmbosserWriter
        Returns:
        returns the current row gap
      • open

        public void open​(boolean duplex)
                  throws java.io.IOException
        Description copied from interface: EmbosserWriter
        Opens for writing using the default contract
        Specified by:
        open in interface EmbosserWriter
        Throws:
        java.io.IOException - if an I/O exception of some sort has occurred
      • currentPage

        public int currentPage()
        Gets the current page number, where the first page is 1.
        Returns:
        returns the current page number
      • pageIsEmpty

        public boolean pageIsEmpty()
        Returns true if page is empty
        Returns:
        returns true if page is empty
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String braille)
                   throws java.io.IOException
        Description copied from interface: EmbosserWriter
        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.
        Specified by:
        write in interface EmbosserWriter
        Parameters:
        braille - characters in the range 0x2800 to 0x28FF
        Throws:
        java.io.IOException
      • lineFeed

        protected void lineFeed()
                         throws java.io.IOException
        Performs a line feed on the EmbosserWriter
        Throws:
        java.io.IOException - if IO fails
      • formFeed

        protected void formFeed()
                         throws java.io.IOException
        Performs a form feed on the EmbosserWriter
        Throws:
        java.io.IOException - if IO fails
      • getPagebreakStyle

        protected PageBreaks getPagebreakStyle()
      • newPage

        public void newPage()
                     throws java.io.IOException
        Description copied from interface: EmbosserWriter
        Starts a new page
        Specified by:
        newPage in interface EmbosserWriter
        Throws:
        java.io.IOException
      • newSectionAndPage

        public void newSectionAndPage​(boolean duplex)
                               throws java.io.IOException
        Description copied from interface: EmbosserWriter
        Starts a new page on a blank sheet of paper with the specified duplex settings.
        Specified by:
        newSectionAndPage in interface EmbosserWriter
        Throws:
        java.io.IOException
      • newVolumeSectionAndPage

        public void newVolumeSectionAndPage​(boolean duplex)
                                     throws java.io.IOException
        Description copied from interface: EmbosserWriter
        Starts a new page on a blank sheet of paper in a new volume with the specified duplex settings.
        Specified by:
        newVolumeSectionAndPage in interface EmbosserWriter
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
        Description copied from interface: EmbosserWriter
        Returns true if embosser is open
        Specified by:
        isOpen in interface EmbosserWriter
        Returns:
        returns true if embosser is open, false otherwise
      • isClosed

        public boolean isClosed()
        Description copied from interface: EmbosserWriter
        Tests if embosser has been closed
        Specified by:
        isClosed in interface EmbosserWriter
        Returns:
        returns true if the embosser has been open, but is now closed, false otherwise
      • supports8dot

        public boolean supports8dot()
        Description copied from interface: EmbosserProperties
        Returns true if this embosser supports 8 dot braille
        Specified by:
        supports8dot in interface EmbosserProperties
        Returns:
        returns true if this embosser supports 8 dot braille
      • supportsAligning

        public boolean supportsAligning()
        Description copied from interface: EmbosserProperties
        Returns true if this embosser supports aligning. This indicates that rows can be padded with whitespace to move the text block horizontally using the value returned by getMaxWidth. Should return true for all physical embossers, since they all have a finite row length.
        Specified by:
        supportsAligning in interface EmbosserProperties
        Returns:
        returns true if this embosser supports aligning, false otherwise.
      • supportsDuplex

        public boolean supportsDuplex()
        Description copied from interface: EmbosserProperties
        Returns true if this embosser supports duplex printing
        Specified by:
        supportsDuplex in interface EmbosserProperties
        Returns:
        returns true if this embosser supports duplex printing
      • supportsVolumes

        public boolean supportsVolumes()
        Description copied from interface: EmbosserProperties
        Returns true if this embosser has some method for volume handling
        Specified by:
        supportsVolumes in interface EmbosserProperties
        Returns:
        returns true if this embosser supports volumes
      • supportsZFolding

        public boolean supportsZFolding()
        Description copied from interface: EmbosserProperties
        Returns true if this embosser supports z-folding. This indicates that, if tractor paper is used, the embosser can emboss every other paper upside down with the rear side up so that pages are ordered face up as they fold naturally in the output stack.
        Specified by:
        supportsZFolding in interface EmbosserProperties
        Returns:
        returns true if this embosser supports z-folding, false otherwise.
      • supportsPrintMode

        public boolean supportsPrintMode​(EmbosserProperties.PrintMode mode)
        Description copied from interface: EmbosserProperties
        Returns true if this embosser supports magazine layout. This indicates that the embosser can reorder pages and emboss two pages side-by-side on the same side of the paper (and two more on the other side), so that a readable document is created by stapling and folding the output stack in the middle.
        Specified by:
        supportsPrintMode in interface EmbosserProperties
        Returns:
        returns true if this embosser supports magazine layout, false otherwise.