class sap.ui.vk.Annotation

Control sample: sap.ui.vk.Annotation
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/vk/Annotation
Application Component: CA-UI5-VTK

Annotation allows applications to display custom html annotation on top of Viewport and associate it with 3D object


Constructor

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()

Properties

Name Type Default Value Description
animate boolean true

Controls the animation of the annotation. If set to false then animation is not played.

Visibility: public
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

Aggregations

Default Aggregation:

Name Cardinality Type Description
textEditor 0..1 sap.ui.core.Control

Associations

Name Cardinality Type Description
viewport 0..1 sap.ui.vk.Viewport

Methods Overview

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 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.

fitToText

Adjust annotation size to fit text

getAnimate

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.

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 -1.

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 false.

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 false.

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 false.

getStyle

Gets current value of property style.

The style of the annotation

Default value is Default.

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 empty string.

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 null.

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 0.

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 0.

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 0.

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 0.

setAnimate

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.

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 null or undefined, the default value of the property will be restored.

Default value is -1.

setAnnotationId

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.

setDisplay

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.

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 null or undefined, the default value of the property will be restored.

Default value is false.

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 null or undefined, the default value of the property will be restored.

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 null or undefined, the default value of the property will be restored.

setNodeRef

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.

setSelected

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.

setStyle

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.

setText

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.

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 null or undefined, the default value of the property will be restored.

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 null or undefined, the default value of the property will be restored.

Default value is 0.

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 null or undefined, the default value of the property will be restored.

Default value is 0.

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 null or undefined, the default value of the property will be restored.

Default value is 0.

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 null or undefined, the default value of the property will be restored.

Default value is 0.

sap.ui.vk.Annotation.createAnnotation

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

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 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

fitToText

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.

getAnimate

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.

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 -1.

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 false.

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 false.

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 false.

getStyle

Gets current value of property style.

The style of the annotation

Default value is Default.

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 empty string.

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 null.

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 0.

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 0.

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 0.

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 0.

setAnimate

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 animate

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 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 animationDelay

setAnnotationId

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 annotationId

setDisplay

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 display

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 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 editable

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
fHeight float

New value for property height

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sName string

New value for property name

setNodeRef

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 nodeRef

setSelected

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 selected

setStyle

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 style

setText

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 text

setTextEditor

Sets the aggregated textEditor.

Param Type DefaultValue Description
oTextEditor sap.ui.core.Control

The textEditor to set

setTransform

Set transformation matrix to the annotation node

Param Type DefaultValue Description
transform number[]

The transformation matrix

setViewport

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

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 null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
fWidth float

New value for property width

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 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 xCoordinate

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 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 xOffset

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 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 yCoordinate

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 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 yOffset