Class DefaultButtonImageResource
- java.lang.Object
-
- org.apache.wicket.request.resource.AbstractResource
-
- org.apache.wicket.request.resource.DynamicImageResource
-
- org.apache.wicket.markup.html.image.resource.RenderedDynamicImageResource
-
- org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource
-
- All Implemented Interfaces:
Serializable
,IResource
,org.apache.wicket.util.io.IClusterable
public class DefaultButtonImageResource extends RenderedDynamicImageResource
Automatically generates a basic button image. The model for the component determines the label displayed on the button.- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ContentRangeType, 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
CONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS
-
-
Constructor Summary
Constructors Constructor Description DefaultButtonImageResource(int width, int height, String label)
DefaultButtonImageResource(String label)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getArcHeight()
int
getArcWidth()
Color
getBackgroundColor()
Color
getColor()
Font
getFont()
Color
getTextColor()
protected boolean
render(Graphics2D graphics, IResource.Attributes attributes)
Renders button image.void
setArcHeight(int arcHeight)
void
setArcWidth(int arcWidth)
void
setBackgroundColor(Color backgroundColor)
void
setColor(Color color)
static void
setDefaultHeight(int defaultHeight)
static void
setDefaultWidth(int defaultWidth)
void
setFont(Font font)
void
setTextColor(Color textColor)
-
Methods inherited from class org.apache.wicket.markup.html.image.resource.RenderedDynamicImageResource
getHeight, getImageData, getType, getWidth, invalidate, render, setHeight, setType, setWidth
-
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, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders
-
-
-
-
Constructor Detail
-
DefaultButtonImageResource
public DefaultButtonImageResource(int width, int height, String label)
- Parameters:
label
- The label for this button imagewidth
- Width of image in pixelsheight
- Height of image in pixels
-
DefaultButtonImageResource
public DefaultButtonImageResource(String label)
- Parameters:
label
- The label for this button image
-
-
Method Detail
-
setDefaultHeight
public static void setDefaultHeight(int defaultHeight)
- Parameters:
defaultHeight
- The defaultHeight to set.
-
setDefaultWidth
public static void setDefaultWidth(int defaultWidth)
- Parameters:
defaultWidth
- The defaultWidth to set.
-
getArcHeight
public int getArcHeight()
- Returns:
- Returns the arcHeight.
-
getArcWidth
public int getArcWidth()
- Returns:
- Returns the arcWidth.
-
getBackgroundColor
public Color getBackgroundColor()
- Returns:
- Returns the backgroundColor.
-
getTextColor
public Color getTextColor()
- Returns:
- Returns the textColor.
-
setArcHeight
public void setArcHeight(int arcHeight)
- Parameters:
arcHeight
- The arcHeight to set.
-
setArcWidth
public void setArcWidth(int arcWidth)
- Parameters:
arcWidth
- The arcWidth to set.
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
- Parameters:
backgroundColor
- The backgroundColor to set.
-
setTextColor
public void setTextColor(Color textColor)
- Parameters:
textColor
- The textColor to set.
-
render
protected boolean render(Graphics2D graphics, IResource.Attributes attributes)
Renders button image.- Specified by:
render
in classRenderedDynamicImageResource
- Parameters:
graphics
- The graphics context to render on.attributes
- the current request attributes- Returns:
true
if the image was rendered.false
if the image size was changed by the rendering implementation and the image should be re-rendered at the new size.- See Also:
RenderedDynamicImageResource.render(java.awt.Graphics2D, Attributes)
-
-