com.octo.captcha.component.image.textpaster
Class AbstractTextPaster

java.lang.Object
  extended by com.octo.captcha.component.image.textpaster.AbstractTextPaster
All Implemented Interfaces:
TextPaster
Direct Known Subclasses:
DecoratedRandomTextPaster, GlyphsPaster, NonLinearRandomAngleTextPaster, NonLinearTextPaster, RandomTextPaster, SimpleTextPaster, VisitedAndDecoratedTextPaster

public abstract class AbstractTextPaster
extends java.lang.Object
implements TextPaster

Base class for Test pasters. Sub classes must implement the pasteText(BufferedImage background, AttributedString attributedWord) method that return an image containing the pasted string.
use constructor to specify your paster properties. This base class use two Integers, maxAcceptedWordLength and minAcceptedWordLength by wich are the length boundaries for the implementation. By default minAcceptedWordLength = 6 and maxAcceptedWordLength = 20


Field Summary
 java.util.Random myRandom
          Comment for myRandom
 
Method Summary
protected  ColorGenerator getColorGenerator()
           
 int getMaxAcceptedWordLenght()
          Deprecated. misspelled, use getMaxAcceptedWordLength() instead
 int getMaxAcceptedWordLength()
           
 int getMinAcceptedWordLenght()
          Deprecated. misspelled, use getMinAcceptedWordLength() instead
 int getMinAcceptedWordLength()
           
 boolean isManageColorPerGlyph()
           
 void setColorGenerator(ColorGenerator colorGenerator)
           
 
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.textpaster.TextPaster
pasteText
 

Field Detail

myRandom

public java.util.Random myRandom
Comment for myRandom

Method Detail

getMaxAcceptedWordLenght

public int getMaxAcceptedWordLenght()
Deprecated. misspelled, use getMaxAcceptedWordLength() instead

Returns:
the max word length accepted by this word2image service

getMinAcceptedWordLenght

public int getMinAcceptedWordLenght()
Deprecated. misspelled, use getMinAcceptedWordLength() instead

Returns:
the min word length accepted by this word2image service

getMaxAcceptedWordLength

public int getMaxAcceptedWordLength()
Specified by:
getMaxAcceptedWordLength in interface TextPaster
Returns:
the max word length accepted by this word2image service

getMinAcceptedWordLength

public int getMinAcceptedWordLength()
Specified by:
getMinAcceptedWordLength in interface TextPaster
Returns:
the min word length accepted by this word2image service

getColorGenerator

protected ColorGenerator getColorGenerator()
Returns:
the color generator

isManageColorPerGlyph

public boolean isManageColorPerGlyph()
Returns:
true if this component manage color per glyph

setColorGenerator

public void setColorGenerator(ColorGenerator colorGenerator)
Parameters:
colorGenerator -


Copyright 2003-2009 JCaptcha. All Rights Reserved.