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.
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
. 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
. 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. getRule()Gets current value of property rule
. getVizVo()Gets content of aggregation vizVo
. setAreaColor(sAreaColor)Sets a new value for property areaColor
. setRule(sRule)Sets a new value for property rule
. setTextSettings(oSettings)Set the settings for the text placed on the Spot for number of clustered objects setVizVo(oVizVo)Sets the aggregated vizVo
. $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
clone,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
rerender,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
invalidate,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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 |
Returns a metadata object for class sap.ui.vbm.ClusterBase.
Returns:
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:
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:
Destroys the vizTemplate in the aggregation vizTemplate
.
Returns:
Destroys the vizVo in the aggregation vizVo
.
Returns:
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:
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:
Fires event
click
to attached listeners.
Expects the following event parameters:
clusterID
of type string
ID 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:
Fires event
contextMenu
to attached listeners.
Expects the following event parameters:
clusterID
of type string
ID of the clicked cluster object. Can serve as input for GeoMap function getInfoForClustermenu
of type sap.ui.unified.Menu
Menu to open
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
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 |
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:
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:
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 |
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:
Gets content of aggregation
vizVo
.
Optional: Instance of a spot, which is used as template for visualizing cluster objects
Returns:
openContextMenu(sType, oContainer, oMenu): void
Open a context menu
Parameters:
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 |
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:
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:
Returns:
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:
Returns:
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:
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:
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. |
Sets the aggregated vizTemplate
.
Parameters:
Returns:
Sets the aggregated vizVo
.
Parameters:
Returns: