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

java.lang.Object
  extended by com.octo.captcha.component.image.textpaster.AbstractTextPaster
      extended by com.octo.captcha.component.image.textpaster.RandomTextPaster
          extended by com.octo.captcha.component.image.textpaster.BaffleRandomTextPaster
All Implemented Interfaces:
TextPaster

Deprecated. use the DecoratedRandomTextPaster instead

public class BaffleRandomTextPaster
extends RandomTextPaster

text paster that paint white holes on the string (erase some parts)

You may specify the number of holes per glyph : 3 by default. You may specify the color of holes : TextColor by default.

See Also:
{http://www.parc.xerox.com/research/istl/projects/captcha/default.html}

Field Summary
 
Fields inherited from class com.octo.captcha.component.image.textpaster.RandomTextPaster
kerning, textColors
 
Fields inherited from class com.octo.captcha.component.image.textpaster.AbstractTextPaster
myRandom
 
Constructor Summary
BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength, java.lang.Integer maxAcceptedWordLength, ColorGenerator colorGenerator, java.lang.Boolean manageColorPerGlyph, java.lang.Integer numberOfHolesPerGlyph, java.awt.Color holesColor)
          Deprecated.  
BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength, java.lang.Integer maxAcceptedWordLength, ColorGenerator colorGenerator, java.lang.Boolean manageColorPerGlyph, java.lang.Integer numberOfHolesPerGlyph, ColorGenerator holesColorGenerator)
          Deprecated.  
BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength, java.lang.Integer maxAcceptedWordLength, ColorGenerator colorGenerator, java.lang.Integer numberOfHolesPerGlyph, java.awt.Color holesColor)
          Deprecated.  
BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength, java.lang.Integer maxAcceptedWordLength, java.awt.Color textColor, java.lang.Integer numberOfHolesPerGlyph, java.awt.Color holesColor)
          Deprecated.  
 
Method Summary
 java.awt.image.BufferedImage pasteText(java.awt.image.BufferedImage background, java.text.AttributedString attributedWord)
          Deprecated. Pastes the attributed string on the backround image and return the final image.
 
Methods inherited from class com.octo.captcha.component.image.textpaster.AbstractTextPaster
getColorGenerator, getMaxAcceptedWordLenght, getMaxAcceptedWordLength, getMinAcceptedWordLenght, getMinAcceptedWordLength, isManageColorPerGlyph, setColorGenerator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaffleRandomTextPaster

public BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength,
                              java.lang.Integer maxAcceptedWordLength,
                              java.awt.Color textColor,
                              java.lang.Integer numberOfHolesPerGlyph,
                              java.awt.Color holesColor)
Deprecated. 
Parameters:
minAcceptedWordLength - Max length of a word
maxAcceptedWordLength - Min length of a word
textColor - Unique color of text
holesColor - Color of the holes

BaffleRandomTextPaster

public BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength,
                              java.lang.Integer maxAcceptedWordLength,
                              ColorGenerator colorGenerator,
                              java.lang.Integer numberOfHolesPerGlyph,
                              java.awt.Color holesColor)
Deprecated. 
Parameters:
minAcceptedWordLength - Max length of a word
maxAcceptedWordLength - Min length of a word
colorGenerator - Color generatior for the text
numberOfHolesPerGlyph - Number of holes around glyphes
holesColor - The color for the glyphs (one color for all glyphes)

BaffleRandomTextPaster

public BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength,
                              java.lang.Integer maxAcceptedWordLength,
                              ColorGenerator colorGenerator,
                              java.lang.Boolean manageColorPerGlyph,
                              java.lang.Integer numberOfHolesPerGlyph,
                              java.awt.Color holesColor)
Deprecated. 
Parameters:
minAcceptedWordLength - Max length of a word
maxAcceptedWordLength - Min length of a word
colorGenerator - Color generatior for the text
manageColorPerGlyph - Boolean to set if each glyph can have a new color from the color generator
numberOfHolesPerGlyph - Number of holes around glyphes
holesColor - The color for the glyphs (one color for all glyphes)

BaffleRandomTextPaster

public BaffleRandomTextPaster(java.lang.Integer minAcceptedWordLength,
                              java.lang.Integer maxAcceptedWordLength,
                              ColorGenerator colorGenerator,
                              java.lang.Boolean manageColorPerGlyph,
                              java.lang.Integer numberOfHolesPerGlyph,
                              ColorGenerator holesColorGenerator)
Deprecated. 
Parameters:
minAcceptedWordLength - Max length of a word
maxAcceptedWordLength - Min length of a word
colorGenerator - Color generatior for the text
manageColorPerGlyph - Boolean to set if each glyph can have a new color from the color generator
numberOfHolesPerGlyph - Number of holes around the glyph
holesColorGenerator - The color genator for the glyphs (one color for all glyph)
Method Detail

pasteText

public java.awt.image.BufferedImage pasteText(java.awt.image.BufferedImage background,
                                              java.text.AttributedString attributedWord)
                                       throws CaptchaException
Deprecated. 
Pastes the attributed string on the backround image and return the final image. Implementation must take into account the fact that the text must be readable by human and non by programs

Specified by:
pasteText in interface TextPaster
Overrides:
pasteText in class RandomTextPaster
Returns:
the final image
Throws:
CaptchaException - if any exception accurs during paste routine.


Copyright 2003-2009 JCaptcha. All Rights Reserved.