Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class 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
Constructor Attributes Constructor Name and Description
 
IlvGlassView(left, top, width, height)
Method Summary
Method Attributes Method Name and Description
 
childrenToHTML(parentNode)
Creates the HTML for this component's children.
 

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

 

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

 
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.
 
Returns the HTML content of the glass view.
 
Returns the cursor of the view.
 
Returns the event handler that is receiving keyboard and mouse events from this view.
 
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.
 
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.
 
Returns the ID of the HTML element that represents the IlvGlassView in the HTML document.
 
Returns the tooltip text of the view.
 

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

 
Returns whether the view is enabled.
 
isScale(e, c)

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

 
Returns the visibility of this view.
 

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

 
Sets the background color of the glass view.
 
setChildrenBounds(left, top, width, height)
Changes the size of this view's children.
 
setContent(onContentSet, 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
 

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

Methods inherited from class IlvEmptyView
addSizeListener, getBounds, getHeight, getLeft, getLocation, getSize, getTop, getWidth, isStateInCookie, removeSizeListener, restoreState, saveState, setBounds, setLocation, setSize, setStateInCookie, toHTML
Methods inherited from class IlvObject
getClassName, hashCode, instanceOf, invoke, registerDispose, registerDisposeByClientId, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility
Constructor Detail
IlvGlassView
IlvGlassView(left, top, width, height)
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.
Method Detail
childrenToHTML
childrenToHTML(parentNode)
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.
Parameters:
parentNode

clearTouchStart
clearTouchStart()

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

This method clears the stored touch context; it is invoked whenever the touch action has ended (or has been cancelled).


convertTouchEvent
convertTouchEvent(e, et)

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

This method converts a touch event into a mouse event and then dispatches it to the appropriate mouse handler.

Parameters:
e - The touch event that has been captured
et - The mouse event type that will be created

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.

hasMoved
hasMoved()

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

This method returns whether the current touch action represents a touch move or not.


isEnabled
isEnabled()
Returns whether the view is enabled.

isScale
isScale(e, c)

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

This method returns whether the current multi-touch action represents a scale gesture or not.

Parameters:
e - The touch event that has been captured
c - The component to which the scale should apply

isVisible
isVisible()
Returns the visibility of this view.

recordTouchMove
recordTouchMove(e)

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

This method records actual touch-move actions to the touch context. This is required because touchend events do not have the last position when the user lifted the finger off the touch surface.

Parameters:
e - The touch event that has been captured

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(onContentSet, 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.
onContentSet

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

setEnabled
setEnabled(enabled)
Enables or disables the view.
Parameters:
enabled

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.
Parameters:
visible

setZIndex
setZIndex(zindex)
Change the Z coordinate of the view
Parameters:
zindex

storeTouchContext
storeTouchContext(e)

Warning: This method is considered to be part of the IlvGlassView internal implementation, it is not a public API.

This method records the context information when the user first starts to interact with the screen. This information is required in order to detect touch actions (such as touch-move, tap, etc).

Parameters:
e - The touch event that has been captured

©Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.