Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## superwaba.ext.xplat.io.print
Class PrintManager

    java.lang.Object
      |
      +--superwaba.ext.xplat.io.print.PrintManager

public abstract class PrintManager
extends Object

This class represents a print manager, which is extended by the drivers to provide a common way to handle the printer. Please be careful when using these methods; any error may freeze the device.

This is not free software. This library can be purchased at the SuperWaba site.

Field Summary
`protected superwaba.ext.xplat.io.print.Graphics` | `g` The Graphics instance that may be assigned to this print manager
`protected superwaba.ext.xplat.io.print.Settings` | `set` The Settings instance that may be assigned to this print manager
`protected TypeWriter` | `tw` The TypeWriter instance that may be assigned to this print manager

Constructor Summary
`protected` | `PrintManager()` This class cannot be instantiated by its constructor

Method Summary
`abstract void` | `close()` Closes this print manager.
`abstract void` | `finishPage()` Ends a page, flushing the contents.
`abstract void` | `formFeed()` Do a form feed.
`abstract String` | `getDetailedErrorMessage(superwaba.ext.xplat.io.print.PrinterException e)` Given the PrinterException, returns a detailed error message for the problem.
`abstract superwaba.ext.xplat.io.print.FontMetrics` | `getFontMetrics(superwaba.ext.xplat.io.print.Font f)` Gets a FontMetrics object for the given font
`superwaba.ext.xplat.io.print.Graphics` | `getGraphics()` May return the Graphics instance if this print manager was opened using textMode = true.
`superwaba.ext.xplat.io.print.Settings` | `getSettings()` Will return the Settings instance assigned to this print manager
`TypeWriter` | `getTypeWriter()` May return the TypeWritter instance if this print manager was opened using textMode = false.
`abstract void` | `open(String printerName, String portName, int baudRate, boolean textMode)` This method must be extended and must set the fields Graphics, TypeWriter and Settings accordingly.
`abstract void` | `startPage()` Start a new page.
`abstract int` | `writeBytes(byte[] buf, int start, int len)` Send bytes to the printer, usualy scape codes and contents

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, toString, wait, wait`

Field Detail

### g

    protected superwaba.ext.xplat.io.print.Graphics g

  The Graphics instance that may be assigned to this print manager

### tw

    protected TypeWriter tw

  The TypeWriter instance that may be assigned to this print manager

### set

    protected superwaba.ext.xplat.io.print.Settings set

  The Settings instance that may be assigned to this print manager

Constructor Detail

### PrintManager

    protected PrintManager()

  This class cannot be instantiated by its constructor

Method Detail

### open

    public abstract void open(String printerName,
                              String portName,
                              int baudRate,
                              boolean textMode)
                       throws superwaba.ext.xplat.io.print.PrinterException

  This method must be extended and must set the fields Graphics, TypeWriter and Settings accordingly. Not all fields are required to be used.

### getGraphics

    public superwaba.ext.xplat.io.print.Graphics getGraphics()
                                                      throws superwaba.ext.xplat.io.print.NotSupportedException

  May return the Graphics instance if this print manager was opened using textMode = true. Will throw NotSupportedException otherwise.

### getTypeWriter

    public TypeWriter getTypeWriter()
                             throws superwaba.ext.xplat.io.print.NotSupportedException

  May return the TypeWritter instance if this print manager was opened using textMode = false. Will throw NotSupportedException otherwise.

### getSettings

    public superwaba.ext.xplat.io.print.Settings getSettings()

  Will return the Settings instance assigned to this print manager

### getFontMetrics

    public abstract superwaba.ext.xplat.io.print.FontMetrics getFontMetrics(superwaba.ext.xplat.io.print.Font f)

  Gets a FontMetrics object for the given font

### close

    public abstract void close()
                        throws superwaba.ext.xplat.io.print.PrinterException

  Closes this print manager.

### formFeed

    public abstract void formFeed()
                           throws superwaba.ext.xplat.io.print.PrinterException,
                                  superwaba.ext.xplat.io.print.NotSupportedException

  Do a form feed. You must always call formFeed before calling finishPage.

### startPage

    public abstract void startPage()
                            throws superwaba.ext.xplat.io.print.PrinterException

  Start a new page. You must always start a new page before writting to the printer.

### finishPage

    public abstract void finishPage()
                             throws superwaba.ext.xplat.io.print.PrinterException

  Ends a page, flushing the contents. You must always call formFeed before calling finishPage.

### writeBytes

    public abstract int writeBytes(byte[] buf,
                                   int start,
                                   int len)
                            throws superwaba.ext.xplat.io.print.PrinterException,
                                   ArrayIndexOutOfBoundsException,
                                   superwaba.ext.xplat.io.print.NotSupportedException

  Send bytes to the printer, usualy scape codes and contents

### getDetailedErrorMessage

    public abstract String getDetailedErrorMessage(superwaba.ext.xplat.io.print.PrinterException e)

  Given the PrinterException, returns a detailed error message for the problem.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD