|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.DynamicImageResource
public abstract class DynamicImageResource
Base class for dynamically generated ImageResources.
| 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 | |
|---|---|
DynamicImageResource()
Construct. |
|
DynamicImageResource(String format)
Creates a dynamic resource from for the given locale |
|
| Method Summary | |
|---|---|
protected void |
configureResponse(AbstractResource.ResourceResponse response,
IResource.Attributes attributes)
|
String |
getFormat()
|
protected abstract byte[] |
getImageData(IResource.Attributes attributes)
Get image data for our dynamic image resource. |
protected AbstractResource.ResourceResponse |
newResourceResponse(IResource.Attributes attributes)
Override this method to return a AbstractResource.ResourceResponse for the request. |
void |
setFormat(String format)
Sets the format of this resource |
protected void |
setLastModifiedTime(Time time)
set the last modified time for this resource. |
protected byte[] |
toImageData(BufferedImage image)
|
| 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 |
|---|
public DynamicImageResource()
public DynamicImageResource(String format)
format - The image format ("png", "jpeg", etc)| Method Detail |
|---|
public final String getFormat()
public final void setFormat(String format)
format - The format (jpg, png or gif..)protected void setLastModifiedTime(Time time)
time - protected byte[] toImageData(BufferedImage image)
image - The image to turn into data
protected abstract byte[] getImageData(IResource.Attributes attributes)
setLastModifiedTime(Time) when it does so. This
ensures that image caching works correctly.
attributes - the context bringing the request, response and the parameters
null means there is no image and 404
(Not found) response will be return.
protected void configureResponse(AbstractResource.ResourceResponse response,
IResource.Attributes attributes)
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
AbstractResourceAbstractResource.ResourceResponse for the request.
newResourceResponse in class AbstractResourceattributes - request attributes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||