Class CmsCroppingParamBean
java.lang.Object
org.opencms.ade.galleries.client.preview.CmsCroppingParamBean
Scale parameter data bean.
- Since:
- 8.0.0
-
Constructor Summary
ConstructorDescriptionConstructor.CmsCroppingParamBean
(int orgHeight, int orgWidth) Constructor.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the cropping height parameter.int
Returns the cropping width parameter.int
getCropX()
Returns the cropping X parameter.int
getCropY()
Returns the cropping Y parameter.Returns the used format name.int
Returns the original image height.int
Returns the original image width.double
getRatio()
Returns the resulting image ratio.getRestrictedSizeParam
(int maxHeight, int maxWidth) Returns a cropping bean with a restricted maximum target size.getRestrictedSizeScaleParam
(int maxHeight, int maxWidth) Returns the scale parameter to this bean for a restricted maximum target size.int
Returns the resulting height of the cropped image.int
Returns the resulting width of the cropped image.Returns the scale parameter.int
Returns the target height.int
Returns the target width.boolean
Returns if contained parameters indicate a cropped image.boolean
isScaled()
Returns if the given cropping parameters would scale the image.static CmsCroppingParamBean
parseImagePath
(String selectedPath) Parses an image scale parameter and returns the parsed data.static CmsCroppingParamBean
parseScaleParam
(String param) Parses an image scale parameter and returns the parsed data.void
reset()
Resets the cropping parameters to no cropping.void
setCropHeight
(int cropHeight) Sets the cropping height parameter.void
setCropWidth
(int cropWidth) Sets the cropping width parameter.void
setCropX
(int cropX) Sets the cropping X parameter.void
setCropY
(int cropY) Sets the cropping Y parameter.void
setFormatName
(String formatName) Sets the used format name.void
setOrgHeight
(int orgHeight) Sets the original image height.void
setOrgWidth
(int orgWidth) Sets the original image width.void
setTargetHeight
(int targetHeight) Sets the target height.void
setTargetWidth
(int targetWidth) Sets the target width.toString()
-
Constructor Details
-
CmsCroppingParamBean
public CmsCroppingParamBean()Constructor. -
CmsCroppingParamBean
Copy constructor.- Parameters:
copy
- the copy values to use
-
CmsCroppingParamBean
Constructor.- Parameters:
orgHeight
- the original image heightorgWidth
- the original image width
-
-
Method Details
-
parseImagePath
Parses an image scale parameter and returns the parsed data.- Parameters:
selectedPath
- the image path including the scale parameter- Returns:
- the cropping data
-
parseScaleParam
Parses an image scale parameter and returns the parsed data.- Parameters:
param
- the image path including the scale parameter- Returns:
- the cropping data
-
getCropHeight
Returns the cropping height parameter.- Returns:
- the cropping height parameter
-
getCropWidth
Returns the cropping width parameter.- Returns:
- the cropping width parameter
-
getCropX
Returns the cropping X parameter.- Returns:
- the cropping X parameter
-
getCropY
Returns the cropping Y parameter.- Returns:
- the cropping Y parameter
-
getFormatName
Returns the used format name.- Returns:
- the used format name
-
getOrgHeight
Returns the original image height.- Returns:
- the original image height
-
getOrgWidth
Returns the original image width.- Returns:
- the original image width
-
getRatio
Returns the resulting image ratio.- Returns:
- the image ratio
-
getRestrictedSizeParam
Returns a cropping bean with a restricted maximum target size.- Parameters:
maxHeight
- the max heightmaxWidth
- the max width- Returns:
- the cropping bean
-
getRestrictedSizeScaleParam
Returns the scale parameter to this bean for a restricted maximum target size.TODO: This does not work correctly if there isn't any cropping/scaling defined.
- Parameters:
maxHeight
- the max heightmaxWidth
- the max width- Returns:
- the scale parameter
-
getResultingHeight
Returns the resulting height of the cropped image.- Returns:
- the height
-
getResultingWidth
Returns the resulting width of the cropped image.- Returns:
- the width
-
getScaleParam
Returns the scale parameter.- Returns:
- the scale parameter
-
getTargetHeight
Returns the target height.- Returns:
- the target height
-
getTargetWidth
Returns the target width.- Returns:
- the target width
-
isCropped
Returns if contained parameters indicate a cropped image.- Returns:
true
if contained parameters indicate a cropped image
-
isScaled
Returns if the given cropping parameters would scale the image.- Returns:
true
if the image is scaled
-
reset
Resets the cropping parameters to no cropping. -
setCropHeight
Sets the cropping height parameter.- Parameters:
cropHeight
- the cropping height parameter to set
-
setCropWidth
Sets the cropping width parameter.- Parameters:
cropWidth
- the cropping width parameter to set
-
setCropX
Sets the cropping X parameter.- Parameters:
cropX
- the cropping X parameter to set
-
setCropY
Sets the cropping Y parameter.- Parameters:
cropY
- the cropping Y parameter to set
-
setFormatName
Sets the used format name.- Parameters:
formatName
- the used format name to set
-
setOrgHeight
Sets the original image height.- Parameters:
orgHeight
- the original image height to set
-
setOrgWidth
Sets the original image width.- Parameters:
orgWidth
- the original image width to set
-
setTargetHeight
Sets the target height.- Parameters:
targetHeight
- the target height to set
-
setTargetWidth
Sets the target width.- Parameters:
targetWidth
- the target width to set
-
toString
-