captchaproducer.java

来自「基于Java平台的、功能强大的验证码图片生成工具」· Java 代码 · 共 54 行

JAVA
54
字号
/*
 * Created on Sep 15, 2005
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package nl.captcha.servlet;

import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;

import nl.captcha.obscurity.BackgroundProducer;
import nl.captcha.obscurity.GimpyEngine;
import nl.captcha.text.TextProducer;
import nl.captcha.text.WordRenederer;

/**
 * @author Administrator
 *
 * Classes implementing this interface will be responsible for
 * creating the base
 */
public interface CaptchaProducer {
	/**
	 * Create an image which have witten a distorted text, text given 
	 * as parameter. The result image is put on the output stream
	 * 
	 * @param stream the OutputStrea where the image is written
	 * @param text the distorted characters written on imagage
	 * @throws IOException if an error occurs during the image written on
	 * output stream.
	 */
	public abstract void createImage(OutputStream stream, String text)
		throws IOException;
	/* (non-Javadoc)
	 * @see nl.captcha.servlet.CaptchaProducer#setBackGroundImageProducer(nl.captcha.obscurity.BackgroundProducer)
	 */
	public abstract void setBackGroundImageProducer(BackgroundProducer background);
	/* (non-Javadoc)
	 * @see nl.captcha.servlet.CaptchaProducer#setObscurificator()
	 */
	public abstract void setObscurificator(GimpyEngine engine);
	/**
	 * @param properties
	 */
	public abstract void setProperties(Properties properties);
	
	public abstract void setTextProducer(TextProducer textP);
	
	public abstract String createText();
	
	public abstract void  setWordRenderer(WordRenederer renederer);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?