Interface I_CmsFormatRestriction
-
- All Known Implementing Classes:
CmsFreeFormatRestriction
,CmsImageFormatRestriction
,CmsOriginalFormatRestriction
,CmsUserFormatRestriction
public interface I_CmsFormatRestriction
Image format restriction. To be used within the image format tab of the image preview.- Since:
- 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
DIMENSION_NOT_SET
Value to indicate this dimension is not set.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.java.lang.String
getLabel()
Returns the label for the format.java.lang.String
getName()
Returns the format name.int
getWidth(int orgHeight, int orgWidth)
Returns the preset width for this format restriction.boolean
isCroppingEnabled()
Returns if this format allows cropping.boolean
isFixedRatio()
Returns if this format has a fixed height/width ratio.boolean
isHeightEditable()
Returns if height is editable.boolean
isWidthEditable()
Returns if width is editable.boolean
matchesCroppingParam(CmsCroppingParamBean croppingParam)
Checks whether the given cropping parameter matches these restrictions.
-
-
-
Field Detail
-
DIMENSION_NOT_SET
static final int DIMENSION_NOT_SET
Value to indicate this dimension is not set.- See Also:
- Constant Field Values
-
-
Method Detail
-
adjustCroppingParam
void adjustCroppingParam(CmsCroppingParamBean croppingParam)
Adjust the given cropping parameter bean to this format restriction.Execute on selection of this restriction.
- Parameters:
croppingParam
- the cropping parameter bean to adjust
-
getHeight
int getHeight(int orgHeight, int orgWidth)
Returns the preset height for this format restriction.- Parameters:
orgHeight
- the original image heightorgWidth
- the original image width- Returns:
- the height
-
getLabel
java.lang.String getLabel()
Returns the label for the format.- Returns:
- the label
-
getName
java.lang.String getName()
Returns the format name.- Returns:
- the format name
-
getWidth
int getWidth(int orgHeight, int orgWidth)
Returns the preset width for this format restriction.- Parameters:
orgHeight
- the original image heightorgWidth
- the original image width- Returns:
- the width
-
isCroppingEnabled
boolean isCroppingEnabled()
Returns if this format allows cropping.- Returns:
true
if cropping is allowed
-
isFixedRatio
boolean isFixedRatio()
Returns if this format has a fixed height/width ratio.- Returns:
true
if the ratio is fixed
-
isHeightEditable
boolean isHeightEditable()
Returns if height is editable.- Returns:
true
if height is editable
-
isWidthEditable
boolean isWidthEditable()
Returns if width is editable.- Returns:
true
if width is editable
-
matchesCroppingParam
boolean matchesCroppingParam(CmsCroppingParamBean croppingParam)
Checks whether the given cropping parameter matches these restrictions.- Parameters:
croppingParam
- the cropping parameter to match- Returns:
true
if the restrictions are matched by the given cropping parameter
-
-