java.lang.Object
org.opencms.ade.galleries.client.preview.util.CmsBoxFit
All Implemented Interfaces:
I_CmsTransform

public class CmsBoxFit extends Object implements I_CmsTransform
A coordinate system transform for translating between coordinates relative to a rectangle and the coordinates relative to a second rectangle with the first rectangle fit into the second one, either by just centering if possible or by centering and scaling it.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Scale mode.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmsBoxFit(CmsBoxFit.Mode mode, double width, double height, double naturalWidth, double naturalHeight)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.opencms.ade.galleries.shared.CmsPoint
    transformBack(org.opencms.ade.galleries.shared.CmsPoint point)
    Applies the inverse of the transformation to a point.
    org.opencms.ade.galleries.shared.CmsPoint
    transformForward(org.opencms.ade.galleries.shared.CmsPoint point)
    Applies the transformation to a point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait