|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.Captcha
public class Captcha
Captcha Image Generator
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ALPHA
|
static java.lang.String |
DEFAULT_FONT_NAME
|
static int |
DEFAULT_FONT_SIZE
|
static int |
DEFAULT_FONT_STYLE
|
static int |
DEFAULT_HEIGHT
|
static boolean |
DEFAULT_IGNORE_CASE
|
static int |
DEFAULT_SYMBOL_COUNT
|
static int |
DEFAULT_WIDTH
|
Constructor Summary | |
---|---|
Captcha()
Constructor |
|
Captcha(int symCount)
Constructor |
|
Captcha(java.lang.String alphabet,
boolean ignoreCase,
int symCount)
Constructor |
Method Summary | |
---|---|
protected java.awt.Font |
getFont(int size)
Gets the captch font |
byte[] |
getImageBytes()
Creates/returns the Captch image as a byte array |
byte[] |
getImageBytes(java.awt.Color bgColor,
int width,
int height)
Creates/returns the Captch image as a byte array |
byte[] |
getImageBytes(int width,
int height)
Creates/returns the Captch image as a byte array |
protected java.util.Random |
getRandom()
Gets the Captcha value randomizer |
java.lang.String |
getValue()
Gets the target value of this captcha |
static void |
main(java.lang.String[] argv)
|
java.io.OutputStream |
writeImage(java.awt.Color bgColor,
int width,
int height,
java.io.OutputStream output)
Writes the captcha image to the specified OutputStream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ALPHA
public static final boolean DEFAULT_IGNORE_CASE
public static final int DEFAULT_SYMBOL_COUNT
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final java.lang.String DEFAULT_FONT_NAME
public static final int DEFAULT_FONT_STYLE
public static final int DEFAULT_FONT_SIZE
Constructor Detail |
---|
public Captcha()
public Captcha(int symCount)
public Captcha(java.lang.String alphabet, boolean ignoreCase, int symCount)
Method Detail |
---|
protected java.util.Random getRandom()
protected java.awt.Font getFont(int size)
public java.lang.String getValue()
public java.io.OutputStream writeImage(java.awt.Color bgColor, int width, int height, java.io.OutputStream output)
bgColor
- The background colorwidth
- The captcha image widthheight
- The captcha image heightoutput
- The OutputStream to which the image is written
public byte[] getImageBytes()
public byte[] getImageBytes(int width, int height)
width
- The captcha image widthheight
- The captcha image height
public byte[] getImageBytes(java.awt.Color bgColor, int width, int height)
bgColor
- The background colorwidth
- The captcha image widthheight
- The captcha image height
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |