|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.util.E4ImageResizer
public class E4ImageResizer
Resizes an image specified by a relative filename based on the client's root path by a specified width
and height in pixels. The image will be cached in a temporary directory (TEMP_PATH under the client's path and
an tag for width and height.
| Example_ImageResizer.java |
| Nested Class Summary | |
|---|---|
static class |
E4ImageResizer.E4ImageResizerSize
Image width and height |
static class |
E4ImageResizer.PostProcessingInformation
|
| Field Summary |
|---|
| Fields inherited from class e4s.util.E4Object |
|---|
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
E4ImageResizer(E4ApplObj_Intf applobj,
E4String filename)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the specified client. |
|
E4ImageResizer(E4ApplObj_Intf applobj,
IMG image)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the specified client. |
|
E4ImageResizer(E4ApplObj_Intf applobj,
java.lang.String filename)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the specified client. |
|
E4ImageResizer(E4Client client,
E4String filename)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the specified client. |
|
E4ImageResizer(E4Client client,
IMG image)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the specified client. |
|
E4ImageResizer(E4Client client,
java.lang.String filename)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the specified client. |
|
E4ImageResizer(E4String filename)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the application (equal for all clients !). |
|
E4ImageResizer(IMG image)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the application (equal for all clients !). |
|
E4ImageResizer(java.lang.String filename)
Make an instance of this E4ImageResizer class with a relative filename under the root directory of the application (equal for all clients !). |
|
| Method Summary | |
|---|---|
static java.lang.String |
_getSVNVersionString()
|
E4Color |
getBackgroundColor()
Return the background color which is required for any offset-filling in the case that image width/length are is different from target width/length. |
E4Color |
getBorderColor()
Get the border color. |
E4Client |
getClient()
|
java.lang.String |
getLastError()
|
E4ImageResizer.PostProcessingInformation |
getLastProcessingInformation(int width,
int height)
Either, this information is from the last conversion - or - if the image was not scaled because it exists in the cache, or width/height is different, values are recalculated here. |
java.lang.String |
getResizedPath(int width,
int height)
Deprecated. |
java.lang.String |
getResizedPathAbs(int width,
int height)
|
static IMG |
getScaledImage(E4Client client,
IMG img,
int width,
int height)
|
static IMG |
getScaledImage(E4Client client,
IMG img,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
|
static IMG |
getScaledImage(E4Client client,
java.lang.String filename,
int width,
int height)
|
static IMG |
getScaledImage(E4Client client,
java.lang.String filename,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
|
static IMG |
getScaledImage(IMG img,
int width,
int height)
|
static IMG |
getScaledImage(IMG img,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
|
IMG |
getScaledImage(int width,
int height)
Get the scaled image which will be created and stored under the TEMP_PATH directory structure,
containing one sub directory for each pair of width/height values. |
IMG |
getScaledImage(int width,
int height,
boolean use_cache)
Get the scaled image which will be created and stored under the TEMP_PATH directory structure,
containing one sub directory for each pair of width/height values. |
static IMG |
getScaledImage(java.lang.String filename,
int width,
int height)
|
static IMG |
getScaledImage(java.lang.String filename,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
|
E4ImageResizer.E4ImageResizerSize |
getSize()
Get Information (width, height) about the image |
java.lang.String |
getTempPath(int width,
int height)
|
static void |
removeTemporaryFiles(E4Client client)
Removes all temporary files for the specified client, or if the client is null for the application. |
boolean |
requiresRendering(int width,
int height)
Check, if an image requires rendering (non existant in that size, changed file) |
void |
setBackgroundColor(java.awt.Color color)
Define a background color which is required for any offset-filling in the case that image width/length are is different from target width/length. |
void |
setBackgroundColor(E4Color color)
Define a background color which is required for any offset-filling in the case that image width/length are is different from target width/length. |
void |
setBorderColor(java.awt.Color color)
Define a border color which is optional. |
void |
setBorderColor(E4Color color)
Define a border color which is optional. |
void |
setDestinationPathRelative(java.lang.String path_relative)
A value of null (= default) uses a generic path based on the #TEMP directory, followed by the image dimensions (something like "temp/0100x0200"). |
static java.lang.String |
storeScaledImage(java.net.URL remote_path,
java.lang.String filename_local)
Read a file from a remote server and store it on a specified local path. |
static java.lang.String |
storeScaledImage(java.net.URL remote_path,
java.lang.String filename_local,
int target_width,
int target_height)
Read and rescale a file from a remote server and store it on a specified local path. |
| Methods inherited from class e4s.util.E4Object |
|---|
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public E4ImageResizer(java.lang.String filename)
filename - a relative filename (only .jpg, .jpeg, .png or .gif supported)public E4ImageResizer(IMG image)
filename - a relative filename (only .jpg, .jpeg, .png or .gif supported)public E4ImageResizer(E4String filename)
filename - a relative filename (only .jpg, .jpeg, .png or .gif supported)
public E4ImageResizer(E4ApplObj_Intf applobj,
java.lang.String filename)
applobj - the current application object containing the actual clientfilename - a relative filename (only .jpg, .jpeg, .png or .gif supported)
public E4ImageResizer(E4ApplObj_Intf applobj,
IMG image)
applobj - the current application object containing the actual clientimage - a relative filename (only .jpg, .jpeg, .png or .gif supported)
public E4ImageResizer(E4ApplObj_Intf applobj,
E4String filename)
applobj - the current application object containing the actual clientfilename - a relative filename (only .jpg, .jpeg, .png or .gif supported)
public E4ImageResizer(E4Client client,
java.lang.String filename)
client - the actual clientfilename - a relative filename (only .jpg, .jpeg, .png or .gif supported)
public E4ImageResizer(E4Client client,
IMG image)
client - the actual clientimage - a relative filename (only .jpg, .jpeg, .png or .gif supported)
public E4ImageResizer(E4Client client,
E4String filename)
client - the actual clientfilename - a relative filename (only .jpg, .jpeg, .png or .gif supported)| Method Detail |
|---|
public E4ImageResizer.E4ImageResizerSize getSize()
public boolean requiresRendering(int width,
int height)
throws java.lang.Exception
java.lang.Exception
public IMG getScaledImage(int width,
int height)
throws java.lang.Exception
TEMP_PATH directory structure,
containing one sub directory for each pair of width/height values. The file will be stored in .png format,
whatever format it has been before. Does not use cache.
width - the width in pixelsheight - the height in pixels
java.lang.Exception
public IMG getScaledImage(int width,
int height,
boolean use_cache)
throws java.lang.Exception
TEMP_PATH directory structure,
containing one sub directory for each pair of width/height values. The file will be stored in .png format,
whatever format it has been before.
width - the width in pixelsheight - the height in pixelsuse_cache - uses a cache for some seconds, can result in out of memory exceptions when many images are beeing rendered in short time
java.lang.Exception
public java.lang.String getTempPath(int width,
int height)
public java.lang.String getResizedPath(int width,
int height)
getResizedPathAbs(int,int)
public java.lang.String getResizedPathAbs(int width,
int height)
public E4Color getBackgroundColor()
getBackgroundColor()public void setBackgroundColor(java.awt.Color color)
color - a AWT colorgetBackgroundColor()public void setBackgroundColor(E4Color color)
color - an AWT color, the default is whitegetBackgroundColor(),
setBackgroundColor(e4s.html.E4Color)public E4Color getBorderColor()
getBackgroundColor(),
setBackgroundColor(e4s.html.E4Color)public void setBorderColor(java.awt.Color color)
color - an AWT color or null if no border shall be drawn (default)getBackgroundColor(),
setBackgroundColor(e4s.html.E4Color)public void setBorderColor(E4Color color)
color - a color or null if no border shall be drawn (default)getBackgroundColor(),
setBackgroundColor(e4s.html.E4Color)public static void removeTemporaryFiles(E4Client client)
public static IMG getScaledImage(IMG img,
int width,
int height)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(java.lang.String filename,
int width,
int height)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(IMG img,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(java.lang.String filename,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(E4Client client,
IMG img,
int width,
int height)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(E4Client client,
java.lang.String filename,
int width,
int height)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(E4Client client,
IMG img,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
throws java.lang.Exception
java.lang.Exception
public static IMG getScaledImage(E4Client client,
java.lang.String filename,
int width,
int height,
E4Color bgColor,
E4Color borderColor)
throws java.lang.Exception
java.lang.Exceptionpublic E4Client getClient()
public static java.lang.String storeScaledImage(java.net.URL remote_path,
java.lang.String filename_local)
throws java.lang.Exception
remote_path - the URL of the image to be readfilename_local - a local filename (absolute path and filename)
java.lang.Exception
public static java.lang.String storeScaledImage(java.net.URL remote_path,
java.lang.String filename_local,
int target_width,
int target_height)
throws java.lang.Exception
remote_path - the URL of the image to be readfilename_local - a local filename (absolute path and filename)target_width - -1 means no resizing or the target width in piceltarget_height - -1 means no resizing or the target height in pixel
java.lang.Exceptionpublic java.lang.String getLastError()
public E4ImageResizer.PostProcessingInformation getLastProcessingInformation(int width,
int height)
public void setDestinationPathRelative(java.lang.String path_relative)
#TEMP directory, followed by the image dimensions (something like "temp/0100x0200").
A call to this function is not necessary, unless you want to change file location away from the temp directory.
path_relative - a path, relative to and within the client directorypublic static java.lang.String _getSVNVersionString()
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||