com.github.cage
Class YCage

java.lang.Object
  extended by com.github.cage.Cage
      extended by com.github.cage.YCage

public class YCage
extends Cage

Creates and configures a Cage instance that can generate captcha images similar to Yahoo's. This is the "Y" template. Simply create an instance with new YCage() and you can generate images. See Cage for more info. This class is thread safe.

Author:
akiraly

Field Summary
protected static int HEIGHT
          Height of CAPTCHA image.
protected static char[] TOKEN_DEFAULT_CHARACTER_SET
          Character set supplied to the RandomTokenGenerator used by this template.
protected static int TOKEN_LEN_DELTA
          Maximum length of token is 6 + 2.
protected static int TOKEN_LEN_MIN
          Minimum length of token.
protected static int WIDTH
          Width of CAPTCHA image.
 
Fields inherited from class com.github.cage.Cage
DEFAULT_COMPRESS_RATIO, DEFAULT_FORMAT
 
Constructor Summary
  YCage()
          Constructor.
protected YCage(Random rnd)
          Constructor.
 
Method Summary
 
Methods inherited from class com.github.cage.Cage
draw, draw, drawImage, getCompressRatio, getFonts, getForegrounds, getFormat, getPainter, getTokenGenerator, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEIGHT

protected static final int HEIGHT
Height of CAPTCHA image.

See Also:
Constant Field Values

WIDTH

protected static final int WIDTH
Width of CAPTCHA image.

See Also:
Constant Field Values

TOKEN_DEFAULT_CHARACTER_SET

protected static final char[] TOKEN_DEFAULT_CHARACTER_SET
Character set supplied to the RandomTokenGenerator used by this template.


TOKEN_LEN_MIN

protected static final int TOKEN_LEN_MIN
Minimum length of token.

See Also:
Constant Field Values

TOKEN_LEN_DELTA

protected static final int TOKEN_LEN_DELTA
Maximum length of token is 6 + 2.

See Also:
Constant Field Values
Constructor Detail

YCage

public YCage()
Constructor.


YCage

protected YCage(Random rnd)
Constructor.

Parameters:
rnd - object used for random value generation. Not null.


Copyright © 2011. All Rights Reserved.