|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.meshcms.core.AbstractThumbnail
org.meshcms.core.ResizedThumbnail
Creates a thumbnail by simply resizing the image. The way the thumbnail is created can be controlled with some parameters (see the various setters for details).
Field Summary | |
static int |
DEFAULT_SIZE
Default thumbnail size. |
static java.lang.String |
MODE_CROP
Used to scale the image and crop it to have a thumbnail of the required size. |
static java.lang.String |
MODE_PADDING
Like MODE_SCALE , but adds a padding to reach the required size. |
static java.lang.String |
MODE_SCALE
Used to scale the image maintaining proportions. |
static java.lang.String |
MODE_STRETCH
Used to resize the image without maintaining proportions. |
static java.lang.String |
WHITE
Default padding color. |
Fields inherited from class org.meshcms.core.AbstractThumbnail |
DEFAULT_BORDER_COLOR |
Constructor Summary | |
ResizedThumbnail()
|
Method Summary | |
protected boolean |
createThumbnail(java.io.File imageFile,
java.io.File thumbnailFile)
Creates the thumbnail. Called only if needed. |
java.lang.String |
getColor()
|
int |
getHeight()
|
java.lang.String |
getMode()
|
java.lang.String |
getSuggestedFileName()
Returns the recommended file name for the current thumbnail. |
int |
getWidth()
|
boolean |
isHighQuality()
Returns the quality setting. |
void |
setColor(java.lang.String color)
Sets the padding color (used only when mode is MODE_PADDING ). |
void |
setHeight(int height)
Sets the maximum image height. |
void |
setHighQuality(boolean highQuality)
Enables or disables better quality for image resizing. |
void |
setMode(java.lang.String mode)
Sets the scaling mode. |
void |
setWidth(int width)
Sets the maximum image width. |
Methods inherited from class org.meshcms.core.AbstractThumbnail |
averageResize, checkAndCreate, drawResizedImage, linearResize, resize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MODE_SCALE
public static final java.lang.String MODE_CROP
public static final java.lang.String MODE_PADDING
MODE_SCALE
, but adds a padding to reach the required size.
public static final java.lang.String MODE_STRETCH
public static final java.lang.String WHITE
public static final int DEFAULT_SIZE
Constructor Detail |
public ResizedThumbnail()
Method Detail |
public java.lang.String getSuggestedFileName()
AbstractThumbnail
getSuggestedFileName
in class AbstractThumbnail
protected boolean createThumbnail(java.io.File imageFile, java.io.File thumbnailFile)
AbstractThumbnail
createThumbnail
in class AbstractThumbnail
imageFile
- source image file to create thumbnail fromthumbnailFile
- destination file
public boolean isHighQuality()
public void setHighQuality(boolean highQuality)
public int getWidth()
public void setWidth(int width)
public int getHeight()
public void setHeight(int height)
public java.lang.String getMode()
public void setMode(java.lang.String mode)
MODE_SCALE
(default),
MODE_CROP
, MODE_PADDING
and MODE_STRETCH
.
public java.lang.String getColor()
public void setColor(java.lang.String color)
MODE_PADDING
).
The color must be supplied in hexadecimal format, with or without a #
sign (e.g. #ffcc00 or 123ABC).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |