org.apache.wicket.markup.html.image.resource
Class DefaultButtonImageResource

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.markup.html.image.resource.RenderedDynamicImageResource
                      extended by org.apache.wicket.markup.html.image.resource.DefaultButtonImageResource
All Implemented Interfaces:
java.io.Serializable, IClusterable, IRequestListener, IResourceListener

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.markup.html.DynamicWebResource
DynamicWebResource.ResourceState
 
Field Summary
 
Fields inherited from interface org.apache.wicket.IResourceListener
INTERFACE
 
Constructor Summary
DefaultButtonImageResource(int width, int height, java.lang.String label)
           
DefaultButtonImageResource(java.lang.String label)
           
 
Method Summary
 int getArcHeight()
           
 int getArcWidth()
           
 java.awt.Color getBackgroundColor()
           
 java.awt.Color getColor()
           
 java.awt.Font getFont()
           
 java.awt.Color getTextColor()
           
protected  boolean render(java.awt.Graphics2D graphics)
          Renders button image.
 void setArcHeight(int arcHeight)
           
 void setArcWidth(int arcWidth)
           
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 void setColor(java.awt.Color color)
           
static void setDefaultHeight(int defaultHeight)
           
static void setDefaultWidth(int defaultWidth)
           
 void setFont(java.awt.Font font)
           
 void setTextColor(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.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

DefaultButtonImageResource

public DefaultButtonImageResource(int width,
                                  int height,
                                  java.lang.String label)
Parameters:
label - The label for this button image
width - Width of image in pixels
height - 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)
Renders button image.

Specified by:
render in class RenderedDynamicImageResource
Parameters:
graphics - The graphics context to render on
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(Graphics2D)


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