Constructor
new Underline(paramsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Help4.control2.hotspot.Underline.Params |
<optional> |
Properties:
Name | Type | Description |
---|---|---|
rect |
Help4.control2.AreaXYWH | the rect of the assigned element |
delta |
Help4.control2.SizeWidthHeight | in case the hotspot is moved |
- Source:
Extends
Methods
(protected) ____defineDataFunctions()
- Overrides:
- Source:
(protected) ____defineProperties(params, derivedopt, nullable)
Parameters:
Name | Type | Attributes | Default | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | ||||||||||||
derived |
Object |
<optional> <nullable> |
null |
Properties
|
- Overrides:
- Source:
(protected) ____defineProperty(args)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
Object |
Properties
|
- Overrides:
- Source:
(protected) ____defineStaticProperties()
auto define all to be cleaned properties
- Overrides:
- Source:
Throws:
Error
(protected) ____extendParams(dest, src) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
dest |
Object | |
src |
Object |
- Overrides:
- Source:
Returns:
- Type
- Object
(protected) ____getClassConfig() → {Help4.jscore.Base.Params}
- Overrides:
- Source:
Returns:
(protected) ____getData() → {Object}
- Overrides:
- Source:
Returns:
- Type
- Object
(protected) ____mergeDerivedParams(level0, level1)
Parameters:
Name | Type | Description |
---|---|---|
level0 |
Help4.jscore.Base.Params | |
level1 |
Help4.jscore.Base.Params |
- Overrides:
- Source:
Throws:
Error
(protected) ____resolveDerivedParams(classConfig)
Parameters:
Name | Type | Description |
---|---|---|
classConfig |
Help4.jscore.Base.Params |
- Overrides:
- Source:
(protected) ____setInitValue(args)
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
Object |
Properties
|
- Overrides:
- Source:
(protected) _applyTextAttribute(node, textId, value)
used to support text extraction and replacement
Parameters:
Name | Type | Default | Description |
---|---|---|---|
node |
HTMLElement | ||
textId |
string | ||
value |
boolean | true |
- Overrides:
- Source:
(protected) _createControl(object, params) → {Help4.control2.Control}
Parameters:
Name | Type | Description |
---|---|---|
object |
function | |
params |
Help4.control2.Control.Params |
- Overrides:
- Source:
Returns:
(protected) _createElement(tagName, params) → {HTMLElement}
creates a new DOM element within my control's DOM
Parameters:
Name | Type | Description |
---|---|---|
tagName |
string | tag name of new DOM element |
params |
Object | additional parameters |
- Overrides:
- Source:
Returns:
- Type
- HTMLElement
(protected) _destroyControl(…keys)
destroys class properties
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
string |
<repeatable> |
- Overrides:
- Source:
(protected) _fireEvent(event) → {Help4.jscore.Base}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Help4.jscore.Base
(async, protected) _fireEvent2(event) → {Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>
(protected) _fireEventSync(event) → {Array.<Help4.EmbeddedEvent.EventResponse>}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Array.<Help4.EmbeddedEvent.EventResponse>
(protected) _onAfterInit(params)
called after init
Parameters:
Name | Type | Description |
---|---|---|
params |
Help4.control2.Control.Params | same params as provided to the constructor |
- Overrides:
- Source:
(protected) _onBeforeDestroy()
called before destroy
- Overrides:
- Source:
(protected) _onDomAttached(dom)
called once the DOM node is attached
Parameters:
Name | Type | Description |
---|---|---|
dom |
HTMLElement | control DOM |
- Overrides:
- Source:
(protected) _onDomAvailable(dom)
called once the DOM node is available but not yet attached
Parameters:
Name | Type | Description |
---|---|---|
dom |
HTMLElement | control DOM |
- Overrides:
- Source:
(protected) _onDomFocussed(dom)
called once the DOM's event listeners are attached and the DOM's automatic focus is applied
Parameters:
Name | Type | Description |
---|---|---|
dom |
HTMLElement | control DOM |
- Overrides:
- Source:
(protected) _onDragMove()
called on every move of the control during drag & drop
- Overrides:
- Source:
(protected) _onDragStart()
called once the control starts drag & drop
- Overrides:
- Source:
(protected) _onDragStop()
called once drag & drop ends
- Overrides:
- Source:
(protected) _onGetDragDropParams() → {Help4.control2.DragDropParams}
called to configure drag & drop properly
- Overrides:
- Source:
Returns:
- allows to define specific DOM (object) and dragable area (area)
(protected) _onReady()
called once control is completely initialized
- Overrides:
- Source:
(protected) _removeTextAttribute(node, …textId)
used to support text extraction and replacement
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
node |
HTMLElement | ||
textId |
string |
<repeatable> |
- Overrides:
- Source:
(protected) _setTextAttribute(node, …textId)
used to support text extraction and replacement
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
node |
HTMLElement | ||
textId |
string |
<repeatable> |
- Overrides:
- Source:
addCss(…classNames) → {Help4.control2.Control}
add CSS classnames to this control
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
classNames |
string |
<repeatable> |
class names to be added to this control's DOM |
- Overrides:
- Source:
Returns:
addListenerSync(eventType, listener) → {Help4.jscore.Base}
add an event listener
Parameters:
Name | Type | Description |
---|---|---|
eventType |
string | Array.<string> | event type to be observed |
listener |
Help4.EmbeddedEvent.Listener | the callback function |
- Overrides:
- Source:
Returns:
- Type
- Help4.jscore.Base
calcMeetingPoint(point) → {Help4.control2.PositionXY}
returns the meeting point from a line starting in "point" to the hotspot
Parameters:
Name | Type | Description |
---|---|---|
point |
Help4.control2.PositionXY |
- Overrides:
- Source:
Returns:
getArea() → {Help4.control2.AreaXYWH}
get position and size of this control
- Overrides:
- Source:
Returns:
- area of this control within DOM
getControlTexts() → {Object|null}
get all texts within my DOM; they can then be used for e.g. automatic machine learning translation (MLT)
- Overrides:
- Source:
Throws:
Error
Returns:
- Type
- Object | null
getDocument() → {Document}
deliver the document that hosts this control
- Overrides:
- Source:
Returns:
- Type
- Document
getDom(idopt) → {HTMLElement}
deliver the DOM elements that represents this control or some element inside
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string |
<optional> |
a possible sub-dom-id |
- Overrides:
- Source:
Returns:
- Type
- HTMLElement
getDragStartPosition() → {Help4.control2.PositionXY}
gets the position (excluding offsets, including positions like top-left, bottom-right)
- Overrides:
- Source:
Returns:
getHostedControls(onlyVisibleopt) → {Array.<Help4.control2.Control>}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
onlyVisible |
boolean |
<optional> |
false | deliver only currently visible controls |
- Overrides:
- Source:
Returns:
- Type
- Array.<Help4.control2.Control>
getMetadata(…keys) → {*}
get information from the metadata store
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
string |
<repeatable> |
keys to retrieve the stored meta information |
- Overrides:
- Source:
Returns:
- Type
- *
getMetadataKeys() → {Array.<string>}
get all currently stored metadata keys
- Overrides:
- Source:
Returns:
- all currently stored keys
- Type
- Array.<string>
getOrder() → (nullable) {string}
- Overrides:
- Source:
Returns:
- Type
- string
getOwnerDom() → {HTMLElement}
deliver the DOM that contains this control
- Overrides:
- Source:
Returns:
- Type
- HTMLElement
getPosition() → {Help4.control2.PositionXY}
get position of this control
- Overrides:
- Source:
Returns:
- position of this control within DOM
getSize() → {Help4.control2.SizeWH}
get size of this control
- Overrides:
- Source:
Returns:
- size of this control's bounding client rect
getTexts(onlyVisibleopt) → {Object|null}
get the texts within my control and within all controls that are within my control
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
onlyVisible |
boolean |
<optional> |
false |
- Overrides:
- Source:
Returns:
- Type
- Object | null
hasCss(…classNames) → {boolean}
tests some classnames on this control
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
classNames |
string |
<repeatable> |
class names to be tested on this control's DOM |
- Overrides:
- Source:
Returns:
- Type
- boolean
isDestroyed() → {boolean}
whether instance is destroyed
- Overrides:
- Source:
Returns:
- Type
- boolean
isMouseOver() → {boolean}
calculate whether the mouse is on top of my DOM
- Overrides:
- Source:
Returns:
- whether mouse is over my DOM
- Type
- boolean
onEvent(event)
handle incoming events
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the received event |
- Overrides:
- Source:
removeCss(…classNames) → {Help4.control2.Control}
remove CSS classnames from this control
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
classNames |
string |
<repeatable> |
class names to be removed from this control's DOM |
- Overrides:
- Source:
Returns:
resumeDragDrop() → {Help4.control2.Control}
resume drag & drop operation
- Overrides:
- Source:
Returns:
setAttribute(name, value) → {Help4.control2.Control}
adds an attribute to the DOM
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
value |
* |
- Overrides:
- Source:
Returns:
setControlTexts(textMap) → {Help4.control2.Control}
exchange all texts of my control; e.g. after successful MLT
Parameters:
Name | Type | Description |
---|---|---|
textMap |
Object |
- Overrides:
- Source:
Throws:
Error
Returns:
setDom(dom)
Parameters:
Name | Type | Description |
---|---|---|
dom |
HTMLElement |
- Overrides:
- Source:
setMetadata(key, value) → {Help4.control2.Control}
allows to store any external key-value information within this control
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Object | the key |
value |
* | any value to be stored |
- Overrides:
- Source:
Returns:
setStyle(styles) → {Help4.control2.Control}
add styles to this control
Parameters:
Name | Type | Description |
---|---|---|
styles |
Object | styles to be added to this control's DOM |
- Overrides:
- Source:
Returns:
setText(text) → {Help4.control2.hotspot.Hotspot}
Parameters:
Name | Type | Description |
---|---|---|
text |
string |
- Overrides:
- Source:
Returns:
setTexts(textMap) → {Help4.control2.Control}
set the texts within my control and within all controls that are within my control
Parameters:
Name | Type | Description |
---|---|---|
textMap |
Object |
- Overrides:
- Source:
Returns:
suspendDragDrop() → {Help4.control2.Control}
suspend drag & drop operation
- Overrides:
- Source:
Returns:
Type Definitions
Params
Type:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rect |
Help4.control2.AreaXYWH |
<optional> |
{x: 0, y: 0, w: 0, h: 0} | the rect of the assigned element |
delta |
Help4.control2.SizeWidthHeight |
<optional> |
{width: 0, height: 0} | in case the hotspot is moved |
- Source: