Class CmsImagePreviewHandler

    • Method Detail

      • addCroppingChangeHandler

        public void addCroppingChangeHandler​(java.lang.Runnable action)
        Adds a handler for cropping changes.

        Parameters:
        action - the handler to add
      • addImagePointChangeHandler

        public void addImagePointChangeHandler​(java.lang.Runnable onImagePointChanged)
        Adds a handler for focal point changes.

        Parameters:
        onImagePointChanged - the handler to add
      • getFormatName

        public java.lang.String getFormatName()
        Returns the name of the currently selected image format.

        Returns:
        the format name
      • getImageAttributes

        public void getImageAttributes​(I_CmsSimpleCallback<java.util.Map<java.lang.String,​java.lang.String>> callback)
        Returns image tag attributes to set for editor plugins.

        Parameters:
        callback - the callback to execute
      • getImageIdHash

        public int getImageIdHash()
        Returns the structure id hash of the previewed image.

        Returns:
        the structure id hash
      • getImageInfo

        public org.opencms.ade.galleries.shared.CmsImageInfoBean getImageInfo()
        Gets the image information.

        Returns:
        the image information
      • getPreviewScaleParam

        public java.lang.String getPreviewScaleParam​(int imageHeight,
                                                     int imageWidth)
        Returns the cropping parameter.

        Parameters:
        imageHeight - the original image height
        imageWidth - the original image width
        Returns:
        the cropping parameter
      • onValueChange

        public void onValueChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<CmsCroppingParamBean> event)
        Specified by:
        onValueChange in interface com.google.gwt.event.logical.shared.ValueChangeHandler<CmsCroppingParamBean>
        See Also:
        ValueChangeHandler.onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
      • setImageContainerSize

        public void setImageContainerSize​(int offsetWidth,
                                          int offsetHeight)
        Sets the dimensions of the area the image is going to be placed in.
        Parameters:
        offsetWidth - the container width
        offsetHeight - the container height