IlvGlassView

IlvObject
  |
  +--IlvEmptyView
       |
       +--IlvGlassView
Category:
Common component
JavaScript File:
IlvGlassView.js
Description:
An IlvGlassView is an extension of IlvEmptyView that is designed to capture keyboard and mouse input events and forward them to an event handler. By default, an IlvGlassView is transparent. Therefore, you can place a glass view above other content as a way to trap user input events.

Constructor Summary
IlvGlassView(left, top, width, height)

Method Summary
childrenToHTML()
Creates the HTML for this component's children.
dispose()
Disposes of all resources being used by the view.
enhanceEvent(e, forceClone)
This method returns an Event suitable for the IlvGlassView coordinate system from the given Event coming from the browser event system.
getContent()
Returns the HTML content of the glass view.
getCursor()
Returns the cursor of the view.
getEventHandler()
Returns the event handler that is receiving keyboard and mouse events from this view.
getEventOriginLeft()
Returns the origin along the x-axis that is used to compute the relative e.mouseX coordinate when mouse events are forwarded to the event handler.
getEventOriginTop()
Returns the origin along the y-axis that is used to compute the relative e.mouseY coordinate when mouse events are forwarded to the event handler.
getHTMLId()
Returns the ID of the HTML element that represents the IlvGlassView in the HTML document.
getToolTipText()
Returns the tooltip text of the view.
isEnabled()
Returns whether the view is enabled.
isVisible()
Returns the visibility of this view.
setBackgroundColor(color)
Sets the background color of the glass view.
setChildrenBounds(left, top, width, height)
Changes the size of this view's children.
setContent(content, onContentSet)
Sets the HTML content of the glass view.
setCursor(cursor)
Changes the cursor of the view.
setEnabled(enabled)
Enables or disables the view.
setEventHandler(eventHandler)
Sets the event handler that will receive keyboard and mouse events from this view.
setToolTipText(string)
Sets the tooltip text of the view.
setVisible(visible)
Sets the visibility of this view.
setZIndex(zindex)
Change the Z coordinate of the view

Constructor Detail

IlvGlassView

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

Method Detail

childrenToHTML

childrenToHTML()
Creates the HTML for this component's children. Warning: This method is considered to be part of an IlvGlassView'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()">
 

enhanceEvent

enhanceEvent(e, forceClone)
This method returns an Event suitable for the IlvGlassView coordinate system from the given Event coming from the browser event system. The new coordinate are stored in mouseX and mouseY properties of the returned event.
Parameters:
e - The mouse Event
forceClone - true to force the cloning of the event.
Returns:
the enhanced event.

getContent

getContent()
Returns the HTML content of the glass view. The default value is the image: IlvConstants.ilvImagePath + "empty.gif", where IlvConstants.ilvImagePath = "script/images/".

getCursor

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

getEventHandler

getEventHandler()
Returns the event handler that is receiving keyboard and mouse events from this view.

getEventOriginLeft

getEventOriginLeft()
Returns the origin along the x-axis that is used to compute the relative e.mouseX coordinate when mouse events are forwarded to the event handler. This implementation returns the left coordinate of this glass view. Override this function to forward mouse events that are relative to a different origin.

getEventOriginTop

getEventOriginTop()
Returns the origin along the y-axis that is used to compute the relative e.mouseY coordinate when mouse events are forwarded to the event handler. This implementation returns the top coordinate of this glass view. Override this function to forward mouse events that are relative to a different origin.

getHTMLId

getHTMLId()
Returns the ID of the HTML element that represents the IlvGlassView in the HTML document.

Since:
JViews 8.1


getToolTipText

getToolTipText()
Returns the tooltip text of the view.

isEnabled

isEnabled()
Returns whether the view is enabled.

isVisible

isVisible()
Returns the visibility of this view.

setBackgroundColor

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

setChildrenBounds

setChildrenBounds(left, top, width, height)
Changes the size of this view's children. Warning: This method is considered to be part of an IlvGlassView'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.

setContent

setContent(content, onContentSet)
Sets the HTML content of the glass view. The default value is the image: IlvConstants.ilvImagePath + "empty.gif", where IlvConstants.ilvImagePath = "script/images/".
Parameters:
onContentSet - An optional JavaScript fragment that will be evaluated after the browser's DOM has stabilized from the changes made by this method.

setCursor

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

setEnabled

setEnabled(enabled)
Enables or disables the view.

setEventHandler

setEventHandler(eventHandler)
Sets the event handler that will receive keyboard and mouse events from this view. The event handler should define 1 or more of the following functions:
  • keyPress(e) handles Key press events.
    Parameter: e - The key event with the following read-only properties:
     e.type:     A string representing the event type.
     e.keyCode:  The code of the key.
        
  • mouseMove(e) handles Mouse move events.
    Parameter: e - The mouse event with 8 read-only properties:
     e.type:     A string representing the event type.
     e.mouseX:   The mouse X coordinate relative to the value returned by the getEventOriginLeft function.
     e.mouseY:   The mouse Y coordinate relative to the value returned by the getEventOriginTop function.
     e.screenX:  The absolute mouse X coordinate in the screen.
     e.screenY:  The absolute mouse Y coordinate in the screen.
     e.altKey:   A Boolean, true when the ALT key is pressed.
     e.ctrlKey:  A Boolean, true when the CONTROL key is pressed.
     e.shiftKey: A Boolean, true when the SHIFT key is pressed.
        
  • mouseDown(e) handles Mouse down events.
    Parameter: e - The mouse event with 8 read-only properties:
     e.type:     A string representing the event type.
     e.mouseX:   The mouse X coordinate relative to the value returned by the getEventOriginLeft function.
     e.mouseY:   The mouse Y coordinate relative to the value returned by the getEventOriginTop function.
     e.screenX:  The absolute mouse X coordinate in the screen.
     e.screenY:  The absolute mouse Y coordinate in the screen.
     e.altKey:   A Boolean, true when the ALT key is pressed.
     e.ctrlKey:  A Boolean, true when the CONTROL key is pressed.
     e.shiftKey: A Boolean, true when the SHIFT key is pressed.
        
  • mouseDrag(e) handles Mouse drag events.
    Parameter: e - The mouse event with 8 read-only properties:
     e.type:     A string representing the event type.
     e.mouseX:   The mouse X coordinate relative to the value returned by the getEventOriginLeft function.
     e.mouseY:   The mouse Y coordinate relative to the value returned by the getEventOriginTop function.
     e.screenX:  The absolute mouse X coordinate in the screen.
     e.screenY:  The absolute mouse Y coordinate in the screen.
     e.altKey:   A Boolean, true when the ALT key is pressed.
     e.ctrlKey:  A Boolean, true when the CONTROL key is pressed.
     e.shiftKey: A Boolean, true when the SHIFT key is pressed.
        
  • mouseUp(e) handles Mouse up events.
    Parameter: e - The mouse event with 8 read-only properties:
     e.type:     A string representing the event type.
     e.mouseX:   The mouse X coordinate relative to the value returned by the getEventOriginLeft function.
     e.mouseY:   The mouse Y coordinate relative to the value returned by the getEventOriginTop function.
     e.screenX:  The absolute mouse X coordinate in the screen.
     e.screenY:  The absolute mouse Y coordinate in the screen.
     e.altKey:   A Boolean, true when the ALT key is pressed.
     e.ctrlKey:  A Boolean, true when the CONTROL key is pressed.
     e.shiftKey: A Boolean, true when the SHIFT key is pressed.
        
  • mouseOver(e) handles Mouse over events.
    Parameter: e - The mouse event with 8 read-only properties:
     e.type:     A string representing the event type.
     e.mouseX:   The mouse X coordinate relative to the value returned by the getEventOriginLeft function.
     e.mouseY:   The mouse Y coordinate relative to the value returned by the getEventOriginTop function.
     e.screenX:  The absolute mouse X coordinate in the screen.
     e.screenY:  The absolute mouse Y coordinate in the screen.
     e.altKey:   A Boolean, true when the ALT key is pressed.
     e.ctrlKey:  A Boolean, true when the CONTROL key is pressed.
     e.shiftKey: A Boolean, true when the SHIFT key is pressed.
        
  • mouseOut(e) handles Mouse out events.
    Parameter: e - The mouse event with 8 read-only properties:
     e.type:     A string representing the event type.
     e.mouseX:   The mouse X coordinate relative to the value returned by the getEventOriginLeft function.
     e.mouseY:   The mouse Y coordinate relative to the value returned by the getEventOriginTop function.
     e.screenX:  The absolute mouse X coordinate in the screen.
     e.screenY:  The absolute mouse Y coordinate in the screen.
     e.altKey:   A Boolean, true when the ALT key is pressed.
     e.ctrlKey:  A Boolean, true when the CONTROL key is pressed.
     e.shiftKey: A Boolean, true when the SHIFT key is pressed.
        
  • mouseWheel(e) handles Mouse wheel events.
    Parameter: e - The mouse event with the following read-only property:
     e.wheelDelta:  The amount of scrolling: This value is positive if the mouse wheel was scrolled up and negative otherwise.
                             This amount depends on the mouse configuration and on the browser.   
        
Parameters:
eventHandler - The handler that will receive events from this glass view.

setToolTipText

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

setVisible

setVisible(visible)
Sets the visibility of this view.

setZIndex

setZIndex(zindex)
Change the Z coordinate of the view

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