Class CmsUserFormatRestriction
- java.lang.Object
-
- org.opencms.ade.galleries.client.preview.CmsUserFormatRestriction
-
- All Implemented Interfaces:
I_CmsFormatRestriction
public class CmsUserFormatRestriction extends java.lang.Object implements 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
Constructors Constructor Description CmsUserFormatRestriction(java.lang.String name, java.lang.String label)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
CmsUserFormatRestriction
public CmsUserFormatRestriction(java.lang.String name, java.lang.String label)
Constructor.- Parameters:
name
- the format namelabel
- the format label
-
-
Method Detail
-
adjustCroppingParam
public void adjustCroppingParam(CmsCroppingParamBean croppingParam)
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:
I_CmsFormatRestriction.adjustCroppingParam(org.opencms.ade.galleries.client.preview.CmsCroppingParamBean)
-
getHeight
public int getHeight(int orgHeight, int orgWidth)
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:
I_CmsFormatRestriction.getHeight(int, int)
-
getLabel
public java.lang.String getLabel()
Description copied from interface:I_CmsFormatRestriction
Returns the label for the format.- Specified by:
getLabel
in interfaceI_CmsFormatRestriction
- Returns:
- the label
- See Also:
I_CmsFormatRestriction.getLabel()
-
getName
public java.lang.String getName()
Description copied from interface:I_CmsFormatRestriction
Returns the format name.- Specified by:
getName
in interfaceI_CmsFormatRestriction
- Returns:
- the format name
- See Also:
I_CmsFormatRestriction.getName()
-
getWidth
public int getWidth(int orgHeight, int orgWidth)
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:
I_CmsFormatRestriction.getWidth(int, int)
-
isCroppingEnabled
public boolean 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:
I_CmsFormatRestriction.isCroppingEnabled()
-
isFixedRatio
public boolean 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:
I_CmsFormatRestriction.isFixedRatio()
-
isHeightEditable
public boolean 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:
I_CmsFormatRestriction.isHeightEditable()
-
isWidthEditable
public boolean 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:
I_CmsFormatRestriction.isWidthEditable()
-
matchesCroppingParam
public boolean matchesCroppingParam(CmsCroppingParamBean croppingParam)
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:
I_CmsFormatRestriction.matchesCroppingParam(org.opencms.ade.galleries.client.preview.CmsCroppingParamBean)
-
-