Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class IlvView

IlvObject
   |
   +--IlvEmptyView
      |
      +--IlvResizableView
         |
         +--IlvAbstractView
            |
            +--IlvView

Category:
Graphics Framework component
JavaScript File:
IlvView.js
Description:
IlvView is a component that displays an image obtained from a server. The server component must be an instance of IlvManagerServlet. This component can be connected to several components that allow you to manipulate it: A legend tool (IlvLegend), an overview (IlvOverview), and tools to zoom (IlvZoomTool) and pan (IlvPanTool).

The IlvInteractor class allows you to implement interaction with the view.


Constructor Summary
Constructor Attributes Constructor Name and Description
 
IlvView(left, top, width, height, namespace)
Method Summary
Method Attributes Method Name and Description
 
Adds a listener to be called when the capabilities have been loaded.
 
addErrorListener(listener)
Adds a listener to be called when an error occurs for the current request.
 
Adds a listener to be called when the view has loaded a new image.
 
Adds a listener to be called when an interactor has changed on the view.
 
Adds a listener to be called when a timeout has been reached for the current request.
 
centerAt(x, y)
Queries a new image centered at the specified point.
 
Creates the HTTP request for capabilities.
 
createImageMapRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for generating an image map.
 
createRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for the image request.
 
Releases the cookie holding the current image request.
 
Indicates if the new images will be revealed by fading the previous image.
 
Returns the current zoom level of the view.
 
Returns the background color of the generated image or null if not specified.
 
Returns the format of the images generated from the server.
 
Returns an array of strings of available layers on the server.
 
Returns the bounding box of the manager on the server side.
 
Returns the maximum zoom level available on the server side.
 
Returns the message panel where the messages will be displayed.
 
Returns the maximum zoom level available on the server side.
 
Returns an array of string of all the layers that will be displayed on the overview window.
 
Returns the factor used to pan.
 
Returns the pop-up menu on set this view.
 
Returns the IlvRectangle object that can be used to draw a rectangle on the view.
 
Returns the URL to be used to create the request as set using setRequestURL.
 
Returns the IlvSelectionManager for this view.
 
Returns the timeout interval for requests to the server, in seconds.
 
Returns the automatic update interval of the view.
 
Returns the current visible area of the manager.
 
Returns an array of strings of available layers on the server.
 
Returns the URL of the image used to show that the component is waiting for a server response.
 
Returns the factor used when calling the zoomIn and zoomOut methods if the zoom is free.
 
Retrieves the zoom levels as an array of double.
 
Hides the image map layer.
 
init()
Initializes the view.
 
Indicates if the automatic update will also update the capabilities.
 
Indicates if the capabilities have been loaded from the server.
 
Returns whether the view is constrained to the manager content bounds or not.
 
Tells if the view is deleting its cookies on dispose.
 
Returns whether view bounding box equals the manager bounding box.
 
Indicates whether the component is generating an image map in addition to the image.
 
Indicates if a layer is currently visible.
 
moveTo(x, y)
Queries a new image with the specified value for the top-left corner.
 
Pans the image to the east.
 
Pans the image to the north.
 
Pans the image to the northeast.
 
Pans the image to the northwest.
 
Pans the image to the south.
 
Pans the image to the southeast.
 
Pans the image to the southwest.
 
Pans the image to the west.
 
performAction(actionName, params, capabilities, capabilitiesParams)
Performs an action on the server side.
 
Allows you to read additional information generated by the capabilities request.
 
Removes a listener installed with addCapabilitiesOnLoadListener.
 
Removes a listener installed with addErrorListener.
 
Removes a listener installed with addImageOnLoadListener.
 
Removes a listener installed with addInteractorListener.
 
Removes a listener installed with addTimeoutErrorListener.
 
Resets the timer that will invoke the session expiration handler.
 
When set to true the automatic update will also update the capabilities.
 
Indicates if the new images will be revealed by fading the previous image.
 
setConstrainedOnContents(constrainedOnContents)
Defines whether the view is constrained to the manager content bounds or not.
 
Tells the view it should delete its cookie when the dispose function is called.
 
Tells the component to generate an image map in addition to the image.
 
Sets the background color of the generated image.
 
setImageFormat(format)
Sets the format of the images generated by the server.
 
setLayerVisible(layer, visible, update)
Hides or shows a layer by querying a new image from the server.
 
setMessagePanel(ilvHTMLPanel)
Sets the message panel where the message will be displayed.
 
setPanFactor(factor)
Sets the factor used to pan.
 
setPopupMenu(popupMenu)
Sets the pop-up menu on this view.
 
setProgressiveZoom(canProgressiveZoom)
Sets the progressive zoom to make view can progessive zoom when doing zoom operation.
 
setRequestURL(requestURL)
Sets the URL to be used to create the request.
 
Sets a listener that will be called when the HTTP session is about to be invalidated.
 
Sets the timeout interval for requests to the server.
 
Changes the automatic update interval of the view.
 
setViewBBox(x, y, w, h)
Queries a new image showing the specified rectangle.
 
Sets the image to display when the component is waiting for a server response.
 
setZoomFactor(factor)
Changes the factor used when zooming.
 
Queries a new image showing all the area available from the server.
 
Shows the image map layer.
 
updateAll(showAll, keepLayerVisibility)
Queries new capabilities and a new image from the server.
 
Queries a new image from the server.
 
zoomBy(z)
Zooms the view to a specified factor by querying a new image from the server.
 
zoomIn()
Zooms the view in by querying a new image from the server.
 
Zooms the view out by querying a new image from the server.
 
zoomToIdentity(nearZoomLevelAllowed)
Sets the identity transformer on the view.
Methods inherited from class IlvAbstractView
childrenToHTML, getCursor, getGlassView, getHitInfos, getHitInfoTypes, getInteractor, keyPress, mouseDown, mouseDrag, mouseMove, mouseOut, mouseOver, mouseUp, putHitInfoType, setAccessible, setAdditionalParameters, setChildrenBounds, setCursor, setHitmapLayers, setInteractor, setScrollBarSize, setScrollBarState
Methods inherited from class IlvResizableView
getMaximumSize, getMinimumSize, isResizable, setHotkeys, setMaximumSize, setMinimumSize, setResizable, toHTML
Methods inherited from class IlvEmptyView
addSizeListener, getBounds, getHeight, getLeft, getLocation, getSize, getTop, getWidth, isStateInCookie, removeSizeListener, restoreState, saveState, setBounds, setLocation, setSize, setStateInCookie
Methods inherited from class IlvObject
getClassName, hashCode, instanceOf, invoke, registerDispose, registerDisposeByClientId, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility
Constructor Detail
IlvView
IlvView(left, top, width, height, namespace)
Parameters:
left - The x absolute position on the page.
top - The y absolute position on the page.
width - The width of the view.
height - The height of the view.
namespace - An optional parameter to place the view in a namespace. This is useful when using IlvViews in multiple browser windows or in multiple frames of a frameset and the views must store cookies that should not conflict with each other. In this case, use the namespace to uniquely identify the views that belong to a specific browser window or frameset frame. For example, if you have created a new window with a unique name:

                    open(childPageURL, uniqueWindowName, ...);
                  
you can then use the window name to define the namespace for views within the child page:

                    var view = new IlvView(..., window.name);
                  
Method Detail
addCapabilitiesOnLoadListener
addCapabilitiesOnLoadListener(listener)
Adds a listener to be called when the capabilities have been loaded.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

addErrorListener
addErrorListener(listener)
Adds a listener to be called when an error occurs for the current request.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

addImageOnLoadListener
addImageOnLoadListener(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 parameter:
  1. view: The IlvView.

addInteractorListener
addInteractorListener(listener)
Adds a listener to be called when an interactor has changed on the view.
Parameters:
listener - The listener function, which must have the following parameters:
  1. view: The IlvView.
  2. oldInteractor: The old interactor (IlvInteractor).
  3. newInteractor: The new interactor (IlvInteractor).

addTimeoutErrorListener
addTimeoutErrorListener(listener)
Adds a listener to be called when a timeout has been reached for the current request.
Parameters:
listener - The listener function, which must have the following parameter:
  1. view: The IlvView.

centerAt
centerAt(x, y)
Queries a new image centered at the specified point. The coordinates are expressed in the server coordinate system.
Parameters:
x
y

createCapabilitiesRequestURL
createCapabilitiesRequestURL()
Creates the HTTP request for capabilities.

createImageMapRequestURL
createImageMapRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for generating an image map.
Parameters:
qx
qy
qw
qh
width
height
layers

createRequestURL
createRequestURL(qx, qy, qw, qh, width, height, layers)
Creates the URL for the image request.
Parameters:
qx - The abscissa of the top-left corner requested in the manager's coordinate system.
qy - The ordinate of the top-left corner requested in the manager's coordinate system.
qw - The width requested in the manager's coordinate system.
qh - The height requested in the manager's coordinate system.
width - The width of the requested image.
height - The height of the requested image.
layers - Array of the layer names requested.

dispose
dispose()
Releases the cookie holding the current image request.

getBlendTransform
getBlendTransform()
Indicates if the new images will be revealed by fading the previous image.

getCurrentZoomLevel
getCurrentZoomLevel()
Returns the current zoom level of the view.
Since:
JViews 8.0

getImageBackgroundColor
getImageBackgroundColor()
Returns the background color of the generated image or null if not specified.

getImageFormat
getImageFormat()
Returns the format of the images generated from the server. The default value is "JPEG".

getLayers
getLayers()
Returns an array of strings of available layers on the server. The value is valid only when the capabilities have been loaded from the server.

getManagerBBox
getManagerBBox()
Returns the bounding box of the manager on the server side. This method returns an object with four properties: left, top, width, and height. These properties define the manager's bounding box as floating point values. This value is valid only when the capabilities have been loaded.

getMaxZoomLevel
getMaxZoomLevel()
Returns the maximum zoom level available on the server side. The value is valid only when the capabilities of the server have been loaded.

The -1 value means no limit.


getMessagePanel
getMessagePanel()
Returns the message panel where the messages will be displayed.

getMinZoomLevel
getMinZoomLevel()
Returns the maximum zoom level available on the server side. The value is valid only when the capabilities of the server have been loaded.

The -1 value means no limit.


getOverviewLayers
getOverviewLayers()
Returns an array of string of all the layers that will be displayed on the overview window. The value is valid only when the capabilities have been loaded from the server.

getPanFactor
getPanFactor()
Returns the factor used to pan. This factor is used in the methods panEast, panWest, panNorth, panNorthEast, panNorthWest, panSouth, panSouthEast, and panSouthWest.

getPopupMenu
getPopupMenu()
Returns the pop-up menu on set this view.
Since:
JViews 7.5
Returns:
the pop-up menu.

getRectangle
getRectangle()
Returns the IlvRectangle object that can be used to draw a rectangle on the view. This method is especially useful for interactors that can display the interaction using this rectangle.

getRequestURL
getRequestURL()
Returns the URL to be used to create the request as set using setRequestURL.

getSelectionManager
getSelectionManager()
Returns the IlvSelectionManager for this view.

This manager allows to prevent an image query on each selection. It queries the server for selection updates and displays rectangles to represent the selection.

The most common use of this method are:

The selection manager is lazily created. As a consequence, the current server selection is not shown on the client before a first call to this method.


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

getUpdateInterval
getUpdateInterval()
Returns the automatic update interval of the view.

getViewBBox
getViewBBox()
Returns the current visible area of the manager. This method returns an object with four properties: left, top, width, and height. These properties define the visible area as floating point values.

getVisibleLayers
getVisibleLayers()
Returns an array of strings of available layers on the server. The value is valid only when the capabilities have been loaded from the server.

getWaitingImage
getWaitingImage()
Returns the URL of the image used to show that the component is waiting for a server response.

getZoomFactor
getZoomFactor()
Returns the factor used when calling the zoomIn and zoomOut methods if the zoom is free.

getZoomLevels
getZoomLevels()
Retrieves the zoom levels as an array of double. This array is set by the capability request.
Since:
JViews 8.0
Returns:
The array of zoom levels or null if none has been set by the capability request.

hideImageMap
hideImageMap()
Hides the image map layer.

init
init()
Initializes the view. This method must be called on the onLoad event of the page containing the view.

isAutoUpdateCapabilities
isAutoUpdateCapabilities()
Indicates if the automatic update will also update the capabilities.

isCapabilitiesLoaded
isCapabilitiesLoaded()
Indicates if the capabilities have been loaded from the server.

isConstrainedOnContents
isConstrainedOnContents()
Returns whether the view is constrained to the manager content bounds or not. The default value is true.

Note that zoom levels (set by minZoomLevel or zoomLevels) lower than 1 will not be allowed if this property is set to true.

Since:
JViews 8.1
Returns:
Returns whether the view is constrained or not.

isDeletingCookieOnDispose
isDeletingCookieOnDispose()
Tells if the view is deleting its cookies on dispose.
Since:
JViews 6.0

isFitToContent
isFitToContent()
Returns whether view bounding box equals the manager bounding box. If this is the case all the objects of manager are displayed by the view.
Since:
JViews 8.1

isGenerateImageMap
isGenerateImageMap()
Indicates whether the component is generating an image map in addition to the image.

isLayerVisible
isLayerVisible(layer)
Indicates if a layer is currently visible.
Parameters:
layer - The name of the layer.

moveTo
moveTo(x, y)
Queries a new image with the specified value for the top-left corner.
Parameters:
x - New value for the left in the server coordinate system.
y - New value for the top in the server coordinate system.

panEast
panEast()
Pans the image to the east.

panNorth
panNorth()
Pans the image to the north.

panNorthEast
panNorthEast()
Pans the image to the northeast.

panNorthWest
panNorthWest()
Pans the image to the northwest.

panSouth
panSouth()
Pans the image to the south.

panSouthEast
panSouthEast()
Pans the image to the southeast.

panSouthWest
panSouthWest()
Pans the image to the southwest.

panWest
panWest()
Pans the image to the west.

performAction
performAction(actionName, params, capabilities, capabilitiesParams)
Performs an action on the server side. This method requests a new image from the client. Additional parameters are sent in the image request so that an action can be performed on the server side before the image is generated. This allows you to define a new type of interaction on the image. To implement the action on the server side, you must implement an action listener (ServerActionListener) on the server side. The action is defined by a name and a list of parameters.
Parameters:
actionName - The name of the action.
params - The parameters of the action as an array of strings.
capabilities - Indicates whether the action is affecting the capabilities (like the manager bounds or the layer list, for example) or not.
capabilitiesParams - The array that contains the parameter to pass to the getCapabilities method (if the capabilities parameter is set to true). If this parameter is omitted, the array [false, false, true] is used.

readAdditionalCapabilities
readAdditionalCapabilities(context)
Allows you to read additional information generated by the capabilities request.
Parameters:
context - The object that contains the JavaScript variable generated by the server.

removeCapabilitiesOnLoadListener
removeCapabilitiesOnLoadListener(listener)
Removes a listener installed with addCapabilitiesOnLoadListener.
Parameters:
listener - The listener to remove.

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

removeImageOnLoadListener
removeImageOnLoadListener(listener)
Removes a listener installed with addImageOnLoadListener.
Parameters:
listener - The listener to remove.

removeInteractorListener
removeInteractorListener(listener)
Removes a listener installed with addInteractorListener.
Parameters:
listener - The listener to remove.

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

resetSessionExpirationTimer
resetSessionExpirationTimer()
Resets the timer that will invoke the session expiration handler.
Since:
JViews 8.1
See also:
#setSessionExpirationHandler

setAutoUpdateCapabilities
setAutoUpdateCapabilities(set)
When set to true the automatic update will also update the capabilities.
Parameters:
set

setBlendTransform
setBlendTransform(set)
Indicates if the new images will be revealed by fading the previous image. This method is available only on Internet Explorer and will be ignored on Netscape Communicator.
Parameters:
set

setConstrainedOnContents
setConstrainedOnContents(constrainedOnContents)
Defines whether the view is constrained to the manager content bounds or not. The default value is true.

Note that zoom levels (set by minZoomLevel or zoomLevels) lower than 1 will not be allowed if this property is set to true.

Parameters:
constrainedOnContents - Defines whether the view is constrained or not.
Since:
JViews 8.1

setDeletingCookieOnDispose
setDeletingCookieOnDispose(del)
Tells the view it should delete its cookie when the dispose function is called.
Parameters:
del - true to delete the cookie; false otherwise.
Since:
JViews 6.0

setGenerateImageMap
setGenerateImageMap(set)
Tells the component to generate an image map in addition to the image.
Parameters:
set - true to generate an image map; false otherwise.

setImageBackgroundColor
setImageBackgroundColor(color)
Sets the background color of the generated image.
Parameters:
color - The background color expressed as a string, for example 'RRGGBB'.

setImageFormat
setImageFormat(format)
Sets the format of the images generated by the server.
Parameters:
format - the format to be set: "JPEG" or "PNG".

setLayerVisible
setLayerVisible(layer, visible, update)
Hides or shows a layer by querying a new image from the server.
Parameters:
layer - The name of the layer.
visible - A Boolean value to turn the layer visibility on or off.
update - Whether to update the image or not.

setMessagePanel
setMessagePanel(ilvHTMLPanel)
Sets the message panel where the message will be displayed.
Parameters:
ilvHTMLPanel - An instance of IlvHTMLPanel.

setPanFactor
setPanFactor(factor)
Sets the factor used to pan. This factor is used in the methods panEast, panWest, panNorth, panNorthEast, panNorthWest, panSouth, panSouthEast, and panSouthWest.

The default value is 0.5.

Parameters:
factor

setPopupMenu
setPopupMenu(popupMenu)
Sets the pop-up menu on this view.
Parameters:
popupMenu - the pop-up menu to set.
Since:
JViews 7.5

setProgressiveZoom
setProgressiveZoom(canProgressiveZoom)
Sets the progressive zoom to make view can progessive zoom when doing zoom operation.
Parameters:
canProgressiveZoom

setRequestURL
setRequestURL(requestURL)
Sets the URL to be used to create the request.
Parameters:
requestURL - the request URL to be set.

setSessionExpirationHandler
setSessionExpirationHandler(handler)
Sets a listener that will be called when the HTTP session is about to be invalidated.

This method works if and only if the session inactivity is reset by a JViews request. If the session inactivity is reset by an external request, the #resetSessionExpirationTimer method must be called.

This method must be called before the capabilities request is made.

Parameters:
handler - The session expiration handler. This must be a function with one parameter: the view.
Since:
JViews 8.1

setTimeoutErrorInterval
setTimeoutErrorInterval(interval)
Sets the timeout interval for requests to the server.
Parameters:
interval - The timeout, specified in seconds. The default value is 600 or 10 minutes.

setUpdateInterval
setUpdateInterval(rate)
Changes the automatic update interval of the view.
Parameters:
rate - The new interval in seconds. An interval of zero stops the automatic update.

setViewBBox
setViewBBox(x, y, w, h)
Queries a new image showing the specified rectangle. The rectangle is expressed in the server coordinate system (manager). If the zoom level is not free, the rectangle bounds can be adjusted to fit the nearest fixed zoom level.
Parameters:
x - New value for the left in the server coordinate system.
y - New value for the top in the server coordinate system.
w - New value for the width in the server coordinate system.
h - New value for the height in the server coordinate system.

setWaitingImage
setWaitingImage(image)
Sets the image to display when the component is waiting for a server response. The image may be an animated GIF.
Parameters:
image - URL of the image to display when waiting for a server response.

setZoomFactor
setZoomFactor(factor)
Changes the factor used when zooming. The factor is used in the methods zoomIn and zoomOut if the zoom is free.

The default value is 1.5.

Parameters:
factor

showAll
showAll()
Queries a new image showing all the area available from the server.

showImageMap
showImageMap()
Shows the image map layer.

updateAll
updateAll(showAll, keepLayerVisibility)
Queries new capabilities and a new image from the server.
Parameters:
showAll - When true the new image will show all of the area available on the server.
keepLayerVisibility - When true the current layer's visibility state is kept.

updateImage
updateImage()
Queries a new image from the server.

zoomBy
zoomBy(z)
Zooms the view to a specified factor by querying a new image from the server. If the zoom is not free, the zoom level will be replaced by the nearest one.
Parameters:
z - The zoom factor.

zoomIn
zoomIn()
Zooms the view in by querying a new image from the server. If the zoom is free, the view is zoomed in by the zoom factor specified by #setZoomFactor.
If the zoom levels are fixed the view is zoomed to the next zoom level, if any.

zoomOut
zoomOut()
Zooms the view out by querying a new image from the server. If the zoom is free, the view is zoomed out by the zoom factor specified by #setZoomFactor.
If the zoom levels are fixed the view is zoomed to the next zoom level, if any.

zoomToIdentity
zoomToIdentity(nearZoomLevelAllowed)
Sets the identity transformer on the view.
. This method will not succeed if the identity zoom level is not in the fixed zoom level list or if the minimum or maximum zoom level is reached, in that case the view is left unchanged.
Parameters:
nearZoomLevelAllowed - Whether snap to the nearest zoom level in fixed zoom levels mode or fail if the exact zoom level is not in the list (default value is false).
Returns:
true if the transformation succeeded, false otherwise.

©Copyright Rogue Wave Software Inc. 1997, 2018. All Rights Reserved.