public class ImageDescriptor extends Object
Constructor and Description |
---|
ImageDescriptor(ImageSize size,
String identifier)
Constructor, where scaled and drawBackground are not set (false).
|
ImageDescriptor(ImageSize size,
String identifier,
boolean scaled,
boolean drawBackground) |
ImageDescriptor(ImageSize size,
String identifier,
boolean scaled,
boolean drawBackground,
Color backgroundColor) |
ImageDescriptor(ImageSize size,
String identifier,
boolean scaled,
boolean drawBackground,
Color backgroundColor,
boolean preserveAspectRation) |
ImageDescriptor(ImageSize size,
String identifier,
boolean scaled,
boolean drawBackground,
Color backgroundColor,
boolean preserveAspectRation,
List<ImageFormatType> validMimeTypes) |
ImageDescriptor(int width,
int height,
String identifier) |
ImageDescriptor(int width,
int height,
String identifier,
boolean scaled,
boolean drawBackground,
Color backgroundColor) |
Modifier and Type | Method and Description |
---|---|
Color |
getBackgroundColor() |
int |
getHorizontalAlignment() |
String |
getIdentifier() |
ImageSize |
getSize() |
List<ImageFormatType> |
getValidMimeTypes() |
int |
getVerticalAlignment() |
boolean |
isDrawBackground() |
boolean |
isPreserveAspectRation() |
boolean |
isScaled() |
void |
setHorizontalAlignment(int alignment)
Set the alignment to use for positioning the image horizontally within the scaled image.
|
void |
setVerticalAlignment(int alignment)
Set the alignment to use for positioning the image vertically within the scaled image.
|
public ImageDescriptor(ImageSize size, String identifier)
size
- The size as ImageSize
.identifier
- The unique identifier of the image.public ImageDescriptor(ImageSize size, String identifier, boolean scaled, boolean drawBackground)
size
- The size as ImageSize
.identifier
- The unique identifier of the image.scaled
- If true, the image is scaled.drawBackground
- If true, the image will be extended to size and a background will be drawn.public ImageDescriptor(ImageSize size, String identifier, boolean scaled, boolean drawBackground, Color backgroundColor)
size
- The size as ImageSize
.identifier
- The unique identifier of the image.scaled
- If true, the image is scaled.drawBackground
- If true, the image will be extended to size and a background will be drawn.backgroundColor
- The background color.public ImageDescriptor(ImageSize size, String identifier, boolean scaled, boolean drawBackground, Color backgroundColor, boolean preserveAspectRation)
size
- The size as ImageSize
.identifier
- The unique identifier of the image.scaled
- If true, the image is scaled.drawBackground
- If true, the image will be extended to size and a background will be drawn.backgroundColor
- The background color.preserveAspectRation
- If true, the aspect ration of the final image will be respected.public ImageDescriptor(ImageSize size, String identifier, boolean scaled, boolean drawBackground, Color backgroundColor, boolean preserveAspectRation, List<ImageFormatType> validMimeTypes)
size
- The size as ImageSize
.identifier
- The unique identifier of the image.scaled
- If true, the image is scaled.drawBackground
- If true, the image will be extended to size and a background will be drawn.backgroundColor
- The background color.preserveAspectRation
- If true, the aspect ration of the final image will be respected.validMimeTypes
- The mime types the image can have. If the image doesn't match any of the, the
first will be used.public ImageDescriptor(int width, int height, String identifier)
width
- The width.height
- The height.identifier
- The unique identifier of the image.public ImageDescriptor(int width, int height, String identifier, boolean scaled, boolean drawBackground, Color backgroundColor)
width
- The width.height
- The height.identifier
- The unique identifier of the image.scaled
- If true, the image is scaled.drawBackground
- If true, the image will be extended to size and a background will be drawn.backgroundColor
- The background color.public Color getBackgroundColor()
public int getHorizontalAlignment()
setHorizontalAlignment(int)
public String getIdentifier()
public ImageSize getSize()
public List<ImageFormatType> getValidMimeTypes()
public int getVerticalAlignment()
setVerticalAlignment(int)
public boolean isDrawBackground()
public boolean isPreserveAspectRation()
public boolean isScaled()
true
if the image is scaled, else not.public void setHorizontalAlignment(int alignment)
alignment
- a value describing the horizontal alignment of the imagepublic void setVerticalAlignment(int alignment)
alignment
- a value describing the vertical alignment of the imageCopyright © 2019 Communote team. All rights reserved.