net.sourceforge.barbecue.output
Interface Output

All Known Implementing Classes:
AbstractOutput

public interface Output


Method Summary
 void beginDraw()
          Sets up the drawing environment.
 int drawBar(int x, int y, int width, int height, boolean paintWithForegroundColor)
          "Draws" a bar at the given coordinates.
 int drawText(java.lang.String text, LabelLayout layout)
          Draw the specified text.
 void endDraw(int width, int height)
          Balanced with startDraw(), used for caching, output of epilogues.
 void paintBackground(int x, int y, int width, int height)
          Paint the background the background colour, based on the height and the width.
 void toggleDrawingColor()
          Swaps the foreground and background colours of the output.
 

Method Detail

drawBar

public int drawBar(int x,
                   int y,
                   int width,
                   int height,
                   boolean paintWithForegroundColor)
            throws OutputException
"Draws" a bar at the given coordinates.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width
height - the height
paintWithForegroundColor - if true, use the foreground color, otherwise use the background color
Returns:
the width of the bar drawn
Throws:
OutputException

beginDraw

public void beginDraw()
               throws OutputException
Sets up the drawing environment. Called before drawing starts. Matched with call to endDraw() at the end. This allows for caching as needed.

Throws:
OutputException

endDraw

public void endDraw(int width,
                    int height)
             throws OutputException
Balanced with startDraw(), used for caching, output of epilogues.

Parameters:
width - The output width (in pixels) of the barcode
height - The output height (in pixels) of the barcode.
Throws:
OutputException

drawText

public int drawText(java.lang.String text,
                    LabelLayout layout)
             throws OutputException
Draw the specified text.

Parameters:
text - text to draw
layout - the text layout calculator
Returns:
the height of this text
Throws:
OutputException

toggleDrawingColor

public void toggleDrawingColor()
Swaps the foreground and background colours of the output.


paintBackground

public void paintBackground(int x,
                            int y,
                            int width,
                            int height)
Paint the background the background colour, based on the height and the width.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width to be painted
height - the height to be painted


Copyright © 2003-2007 barbecue.sourceforge.net. All Rights Reserved.