org.apache.wicket.extensions.markup.html.captcha
Class CaptchaImageResource

java.lang.Object
  extended by org.apache.wicket.request.resource.AbstractResource
      extended by org.apache.wicket.request.resource.DynamicImageResource
          extended by org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource
All Implemented Interfaces:
Serializable, IClusterable, IResource

public final class CaptchaImageResource
extends DynamicImageResource

Generates a captcha image.

Author:
Joshua Perlow
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ResourceResponse, AbstractResource.WriteCallback
 
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes
 
Field Summary
 
Fields inherited from class org.apache.wicket.request.resource.AbstractResource
INTERNAL_HEADERS
 
Constructor Summary
CaptchaImageResource()
          Construct.
CaptchaImageResource(IModel<String> challengeId)
          Construct.
CaptchaImageResource(IModel<String> challengeId, int fontSize, int margin)
          Construct.
CaptchaImageResource(String challengeId)
          Construct.
CaptchaImageResource(String challengeId, int fontSize, int margin)
          Construct.
 
Method Summary
 String getChallengeId()
          Gets the id for the challenge.
 IModel<String> getChallengeIdModel()
          Gets the id for the challenge
protected  byte[] getImageData(IResource.Attributes attributes)
           
 void invalidate()
          Causes the image to be redrawn the next time its requested.
 
Methods inherited from class org.apache.wicket.request.resource.DynamicImageResource
configureResponse, getFormat, newResourceResponse, setFormat, setLastModifiedTime, toImageData
 
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, flushResponseAfterHeaders, getCachingStrategy, respond, setResponseHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaptchaImageResource

public CaptchaImageResource()
Construct.


CaptchaImageResource

public CaptchaImageResource(String challengeId)
Construct.

Parameters:
challengeId - The id of the challenge

CaptchaImageResource

public CaptchaImageResource(IModel<String> challengeId)
Construct.

Parameters:
challengeId - The id of the challenge

CaptchaImageResource

public CaptchaImageResource(IModel<String> challengeId,
                            int fontSize,
                            int margin)
Construct.

Parameters:
challengeId - The id of the challenge
fontSize - The font size
margin - The image's margin

CaptchaImageResource

public CaptchaImageResource(String challengeId,
                            int fontSize,
                            int margin)
Construct.

Parameters:
challengeId - The id of the challenge
fontSize - The font size
margin - The image's margin
Method Detail

getChallengeId

public final String getChallengeId()
Gets the id for the challenge.

Returns:
The id for the challenge

getChallengeIdModel

public final IModel<String> getChallengeIdModel()
Gets the id for the challenge

Returns:
The id for the challenge

invalidate

public final void invalidate()
Causes the image to be redrawn the next time its requested.


getImageData

protected final byte[] getImageData(IResource.Attributes attributes)
Specified by:
getImageData in class DynamicImageResource


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.