Package io.wcm.handler.media
Class CropDimension
- java.lang.Object
-
- io.wcm.handler.media.Dimension
-
- io.wcm.handler.media.CropDimension
-
@ProviderType public final class CropDimension extends Dimension
Crop dimension with left, top, width and height as integer.
-
-
Constructor Summary
Constructors Constructor Description CropDimension(long left, long top, long width, long height)
CropDimension(long left, long top, long width, long height, boolean autoCrop)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static @NotNull CropDimension
fromCropString(@NotNull java.lang.String cropString)
Get crop dimension from crop string.long
getBottom()
@NotNull java.lang.String
getCropString()
@NotNull java.lang.String
getCropStringWidthHeight()
long
getLeft()
@NotNull java.awt.geom.Rectangle2D
getRectangle()
long
getRight()
long
getTop()
int
hashCode()
boolean
isAutoCrop()
java.lang.String
toString()
-
-
-
Constructor Detail
-
CropDimension
public CropDimension(long left, long top, long width, long height)
- Parameters:
left
- Left in pixelstop
- Top in pixelswidth
- Width in pixelsheight
- Height in pixels
-
CropDimension
public CropDimension(long left, long top, long width, long height, boolean autoCrop)
- Parameters:
left
- Left in pixelstop
- Top in pixelswidth
- Width in pixelsheight
- Height in pixelsautoCrop
- Mark this dimension as auto-cropped
-
-
Method Detail
-
getLeft
public long getLeft()
- Returns:
- Left in pixels
-
getTop
public long getTop()
- Returns:
- Top in pixels
-
getRight
public long getRight()
- Returns:
- Right in pixels
-
getBottom
public long getBottom()
- Returns:
- Bottom in pixels
-
isAutoCrop
public boolean isAutoCrop()
- Returns:
- true if is dimenions is marked as auto-cropped
-
getCropString
@NotNull public @NotNull java.lang.String getCropString()
- Returns:
- Crop string with left,top,right,bottom.
-
getCropStringWidthHeight
@NotNull public @NotNull java.lang.String getCropStringWidthHeight()
- Returns:
- Crop string with left,top,width,height.
-
getRectangle
@NotNull public @NotNull java.awt.geom.Rectangle2D getRectangle()
- Returns:
- Rectangle
-
fromCropString
@NotNull public static @NotNull CropDimension fromCropString(@NotNull @NotNull java.lang.String cropString)
Get crop dimension from crop string. Please note: Crop string contains not width/height as 3rd/4th parameter but right, bottom.- Parameters:
cropString
- Cropping string from AEM inplace editor- Returns:
- Crop dimension instance
- Throws:
java.lang.IllegalArgumentException
- if crop string syntax is invalid
-
-