1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.octo.captcha.engine.image.gimpy;
20
21 import com.octo.captcha.component.image.backgroundgenerator.BackgroundGenerator;
22 import com.octo.captcha.component.image.backgroundgenerator.FunkyBackgroundGenerator;
23 import com.octo.captcha.component.image.fontgenerator.FontGenerator;
24 import com.octo.captcha.component.image.fontgenerator.TwistedAndShearedRandomFontGenerator;
25 import com.octo.captcha.component.image.textpaster.RandomTextPaster;
26 import com.octo.captcha.component.image.textpaster.TextPaster;
27
28 import java.awt.*;
29
30 /***
31 * <p>Description: </p>
32 *
33 * @author <a href="mailto:mga@octo.com">Mathieu Gandin</a>
34 * @version 1.0
35 */
36 public class SimpleListImageCaptchaEngine
37 extends com.octo.captcha.engine.image.ListImageCaptchaEngine {
38
39 protected void buildInitialFactories() {
40 com.octo.captcha.component.word.wordgenerator.WordGenerator wordGenerator = new com.octo.captcha.component.word.wordgenerator.RandomWordGenerator(
41 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
42 TextPaster textPaster = new RandomTextPaster(new Integer(5),
43 new Integer(8), Color.white);
44 BackgroundGenerator backgroundGenerator = new FunkyBackgroundGenerator(
45 new Integer(200), new Integer(100));
46 FontGenerator fontGenerator = new TwistedAndShearedRandomFontGenerator(
47 new Integer(25), new Integer(30));
48 com.octo.captcha.component.image.wordtoimage.WordToImage wordToImage = new com.octo.captcha.component.image.wordtoimage.ComposedWordToImage(
49 fontGenerator, backgroundGenerator, textPaster);
50 this.addFactory(
51 new com.octo.captcha.image.gimpy.GimpyFactory(wordGenerator,
52 wordToImage));
53 }
54
55 }