Class sap.ui.vk.OverlayModule: sap/ui/vk/Overlay

extends Control

Constructor for a new Overlay.

Experimental API:Since 1.32.0 This class is experimental and might be modified or removed in future versions.

Constructor Summary
new sap.ui.vk.Overlay(sId?, mSettings?)Constructor for a new Overlay.
Event Summary
click(oControlEvent)Raised when the Control is clicked.
contextMenu(oControlEvent)Raised when the Control is right clicked/longPress(tap and hold).
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.vk.Overlay.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vk.Overlay with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vk.Overlay.getMetadata()Returns a metadata object for class sap.ui.vk.Overlay.
addArea(oArea)Adds some area to the aggregation areas.
attachClick(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the click event of this sap.ui.vk.Overlay.
attachContextMenu(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the contextMenu event of this sap.ui.vk.Overlay.
destroyAreas()Destroys all the areas in the aggregation areas.
detachClick(fnFunction, oListener)Detaches event handler fnFunction from the click event of this sap.ui.vk.Overlay.
detachContextMenu(fnFunction, oListener)Detaches event handler fnFunction from the contextMenu event of this sap.ui.vk.Overlay.
fireClick(mArguments?)Fires event click to attached listeners.
fireContextMenu(mArguments?)Fires event contextMenu to attached listeners.
getAreas()Gets content of aggregation areas.
getPositionInteractive(bPosArray, callback)Trigger the interactive creation mode to get a position or position array.
getTarget()ID of the element which is the current target of the association target, or null.
getZoomOnResize()Gets current value of property zoomOnResize.
indexOfArea(oArea)Checks for the provided sap.ui.vk.OverlayArea in the aggregation areas.
insertArea(oArea, iIndex)Inserts a area into the aggregation areas.
openContextMenu(oMenu)open the context menu
removeAllAreas()Removes all the controls from the aggregation areas.
removeArea(vArea)Removes a area from the aggregation areas.
reset()Reset the Overlay to its initial size and position.
setPanAndZoom(nDeltaX, nDeltaY, fZoom)Pan and Zoom for the Overlay.
setTarget(oTarget)Sets the associated target.
setZoomOnResize(bZoomOnResize)Sets a new value for property zoomOnResize.
Constructor Detail
new sap.ui.vk.Overlay(sId?, mSettings?)
Constructor for a new Overlay.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Aggregations
    • areas : sap.ui.vk.OverlayArea[]
  • Events
    • click : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • contextMenu : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Event Detail
click(oControlEvent)
Raised when the Control is clicked.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{int}oControlEvent.getParameters.clientX Client coordinate X
{int}oControlEvent.getParameters.clientY Client coordinate Y
{string}oControlEvent.getParameters.pos Coordinates of click position in format "x;y;0"
contextMenu(oControlEvent)
Raised when the Control is right clicked/longPress(tap and hold).
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.pos Coordinates of click position in format "x;y;0"
{sap.ui.unified.Menu}oControlEvent.getParameters.menu Menu to open
Method Detail
sap.ui.vk.Overlay.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vk.Overlay with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.vk.Overlay.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vk.Overlay.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addArea(oArea): sap.ui.vk.Overlay
Adds some area to the aggregation areas.
Parameters:
{sap.ui.vk.OverlayArea}oArea the area to add; if empty, nothing is inserted
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
attachClick(oData?, fnFunction, oListener?): sap.ui.vk.Overlay
Attaches event handler fnFunction to the click event of this sap.ui.vk.Overlay.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Overlay itself.

Raised when the Control is clicked.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vk.Overlay itself
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
attachContextMenu(oData?, fnFunction, oListener?): sap.ui.vk.Overlay
Attaches event handler fnFunction to the contextMenu event of this sap.ui.vk.Overlay.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vk.Overlay itself.

Raised when the Control is right clicked/longPress(tap and hold).

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vk.Overlay itself
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
destroyAreas(): sap.ui.vk.Overlay
Destroys all the areas in the aggregation areas.
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
detachClick(fnFunction, oListener): sap.ui.vk.Overlay
Detaches event handler fnFunction from the click event of this sap.ui.vk.Overlay.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
detachContextMenu(fnFunction, oListener): sap.ui.vk.Overlay
Detaches event handler fnFunction from the contextMenu event of this sap.ui.vk.Overlay.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
fireClick(mArguments?): sap.ui.vk.Overlay
Fires event click to attached listeners.

Expects the following event parameters:

  • clientX of type intClient coordinate X
  • clientY of type intClient coordinate Y
  • pos of type stringCoordinates of click position in format "x;y;0"
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
fireContextMenu(mArguments?): sap.ui.vk.Overlay
Fires event contextMenu to attached listeners.

Expects the following event parameters:

  • pos of type stringCoordinates of click position in format "x;y;0"
  • menu of type sap.ui.unified.MenuMenu to open
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
getAreas(): sap.ui.vk.OverlayArea[]
Gets content of aggregation areas.

Aggregation of Highlight Areas.

Returns:
{sap.ui.vk.OverlayArea[]}
getPositionInteractive(bPosArray, callback): boolean
Trigger the interactive creation mode to get a position or position array.

Experimental API:Since 1.32.0 This method is experimental and might be modified or removerd in future versions.

Parameters:
{boolean}bPosArray Indicator if a single position or an array is requested
{function}callback Callback function func( sPosArray ) to be called when done. Position(array) sPosArray is provided in format "x;y;0;..."
Experimental:
Since 1.32.0 This method is experimental and might be modified or removerd in future versions.
Returns:
{boolean} Indicator whether the creation mode could be triggered successfully or not.
getTarget(): sap.ui.core.Control
ID of the element which is the current target of the association target, or null.
Returns:
{sap.ui.core.Control}
getZoomOnResize(): boolean
Gets current value of property zoomOnResize.

Default value is true.

Returns:
{boolean} Value of property zoomOnResize
indexOfArea(oArea): int
Checks for the provided sap.ui.vk.OverlayArea in the aggregation areas. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.vk.OverlayArea}oArea The area whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertArea(oArea, iIndex): sap.ui.vk.Overlay
Inserts a area into the aggregation areas.
Parameters:
{sap.ui.vk.OverlayArea}oArea the area to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the area should be inserted at; for a negative value of iIndex, the area is inserted at position 0; for a value greater than the current size of the aggregation, the area is inserted at the last position
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
openContextMenu(oMenu): void
open the context menu
Parameters:
{object}oMenu the context menu to be opened
removeAllAreas(): sap.ui.vk.OverlayArea[]
Removes all the controls from the aggregation areas.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.vk.OverlayArea[]} An array of the removed elements (might be empty)
removeArea(vArea): sap.ui.vk.OverlayArea
Removes a area from the aggregation areas.
Parameters:
{int|string|sap.ui.vk.OverlayArea}vArea The areato remove or its index or id
Returns:
{sap.ui.vk.OverlayArea} The removed area or null
Reset the Overlay to its initial size and position.
Returns:
{sap.ui.vk.Overlay} This allows method chaining
setPanAndZoom(nDeltaX, nDeltaY, fZoom): void
Pan and Zoom for the Overlay. The offsets nDeltaX and nDeltaY are applied to the current center position. If zooming is involved as well the offsets are applied after the zooming.
Parameters:
{int}nDeltaX the move of the center in x-direction in pixels
{int}nDeltaY the move of the center in y-direction in pixels
{float}fZoom the zoom factor to apply to the current state
setTarget(oTarget): sap.ui.vk.Overlay
Sets the associated target.
Parameters:
{sap.ui.core.Control}oTarget Id of an element which becomes the new target of this target association; alternatively, an element instance may be given
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining
setZoomOnResize(bZoomOnResize): sap.ui.vk.Overlay
Sets a new value for property zoomOnResize.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bZoomOnResize New value for property zoomOnResize
Returns:
{sap.ui.vk.Overlay} Reference to this in order to allow method chaining