Class CmsJspImageScalerTagSupport

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspImageScalerTagSupport
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
CmsJspTagImage, CmsJspTagScaleImage

public abstract class CmsJspImageScalerTagSupport extends javax.servlet.jsp.tagext.BodyTagSupport
Abstract parent for all JSP tags dealing with image scaling, defines some common image scaler properties and corresponding getters/setters that may be used by extending classes.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected CmsImageScaler
    The given image scaler parameters.
    protected String
    The image source.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.
    protected static final String
    Required image scaler attributes constant.

    Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport

    bodyContent

    Fields inherited from class javax.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface javax.servlet.jsp.tagext.BodyTag

    EVAL_BODY_BUFFERED, EVAL_BODY_TAG

    Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface javax.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a CmsImageScaler to be used by derived classes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the scaling height for the image.
    Returns the maximum scaling height for the image, only needed if scale type is 5.
    Returns the maximum scaling width for the image, only needed if scale type is 5.
    Returns the background color used by the image scaler.
    Returns the filter list used by the image scaler.
    Returns the position used by the image scaler.
    Returns the quality used by the image scaler.
    Returns the render mode used by the image scaler.
    Returns the scaling type for the image.
    Returns the source of the image to scale, which will have the OpenCms webapp / servlet prefix added.
    Returns the scaling width for the image.
    void
    Does some cleanup and creates a new ImageScaler before the tag is released to the tag pool.
    void
    Sets the scaling height for the image.
    void
    Sets the maximum scaling height for the image, only needed if scale type is 5.
    void
    Sets the maximum scaling width for the image, only needed if scale type is 5.
    void
    Sets the background color used by the image scaler.
    void
    Sets the filter(s) used by the image scaler.
    void
    Sets the position used by the image scaler.
    void
    Sets the quality used by the image scaler.
    void
    Sets the render mode used by the image scaler.
    void
    Sets the scaling type for the image.
    void
    setSrc(String value)
    Sets the source of the image.
    void
    Sets the scaling width for the image.

    Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport

    doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, setBodyContent

    Methods inherited from class javax.servlet.jsp.tagext.TagSupport

    findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax.servlet.jsp.tagext.Tag

    getParent, setPageContext, setParent
  • Field Details

  • Constructor Details

    • CmsJspImageScalerTagSupport

      Initializes a CmsImageScaler to be used by derived classes. The CmsImageScaler is recreated every time release() is called.
  • Method Details

    • getHeight

      public String getHeight()
      Returns the scaling height for the image.

      Returns:
      the scaling height for the image
    • getMaxHeight

      public String getMaxHeight()
      Returns the maximum scaling height for the image, only needed if scale type is 5.

      Returns:
      the maximum scaling height for the image
    • getMaxWidth

      public String getMaxWidth()
      Returns the maximum scaling width for the image, only needed if scale type is 5.

      Returns:
      the maximum scaling width for the image
    • getScaleColor

      Returns the background color used by the image scaler.

      Returns:
      the background color used by the image scaler
    • getScaleFilter

      Returns the filter list used by the image scaler.

      Returns:
      the filter list used by the image scaler
    • getScalePosition

      Returns the position used by the image scaler.

      Returns:
      the position used by the image scaler
    • getScaleQuality

      Returns the quality used by the image scaler.

      Returns:
      the quality used by the image scaler
    • getScaleRendermode

      Returns the render mode used by the image scaler.

      Returns:
      the render mode used by the image scaler
    • getScaleType

      public String getScaleType()
      Returns the scaling type for the image.

      Returns:
      the scaling type for the image
    • getSrc

      public String getSrc()
      Returns the source of the image to scale, which will have the OpenCms webapp / servlet prefix added.

      Returns:
      the source of the image to scale
    • getWidth

      public String getWidth()
      Returns the scaling width for the image.

      Returns:
      the scaling width for the image
    • release

      public void release()
      Does some cleanup and creates a new ImageScaler before the tag is released to the tag pool.
      Specified by:
      release in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      release in class javax.servlet.jsp.tagext.BodyTagSupport
      See Also:
      • Tag.release()
    • setHeight

      public void setHeight(String value)
      Sets the scaling height for the image.

      If no valid integer is given, then "0" is used as value.

      Parameters:
      value - the scaling height for the image to set
    • setMaxHeight

      public void setMaxHeight(String value)
      Sets the maximum scaling height for the image, only needed if scale type is 5.

      If no valid integer is given, then the value of getHeight() is used as value.

      Parameters:
      value - the maximum scaling height for the image to set
    • setMaxWidth

      public void setMaxWidth(String value)
      Sets the maximum scaling width for the image, only needed if scale type is 5.

      If no valid integer is given, then the value of getWidth() is used as value.

      Parameters:
      value - the maximum scaling width for the image to set
    • setScaleColor

      public void setScaleColor(String value)
      Sets the background color used by the image scaler.

      Parameters:
      value - the background color to set
    • setScaleFilter

      public void setScaleFilter(String value)
      Sets the filter(s) used by the image scaler.

      Parameters:
      value - the filter(s) to set
    • setScalePosition

      public void setScalePosition(String value)
      Sets the position used by the image scaler.

      Parameters:
      value - the position to set
    • setScaleQuality

      public void setScaleQuality(String value)
      Sets the quality used by the image scaler.

      Parameters:
      value - the quality to set
    • setScaleRendermode

      public void setScaleRendermode(String value)
      Sets the render mode used by the image scaler.

      Parameters:
      value - the render mode to set
    • setScaleType

      public void setScaleType(String value)
      Sets the scaling type for the image.

      If no valid integer is given, then "0" is used as value.

      Parameters:
      value - the scaling type for the image to set
    • setSrc

      public void setSrc(String value)
      Sets the source of the image.

      The source must be an absolute path in the current users OpenCms site, without any webapp or servlet prefix.

      Parameters:
      value - the image source to set
    • setWidth

      public void setWidth(String value)
      Sets the scaling width for the image.

      If no valid integer is given, then "0" is used as value.

      Parameters:
      value - the scaling width for the image to set