Package org.opencms.jsp
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
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
Modifier and TypeFieldDescriptionprotected 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
ConstructorDescriptionInitializes a CmsImageScaler to be used by derived classes. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.getSrc()
Returns the source of the image to scale, which will have the OpenCms webapp / servlet prefix added.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
Sets the scaling height for the image.void
setMaxHeight
(String value) Sets the maximum scaling height for the image, only needed if scale type is 5.void
setMaxWidth
(String value) Sets the maximum scaling width for the image, only needed if scale type is 5.void
setScaleColor
(String value) Sets the background color used by the image scaler.void
setScaleFilter
(String value) Sets the filter(s) used by the image scaler.void
setScalePosition
(String value) Sets the position used by the image scaler.void
setScaleQuality
(String value) Sets the quality used by the image scaler.void
setScaleRendermode
(String value) Sets the render mode used by the image scaler.void
setScaleType
(String value) Sets the scaling type for the image.void
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
-
SCALE_ATTR_HEIGHT
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_MAXHEIGHT
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_MAXWIDTH
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_POSITION
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_QUALITY
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_RENDERMODE
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_TYPE
Required image scaler attributes constant.- See Also:
-
SCALE_ATTR_WIDTH
Required image scaler attributes constant.- See Also:
-
m_scaler
The given image scaler parameters. -
m_src
The image source.
-
-
Constructor Details
-
CmsJspImageScalerTagSupport
public CmsJspImageScalerTagSupport()Initializes a CmsImageScaler to be used by derived classes. The CmsImageScaler is recreated every timerelease()
is called.
-
-
Method Details
-
getHeight
Returns the scaling height for the image.- Returns:
- the scaling height for the image
-
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
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
Returns the scaling type for the image.- Returns:
- the scaling type for the image
-
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
Returns the scaling width for the image.- Returns:
- the scaling width for the image
-
release
Does some cleanup and creates a new ImageScaler before the tag is released to the tag pool.- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classjavax.servlet.jsp.tagext.BodyTagSupport
- See Also:
-
Tag.release()
-
setHeight
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
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
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
Sets the background color used by the image scaler.- Parameters:
value
- the background color to set
-
setScaleFilter
Sets the filter(s) used by the image scaler.- Parameters:
value
- the filter(s) to set
-
setScalePosition
Sets the position used by the image scaler.- Parameters:
value
- the position to set
-
setScaleQuality
Sets the quality used by the image scaler.- Parameters:
value
- the quality to set
-
setScaleRendermode
Sets the render mode used by the image scaler.- Parameters:
value
- the render mode to set
-
setScaleType
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
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
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
-