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

java.lang.Object
  extended by org.apache.wicket.Resource
      extended by org.apache.wicket.markup.html.WebResource
          extended by org.apache.wicket.markup.html.DynamicWebResource
              extended by org.apache.wicket.markup.html.image.resource.DynamicImageResource
                  extended by org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource
All Implemented Interfaces:
java.io.Serializable, IClusterable, IRequestListener, IResourceListener

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.markup.html.DynamicWebResource
DynamicWebResource.ResourceState
 
Field Summary
 
Fields inherited from interface org.apache.wicket.IResourceListener
INTERFACE
 
Constructor Summary
CaptchaImageResource()
          Construct.
CaptchaImageResource(java.lang.String challengeId)
          Construct.
CaptchaImageResource(java.lang.String challengeId, int fontSize, int margin)
          Construct.
 
Method Summary
 java.lang.String getChallengeId()
          Gets the id for the challenge.
protected  byte[] getImageData()
          Get image data for our dynamic image resource.
 void invalidate()
          Causes the image to be redrawn the next time its requested.
 
Methods inherited from class org.apache.wicket.markup.html.image.resource.DynamicImageResource
getFormat, getResourceState, setFormat, setLastModifiedTime, toImageData
 
Methods inherited from class org.apache.wicket.markup.html.DynamicWebResource
getLocale, getResourceStream, setHeaders
 
Methods inherited from class org.apache.wicket.markup.html.WebResource
configureResponse, getCacheDuration
 
Methods inherited from class org.apache.wicket.Resource
getParameters, isCacheable, onResourceRequested, setCacheable, setParameters
 
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(java.lang.String challengeId)
Construct.

Parameters:
challengeId - The id of the challenge

CaptchaImageResource

public CaptchaImageResource(java.lang.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 java.lang.String getChallengeId()
Gets the id for the challenge.

Returns:
The the id for the challenge

invalidate

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

Overrides:
invalidate in class Resource
See Also:
Resource.invalidate()

getImageData

protected final byte[] getImageData()
Description copied from class: DynamicImageResource
Get image data for our dynamic image resource. If the subclass regenerates the data, it should set the lastModifiedTime when it does so. This ensures that image caching works correctly.

Specified by:
getImageData in class DynamicImageResource
Returns:
The image data for this dynamic image
See Also:
DynamicImageResource.getImageData()


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.