Method Summary |
|
public void | addFont(Font font) Add fonts into fonts list. |
static int | decode(String color) |
public String | getBgColor() Get the background color of the captcha box (in string as #RRGGBB). |
public int | getBgRGB() Get the background color in int array (0: red, 1: green, 2:blue). |
public CaptchaEngine | getCaptchaEngine() Get the captcha engine. |
public Font[] | getDefaultFonts() Gets the default font list. |
public String | getExclude() Get exclude characters. |
public Font | getFont(int j) Get nth Font. |
public String | getFontColor() Gets font color. |
public int | getFontRGB() Get the font color in int array (0: red, 1: green, 2:blue). |
public List | getFonts() Gets fonts list, default provide two fonts. |
public int | getIntHeight() Get the captcha int height in pixel; to be used by the derived subclass. |
public int | getIntWidth() Get the captcha int width in pixel; to be used by the derived subclass. |
public int | getLength() Get length of the autogenerated text value; default to 5. |
public String | getValue() Get the text value of this captcha. |
public boolean | isNoise() Whether generate noise; default to true. |
protected CaptchaEngine | newCaptchaEngine() Instantiates the default captcha engine.
It is called, if
Captcha.setEngine is not called with non-null
engine.
By default, it looks up the component attribute called
captcha-engine. |
public String | randomValue() Regenerates new captcha text value and redraw. |
public void | setBgColor(String color) Set the background color of the chart. |
public void | setEngine(String clsnm) Sets the captcha engine by use of a class name. |
public void | setEngine(CaptchaEngine engine) Set the captcha engine. |
public void | setExclude(String exclude) Set exclude characters that will not be generated. |
public void | setFontColor(String color) Set font color. |
public void | setHeight(String h) Override super class to prepare the int height. |
public void | setLength(int len) Set length of the autogenerated text value; default to 5. |
public void | setNoise(boolean b) Wheather generate noise; default to true. |
public void | setValue(String text) Set the text value to be shown as the distortion captcha. |
public void | setWidth(String w) Override super class to prepare the int width. |
protected void | smartDrawCaptcha() mark a draw flag to inform that this Chart needs update. |