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 final int
    Value to indicate this dimension is not set.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adjust the given cropping parameter bean to this format restriction.
    int
    getHeight(int orgHeight, int orgWidth)
    Returns the preset height for this format restriction.
    Returns the label for the format.
    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
    Checks whether the given cropping parameter matches these restrictions.
  • Field Details

  • Method Details

    • adjustCroppingParam

      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 height
      orgWidth - the original image width
      Returns:
      the height
    • getLabel

      Returns the label for the format.

      Returns:
      the label
    • 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 height
      orgWidth - the original image width
      Returns:
      the width
    • 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

      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