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:
java.io.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, java.lang.String label)DefaultButtonImageResource(java.lang.String label)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetArcHeight()intgetArcWidth()java.awt.ColorgetBackgroundColor()java.awt.ColorgetColor()java.awt.FontgetFont()java.awt.ColorgetTextColor()protected booleanrender(java.awt.Graphics2D graphics, IResource.Attributes attributes)Renders button image.voidsetArcHeight(int arcHeight)voidsetArcWidth(int arcWidth)voidsetBackgroundColor(java.awt.Color backgroundColor)voidsetColor(java.awt.Color color)static voidsetDefaultHeight(int defaultHeight)static voidsetDefaultWidth(int defaultWidth)voidsetFont(java.awt.Font font)voidsetTextColor(java.awt.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, java.lang.String label)- Parameters:
label- The label for this button imagewidth- Width of image in pixelsheight- Height of image in pixels
-
DefaultButtonImageResource
public DefaultButtonImageResource(java.lang.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 java.awt.Color getBackgroundColor()
- Returns:
- Returns the backgroundColor.
-
getColor
public java.awt.Color getColor()
- Returns:
- Returns the color.
-
getFont
public java.awt.Font getFont()
- Returns:
- Returns the font.
-
getTextColor
public java.awt.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(java.awt.Color backgroundColor)
- Parameters:
backgroundColor- The backgroundColor to set.
-
setColor
public void setColor(java.awt.Color color)
- Parameters:
color- The color to set.
-
setFont
public void setFont(java.awt.Font font)
- Parameters:
font- The font to set.
-
setTextColor
public void setTextColor(java.awt.Color textColor)
- Parameters:
textColor- The textColor to set.
-
render
protected boolean render(java.awt.Graphics2D graphics, IResource.Attributes attributes)Renders button image.- Specified by:
renderin classRenderedDynamicImageResource- Parameters:
graphics- The graphics context to render on.attributes- the current request attributes- Returns:
trueif the image was rendered.falseif 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)
-
-