com.octo.captcha.component.image.backgroundgenerator
Class MultipleShapeBackgroundGenerator

java.lang.Object
  extended by com.octo.captcha.component.image.backgroundgenerator.AbstractBackgroundGenerator
      extended by com.octo.captcha.component.image.backgroundgenerator.MultipleShapeBackgroundGenerator
All Implemented Interfaces:
BackgroundGenerator

public class MultipleShapeBackgroundGenerator
extends AbstractBackgroundGenerator

Draw mutliple different shape with different colors. see attributes to construct it in a proper way.


Constructor Summary
MultipleShapeBackgroundGenerator(java.lang.Integer width, java.lang.Integer height)
           
MultipleShapeBackgroundGenerator(java.lang.Integer width, java.lang.Integer height, java.awt.Color firstEllipseColor, java.awt.Color secondEllipseColor, java.lang.Integer spaceBetweenLine, java.lang.Integer spaceBetweenCircle, java.lang.Integer ellipseHeight, java.lang.Integer ellipseWidth, java.awt.Color firstRectangleColor, java.awt.Color secondRectangleColor, java.lang.Integer rectangleWidth)
           
 
Method Summary
 java.awt.image.BufferedImage getBackground()
          Main method.
protected  int getEllipseHeight()
          Helper method to get the height of drawn ellipses.
protected  int getEllipseWidth()
          Helper method to get the width of drawn ellipses.
protected  int getRectangleWidth()
          Helper method to get the width of drawn rectangles.
protected  int getSpaceBetweenCircle()
          Helper method to get the int value of the number of pixels between circles.
protected  int getSpaceBetweenLine()
          Helper method to get the int value of the number of pixels between lines.
 
Methods inherited from class com.octo.captcha.component.image.backgroundgenerator.AbstractBackgroundGenerator
getImageHeight, getImageWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleShapeBackgroundGenerator

public MultipleShapeBackgroundGenerator(java.lang.Integer width,
                                        java.lang.Integer height)

MultipleShapeBackgroundGenerator

public MultipleShapeBackgroundGenerator(java.lang.Integer width,
                                        java.lang.Integer height,
                                        java.awt.Color firstEllipseColor,
                                        java.awt.Color secondEllipseColor,
                                        java.lang.Integer spaceBetweenLine,
                                        java.lang.Integer spaceBetweenCircle,
                                        java.lang.Integer ellipseHeight,
                                        java.lang.Integer ellipseWidth,
                                        java.awt.Color firstRectangleColor,
                                        java.awt.Color secondRectangleColor,
                                        java.lang.Integer rectangleWidth)
Method Detail

getBackground

public java.awt.image.BufferedImage getBackground()
Main method. It generates a background of the captcha with a large number of lines, ellipse, and gradient paint.

Returns:
the background full of shapes

getSpaceBetweenLine

protected int getSpaceBetweenLine()
Helper method to get the int value of the number of pixels between lines.

Returns:
number of pixels between lines.

getSpaceBetweenCircle

protected int getSpaceBetweenCircle()
Helper method to get the int value of the number of pixels between circles.

Returns:
number of pixels between circles.

getEllipseHeight

protected int getEllipseHeight()
Helper method to get the height of drawn ellipses.

Returns:
height of ellipses.

getEllipseWidth

protected int getEllipseWidth()
Helper method to get the width of drawn ellipses.

Returns:
width of ellipses.

getRectangleWidth

protected int getRectangleWidth()
Helper method to get the width of drawn rectangles.

Returns:
width of rectangles.


Copyright 2003-2009 JCaptcha. All Rights Reserved.