NodeHighlightManager

How to get NodeHighlightManager

ES2015+:

import NodeHighlightManager from 'fontoxml-focus-highlight-view/nodeHighlightManager'

ES5:

define([
	'fontoxml-focus-highlight-view/nodeHighlightManager'
], function (
	NodeHighlightManager
) {
});

Type: Class

The nodeHighlightManager can be used to highlight nodes on the canvas.

Make sure to call one of the styleAs* methods in an install.js to specify how a highlight should be rendered.

Methods

Name Description
setHighlight

Set node ids to highlight for the given type. Returns a function that can be used to safely clear the highlight in cases where multiple components control the same highlight type.


  Arguments
# Name Type Description
1. highlightType String
2. nodeIds String | Array<String> | Null

Set to null to remove the highlight

  Returns

Type: Function

Call to clear the highlight, unless it has been changed

setRecursive

Determines whether the given highlight type also applies to all descendants of matching nodes.


  Arguments
# Name Type Description
1. highlightType String
2. isRecursive Boolean
styleAsActiveHighlight

Use the active highlight style for the given type (solid border)


  Arguments
# Name Type Description
1. highlightType String
2. color String

in any valid css notation ('hotpink' / '#ff7700' / 'rgba(0, 128, 255, 0.5)')

styleAsHoverHighlight

Use the hover highlight style for the given type (dotted border)


  Arguments
# Name Type Description
1. highlightType String
2. color String

in any valid css notation ('hotpink' / '#ff7700' / 'rgba(0, 128, 255, 0.5)')

styleAsSelectionHighlight

Use the selection highlight style for the given type (plain background / overlay color)


  Arguments
# Name Type Description
1. highlightType String
2. color String

in any valid css notation ('hotpink' / '#ff7700' / 'rgba(0, 128, 255, 0.5)')

3. unfocusedColor String

in any valid css notation ('hotpink' / '#ff7700' / 'rgba(0, 128, 255, 0.5)')