Class sap.ui.vbm.ClusterBaseModule: sap/ui/vbm/ClusterBase

extends Element
known direct subclasses: ClusterDistance, ClusterGrid, ClusterTree

Abtract base class for Clustering types. This element implements the common part for all specific Cluster elements. It must not be used directly, but is the base for further extension.
There are two optional aggregations: vizTemplate and vizVo determining how cluster objects should be visualized. Only the one or the other should be provided.
With aggregation vizTemplate you can provide an arbitrary SAPUI5 control for the actual visualization. If you want this control to display the number of clustered object you need to provide the name of the receiving property of the template via property textProperty. For interaction with the cluster you can either use the events provided by the visualization template or, if it does not provide appropriate events, the cluster element events click and contextMenu. The event handler will receive an instance of sap.ui.vbm.ClusterContainer.
With aggregation vizVo you provide an instance of sap.ui.vbm.Spot as visualization object. Spots are based on an image. The text for the number of clustered objects needs to be placed over the image. The actual color, font, size, and positioning of the text can be influence via property textSettings. For interaction with the cluster you can use the events provided by the spot.

Constructor Summary
new sap.ui.vbm.ClusterBase(sId?, mSettings?)Constructor for a new ClusterBase.
Event Summary
click(oControlEvent)The event is raised when there is a click action on a Cluster Object.
contextMenu(oControlEvent)The event is raised when there is a right click or a tap and hold action on a Cluster.
Method Summary
sap.ui.vbm.ClusterBase.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vbm.ClusterBase with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vbm.ClusterBase.getMetadata()Returns a metadata object for class sap.ui.vbm.ClusterBase.
attachClick(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the click event of this sap.ui.vbm.ClusterBase.
attachContextMenu(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the contextMenu event of this sap.ui.vbm.ClusterBase.
destroyVizTemplate()Destroys the vizTemplate in the aggregation vizTemplate.
destroyVizVo()Destroys the vizVo in the aggregation vizVo.
detachClick(fnFunction, oListener)Detaches event handler fnFunction from the click event of this sap.ui.vbm.ClusterBase.
detachContextMenu(fnFunction, oListener)Detaches event handler fnFunction from the contextMenu event of this sap.ui.vbm.ClusterBase.
fireClick(mArguments?)Fires event click to attached listeners.
fireContextMenu(mArguments?)Fires event contextMenu to attached listeners.
getAreaAlwaysVisible()Gets current value of property areaAlwaysVisible.
getAreaColor()Gets current value of property areaColor.
getAreaColorBorder()Gets current value of property areaColorBorder.
getRule()Gets current value of property rule.
getTextProperty()Gets current value of property textProperty.
getTextSettings()Gets current value of property textSettings.
getVizTemplate()Gets content of aggregation vizTemplate.
getVizVo()Gets content of aggregation vizVo.
openContextMenu(sType, oContainer, oMenu)Open a context menu
openDetailWindow(oSpotInst, oParams)Open a Detail Window.
setAreaAlwaysVisible(bAreaAlwaysVisible)Sets a new value for property areaAlwaysVisible.
setAreaColor(sAreaColor)Sets a new value for property areaColor.
setAreaColorBorder(sAreaColorBorder)Sets a new value for property areaColorBorder.
setRule(sRule)Sets a new value for property rule.
setTextProperty(sTextProperty)Sets a new value for property textProperty.
setTextSettings(oSettings)Set the settings for the text placed on the Spot for number of clustered objects
setVizTemplate(oVizTemplate)Sets the aggregated vizTemplate.
setVizVo(oVizVo)Sets the aggregated vizVo.
Constructor Detail
new sap.ui.vbm.ClusterBase(sId?, mSettings?)
Constructor for a new ClusterBase.

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
  • 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.Element 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)
The event is raised when there is a click action on a Cluster Object.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.clusterID ID of the clicked cluster object. Can serve as input for GeoMap function getInfoForCluster
contextMenu(oControlEvent)
The event is raised when there is a right click or a tap and hold action on a Cluster.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.clusterID ID of the clicked cluster object. Can serve as input for GeoMap function getInfoForCluster
{sap.ui.unified.Menu}oControlEvent.getParameters.menu Menu to open
Method Detail
sap.ui.vbm.ClusterBase.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vbm.ClusterBase 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.Element.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.vbm.ClusterBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vbm.ClusterBase.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachClick(oData?, fnFunction, oListener?): sap.ui.vbm.ClusterBase
Attaches event handler fnFunction to the click event of this sap.ui.vbm.ClusterBase.

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.vbm.ClusterBase itself.

The event is raised when there is a click action on a Cluster Object.

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.vbm.ClusterBase itself
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
attachContextMenu(oData?, fnFunction, oListener?): sap.ui.vbm.ClusterBase
Attaches event handler fnFunction to the contextMenu event of this sap.ui.vbm.ClusterBase.

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.vbm.ClusterBase itself.

The event is raised when there is a right click or a tap and hold action on a Cluster.

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.vbm.ClusterBase itself
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
destroyVizTemplate(): sap.ui.vbm.ClusterBase
Destroys the vizTemplate in the aggregation vizTemplate.
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
destroyVizVo(): sap.ui.vbm.ClusterBase
Destroys the vizVo in the aggregation vizVo.
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
detachClick(fnFunction, oListener): sap.ui.vbm.ClusterBase
Detaches event handler fnFunction from the click event of this sap.ui.vbm.ClusterBase.

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.vbm.ClusterBase} Reference to this in order to allow method chaining
detachContextMenu(fnFunction, oListener): sap.ui.vbm.ClusterBase
Detaches event handler fnFunction from the contextMenu event of this sap.ui.vbm.ClusterBase.

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.vbm.ClusterBase} Reference to this in order to allow method chaining
fireClick(mArguments?): sap.ui.vbm.ClusterBase
Fires event click to attached listeners.

Expects the following event parameters:

  • clusterID of type stringID of the clicked cluster object. Can serve as input for GeoMap function getInfoForCluster
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
fireContextMenu(mArguments?): sap.ui.vbm.ClusterBase
Fires event contextMenu to attached listeners.

Expects the following event parameters:

  • clusterID of type stringID of the clicked cluster object. Can serve as input for GeoMap function getInfoForCluster
  • menu of type sap.ui.unified.MenuMenu to open
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
getAreaAlwaysVisible(): boolean
Gets current value of property areaAlwaysVisible.

Flag controlling the visibility of the area convered by a cluster object.

Default value is false.

Returns:
{boolean} Value of property areaAlwaysVisible
getAreaColor(): sap.ui.core.CSSColor
Gets current value of property areaColor.

Fill color for the area covered by a cluster object

Default value is rgba(200,0,0,0.2).

Returns:
{sap.ui.core.CSSColor} Value of property areaColor
getAreaColorBorder(): sap.ui.core.CSSColor
Gets current value of property areaColorBorder.

Border color for the area covered by a cluster object

Default value is rgba(220,220,220,0.5).

Returns:
{sap.ui.core.CSSColor} Value of property areaColorBorder
getRule(): string
Gets current value of property rule.

Clustering rule, describing which visual objects should be considered for clustering

Returns:
{string} Value of property rule
getTextProperty(): string
Gets current value of property textProperty.

Name of property of the visualization control receiving the number of clustered objects. This setting applys only if aggregation vizTemplate is used.

Default value is text.

Returns:
{string} Value of property textProperty
getTextSettings(): object
Gets current value of property textSettings.

Settings for the text placed on the given Spot telling the number of clustered objects. This setting applys only if aggregation vizVo is used. If omitted the number of clustered object will not be shown!

Returns:
{object} Value of property textSettings
getVizTemplate(): sap.ui.core.Control
Gets content of aggregation vizTemplate.

Optional: Instance of a control, which is used as template for visualizing cluster objects. This is the prefered choise.

Returns:
{sap.ui.core.Control}
getVizVo(): sap.ui.vbm.Spot
Gets content of aggregation vizVo.

Optional: Instance of a spot, which is used as template for visualizing cluster objects

Returns:
{sap.ui.vbm.Spot}
openContextMenu(sType, oContainer, oMenu): void
Open a context menu
Parameters:
{string}sType Type of VO
{sap.ui.vbm.ClusterContainer}oContainer VO instance for which the Context Menu should be opened
{sap.ui.unified.Menu}oMenu the context menu to be opened
openDetailWindow(oSpotInst, oParams): void
Open a Detail Window. This function can only be used with a Spot as Cluster visualization object!
Parameters:
{sap.ui.vbm.Spot}oSpotInst Spot instance for which the Detail Window should be opened
{object}oParams Parameter object
{string}oParams.caption Text for Detail Window caption
{string}oParams.offsetX position offset in x-direction from the anchor point
{string}oParams.offsetY position offset in y-direction from the anchor point
setAreaAlwaysVisible(bAreaAlwaysVisible): sap.ui.vbm.ClusterBase
Sets a new value for property areaAlwaysVisible.

Flag controlling the visibility of the area convered by a cluster object.

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

Default value is false.

Parameters:
{boolean}bAreaAlwaysVisible New value for property areaAlwaysVisible
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
setAreaColor(sAreaColor): sap.ui.vbm.ClusterBase
Sets a new value for property areaColor.

Fill color for the area covered by a cluster object

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

Default value is rgba(200,0,0,0.2).

Parameters:
{sap.ui.core.CSSColor}sAreaColor New value for property areaColor
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
setAreaColorBorder(sAreaColorBorder): sap.ui.vbm.ClusterBase
Sets a new value for property areaColorBorder.

Border color for the area covered by a cluster object

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

Default value is rgba(220,220,220,0.5).

Parameters:
{sap.ui.core.CSSColor}sAreaColorBorder New value for property areaColorBorder
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
setRule(sRule): sap.ui.vbm.ClusterBase
Sets a new value for property rule.

Clustering rule, describing which visual objects should be considered for clustering

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

Parameters:
{string}sRule New value for property rule
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
setTextProperty(sTextProperty): sap.ui.vbm.ClusterBase
Sets a new value for property textProperty.

Name of property of the visualization control receiving the number of clustered objects. This setting applys only if aggregation vizTemplate is used.

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

Default value is text.

Parameters:
{string}sTextProperty New value for property textProperty
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
setTextSettings(oSettings)
Set the settings for the text placed on the Spot for number of clustered objects
Parameters:
{object}oSettings Settings object
{CSSColor}?oSettings.textcolor Text color. Default is black
{string}?oSettings.textfont Text font family. Default take from theming parameter sapUiFontFamily
{string}?oSettings.textfontsize Text font size. Default is 10.
{string}?oSettings.textoffset Text horizontal offset in pixels. Default is 0.
{string}?oSettings.textoffsetY Text vertical offset in pixels. Default is 0.
setVizTemplate(oVizTemplate): sap.ui.vbm.ClusterBase
Sets the aggregated vizTemplate.
Parameters:
{sap.ui.core.Control}oVizTemplate The vizTemplate to set
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining
setVizVo(oVizVo): sap.ui.vbm.ClusterBase
Sets the aggregated vizVo.
Parameters:
{sap.ui.vbm.Spot}oVizVo The vizVo to set
Returns:
{sap.ui.vbm.ClusterBase} Reference to this in order to allow method chaining