org.ajax4jsf.resource
Class Java2Dresource

java.lang.Object
  extended by javax.faces.application.Resource
      extended by org.richfaces.resource.AbstractCacheableResource
          extended by org.richfaces.resource.AbstractBaseResource
              extended by org.ajax4jsf.resource.Java2Dresource
All Implemented Interfaces:
javax.faces.component.StateHolder, org.richfaces.resource.VersionedResource
Direct Known Subclasses:
BaseGradient, CancelControlIcon, CustomizeableGradient, OneColorBasedResource, TestResource2

public abstract class Java2Dresource
extends AbstractBaseResource
implements javax.faces.component.StateHolder

Version:
$Revision: 1.1.2.3 $ $Date: 2007/02/01 15:31:57 $
Author:
shura (latest modification by $Author: alexsmirnov $)

Nested Class Summary
static class Java2Dresource.ImageType
           
 
Field Summary
 
Fields inherited from class org.richfaces.resource.AbstractBaseResource
URL_PROTOCOL
 
Fields inherited from class javax.faces.application.Resource
COMPONENT_RESOURCE_KEY
 
Constructor Summary
Java2Dresource(Java2Dresource.ImageType imageType)
           
 
Method Summary
protected  java.lang.Integer decodeColor(java.lang.String value)
           
protected  java.lang.String encodeSkinParameter(java.lang.String param)
           
protected  java.lang.Integer getColorValueParameter(javax.faces.context.FacesContext context, java.lang.String name, boolean useDefault)
           
 java.lang.String getContentType()
           
abstract  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.Integer getHeight(javax.faces.context.FacesContext context, java.lang.String heightParamName)
           
 java.io.InputStream getInputStream()
           
protected  java.lang.String getValueParameter(javax.faces.context.FacesContext context, java.lang.String name)
           
 boolean isTransient()
           
protected  void paint(java.awt.Graphics2D graphics2D, java.awt.Dimension dimension)
          Template method for create image as Applet-like paint.
 void populateParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
           
protected  void readState(javax.faces.context.FacesContext context, NumericDataInputStream stream)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setTransient(boolean newTransientValue)
           
protected  void writeState(javax.faces.context.FacesContext context, NumericDataOutputStream stream)
           
 
Methods inherited from class org.richfaces.resource.AbstractBaseResource
getClassLoader, getContentLength, getEntityTag, getExpires, getLastModified, getRequestPath, getResponseHeaders, getTimeToLive, getURL, getVersion, isCacheable, setCacheable, setVersion
 
Methods inherited from class org.richfaces.resource.AbstractCacheableResource
isMatchesEntityTag, isMatchesEntityTag, isMatchesLastModified, isMatchesLastModified, userAgentNeedsUpdate
 
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
 

Constructor Detail

Java2Dresource

public Java2Dresource(Java2Dresource.ImageType imageType)
Method Detail

populateParameters

public void populateParameters(java.util.Map<java.lang.String,java.lang.String> parameters)

getDimension

public abstract 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

Returns:
dimensions of the image to be displayed on page

paint

protected void paint(java.awt.Graphics2D graphics2D,
                     java.awt.Dimension dimension)
Template method for create image as Applet-like paint.

Parameters:
graphics2D - - graphics to paint.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in class javax.faces.application.Resource
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class javax.faces.application.Resource

writeState

protected void writeState(javax.faces.context.FacesContext context,
                          NumericDataOutputStream stream)

readState

protected void readState(javax.faces.context.FacesContext context,
                         NumericDataInputStream stream)

isTransient

public boolean isTransient()
Specified by:
isTransient in interface javax.faces.component.StateHolder

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder

setTransient

public void setTransient(boolean newTransientValue)
Specified by:
setTransient in interface javax.faces.component.StateHolder

getValueParameter

protected java.lang.String getValueParameter(javax.faces.context.FacesContext context,
                                             java.lang.String name)

encodeSkinParameter

protected java.lang.String encodeSkinParameter(java.lang.String param)

getColorValueParameter

protected java.lang.Integer getColorValueParameter(javax.faces.context.FacesContext context,
                                                   java.lang.String name,
                                                   boolean useDefault)

getHeight

protected java.lang.Integer getHeight(javax.faces.context.FacesContext context,
                                      java.lang.String heightParamName)

decodeColor

protected java.lang.Integer decodeColor(java.lang.String value)


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