com.openpcl.pclrenderimage.render
Class PriDrawText

java.lang.Object
  extended by com.openpcl.pclrenderimage.render.PriDrawText
All Implemented Interfaces:
IPluginHooksPriDrawText

public class PriDrawText
extends Object
implements IPluginHooksPriDrawText

Handle all the text drawing. The extra optional code is if a boolean is set true, it draws a box around each character cell and draws left and right guidlines to see if each character is centered horizontally in its character cell box. Then there is more optional code that centers each char in it char cell box. Then the 3rd optional code draws an underline below the chars that were bumped to center the char in its cell. The user can hit Ctrl-B to toggle on and off the underlines below the chars that were centered.

Author:
howard 5/17/2006

Field Summary
protected  Graphics2D mGraphics2D
           
protected  int mNumWidthPixelsInternalPrinterFont
           
protected  PclRenderImage mPclRenderImage
           
protected  PriBitmapCharacter mPriBitmapCharacter
           
protected  PriBitmapFont mPriBitmapFont
           
protected  PriFontBase mPriFontBase
           
protected  PriFontManager mPriFontManager
           
protected  PriPclContext mPriPclContext
           
protected  int mSelectedSoftFontId
           
 
Constructor Summary
PriDrawText(PclRenderImage pPclRenderImage)
          Constructor without passing the Graphics2D.
PriDrawText(PclRenderImage pPclRenderImage, Graphics2D pGraphics2D)
          Constructor
 
Method Summary
 void drawBufferedUpCharsAs1String()
          Draw buffered up chars as one String.
 void drawThisChar(char pCharToDraw)
          Draw one char on the image.
 void freeUpMemory()
          When the user is done with this rendering session, then free up memory.
 void setToInitialValues()
          Set to initial values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPclRenderImage

protected PclRenderImage mPclRenderImage

mGraphics2D

protected Graphics2D mGraphics2D

mSelectedSoftFontId

protected int mSelectedSoftFontId

mNumWidthPixelsInternalPrinterFont

protected int mNumWidthPixelsInternalPrinterFont

mPriPclContext

protected PriPclContext mPriPclContext

mPriFontManager

protected PriFontManager mPriFontManager

mPriFontBase

protected PriFontBase mPriFontBase

mPriBitmapFont

protected PriBitmapFont mPriBitmapFont

mPriBitmapCharacter

protected PriBitmapCharacter mPriBitmapCharacter
Constructor Detail

PriDrawText

public PriDrawText(PclRenderImage pPclRenderImage,
                   Graphics2D pGraphics2D)
Constructor

Parameters:
pPclRenderImage -
pGraphics2D -

PriDrawText

public PriDrawText(PclRenderImage pPclRenderImage)
Constructor without passing the Graphics2D. Needed for subclasses that don't use the Graphics2D, so don't delete or change this constructor.

Parameters:
pPclRenderImage -
Method Detail

setToInitialValues

public void setToInitialValues()
Set to initial values. Subclass plugins override this method so do not delete or rename this method.

Specified by:
setToInitialValues in interface IPluginHooksPriDrawText

freeUpMemory

public void freeUpMemory()
When the user is done with this rendering session, then free up memory. Subclass plugins override this method so do not delete or rename this method.

Specified by:
freeUpMemory in interface IPluginHooksPriDrawText

drawThisChar

public void drawThisChar(char pCharToDraw)
Draw one char on the image. Subclass plugins override this method so do not delete or rename this method.

Specified by:
drawThisChar in interface IPluginHooksPriDrawText

drawBufferedUpCharsAs1String

public void drawBufferedUpCharsAs1String()
Draw buffered up chars as one String. Overridden methods in a subclass of this class will have code to buffer up viewable text, and write out the text as one write operation to save space in it's output stream. For example, a subclass plugin that has this method can "save to a PDF file" by using the itext.jar classes. The output .PDF file will be much bigger if chars are written to the PDF file one at a time compared to one write operation for the string of chars.

PclRenderImage uses the internal printer font character width tables, so for printing, chars drawn one at a time outside of this method. However, code in this method here is for viewing only, and not printing.

If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt.
Subclass plugins override this method so do not delete or rename this method.

Specified by:
drawBufferedUpCharsAs1String in interface IPluginHooksPriDrawText


OpenPCL http://www.openpcl.com