Class CmsImageFormatHandler
java.lang.Object
org.opencms.ade.galleries.client.preview.CmsImageFormatHandler
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsCroppingParamBean>,com.google.gwt.event.shared.HasHandlers
public class CmsImageFormatHandler
extends Object
implements com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsCroppingParamBean>
Image format form handler.
- Since:
- 8.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCmsImageFormatHandler(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryMode galleryMode, CmsGalleryDialog dialog, String selectedPath, int imageHeight, int imageWidth) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final <H extends com.google.gwt.event.shared.EventHandler>
com.google.gwt.event.shared.HandlerRegistrationaddHandler(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type) Adds this handler to the widget.com.google.gwt.event.shared.HandlerRegistrationaddValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsCroppingParamBean> handler) voidfireEvent(com.google.gwt.event.shared.GwtEvent<?> event) protected voidHelper method for firing a 'value changed' event.Returns the current cropping parameter.Returns the current format.Returns the formats.getImageAttributes(Map<String, String> attributes) Adds necessary attributes to the map.intReturns the original height.intReturns the original width.voidinit(CmsImageFormatsForm formatForm, CmsCroppingDialog croppingDialog) Initializes the format form handler.booleanReturns if scaling formats may be selected for the image.voidonFormatChange(String formatKey) Execute on format change.voidonHeightChange(String height) Execute on height change.voidonLockRatio(boolean locked) Execute when the lock image ratio is clicked.voidExecute when cropping is removed.voidExecute to reset image format and size input.voidonWidthChange(String width) Execute on width change.voidShows the image cropping dialog.voidsetCropping(CmsCroppingParamBean croppingParam) Sets the given cropping parameter.voidsetOriginalWidth(int originalWidth) Sets the original width.
-
Constructor Details
-
Method Details
-
getCroppingParam
Returns the current cropping parameter.- Returns:
- the current cropping parameter
-
getCurrentFormat
Returns the current format.- Returns:
- the current format
-
getFormats
Returns the formats.- Returns:
- the formats
-
getImageAttributes
Adds necessary attributes to the map.- Parameters:
attributes- the attribute map- Returns:
- the attribute map
-
getOriginalHeight
Returns the original height.- Returns:
- the original height
-
getOriginalWidth
Returns the original width.- Returns:
- the original width
-
init
Initializes the format form handler.- Parameters:
formatForm- the format formcroppingDialog- the cropping dialog
-
isUseFormats
Returns if scaling formats may be selected for the image.- Returns:
trueif scaling formats may be selected for the image
-
onFormatChange
Execute on format change.- Parameters:
formatKey- the new format value
-
onHeightChange
Execute on height change.- Parameters:
height- the new height
-
onLockRatio
Execute when the lock image ratio is clicked.- Parameters:
locked-trueif ratio is locked
-
onRemoveCropping
Execute when cropping is removed. -
onResetSize
Execute to reset image format and size input. -
onWidthChange
Execute on width change.- Parameters:
width- the new width
-
openCropping
Shows the image cropping dialog. -
setCropping
Sets the given cropping parameter.- Parameters:
croppingParam- the cropping parameter
-
setOriginalWidth
Sets the original width.- Parameters:
originalWidth- the original width to set
-
fireValueChangedEvent
Helper method for firing a 'value changed' event.