Class CmsUserFormatRestriction
java.lang.Object
org.opencms.ade.galleries.client.preview.CmsUserFormatRestriction
- All Implemented Interfaces:
I_CmsFormatRestriction
User defined image format restriction. To be used within the image format tab of the image preview.
- Since:
- 8.0.0
-
Field Summary
Fields inherited from interface org.opencms.ade.galleries.client.preview.I_CmsFormatRestriction
DIMENSION_NOT_SET
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adjustCroppingParam
(CmsCroppingParamBean croppingParam) Adjust the given cropping parameter bean to this format restriction.int
getHeight
(int orgHeight, int orgWidth) Returns the preset height for this format restriction.getLabel()
Returns the label for the format.getName()
Returns the format name.int
getWidth
(int orgHeight, int orgWidth) Returns the preset width for this format restriction.boolean
Returns if this format allows cropping.boolean
Returns if this format has a fixed height/width ratio.boolean
Returns if height is editable.boolean
Returns if width is editable.boolean
matchesCroppingParam
(CmsCroppingParamBean croppingParam) Checks whether the given cropping parameter matches these restrictions.
-
Constructor Details
-
CmsUserFormatRestriction
Constructor.- Parameters:
name
- the format namelabel
- the format label
-
-
Method Details
-
adjustCroppingParam
Description copied from interface:I_CmsFormatRestriction
Adjust the given cropping parameter bean to this format restriction.Execute on selection of this restriction.
- Specified by:
adjustCroppingParam
in interfaceI_CmsFormatRestriction
- Parameters:
croppingParam
- the cropping parameter bean to adjust- See Also:
-
getHeight
Description copied from interface:I_CmsFormatRestriction
Returns the preset height for this format restriction.- Specified by:
getHeight
in interfaceI_CmsFormatRestriction
- Parameters:
orgHeight
- the original image heightorgWidth
- the original image width- Returns:
- the height
- See Also:
-
getLabel
Description copied from interface:I_CmsFormatRestriction
Returns the label for the format.- Specified by:
getLabel
in interfaceI_CmsFormatRestriction
- Returns:
- the label
- See Also:
-
getName
Description copied from interface:I_CmsFormatRestriction
Returns the format name.- Specified by:
getName
in interfaceI_CmsFormatRestriction
- Returns:
- the format name
- See Also:
-
getWidth
Description copied from interface:I_CmsFormatRestriction
Returns the preset width for this format restriction.- Specified by:
getWidth
in interfaceI_CmsFormatRestriction
- Parameters:
orgHeight
- the original image heightorgWidth
- the original image width- Returns:
- the width
- See Also:
-
isCroppingEnabled
Description copied from interface:I_CmsFormatRestriction
Returns if this format allows cropping.- Specified by:
isCroppingEnabled
in interfaceI_CmsFormatRestriction
- Returns:
true
if cropping is allowed- See Also:
-
isFixedRatio
Description copied from interface:I_CmsFormatRestriction
Returns if this format has a fixed height/width ratio.- Specified by:
isFixedRatio
in interfaceI_CmsFormatRestriction
- Returns:
true
if the ratio is fixed- See Also:
-
isHeightEditable
Description copied from interface:I_CmsFormatRestriction
Returns if height is editable.- Specified by:
isHeightEditable
in interfaceI_CmsFormatRestriction
- Returns:
true
if height is editable- See Also:
-
isWidthEditable
Description copied from interface:I_CmsFormatRestriction
Returns if width is editable.- Specified by:
isWidthEditable
in interfaceI_CmsFormatRestriction
- Returns:
true
if width is editable- See Also:
-
matchesCroppingParam
Description copied from interface:I_CmsFormatRestriction
Checks whether the given cropping parameter matches these restrictions.- Specified by:
matchesCroppingParam
in interfaceI_CmsFormatRestriction
- Parameters:
croppingParam
- the cropping parameter to match- Returns:
true
if the restrictions are matched by the given cropping parameter- See Also:
-