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
ConstructorDescriptionCmsImageFormatHandler
(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.HandlerRegistration
addValueChangeHandler
(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsCroppingParamBean> handler) void
fireEvent
(com.google.gwt.event.shared.GwtEvent<?> event) protected void
Helper 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.int
Returns the original height.int
Returns the original width.void
init
(CmsImageFormatsForm formatForm, CmsCroppingDialog croppingDialog) Initializes the format form handler.boolean
Returns if scaling formats may be selected for the image.void
onFormatChange
(String formatKey) Execute on format change.void
onHeightChange
(String height) Execute on height change.void
onLockRatio
(boolean locked) Execute when the lock image ratio is clicked.void
Execute when cropping is removed.void
Execute to reset image format and size input.void
onWidthChange
(String width) Execute on width change.void
Shows the image cropping dialog.void
setCropping
(CmsCroppingParamBean croppingParam) Sets the given cropping parameter.void
setOriginalWidth
(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:
true
if 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
-true
if 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.