org.richfaces.renderkit.html
Class BaseGradient

java.lang.Object
  extended by javax.faces.application.Resource
      extended by org.richfaces.resource.AbstractBaseResource
          extended by org.richfaces.resource.AbstractCacheableResource
              extended by org.ajax4jsf.resource.Java2Dresource
                  extended by org.richfaces.renderkit.html.BaseGradient
All Implemented Interfaces:
org.richfaces.resource.CacheableResource, org.richfaces.resource.StateHolderResource
Direct Known Subclasses:
Base2WayGradient, BaseControlBackgroundImage, ComboBoxButtonPressGradient, GradientA, SpinnerButtonGradient, SpinnerFieldGradient

public class BaseGradient
extends Java2Dresource

Author:
Nick Belaevski - nbelaevski@exadel.com created 02.02.2007

Field Summary
protected  GradientType gradientType
           
protected  java.lang.Integer headerBackgroundColor
           
protected  java.lang.Integer headerGradientColor
           
 
Fields inherited from class org.richfaces.resource.AbstractBaseResource
URL_PROTOCOL
 
Fields inherited from class javax.faces.application.Resource
COMPONENT_RESOURCE_KEY
 
Constructor Summary
BaseGradient()
           
BaseGradient(boolean horizontal)
           
BaseGradient(int width, int height)
           
BaseGradient(int width, int height, boolean horizontal)
           
BaseGradient(int width, int height, int gradientHeight)
           
BaseGradient(int width, int height, int gradientHeight, boolean horizontal)
           
BaseGradient(int width, int height, int gradientHeight, java.lang.String baseColor, java.lang.String gradientColor)
           
BaseGradient(int width, int height, int gradientHeight, java.lang.String baseColor, java.lang.String gradientColor, boolean horizontal)
           
BaseGradient(int width, int height, java.lang.String baseColor, java.lang.String gradientColor)
           
BaseGradient(int width, int height, java.lang.String baseColor, java.lang.String gradientColor, boolean horizontal)
           
BaseGradient(java.lang.String baseColor, java.lang.String gradientColor)
           
BaseGradient(java.lang.String baseColor, java.lang.String gradientColor, boolean horizontal)
           
 
Method Summary
protected  void drawGradient(java.awt.Graphics2D g2d, java.awt.Shape shape, GradientType.BiColor colors, int height)
           
protected  java.lang.String getBaseColor()
           
 java.awt.Dimension getDimension()
          Primary calculation of image dimensions - used when HTML code is generated to render IMG's width and height Subclasses should override this method to provide correct sizes of rendered images
protected  java.lang.String getGradientColor()
           
protected  int getGradientHeight()
           
protected  int getHeight()
           
protected  int getWidth()
           
protected  boolean isHorizontal()
           
protected  void paint(java.awt.Graphics2D graphics2d, java.awt.Dimension dimension)
          Template method for create image as Applet-like paint.
protected  void paintGradient(java.awt.Graphics2D g2d, java.awt.Dimension dim)
           
 void readState(javax.faces.context.FacesContext context, java.io.DataInput dataInput)
           
 void writeState(javax.faces.context.FacesContext context, java.io.DataOutput dataOutput)
           
 
Methods inherited from class org.ajax4jsf.resource.Java2Dresource
decodeColor, encodeSkinParameter, getColorValueParameter, getContentType, getHeight, getInputStream, getValueParameter, isTransient
 
Methods inherited from class org.richfaces.resource.AbstractCacheableResource
addCacheControlResponseHeaders, getEntityTag, getExpires, getTimeToLive, isCacheable, isMatchesEntityTag, isMatchesEntityTag, isMatchesLastModified, isMatchesLastModified, setCacheable, userAgentNeedsUpdate
 
Methods inherited from class org.richfaces.resource.AbstractBaseResource
addNoCacheResponseHeaders, getClassLoader, getContentLength, getLastModified, getRequestPath, getResponseHeaders, getURL
 
Methods inherited from class javax.faces.application.Resource
getLibraryName, getResourceName, setContentType, setLibraryName, setResourceName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

headerBackgroundColor

protected java.lang.Integer headerBackgroundColor

headerGradientColor

protected java.lang.Integer headerGradientColor

gradientType

protected GradientType gradientType
Constructor Detail

BaseGradient

public BaseGradient(int width,
                    int height,
                    int gradientHeight,
                    java.lang.String baseColor,
                    java.lang.String gradientColor,
                    boolean horizontal)

BaseGradient

public BaseGradient(int width,
                    int height,
                    int gradientHeight)

BaseGradient

public BaseGradient(int width,
                    int height,
                    int gradientHeight,
                    java.lang.String baseColor,
                    java.lang.String gradientColor)

BaseGradient

public BaseGradient(int width,
                    int height)

BaseGradient

public BaseGradient(int width,
                    int height,
                    java.lang.String baseColor,
                    java.lang.String gradientColor)

BaseGradient

public BaseGradient()

BaseGradient

public BaseGradient(java.lang.String baseColor,
                    java.lang.String gradientColor)

BaseGradient

public BaseGradient(int width,
                    int height,
                    int gradientHeight,
                    boolean horizontal)

BaseGradient

public BaseGradient(int width,
                    int height,
                    boolean horizontal)

BaseGradient

public BaseGradient(int width,
                    int height,
                    java.lang.String baseColor,
                    java.lang.String gradientColor,
                    boolean horizontal)

BaseGradient

public BaseGradient(boolean horizontal)

BaseGradient

public BaseGradient(java.lang.String baseColor,
                    java.lang.String gradientColor,
                    boolean horizontal)
Method Detail

getDimension

public java.awt.Dimension getDimension()
Description copied from class: Java2Dresource
Primary calculation of image dimensions - used when HTML code is generated to render IMG's width and height Subclasses should override this method to provide correct sizes of rendered images

Specified by:
getDimension in class Java2Dresource
Returns:
dimensions of the image to be displayed on page

getGradientHeight

protected int getGradientHeight()
Returns:
the gradientHeight

getHeight

protected int getHeight()

getWidth

protected int getWidth()

getBaseColor

protected java.lang.String getBaseColor()
Returns:
the baseColor

getGradientColor

protected java.lang.String getGradientColor()
Returns:
the gradientColor

isHorizontal

protected boolean isHorizontal()
Returns:
the horizontal

drawGradient

protected void drawGradient(java.awt.Graphics2D g2d,
                            java.awt.Shape shape,
                            GradientType.BiColor colors,
                            int height)

paint

protected void paint(java.awt.Graphics2D graphics2d,
                     java.awt.Dimension dimension)
Description copied from class: Java2Dresource
Template method for create image as Applet-like paint.

Overrides:
paint in class Java2Dresource
Parameters:
graphics2d - - graphics to paint.

paintGradient

protected void paintGradient(java.awt.Graphics2D g2d,
                             java.awt.Dimension dim)
Parameters:
g2d -
dim -

readState

public void readState(javax.faces.context.FacesContext context,
                      java.io.DataInput dataInput)
               throws java.io.IOException
Specified by:
readState in interface org.richfaces.resource.StateHolderResource
Overrides:
readState in class Java2Dresource
Throws:
java.io.IOException

writeState

public void writeState(javax.faces.context.FacesContext context,
                       java.io.DataOutput dataOutput)
                throws java.io.IOException
Specified by:
writeState in interface org.richfaces.resource.StateHolderResource
Overrides:
writeState in class Java2Dresource
Throws:
java.io.IOException


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.