ve.NodeEditorDatatype

ve.Component. ve.NodeEditorDatatype

Refer to ve.Component for methods or fields inherited from this Component's parent such as .options.attributes or .element.

Creates a Node instance within the current ve.NodeEditor that can be connected to other nodes. Note that this is a subtype of NodeEditor and must be bound as such to its ve.NodeEditor.main.nodes: Array.

  • Functional binding: veNodeEditorDatatype().
Constructor:
  • arg0_value: Object
  • arg1_options: Object
    • .category_options: Object - Used for determining colour and other related options.
    • .is_comment=false; boolean
    • .node_editor: ve.NodeEditor
Instance:
  • .connections: Array<Array<ve.NodeEditorDatatype, number>> - [0] represents the node of the given connection, [1] represents the given index.
  • .constant_values: Array
  • .dynamic_values: Array
  • .geometries: Array<maptalks.Geometry>
  • .id: string
  • .ui: Object
  • .v: Object - Parses to/from JSON in Object form.
Methods:
  • _render()
  • draw()
  • getConnection(arg0_node:ve.NodeEditorDatatype, arg1_index:number) | number
  • handleEvents()
  • hasConnection(arg0_index:number) | boolean
  • isSelected(arg0_index:number) | boolean
  • openContextMenu()
  • remove()
  • toJSON() | Object
Static Fields:
  • .instances: Array<ve.NodeEditorDatatype>
  • .types: Object
Static Methods:
  • draw(arg0_editor:ve.NodeEditor)
  • getNode(arg0_node_id:string, arg1_editor:ve.NodeEditor)

Constructor

new ve.NodeEditorDatatype()

Source:

Extends

Members

v :Object

Returns the JSON compatible object representing the current component.

  • Accessor of: ve.NodeEditorDatatype
Source:
Type:

v

Sets the current value from a JSON compatible object.

  • Accessor of: ve.NodeEditorDatatype
Source:

from_binding

Internal .from_binding setter for handling .options.from_binding. Accepts a string literal that is then parsed to a variable reference.

.to_binding counterparts are manually handled child-side.

Overrides:
Source:

instances :Array.<ve.NodeEditorDatatype>

Source:
Type:
  • Array.<ve.NodeEditorDatatype>

limit

Tests the current this.limit by calling this.limit_function(this.v, this). Otherwise resolves to true if no .options.limit is set.

Overrides:
Source:

name

Returns the visual name of the present ve.Component,

Overrides:
Source:

Methods

#draw(arg0_editor, arg1_do_not_runopt)

Draws the present node within its ve.NodeEditor context.

  • Static method of: ve.NodeEditorDatatype
Source:
Parameters:
Name Type Attributes Default Description
arg0_editor ve.NodeEditor
arg1_do_not_run boolean <optional>
false

Whether to run the editor when visualising the draw call.

#getNode(arg0_node_id, arg1_editor) → {ve.NodeEditorDatatype}

Fetches a node from its ve.NodeEditor and ID.

  • Static method of: ve.NodeEditorDatatype
Source:
Parameters:
Name Type Description
arg0_node_id string
arg1_editor ve.NodeEditor
Returns:
Type:
ve.NodeEditorDatatype

draw()

Draws the present node.

  • Method of: ve.NodeEditorDatatype
Source:

getConnection(arg0_node, arg1_index) → {number}

Returns the given index of a connection, i.e. the node an input parameter is connected to,

  • Method of: ve.NodeEditorDatatype
Source:
Parameters:
Name Type Description
arg0_node ve.NodeEditorDatatype
arg1_index number
Returns:
Type:
number

handleEvents()

Handles events for the given node.

  • Method of: ve.NodeEditorDatatype
Source:

hasConnection(arg0_index) → {boolean}

Checks if an index in the node, i.e. an input parameter has a connection. Note that the 0th index represents the base output.

  • Method of: ve.NodeEditorDatatype
Source:
Parameters:
Name Type Description
arg0_index number
Returns:
Type:
boolean

isSelected(arg0_index) → {boolean}

Checks if a given index in the node, i.e. an input parameter is currently selected. Note that the 0th index represents the base output.

  • Method of: ve.NodeEditorDatatype
Source:
Parameters:
Name Type Description
arg0_index number
Returns:
Type:
boolean

openContextMenu()

Opens a context menu for editing the current node.

  • Method of: ve.NodeEditorDatatype
Source:

remove()

Removes the present node from its ve.NodeEditor scene.

  • Method of: ve.NodeEditorDatatype
Source:

toJSON() → {Object}

Converts the current node to a JSON-compatible object.

  • Method of: ve.NodeEditorDatatype
Source:
Returns:
Type:
Object

addComponent()

Adds the current component to this.parent_el should it exist.

Overrides:
Source:

bind(arg0_container_el)

Manually binds/mounts the present ve.Component into the visual DOM.

Overrides:
Source:
Parameters:
Name Type Description
arg0_container_el HTMLElement

fireFromBinding()

Pseudo-setter from binding. Fires only upon program-driven changes to .v directly, which means that this has to be monitored manually component-side in set v(). This should always come last in set v().

Overrides:
Source:

fireToBinding()

Pseudo-setter to binding. Fires only upon user-driven changes, which means that this has to be monitored manually component-side.

Overrides:
Source:

remove()

Removes the component/element from the DOM.

Overrides:
Source:

removeComponent()

Removes the current component from this.parent_el should it exist.

Overrides:
Source:

setOwner(arg0_value, arg1_owner_array)

Sets the root parent and ownership tree. Influences this.parent_el, this.owner, this.owners.

Overrides:
Source:
Parameters:
Name Type Description
arg0_value
arg1_owner_array

setValueFromObject(arg0_object, arg1_object)

Destructures Object values and transfers them into the .v instance fields of each Vercengen component.

Overrides:
Source:
Parameters:
Name Type Description
arg0_object Object

The Vercengen object to transfer to.

arg1_object Object

The other object to transfer from.