Class CmsJspImageScalerTagSupport

  • All Implemented Interfaces:
    java.io.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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CmsImageScaler m_scaler
      The given image scaler parameters.
      protected java.lang.String m_src
      The image source.
      protected static java.lang.String SCALE_ATTR_HEIGHT
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_MAXHEIGHT
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_MAXWIDTH
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_POSITION
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_QUALITY
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_RENDERMODE
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_TYPE
      Required image scaler attributes constant.
      protected static java.lang.String SCALE_ATTR_WIDTH
      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
      CmsJspImageScalerTagSupport()
      Initializes a CmsImageScaler to be used by derived classes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHeight()
      Returns the scaling height for the image.
      java.lang.String getMaxHeight()
      Returns the maximum scaling height for the image, only needed if scale type is 5.
      java.lang.String getMaxWidth()
      Returns the maximum scaling width for the image, only needed if scale type is 5.
      java.lang.String getScaleColor()
      Returns the background color used by the image scaler.
      java.lang.String getScaleFilter()
      Returns the filter list used by the image scaler.
      java.lang.String getScalePosition()
      Returns the position used by the image scaler.
      java.lang.String getScaleQuality()
      Returns the quality used by the image scaler.
      java.lang.String getScaleRendermode()
      Returns the render mode used by the image scaler.
      java.lang.String getScaleType()
      Returns the scaling type for the image.
      java.lang.String getSrc()
      Returns the source of the image to scale, which will have the OpenCms webapp / servlet prefix added.
      java.lang.String getWidth()
      Returns the scaling width for the image.
      void release()
      Does some cleanup and creates a new ImageScaler before the tag is released to the tag pool.
      void setHeight​(java.lang.String value)
      Sets the scaling height for the image.
      void setMaxHeight​(java.lang.String value)
      Sets the maximum scaling height for the image, only needed if scale type is 5.
      void setMaxWidth​(java.lang.String value)
      Sets the maximum scaling width for the image, only needed if scale type is 5.
      void setScaleColor​(java.lang.String value)
      Sets the background color used by the image scaler.
      void setScaleFilter​(java.lang.String value)
      Sets the filter(s) used by the image scaler.
      void setScalePosition​(java.lang.String value)
      Sets the position used by the image scaler.
      void setScaleQuality​(java.lang.String value)
      Sets the quality used by the image scaler.
      void setScaleRendermode​(java.lang.String value)
      Sets the render mode used by the image scaler.
      void setScaleType​(java.lang.String value)
      Sets the scaling type for the image.
      void setSrc​(java.lang.String value)
      Sets the source of the image.
      void setWidth​(java.lang.String value)
      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
    • Constructor Detail

      • CmsJspImageScalerTagSupport

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

      • getHeight

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

        Returns:
        the scaling height for the image
      • getMaxHeight

        public java.lang.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 java.lang.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

        public java.lang.String getScaleColor()
        Returns the background color used by the image scaler.

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

        public java.lang.String getScaleFilter()
        Returns the filter list used by the image scaler.

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

        public java.lang.String getScalePosition()
        Returns the position used by the image scaler.

        Returns:
        the position used by the image scaler
      • getScaleQuality

        public java.lang.String getScaleQuality()
        Returns the quality used by the image scaler.

        Returns:
        the quality used by the image scaler
      • getScaleRendermode

        public java.lang.String getScaleRendermode()
        Returns the render mode used by the image scaler.

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

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

        Returns:
        the scaling type for the image
      • getSrc

        public java.lang.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 java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String value)
        Sets the background color used by the image scaler.

        Parameters:
        value - the background color to set
      • setScaleFilter

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

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

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

        Parameters:
        value - the position to set
      • setScaleQuality

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

        Parameters:
        value - the quality to set
      • setScaleRendermode

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

        Parameters:
        value - the render mode to set
      • setScaleType

        public void setScaleType​(java.lang.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​(java.lang.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​(java.lang.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