IlvImageView

IlvObject
  |
  +--IlvEmptyView
       |
       +--IlvImageView
Category:
Common component
JavaScript File:
IlvImageView.js
Description:
An IlvImageView is an extension of IlvEmptyView that is designed to display an image. By default, the image is scaled to fit the view. Use the setImageSize() method to set the image size independent of the view size.

Constructor Summary
IlvImageView(left, top, width, height, image)

Method Summary
addErrorListener(listener)
Adds a listener to be called when an error occurs during the current request for an image from the server.
addImageLoadListener(listener)
Adds a listener to be called when the view has loaded a new image.
addImageLoadingListener(listener)
Adds a listener to be called when the view has begun loading a new image.
addImagePreloadListener(listener)
Adds a listener to be called when the view has loaded a new image, but before the new image is made visible.
addScrollListener(listener)
Adds a listener to be called when the view has been scrolled.
addTimeoutErrorListener(listener)
Adds a listener to be called when a timeout has occurred during the current request for an image from the server.
childrenToHTML()
Creates the HTML for this component's child views.
dispose()
Disposes of all resources being used by the view.
getBlendTransform()
Returns whether new images will be revealed by fading the previous image.
getCursor()
Returns the cursor of the view.
getHTMLContent()
Returns the piece of HTML for the view.
getImage()
Returns the image of the view.
getImageSize()
Returns the size of the view's image.
getScrollPosition()
Returns the scroll position of this view.
getTimeoutInterval()
Returns the timeout interval for image requests to the server, in seconds.
getToolTipText()
Returns the tooltip text of the image.
isImageLoaded()
Returns whether an image is loaded in the view.
isVisible()
Returns the visibility of this view.
onTimeout(view)
This method is automatically invoked when a timeout error occurs.
removeErrorListener(listener)
Removes a listener installed with addErrorListener.
removeImageLoadListener(listener)
Removes a listener installed with addImageLoadListener.
removeImagePreloadListener(listener)
Removes a listener installed with addImagePreloadListener.
removeTimeoutErrorListener(listener)
Removes a listener installed with addTimeoutErrorListener.
setBackgroundColor(color)
Sets the background color of the image view.
setBlendTransform(set)
Sets whether new images will be revealed by fading the previous image.
setChildrenBounds(left, top, width, height)
Changes the size of the view's child views.
setCursor(cursor)
Sets the cursor of the view.
setImage(image, width, height)
Sets the image of the view.
setImageSize(width, height, skipImageRedisplay)
Sets the size of the view's image.
setScrollPosition(x, y)
Sets the scroll position of this view.
setTimeoutInterval(interval)
Sets the timeout interval for loading an image from the server.
setToolTipText(string)
Sets the tooltip text of the image.
setVisible(visible)
Sets the visibility of this view.
startErrorTimer()
Starts a timer for errors.
stopErrorTimer()
Stops the error timer.

Constructor Detail

IlvImageView

IlvImageView(left, top, width, height, image)
Creates an instance of IlvImageView.

Method Detail

addErrorListener

addErrorListener(listener)
Adds a listener to be called when an error occurs during the current request for an image from the server.
Parameters:
listener - The listener function, which must have the following parameters:
  • view: The IlvImageView.

addImageLoadListener

addImageLoadListener(listener)
Adds a listener to be called when the view has loaded a new image.
Parameters:
listener - The listener function, which must have the following parameters:
  • view: The IlvImageView.

addImageLoadingListener

addImageLoadingListener(listener)
Adds a listener to be called when the view has begun loading a new image.
Parameters:
listener - The listener function, which must have the following parameters:
  • view: The IlvImageView.

addImagePreloadListener

addImagePreloadListener(listener)
Adds a listener to be called when the view has loaded a new image, but before the new image is made visible.
Parameters:
listener - The listener function, which must have the following parameters:
  • view: The IlvImageView.

addScrollListener

addScrollListener(listener)
Adds a listener to be called when the view has been scrolled.
Parameters:
listener - The listener function, which must have the following parameters:
  • view: The IlvImageView.

addTimeoutErrorListener

addTimeoutErrorListener(listener)
Adds a listener to be called when a timeout has occurred during the current request for an image from the server.
Parameters:
listener - The listener function, which must have the following parameters:
  • view: The IlvImageView.

childrenToHTML

childrenToHTML()
Creates the HTML for this component's child views. Warning: This method is considered to be part of an IlvImageView's internal implementation and is not a public API.

dispose

dispose()
Disposes of all resources being used by the view. Make sure to call the global IlvObject.callDispose() function on the onunload event of the page:
  <body onunload="IlvObject.callDispose()">
 

getBlendTransform

getBlendTransform()
Returns whether new images will be revealed by fading the previous image. The default value is true.

getCursor

getCursor()
Returns the cursor of the view. The default value is "auto".

getHTMLContent

getHTMLContent()
Returns the piece of HTML for the view.

getImage

getImage()
Returns the image of the view.

getImageSize

getImageSize()
Returns the size of the view's image.
Returns:
An object with two properties: width and height.

getScrollPosition

getScrollPosition()
Returns the scroll position of this view.
Returns:
An object with two properties: x and y.

getTimeoutInterval

getTimeoutInterval()
Returns the timeout interval for image requests to the server, in seconds. The default value is 600 or 10 minutes.

getToolTipText

getToolTipText()
Returns the tooltip text of the image.

isImageLoaded

isImageLoaded()
Returns whether an image is loaded in the view.

isVisible

isVisible()
Returns the visibility of this view.

onTimeout

onTimeout(view)
This method is automatically invoked when a timeout error occurs.
Parameters:
view - The IlvImageView.

removeErrorListener

removeErrorListener(listener)
Removes a listener installed with addErrorListener.
Parameters:
listener - The listener to remove.

removeImageLoadListener

removeImageLoadListener(listener)
Removes a listener installed with addImageLoadListener.
Parameters:
listener - The listener to remove.

removeImagePreloadListener

removeImagePreloadListener(listener)
Removes a listener installed with addImagePreloadListener.
Parameters:
listener - The listener to remove.

removeTimeoutErrorListener

removeTimeoutErrorListener(listener)
Removes a listener installed with addTimeoutErrorListener.
Parameters:
listener - The listener to remove.

setBackgroundColor

setBackgroundColor(color)
Sets the background color of the image view. By default, an image view has no background color and is therefore transparent.
Parameters:
color - A string describing the color. For example, "#FFFFFF" corresponds to white.

setBlendTransform

setBlendTransform(set)
Sets whether new images will be revealed by fading the previous image. The default value is true. This method is available only on Internet Explorer and will be ignored on Netscape Communicator.

setChildrenBounds

setChildrenBounds(left, top, width, height)
Changes the size of the view's child views. Warning: This method is considered to be part of an IlvImageView's internal implementation and is not a public API.
Parameters:
left - The absolute x position of the view on the page.
top - The absolute y position of the view on the page.
width - The width of the view.
height - The height of the view.

setCursor

setCursor(cursor)
Sets the cursor of the view.
Parameters:
cursor - The cursor name.

setImage

setImage(image, width, height)
Sets the image of the view.
Parameters:
image - The URL of the image.
width - The optional width of the image. Both the width and height must be specified in order to set the size of the new image. If either the width or height parameters are omitted, the view's image size will not be changed. If width < 0, the image width will be scaled to fit the width of the view.
height - The optional height of the image. Both the width and height must be specified in order to set the size of the new image. If either the width or height parameters are omitted, the view's image size will not be changed. If height < 0, the image height will be scaled to fit the height of the view.

setImageSize

setImageSize(width, height, skipImageRedisplay)
Sets the size of the view's image. The default is to scale the image to the size of the view.
Parameters:
width - The width of the image. If width < 0, the image width will be scaled to fit the width of the view.
height - The height of the image. If height < 0, the image height will be scaled to fit the height of the view.
skipImageRedisplay - A Boolean flag that indicates that the view's current image should not be scaled and redisplayed at the new size. This is useful if this call to setImageSize() will be immediately followed by a call to setImage. If skipImageRedisplay is omitted or is false, then the view's current image will be scaled and displayed at the new size.

setScrollPosition

setScrollPosition(x, y)
Sets the scroll position of this view.
Parameters:
x - The scroll position along the x-axis, relative to the top of the panel.
y - The scroll position along the y-axis, relative to the left side of the panel.

setTimeoutInterval

setTimeoutInterval(interval)
Sets the timeout interval for loading an image from the server.
Parameters:
interval - The timeout, specified in seconds. The default value is 600 or 10 minutes.

setToolTipText

setToolTipText(string)
Sets the tooltip text of the image.
Parameters:
string - A string.

setVisible

setVisible(visible)
Sets the visibility of this view.

startErrorTimer

startErrorTimer()
Starts a timer for errors.

stopErrorTimer

stopErrorTimer()
Stops the error timer.

Inherited Methods from IlvEmptyView
addSizeListener, childrenToHTML, getBounds, getHeight, getLeft, getLocation, getSize, getTop, getWidth, isStateInCookie, removeSizeListener, restoreState, saveState, setBounds, setChildrenBounds, setLocation, setSize, setStateInCookie, toHTML
Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility