superwaba.ext.xplat.io.print.pboy
Class PBoyGraphics

java.lang.Object
  |
  +--superwaba.ext.xplat.io.print.Graphics
        |
        +--superwaba.ext.xplat.io.print.pboy.PBoyGraphics

public class PBoyGraphics
extends Graphics

Implementation of the print.Graphics class for the PrintBoy support under SuperWaba.


Method Summary
 void drawImage(Image img, int x, int y)
          Draws an image as in the given position.
 void drawImage(Image img, int x, int y, float scale)
          Draws an image scaled with the given scale.
 void drawLine(int ax, int ay, int bx, int by)
          Draws a line from ax,ay to bx,by using the current foreground color.
 void drawRect(int x, int y, int width, int height)
          Draws a rectangle with the given parameters using the current foreground color.
 void drawRoundRect(int x, int y, int width, int height, int r)
          Draws a round rectangle with the given parameters using the current foreground color.
 void drawText(java.lang.String text, int x, int y)
          Draws the given text in the given position, using the currently selected font and using the current foreground color.
 void fillRect(int x, int y, int width, int height)
          Fills a rectangle with the given parameters using the current background color.
 void fillRoundRect(int x, int y, int width, int height, int r)
          Fills a round rectangle with the given parameters using the current background color.
 void setBackColor(Color c)
          In most printers, setting from anything than Color.BLACK will turn gray what you draw.
 void setFont(Font font)
          Sets the font to the given font.
 void setForeColor(Color c)
          In most printers, setting from anything than Color.BLACK will turn gray what you draw.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setFont

public void setFont(Font font)
             throws PrinterException,
                    NotSupportedException
Sets the font to the given font.
Overrides:
setFont in class Graphics

drawImage

public void drawImage(Image img,
                      int x,
                      int y)
               throws PrinterException,
                      NotSupportedException
Draws an image as in the given position. Note that in Palm OS < 3.5, the image is converted to black and white before printing. Also, some printers may not support grayscale or color images even in newer Palm OS versions.
Overrides:
drawImage in class Graphics

drawImage

public void drawImage(Image img,
                      int x,
                      int y,
                      float scale)
               throws PrinterException,
                      NotSupportedException
Draws an image scaled with the given scale. You may use values like 2 or 0.5. Not all printers support this feature
Overrides:
drawImage in class Graphics

drawText

public void drawText(java.lang.String text,
                     int x,
                     int y)
              throws PrinterException,
                     NotSupportedException
Draws the given text in the given position, using the currently selected font and using the current foreground color.
Overrides:
drawText in class Graphics

setForeColor

public void setForeColor(Color c)
In most printers, setting from anything than Color.BLACK will turn gray what you draw.
Overrides:
setForeColor in class Graphics

setBackColor

public void setBackColor(Color c)
In most printers, setting from anything than Color.BLACK will turn gray what you draw.
Overrides:
setBackColor in class Graphics

drawLine

public void drawLine(int ax,
                     int ay,
                     int bx,
                     int by)
              throws PrinterException,
                     NotSupportedException
Draws a line from ax,ay to bx,by using the current foreground color. Note that some printers do not support diagonal lines.
Overrides:
drawLine in class Graphics

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int r)
                   throws PrinterException,
                          NotSupportedException
Draws a round rectangle with the given parameters using the current foreground color.
Overrides:
drawRoundRect in class Graphics

drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height)
              throws PrinterException,
                     NotSupportedException
Draws a rectangle with the given parameters using the current foreground color.
Overrides:
drawRect in class Graphics

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int r)
                   throws PrinterException,
                          NotSupportedException
Fills a round rectangle with the given parameters using the current background color.
Overrides:
fillRoundRect in class Graphics

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
              throws PrinterException,
                     NotSupportedException
Fills a rectangle with the given parameters using the current background color.
Overrides:
fillRect in class Graphics