org.apache.wicket.markup.html.image.resource
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, 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.
getColor
public Color getColor()
- Returns:
- Returns the color.
getFont
public Font getFont()
- Returns:
- Returns the font.
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.
setColor
public void setColor(Color color)
- Parameters:
color
- The color to set.
setFont
public void setFont(Font font)
- Parameters:
font
- The font 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 class RenderedDynamicImageResource
- 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)
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.