| de.jwic.base.ControlContainer de.jwic.controls.ImageControl
ImageControl | abstract public class ImageControl extends ControlContainer implements IResourceControl(Code) | | Default IImageControl implementation that support linked map.
ImageControl.vtl uses jWic ajax update listener to replace the image without flicker.
IE 6 has a bug when working with img tag using a map:
An update to the map without updating its img also crashes the IE6!
author: jbornema |
Method Summary | |
public void | actionPerformed(String actionId, String parameter) | public void | addShape(String type, String coords, String title, String url) Adds a shape of type SHAPE_TYPE_RECT, ..._CIRLCE or ..._POLY with url and title. | public void | addShape(String type, String coords, String title) | public void | attachResource(HttpServletRequest req, HttpServletResponse res) | public String | createImageURL() Create a URL to this image. | abstract public String | getFilename() The filename is used in the servlet response and in
the html rendering. | public int | getHeight() Return the image height in pixel. | public ByteArrayOutputStream | getImageOutputStream() Return the ByteArrayOutputStream renderImage() must write the binary
image data into. | public String | getInfoMessage() Return the info message that is used for img title attribute and is
also displayed in window.status. | public String | getMimeType() Return the mime type for this image, like MIME_TYPE_JPG. | public List | getShapes() Return Collection of Shape objects that had been added with addShape(...). | public int | getWidth() Return the image width in pixel. | public boolean | isCreateUniqueURL() Return true if on every createUniqueURL() a new URL is created. | public boolean | isHidden() Return true if control should be rendered with no content. | abstract public void | renderImage() Renders the image data to imageOutputStream.
Don't forget to set the appropiate mime type and call
ByteArrayOutputStream.reset() before generating the image data again. | public String | renderImage(OutputStream out) Renders the image data to the writer. | public void | setCreateUniqueURL(boolean createUniqueURL) Set if on every createUniqueURL() a new URL is created. | public void | setHeight(int height) Set the image height in pixel. | public void | setHidden(boolean hidden) Set if control should be rendered with no content. | public void | setInfoMessage(String infoMessage) Set the info message that is used for img title attribute and is
also displayed in window.status. | public void | setMimeType(String mimeType) Set the mime type for this image, like MIME_TYPE_JPG. | public void | setRequireRedraw(boolean requireRedraw) | public void | setWidth(int width) Set the image width in pixel. |
SHAPE_TYPE_CIRCLE | final public static String SHAPE_TYPE_CIRCLE(Code) | | |
SHAPE_TYPE_POLY | final public static String SHAPE_TYPE_POLY(Code) | | |
SHAPE_TYPE_RECT | final public static String SHAPE_TYPE_RECT(Code) | | |
createUniqueURL | protected boolean createUniqueURL(Code) | | |
height | protected int height(Code) | | |
hidden | protected boolean hidden(Code) | | |
width | protected int width(Code) | | |
addShape | public void addShape(String type, String coords, String title, String url)(Code) | | Adds a shape of type SHAPE_TYPE_RECT, ..._CIRLCE or ..._POLY with url and title.
If url is null no "clickable" link is added.
Depending on the shape type the coords follow different syntax:
SHAPE_TYPE_RECT: "x1,y1,x2,y2"
SHAPE_TYPE_CIRCLE: "x,y,r"
SHAPE_TYPE_POLY: "x1,y1[,x2,y2[,...]]"
Parameters: type - Parameters: coords - Parameters: url - Parameters: title - |
addShape | public void addShape(String type, String coords, String title)(Code) | | Same as addShape(type, coords, title, null)
Parameters: type - Parameters: coords - Parameters: title - |
createImageURL | public String createImageURL()(Code) | | Create a URL to this image.
Current milliseconds is part of that URL is createUniqueURL is set.
|
getFilename | abstract public String getFilename()(Code) | | The filename is used in the servlet response and in
the html rendering.
The filename for the created image. |
getHeight | public int getHeight()(Code) | | Return the image height in pixel.
|
getImageOutputStream | public ByteArrayOutputStream getImageOutputStream()(Code) | | Return the ByteArrayOutputStream renderImage() must write the binary
image data into. Should call reset() to it before creating the image
data again.
|
getInfoMessage | public String getInfoMessage()(Code) | | Return the info message that is used for img title attribute and is
also displayed in window.status.
|
getMimeType | public String getMimeType()(Code) | | Return the mime type for this image, like MIME_TYPE_JPG.
|
getShapes | public List getShapes()(Code) | | Return Collection of Shape objects that had been added with addShape(...).
|
getWidth | public int getWidth()(Code) | | Return the image width in pixel.
|
isCreateUniqueURL | public boolean isCreateUniqueURL()(Code) | | Return true if on every createUniqueURL() a new URL is created.
Default is false.
|
isHidden | public boolean isHidden()(Code) | | Return true if control should be rendered with no content.
Used to render the JavaScript if control should be invisible.
Should be used instead of visible attribute.
|
renderImage | abstract public void renderImage() throws IOException(Code) | | Renders the image data to imageOutputStream.
Don't forget to set the appropiate mime type and call
ByteArrayOutputStream.reset() before generating the image data again.
throws: IOException - |
setCreateUniqueURL | public void setCreateUniqueURL(boolean createUniqueURL)(Code) | | Set if on every createUniqueURL() a new URL is created.
Default is false.
Parameters: createUniqueURL - |
setHeight | public void setHeight(int height)(Code) | | Set the image height in pixel.
Parameters: height - |
setHidden | public void setHidden(boolean hidden)(Code) | | Set if control should be rendered with no content.
Used to render the JavaScript if control should be invisible.
Should be used instead of visible attribute.
Parameters: hidden - |
setInfoMessage | public void setInfoMessage(String infoMessage)(Code) | | Set the info message that is used for img title attribute and is
also displayed in window.status.
Parameters: infoMessage - |
setMimeType | public void setMimeType(String mimeType)(Code) | | Set the mime type for this image, like MIME_TYPE_JPG.
Parameters: mimeType - |
setRequireRedraw | public void setRequireRedraw(boolean requireRedraw)(Code) | | |
setWidth | public void setWidth(int width)(Code) | | Set the image width in pixel.
Parameters: width - |
|
|