com.octo.captcha.component.image.wordtoimage
Class AbstractWordToImage

java.lang.Object
  extended by com.octo.captcha.component.image.wordtoimage.AbstractWordToImage
All Implemented Interfaces:
WordToImage
Direct Known Subclasses:
ComposedWordToImage, SimpleWordToImage

public abstract class AbstractWordToImage
extends java.lang.Object
implements WordToImage

Implementation skeleton for the WordToImage component

Basically this class implements the imageFromWord method proceding as folow :

This class implements the Template method pattern from the GOF design patterns.

Version:
1.0
Author:
Marc-Antoine Garrigue

Constructor Summary
protected AbstractWordToImage()
           
protected AbstractWordToImage(boolean manageFontByCharacter)
           
 
Method Summary
 java.awt.image.BufferedImage getImage(java.lang.String word)
          Creates an image of the provided String This method is a skeleton for creation algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.octo.captcha.component.image.wordtoimage.WordToImage
getImageHeight, getImageWidth, getMaxAcceptedWordLength, getMinAcceptedWordLength, getMinFontSize
 

Constructor Detail

AbstractWordToImage

protected AbstractWordToImage()

AbstractWordToImage

protected AbstractWordToImage(boolean manageFontByCharacter)
Method Detail

getImage

public java.awt.image.BufferedImage getImage(java.lang.String word)
                                      throws CaptchaException
Creates an image of the provided String This method is a skeleton for creation algorithm. it proceeds as folows :

Specified by:
getImage in interface WordToImage
Returns:
an image representation of the word
Throws:
CaptchaException - if word is invalid or if image generation fails.


Copyright © 2003-2011 JCaptcha corp.. All Rights Reserved.