nl.captcha
Class Captcha.Builder

java.lang.Object
  extended by nl.captcha.Captcha.Builder
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Captcha

public static class Captcha.Builder
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Captcha.Builder(int width, int height)
           
 
Method Summary
 Captcha.Builder addBackground()
          Add a background using the default BackgroundProducer (a TransparentBackgroundProducer).
 Captcha.Builder addBackground(BackgroundProducer bgProd)
          Add a background using the given BackgroundProducer.
 Captcha.Builder addBorder()
          Draw a single-pixel wide black border around the image.
 Captcha.Builder addNoise()
          Add noise using the default NoiseProducer (a CurvedLineNoiseProducer).
 Captcha.Builder addNoise(NoiseProducer nProd)
          Add noise using the given NoiseProducer.
 Captcha.Builder addText()
          Generate the answer to the CAPTCHA using the DefaultTextProducer.
 Captcha.Builder addText(TextProducer txtProd)
          Generate the answer to the CAPTCHA using the given TextProducer.
 Captcha.Builder addText(TextProducer txtProd, WordRenderer wRenderer)
          Generate the answer to the CAPTCHA using the given TextProducer, and render it to the image using the given WordRenderer.
 Captcha.Builder addText(WordRenderer wRenderer)
          Generate the answer to the CAPTCHA using the default TextProducer, and render it to the image using the given WordRenderer.
 Captcha build()
          Build the CAPTCHA.
 Captcha.Builder gimp()
          Gimp the image using the default GimpyRenderer (a RippleGimpyRenderer).
 Captcha.Builder gimp(GimpyRenderer gimpy)
          Gimp the image using the given GimpyRenderer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Captcha.Builder

public Captcha.Builder(int width,
                       int height)
Method Detail

addBackground

public Captcha.Builder addBackground()
Add a background using the default BackgroundProducer (a TransparentBackgroundProducer).


addBackground

public Captcha.Builder addBackground(BackgroundProducer bgProd)
Add a background using the given BackgroundProducer.

Parameters:
bgProd -

addText

public Captcha.Builder addText()
Generate the answer to the CAPTCHA using the DefaultTextProducer.


addText

public Captcha.Builder addText(TextProducer txtProd)
Generate the answer to the CAPTCHA using the given TextProducer.

Parameters:
txtProd -

addText

public Captcha.Builder addText(WordRenderer wRenderer)
Generate the answer to the CAPTCHA using the default TextProducer, and render it to the image using the given WordRenderer.

Parameters:
wRenderer -

addText

public Captcha.Builder addText(TextProducer txtProd,
                               WordRenderer wRenderer)
Generate the answer to the CAPTCHA using the given TextProducer, and render it to the image using the given WordRenderer.

Parameters:
txtProd -
wRenderer -

addNoise

public Captcha.Builder addNoise()
Add noise using the default NoiseProducer (a CurvedLineNoiseProducer).


addNoise

public Captcha.Builder addNoise(NoiseProducer nProd)
Add noise using the given NoiseProducer.

Parameters:
nProd -

gimp

public Captcha.Builder gimp()
Gimp the image using the default GimpyRenderer (a RippleGimpyRenderer).


gimp

public Captcha.Builder gimp(GimpyRenderer gimpy)
Gimp the image using the given GimpyRenderer.

Parameters:
gimpy -

addBorder

public Captcha.Builder addBorder()
Draw a single-pixel wide black border around the image.


build

public Captcha build()
Build the CAPTCHA. This method should always be called, and should always be called last.

Returns:
The constructed CAPTCHA.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010-2011 James Childers. All Rights Reserved.