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.
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
. addDragSource(oDragSource)Adds some dragSource to the aggregation dragSource
. addDropTarget(oDropTarget)Adds some dropTarget to the aggregation dropTarget
. getIcon()Gets current value of property icon
. getImage()Gets current value of property image
. 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
. 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
. setContentFont(sContentFont)Sets a new value for property contentFont
. 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
. 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
. attachClick,
attachContextMenu,
attachDrop,
attachHandleClick,
attachHandleContextMenu,
attachHandleMoved,
detachClick,
detachContextMenu,
detachDrop,
detachHandleClick,
detachHandleContextMenu,
detachHandleMoved,
fireClick,
fireContextMenu,
fireDrop,
fireHandleClick,
fireHandleContextMenu,
fireHandleMoved,
getChangeable,
getDragData,
getEntity,
getFxdir,
getFxsize,
getHotDeltaColor,
getHotScale,
getKey,
getLabelArrow,
getLabelBgColor,
getLabelBorderColor,
getLabelPos,
getLabelText,
getLabelType,
getSelect,
getSelectColor,
openContextMenu,
openDetailWindow,
setChangeable,
setDragData,
setEntity,
setFxdir,
setFxsize,
setHotDeltaColor,
setHotScale,
setKey,
setLabelArrow,
setLabelBgColor,
setLabelBorderColor,
setLabelPos,
setLabelText,
setLabelType,
setSelect,
setSelectColor $,
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,
init,
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.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 |
Returns a metadata object for class sap.ui.vbm.Spot.
Returns:
Adds some dragSource to the aggregation dragSource
.
Parameters:
Returns:
Adds some dropTarget to the aggregation dropTarget
.
Parameters:
Returns:
Destroys all the dragSource in the aggregation dragSource
.
Returns:
Destroys all the dropTarget in the aggregation dropTarget
.
Returns:
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 |
Gets content of aggregation
dragSource
.
DragSource aggregation
Returns:
Gets content of aggregation
dropTarget
.
DropTarget aggregation
Returns:
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:
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:
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:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
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:
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:
Removes all the controls from the aggregation
dragSource
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes all the controls from the aggregation
dropTarget
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes a dragSource from the aggregation dragSource
.
Parameters:
Returns:
Removes a dropTarget from the aggregation dropTarget
.
Parameters:
Returns:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
Returns: