Annotation allows applications to display custom html annotation on top of Viewport and associate it with 3D object
Constructor for a new Annotation.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.vk.Annotation()
Name | Type | Default Value | Description |
---|---|---|---|
animate | boolean | true | Controls the animation of the annotation. If set to |
animationDelay | float | -1 | Amount of time in seconds to wait before animation is played. Default value of -1 means that this is not set. Visibility: public |
annotationId | string | Reference to the annotation Id Visibility: public |
|
display | boolean | false | Controls the visibility of the annotation Visibility: public |
editable | boolean | false | If annotation is editable then double click event is fired when user double clicks on the annotation and text editing is allowed by calling openEditor() method. If annotation is also selected then resize and reposition handles will be displayed. Visibility: public |
height | float | Sets the height of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored. Visibility: public |
|
name | string | Reference to the annotation name Visibility: public |
|
nodeRef | any | Reference to the node that represents the annotation Visibility: public |
|
selected | boolean | false | Controls the annotation selected state Visibility: public |
style | sap.ui.vk.AnnotationStyle | Default | The style of the annotation Visibility: public |
text | string | empty string | The text that will be displayed in the annotation Visibility: public |
width | float | Sets the width of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored. Visibility: public |
|
xCoordinate | float | 0 | Sets the X Coordinate of the annotation. This uses a scale of -0.5 to 0.5, left to right respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Visibility: public |
xOffset | float | 0 | Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, left to right respectively. Visibility: public |
yCoordinate | float | 0 | Sets the Y Coordinate of the annotation. This uses a scale of -0.5 to 0.5, top to bottom respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Visibility: public |
yOffset | float | 0 | Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, top to bottom respectively. Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
textEditor | 0..1 | sap.ui.core.Control |
Method | Description |
---|---|
sap.ui.vk.Annotation.createAnnotation |
The main method for creation of annotations |
destroyTextEditor |
Destroys the textEditor in the aggregation textEditor. |
sap.ui.vk.Annotation.extend |
Creates a new subclass of class sap.ui.vk.Annotation with name
|
fitToText |
Adjust annotation size to fit text |
getAnimate |
Gets current value of property animate. Controls the animation of the annotation. If set to Default value is |
getAnimationDelay |
Gets current value of property animationDelay. Amount of time in seconds to wait before animation is played. Default value of -1 means that this is not set. Default value is |
getAnnotationId |
Gets current value of property annotationId. Reference to the annotation Id |
getDisplay |
Gets current value of property display. Controls the visibility of the annotation Default value is |
getEditable |
Gets current value of property editable. If annotation is editable then double click event is fired when user double clicks on the annotation and text editing is allowed by calling openEditor() method. If annotation is also selected then resize and reposition handles will be displayed. Default value is |
getHeight |
Gets current value of property height. Sets the height of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored. |
sap.ui.vk.Annotation.getMetadata |
Returns a metadata object for class sap.ui.vk.Annotation. |
getName |
Gets current value of property name. Reference to the annotation name |
getNodeRef |
Gets current value of property nodeRef. Reference to the node that represents the annotation |
getSelected |
Gets current value of property selected. Controls the annotation selected state Default value is |
getStyle |
Gets current value of property style. The style of the annotation Default value is |
getTargetNodes |
Return list of target nodes. |
getText |
Gets current value of property text. The text that will be displayed in the annotation Default value is |
getTextEditor |
Gets content of aggregation textEditor. |
getTransform |
Get transformation matrix from the annotation node |
getViewport |
ID of the element which is the current target of the association viewport, or |
getWidth |
Gets current value of property width. Sets the width of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored. |
getXCoordinate |
Gets current value of property xCoordinate. Sets the X Coordinate of the annotation. This uses a scale of -0.5 to 0.5, left to right respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Default value is |
getXOffset |
Gets current value of property xOffset. Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, left to right respectively. Default value is |
getYCoordinate |
Gets current value of property yCoordinate. Sets the Y Coordinate of the annotation. This uses a scale of -0.5 to 0.5, top to bottom respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Default value is |
getYOffset |
Gets current value of property yOffset. Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, top to bottom respectively. Default value is |
setAnimate |
Sets a new value for property animate. Controls the animation of the annotation. If set to When called with a value of Default value is |
setAnimationDelay |
Sets a new value for property animationDelay. Amount of time in seconds to wait before animation is played. Default value of -1 means that this is not set. When called with a value of Default value is |
setAnnotationId |
Sets a new value for property annotationId. Reference to the annotation Id When called with a value of |
setDisplay |
Sets a new value for property display. Controls the visibility of the annotation When called with a value of Default value is |
setEditable |
Sets a new value for property editable. If annotation is editable then double click event is fired when user double clicks on the annotation and text editing is allowed by calling openEditor() method. If annotation is also selected then resize and reposition handles will be displayed. When called with a value of Default value is |
setHeight |
Sets a new value for property height. Sets the height of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored. When called with a value of |
setInitialOffset |
Adjust annotation size and position so it is placed close to the object it's pointing to. This method can be used if precise position is not known by the application. |
setName |
Sets a new value for property name. Reference to the annotation name When called with a value of |
setNodeRef |
Sets a new value for property nodeRef. Reference to the node that represents the annotation When called with a value of |
setSelected |
Sets a new value for property selected. Controls the annotation selected state When called with a value of Default value is |
setStyle |
Sets a new value for property style. The style of the annotation When called with a value of Default value is |
setText |
Sets a new value for property text. The text that will be displayed in the annotation When called with a value of Default value is |
setTextEditor |
Sets the aggregated textEditor. |
setTransform |
Set transformation matrix to the annotation node |
setViewport |
Sets the associated viewport. |
setWidth |
Sets a new value for property width. Sets the width of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored. When called with a value of |
setXCoordinate |
Sets a new value for property xCoordinate. Sets the X Coordinate of the annotation. This uses a scale of -0.5 to 0.5, left to right respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. When called with a value of Default value is |
setXOffset |
Sets a new value for property xOffset. Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, left to right respectively. When called with a value of Default value is |
setYCoordinate |
Sets a new value for property yCoordinate. Sets the Y Coordinate of the annotation. This uses a scale of -0.5 to 0.5, top to bottom respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. When called with a value of Default value is |
setYOffset |
Sets a new value for property yOffset. Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, top to bottom respectively. When called with a value of Default value is |
The main method for creation of annotations
Param | Type | DefaultValue | Description |
---|---|---|---|
divAnnotation | any |
Object with annotation settings |
|
viewport | sap.ui.vk.Viewport |
Viewport where annotation are displayed |
Creates a new subclass of class sap.ui.vk.Annotation 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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Adjust annotation size to fit text
Param | Type | DefaultValue | Description |
---|---|---|---|
maxWidth | number |
If set then maximum width of annotation will be limited to this number in pixels. |
|
maxHeight | number |
If set then maximum height of annotation will be limited to this number in pixels. |
Gets current value of property animate.
Controls the animation of the annotation. If set to false
then animation is not played.
Default value is true
.
Gets current value of property animationDelay.
Amount of time in seconds to wait before animation is played. Default value of -1 means that this is not set.
Default value is -1
.
Gets current value of property display.
Controls the visibility of the annotation
Default value is false
.
Gets current value of property editable.
If annotation is editable then double click event is fired when user double clicks on the annotation and text editing is allowed by calling openEditor() method. If annotation is also selected then resize and reposition handles will be displayed.
Default value is false
.
Gets current value of property height.
Sets the height of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored.
Gets current value of property nodeRef.
Reference to the node that represents the annotation
Gets current value of property selected.
Controls the annotation selected state
Default value is false
.
Gets current value of property text.
The text that will be displayed in the annotation
Default value is empty string
.
Gets current value of property width.
Sets the width of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored.
Gets current value of property xCoordinate.
Sets the X Coordinate of the annotation. This uses a scale of -0.5 to 0.5, left to right respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport.
Default value is 0
.
Gets current value of property xOffset.
Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, left to right respectively.
Default value is 0
.
Gets current value of property yCoordinate.
Sets the Y Coordinate of the annotation. This uses a scale of -0.5 to 0.5, top to bottom respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport.
Default value is 0
.
Gets current value of property yOffset.
Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, top to bottom respectively.
Default value is 0
.
Sets a new value for property animate.
Controls the animation of the annotation. If set to false
then animation is not played.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bAnimate | boolean | true |
New value for property |
Sets a new value for property animationDelay.
Amount of time in seconds to wait before animation is played. Default value of -1 means that this is not set.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is -1
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fAnimationDelay | float | -1 |
New value for property |
Sets a new value for property annotationId.
Reference to the annotation Id
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAnnotationId | string |
New value for property |
Sets a new value for property display.
Controls the visibility of the annotation
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bDisplay | boolean | false |
New value for property |
Sets a new value for property editable.
If annotation is editable then double click event is fired when user double clicks on the annotation and text editing is allowed by calling openEditor() method. If annotation is also selected then resize and reposition handles will be displayed.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEditable | boolean | false |
New value for property |
Sets a new value for property height.
Sets the height of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
fHeight | float |
New value for property |
Adjust annotation size and position so it is placed close to the object it's pointing to. This method can be used if precise position is not known by the application.
Sets a new value for property name.
Reference to the annotation name
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sName | string |
New value for property |
Sets a new value for property nodeRef.
Reference to the node that represents the annotation
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
oNodeRef | any |
New value for property |
Sets a new value for property selected.
Controls the annotation selected state
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bSelected | boolean | false |
New value for property |
Sets a new value for property style.
The style of the annotation
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Default
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sStyle | sap.ui.vk.AnnotationStyle | Default |
New value for property |
Sets a new value for property text.
The text that will be displayed in the annotation
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string | "" |
New value for property |
Sets the aggregated textEditor.
Param | Type | DefaultValue | Description |
---|---|---|---|
oTextEditor | sap.ui.core.Control |
The textEditor to set |
Set transformation matrix to the annotation node
Param | Type | DefaultValue | Description |
---|---|---|---|
transform | number[] |
The transformation matrix |
Sets the associated viewport.
Param | Type | DefaultValue | Description |
---|---|---|---|
oViewport | sap.ui.core.ID sap.ui.vk.Viewport |
ID of an element which becomes the new target of this viewport association; alternatively, an element instance may be given |
Sets a new value for property width.
Sets the width of the annotation. This uses a scale of 0 to 1, 0% to 100% respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport. Negative values will be ignored.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
fWidth | float |
New value for property |
Sets a new value for property xCoordinate.
Sets the X Coordinate of the annotation. This uses a scale of -0.5 to 0.5, left to right respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fXCoordinate | float | 0 |
New value for property |
Sets a new value for property xOffset.
Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, left to right respectively.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fXOffset | float | 0 |
New value for property |
Sets a new value for property yCoordinate.
Sets the Y Coordinate of the annotation. This uses a scale of -0.5 to 0.5, top to bottom respectively. This is relative to the Viewport's safe area if present, otherwise it is relative to the Viewport.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fYCoordinate | float | 0 |
New value for property |
Sets a new value for property yOffset.
Sets horizontal offset of annotation's position relative to the point where it should be normally placed. Can be used to offset annotation from attachment node (if set). This uses a scale of -0.5 to 0.5, top to bottom respectively.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fYOffset | float | 0 |
New value for property |