org.richfaces.renderkit.html.images
Class TriangleIconBase

java.lang.Object
  extended by org.ajax4jsf.resource.InternetResourceBase
      extended by org.ajax4jsf.resource.Java2Dresource
          extended by org.richfaces.renderkit.html.images.TriangleIconBase
All Implemented Interfaces:
InternetResource
Direct Known Subclasses:
TriangleIconDown

public abstract class TriangleIconBase
extends Java2Dresource

Author:
Siarhej Chalipau

Field Summary
protected static java.lang.String BORDER_COLOR
           
protected static java.lang.String DISABLED_BORDER_COLOR
           
protected static java.lang.String DISABLED_ICON_COLOR
           
protected static java.lang.String ICON_COLOR
           
 
Fields inherited from interface org.ajax4jsf.resource.InternetResource
CODEC_ATTR, DATA_SEPARATOR, DEFAULT_EXPIRE, DEFAULT_EXPITE_PARAMETER, ENCODE_PASS_PARAMETER, ENCODE_URI_PARAMETER, RESOURCE_PROTOCOL, RESOURCE_URI_PREFIX, RESOURCE_URI_PREFIX_LENGTH
 
Constructor Summary
TriangleIconBase()
           
 
Method Summary
protected  java.lang.Object deserializeData(byte[] objectArray)
          Deserialize parameters object from byte array.
protected  java.lang.Object getDataToStore(javax.faces.context.FacesContext context, java.lang.Object data)
          Template method to construct resource-specific data ( to store in resource URI ).
protected  java.lang.Object getDataToStore(javax.faces.context.FacesContext context, java.lang.String iconColorParam, java.lang.String defaultIconColorParam, java.lang.String borderColorParam, java.lang.String defaultBorderColorParam)
           
 java.awt.Dimension getDimensions(javax.faces.context.FacesContext facesContext, java.lang.Object data)
          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.awt.Dimension getDimensions(ResourceContext resourceContext)
          Secondary calculation is used basically by getImage method
protected  java.lang.String getParameterValue(javax.faces.context.FacesContext context, Skin skin, Skin defaultSkin, java.lang.String parameterName, java.lang.String defaultParameterName)
           
 boolean isCacheable()
           
protected  void paint(ResourceContext context, java.awt.Graphics2D g2d)
          Template method for create image as Applet-like paint.
protected  void paintBaseTriangle(java.awt.Graphics2D g2d)
           
protected abstract  void paintImage(ResourceContext context, java.awt.Graphics2D g2d, java.awt.Color textColor, java.awt.Color borderColor)
           
 
Methods inherited from class org.ajax4jsf.resource.Java2Dresource
getImage, getResourceAsStream, send
 
Methods inherited from class org.ajax4jsf.resource.InternetResourceBase
encode, encode, encodeBegin, encodeEnd, getContentLength, getContentType, getExpired, getKey, getLastModified, getProperty, getRenderer, getUri, isCacheable, isSessionAware, requireFacesContext, restoreData, sendHeaders, setCacheable, setContentLength, setExpired, setKey, setLastModified, setProperty, setRenderer, setSessionAware
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICON_COLOR

protected static final java.lang.String ICON_COLOR
See Also:
Constant Field Values

BORDER_COLOR

protected static final java.lang.String BORDER_COLOR
See Also:
Constant Field Values

DISABLED_ICON_COLOR

protected static final java.lang.String DISABLED_ICON_COLOR
See Also:
Constant Field Values

DISABLED_BORDER_COLOR

protected static final java.lang.String DISABLED_BORDER_COLOR
See Also:
Constant Field Values
Constructor Detail

TriangleIconBase

public TriangleIconBase()
Method Detail

paintImage

protected abstract void paintImage(ResourceContext context,
                                   java.awt.Graphics2D g2d,
                                   java.awt.Color textColor,
                                   java.awt.Color borderColor)

paintBaseTriangle

protected void paintBaseTriangle(java.awt.Graphics2D g2d)

paint

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

Overrides:
paint in class Java2Dresource
Parameters:
context - - current resource context.
g2d - - graphics to paint.

getDimensions

public java.awt.Dimension getDimensions(javax.faces.context.FacesContext facesContext,
                                        java.lang.Object data)
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

Overrides:
getDimensions in class Java2Dresource
Returns:
dimensions of the image to be displayed on page

getDimensions

protected java.awt.Dimension getDimensions(ResourceContext resourceContext)
Description copied from class: Java2Dresource
Secondary calculation is used basically by getImage method

Overrides:
getDimensions in class Java2Dresource
Returns:

getDataToStore

protected java.lang.Object getDataToStore(javax.faces.context.FacesContext context,
                                          java.lang.Object data)
Description copied from class: InternetResourceBase
Template method to construct resource-specific data ( to store in resource URI ). If resource must store any data in session or other cache, it must be done here. Since lightweight realisation, information for restore such data muct be returned by this method.

Overrides:
getDataToStore in class InternetResourceBase
Parameters:
data - - pass icon color and background color
context - - current faces context.
Returns:
- any Serializable object, or null.

getParameterValue

protected java.lang.String getParameterValue(javax.faces.context.FacesContext context,
                                             Skin skin,
                                             Skin defaultSkin,
                                             java.lang.String parameterName,
                                             java.lang.String defaultParameterName)

getDataToStore

protected java.lang.Object getDataToStore(javax.faces.context.FacesContext context,
                                          java.lang.String iconColorParam,
                                          java.lang.String defaultIconColorParam,
                                          java.lang.String borderColorParam,
                                          java.lang.String defaultBorderColorParam)

deserializeData

protected java.lang.Object deserializeData(byte[] objectArray)
Description copied from class: InternetResourceBase
Deserialize parameters object from byte array. By default, used Java de-serialisation from ObjectOutputStream , but implementations can override this method ( togewer with getDataToStore ) for implement short version.

Overrides:
deserializeData in class InternetResourceBase
Returns:

isCacheable

public boolean isCacheable()


Copyright © 2010. All Rights Reserved.