Class sap.ui.vbm.SpotModule: sap/ui/vbm/Spot

extends VoBase

Specific Visual Object element for a Spot. A Spot is actually an image drawn at the given position. There are two modes for using spots:

  • A controlled mode by providing a spot type. In this mode many properties for the spot are automatically set by programmed defaults according to the Fiori guidelines.
  • A freestyle mode, providing the full control on colors and layout.
Beside the visualization with an image a spot can have an icon or text, which can be controlled and positioned using the content properties.
A Spot supports GeoMap internal drag'n drop with fine grained control on matching drag sources and drop targets. A drag'n drop operation is possible if any type in the drag source aggregation of the dragged visual object matches a type in the drop target aggregation of the target vo. Drag source and drop target types defined on element level apply only for a single element instance, except the element is used as template.

Constructor Summary
new sap.ui.vbm.Spot(sId?, mSettings?)Constructor for a new Spot.
Method Summary
sap.ui.vbm.Spot.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vbm.Spot with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vbm.Spot.getMetadata()Returns a metadata object for class sap.ui.vbm.Spot.
addDragSource(oDragSource)Adds some dragSource to the aggregation dragSource.
addDropTarget(oDropTarget)Adds some dropTarget to the aggregation dropTarget.
destroyDragSource()Destroys all the dragSource in the aggregation dragSource.
destroyDropTarget()Destroys all the dropTarget in the aggregation dropTarget.
getAlignment()Gets current value of property alignment.
getContentColor()Gets current value of property contentColor.
getContentFont()Gets current value of property contentFont.
getContentOffset()Gets current value of property contentOffset.
getContentSize()Gets current value of property contentSize.
getDragSource()Gets content of aggregation dragSource.
getDropTarget()Gets content of aggregation dropTarget.
getIcon()Gets current value of property icon.
getImage()Gets current value of property image.
getImageSelected()Gets current value of property imageSelected.
getPosition()Gets current value of property position.
getScale()Gets current value of property scale.
getText()Gets current value of property text.
getType()Gets current value of property type.
indexOfDragSource(oDragSource)Checks for the provided sap.ui.vbm.DragSource in the aggregation dragSource.
indexOfDropTarget(oDropTarget)Checks for the provided sap.ui.vbm.DropTarget in the aggregation dropTarget.
insertDragSource(oDragSource, iIndex)Inserts a dragSource into the aggregation dragSource.
insertDropTarget(oDropTarget, iIndex)Inserts a dropTarget into the aggregation dropTarget.
removeAllDragSource()Removes all the controls from the aggregation dragSource.
removeAllDropTarget()Removes all the controls from the aggregation dropTarget.
removeDragSource(vDragSource)Removes a dragSource from the aggregation dragSource.
removeDropTarget(vDropTarget)Removes a dropTarget from the aggregation dropTarget.
setAlignment(sAlignment)Sets a new value for property alignment.
setContentColor(sContentColor)Sets a new value for property contentColor.
setContentFont(sContentFont)Sets a new value for property contentFont.
setContentOffset(sContentOffset)Sets a new value for property contentOffset.
setContentSize(sContentSize)Sets a new value for property contentSize.
setIcon(sIcon)Sets a new value for property icon.
setImage(sImage)Sets a new value for property image.
setImageSelected(sImageSelected)Sets a new value for property imageSelected.
setPosition(sPosition)Sets a new value for property position.
setScale(sScale)Sets a new value for property scale.
setText(sText)Sets a new value for property text.
setType(sType)Sets a new value for property type.
Constructor Detail
new sap.ui.vbm.Spot(sId?, mSettings?)
Constructor for a new Spot.

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:

In addition, all settings applicable to the base type sap.ui.vbm.VoBase 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
Method Detail
sap.ui.vbm.Spot.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vbm.Spot 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.vbm.VoBase.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.Spot.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vbm.Spot.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addDragSource(oDragSource): sap.ui.vbm.Spot
Adds some dragSource to the aggregation dragSource.
Parameters:
{sap.ui.vbm.DragSource}oDragSource the dragSource to add; if empty, nothing is inserted
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
addDropTarget(oDropTarget): sap.ui.vbm.Spot
Adds some dropTarget to the aggregation dropTarget.
Parameters:
{sap.ui.vbm.DropTarget}oDropTarget the dropTarget to add; if empty, nothing is inserted
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
destroyDragSource(): sap.ui.vbm.Spot
Destroys all the dragSource in the aggregation dragSource.
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
destroyDropTarget(): sap.ui.vbm.Spot
Destroys all the dropTarget in the aggregation dropTarget.
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
getAlignment(): string
Gets current value of property alignment.

Alignment of the spot to its position:

  • 0: center
  • 1: top center
  • 2: top right
  • 3: center right
  • 4: bottom right
  • 5: bottom center
  • 6: bottom left
  • 7: center left
  • 8: top left

Default value is 5.

Returns:
{string} Value of property alignment
getContentColor(): string
Gets current value of property contentColor.

The color of the content ( icon or text ).

Returns:
{string} Value of property contentColor
getContentFont(): string
Gets current value of property contentFont.

The font of the spot's text. If icon is used then the font is automatically set to"SAP-icons".

Default value is arial.

Returns:
{string} Value of property contentFont
getContentOffset(): string
Gets current value of property contentOffset.

The offset from the center of the image where to place the content ( text or icon ) in x;y- direction

Default value is 0;0.

Returns:
{string} Value of property contentOffset
getContentSize(): string
Gets current value of property contentSize.

The font size to be used for text or icon

Returns:
{string} Value of property contentSize
getDragSource(): sap.ui.vbm.DragSource[]
Gets content of aggregation dragSource.

DragSource aggregation

Returns:
{sap.ui.vbm.DragSource[]}
getDropTarget(): sap.ui.vbm.DropTarget[]
Gets content of aggregation dropTarget.

DropTarget aggregation

Returns:
{sap.ui.vbm.DropTarget[]}
getIcon(): string
Gets current value of property icon.

The icon to be rendered on the spot. Note that either text or icon may be displayed ( not both together ). Use the CharCode-Id of SAPUI5-Icons (e.g.: "\ue146")

Returns:
{string} Value of property icon
getImage(): string
Gets current value of property image.

The image for the spot. This must be a reference to a resource.

Returns:
{string} Value of property image
getImageSelected(): string
Gets current value of property imageSelected.

The image for the spot when selected. This must be a reference to a resource.

Returns:
{string} Value of property imageSelected
getPosition(): string
Gets current value of property position.

The position of the spot. The format is "lon;lat;0"

Default value is 0;0;0.

Returns:
{string} Value of property position
getScale(): string
Gets current value of property scale.

The scale of the spot. The format is "x-Scale;y-Scale;z-Scale". The z-Scale is curretly ignored.

Default value is 1;1;1.

Returns:
{string} Value of property scale
getText(): string
Gets current value of property text.

The text that is displayed on the spot. The text should not exceed a few characters. Note that either text or icon may be displayed ( not both together ).

Returns:
{string} Value of property text
Gets current value of property type.

Spot type for semantic spots. A given semantic type will overrule settings for image, scale, and content.

Returns:
{sap.ui.vbm.SemanticType} Value of property type
indexOfDragSource(oDragSource): int
Checks for the provided sap.ui.vbm.DragSource in the aggregation dragSource. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.vbm.DragSource}oDragSource The dragSource whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfDropTarget(oDropTarget): int
Checks for the provided sap.ui.vbm.DropTarget in the aggregation dropTarget. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.vbm.DropTarget}oDropTarget The dropTarget whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertDragSource(oDragSource, iIndex): sap.ui.vbm.Spot
Inserts a dragSource into the aggregation dragSource.
Parameters:
{sap.ui.vbm.DragSource}oDragSource the dragSource to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the dragSource should be inserted at; for a negative value of iIndex, the dragSource is inserted at position 0; for a value greater than the current size of the aggregation, the dragSource is inserted at the last position
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
insertDropTarget(oDropTarget, iIndex): sap.ui.vbm.Spot
Inserts a dropTarget into the aggregation dropTarget.
Parameters:
{sap.ui.vbm.DropTarget}oDropTarget the dropTarget to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the dropTarget should be inserted at; for a negative value of iIndex, the dropTarget is inserted at position 0; for a value greater than the current size of the aggregation, the dropTarget is inserted at the last position
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
removeAllDragSource(): sap.ui.vbm.DragSource[]
Removes all the controls from the aggregation dragSource.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.vbm.DragSource[]} An array of the removed elements (might be empty)
removeAllDropTarget(): sap.ui.vbm.DropTarget[]
Removes all the controls from the aggregation dropTarget.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.vbm.DropTarget[]} An array of the removed elements (might be empty)
removeDragSource(vDragSource): sap.ui.vbm.DragSource
Removes a dragSource from the aggregation dragSource.
Parameters:
{int|string|sap.ui.vbm.DragSource}vDragSource The dragSourceto remove or its index or id
Returns:
{sap.ui.vbm.DragSource} The removed dragSource or null
removeDropTarget(vDropTarget): sap.ui.vbm.DropTarget
Removes a dropTarget from the aggregation dropTarget.
Parameters:
{int|string|sap.ui.vbm.DropTarget}vDropTarget The dropTargetto remove or its index or id
Returns:
{sap.ui.vbm.DropTarget} The removed dropTarget or null
setAlignment(sAlignment): sap.ui.vbm.Spot
Sets a new value for property alignment.

Alignment of the spot to its position:

  • 0: center
  • 1: top center
  • 2: top right
  • 3: center right
  • 4: bottom right
  • 5: bottom center
  • 6: bottom left
  • 7: center left
  • 8: top left

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

Default value is 5.

Parameters:
{string}sAlignment New value for property alignment
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setContentColor(sContentColor): sap.ui.vbm.Spot
Sets a new value for property contentColor.

The color of the content ( icon or text ).

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

Parameters:
{string}sContentColor New value for property contentColor
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setContentFont(sContentFont): sap.ui.vbm.Spot
Sets a new value for property contentFont.

The font of the spot's text. If icon is used then the font is automatically set to"SAP-icons".

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

Default value is arial.

Parameters:
{string}sContentFont New value for property contentFont
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setContentOffset(sContentOffset): sap.ui.vbm.Spot
Sets a new value for property contentOffset.

The offset from the center of the image where to place the content ( text or icon ) in x;y- direction

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

Default value is 0;0.

Parameters:
{string}sContentOffset New value for property contentOffset
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setContentSize(sContentSize): sap.ui.vbm.Spot
Sets a new value for property contentSize.

The font size to be used for text or icon

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

Parameters:
{string}sContentSize New value for property contentSize
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setIcon(sIcon): sap.ui.vbm.Spot
Sets a new value for property icon.

The icon to be rendered on the spot. Note that either text or icon may be displayed ( not both together ). Use the CharCode-Id of SAPUI5-Icons (e.g.: "\ue146")

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

Parameters:
{string}sIcon New value for property icon
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setImage(sImage): sap.ui.vbm.Spot
Sets a new value for property image.

The image for the spot. This must be a reference to a resource.

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

Parameters:
{string}sImage New value for property image
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setImageSelected(sImageSelected): sap.ui.vbm.Spot
Sets a new value for property imageSelected.

The image for the spot when selected. This must be a reference to a resource.

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

Parameters:
{string}sImageSelected New value for property imageSelected
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setPosition(sPosition): sap.ui.vbm.Spot
Sets a new value for property position.

The position of the spot. The format is "lon;lat;0"

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

Default value is 0;0;0.

Parameters:
{string}sPosition New value for property position
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setScale(sScale): sap.ui.vbm.Spot
Sets a new value for property scale.

The scale of the spot. The format is "x-Scale;y-Scale;z-Scale". The z-Scale is curretly ignored.

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

Default value is 1;1;1.

Parameters:
{string}sScale New value for property scale
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setText(sText): sap.ui.vbm.Spot
Sets a new value for property text.

The text that is displayed on the spot. The text should not exceed a few characters. Note that either text or icon may be displayed ( not both together ).

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

Parameters:
{string}sText New value for property text
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining
setType(sType): sap.ui.vbm.Spot
Sets a new value for property type.

Spot type for semantic spots. A given semantic type will overrule settings for image, scale, and content.

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

Parameters:
{sap.ui.vbm.SemanticType}sType New value for property type
Returns:
{sap.ui.vbm.Spot} Reference to this in order to allow method chaining