Class CmsImageFormatRestriction
java.lang.Object
org.opencms.ade.galleries.client.preview.CmsImageFormatRestriction
- All Implemented Interfaces:
I_CmsFormatRestriction
Predefined 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
ConstructorsConstructorDescriptionCmsImageFormatRestriction(String name, String label, String config) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustCroppingParam(CmsCroppingParamBean croppingParam) Adjust the given cropping parameter bean to this format restriction.intgetHeight(int orgHeight, int orgWidth) Returns the preset height for this format restriction.getLabel()Returns the label for the format.getName()Returns the format name.intgetWidth(int orgHeight, int orgWidth) Returns the preset width for this format restriction.booleanReturns if this format allows cropping.booleanReturns if this format has a fixed height/width ratio.booleanReturns if height is editable.static booleanisValidConfig(String config) Returns if given configuration string is valid.booleanReturns if width is editable.booleanmatchesCroppingParam(CmsCroppingParamBean croppingParam) Checks whether the given cropping parameter matches these restrictions.
-
Constructor Details
-
CmsImageFormatRestriction
Constructor.- Parameters:
name- the format namelabel- the labelconfig- the configuration
-
-
Method Details
-
isValidConfig
Returns if given configuration string is valid.- Parameters:
config- configuration string- Returns:
trueif given configuration string is valid
-
adjustCroppingParam
Description copied from interface:I_CmsFormatRestrictionAdjust the given cropping parameter bean to this format restriction.Execute on selection of this restriction.
- Specified by:
adjustCroppingParamin interfaceI_CmsFormatRestriction- Parameters:
croppingParam- the cropping parameter bean to adjust- See Also:
-
getHeight
Description copied from interface:I_CmsFormatRestrictionReturns the preset height for this format restriction.- Specified by:
getHeightin interfaceI_CmsFormatRestriction- Parameters:
orgHeight- the original image heightorgWidth- the original image width- Returns:
- the height
- See Also:
-
getLabel
Description copied from interface:I_CmsFormatRestrictionReturns the label for the format.- Specified by:
getLabelin interfaceI_CmsFormatRestriction- Returns:
- the label
- See Also:
-
getName
Description copied from interface:I_CmsFormatRestrictionReturns the format name.- Specified by:
getNamein interfaceI_CmsFormatRestriction- Returns:
- the format name
- See Also:
-
getWidth
Description copied from interface:I_CmsFormatRestrictionReturns the preset width for this format restriction.- Specified by:
getWidthin interfaceI_CmsFormatRestriction- Parameters:
orgHeight- the original image heightorgWidth- the original image width- Returns:
- the width
- See Also:
-
isCroppingEnabled
Description copied from interface:I_CmsFormatRestrictionReturns if this format allows cropping.- Specified by:
isCroppingEnabledin interfaceI_CmsFormatRestriction- Returns:
trueif cropping is allowed- See Also:
-
isFixedRatio
Description copied from interface:I_CmsFormatRestrictionReturns if this format has a fixed height/width ratio.- Specified by:
isFixedRatioin interfaceI_CmsFormatRestriction- Returns:
trueif the ratio is fixed- See Also:
-
isHeightEditable
Description copied from interface:I_CmsFormatRestrictionReturns if height is editable.- Specified by:
isHeightEditablein interfaceI_CmsFormatRestriction- Returns:
trueif height is editable- See Also:
-
isWidthEditable
Description copied from interface:I_CmsFormatRestrictionReturns if width is editable.- Specified by:
isWidthEditablein interfaceI_CmsFormatRestriction- Returns:
trueif width is editable- See Also:
-
matchesCroppingParam
Description copied from interface:I_CmsFormatRestrictionChecks whether the given cropping parameter matches these restrictions.- Specified by:
matchesCroppingParamin interfaceI_CmsFormatRestriction- Parameters:
croppingParam- the cropping parameter to match- Returns:
trueif the restrictions are matched by the given cropping parameter- See Also:
-