Packagecom.yworks.canvas.model
Classpublic class HighlightPaintManager
InheritanceHighlightPaintManager Inheritance ModelManager Inheritance Object

A ModelManager implementation that manages the visual decorations of highlighted elements in a canvas.

For each item that should be highlighted this class uses the lookup mechanism of the items to lookup an IHighlightPaintableInstaller implementation which will do the actual installation of the decoration in the canvas.

See also

ModelManager


Public Properties
 PropertyDefined By
 Inheritedcanvas : CanvasComponent
[read-only] Gets the canvas instance this instance is managing.
ModelManager
  groupProvider : ICanvasGroupProvider
Gets or sets the group provider that will be used in install to determine the canvas group where the selection paint should be installed into.
HighlightPaintManager
  inputModeContext : IInputModeContext
Gets or sets the IInputModeContext to use for this instance.
HighlightPaintManager
  selectionModel : ISelectionModel
Gets or sets the selection model that determines which items are highlighted.
HighlightPaintManager
Protected Properties
 PropertyDefined By
 Inherited_canvas : CanvasComponent
The canvas instance this instance is managing.
ModelManager
Public Methods
 MethodDefined By
  
Creates an instance that for all selected items in the model dynamically installs a selection paint decoration.
HighlightPaintManager
 Inherited
Adds an item to the canvas.
ModelManager
  
Adds another highlight.
HighlightPaintManager
  
Adds an item to the current highlight selection.
HighlightPaintManager
  
Removes all highlights.
HighlightPaintManager
 Inherited
Checks whether this descriptor is currently being managed by this instance.
ModelManager
  
[static] Creates a manager for the given input mode, reusing it's canvas an input mode context.
HighlightPaintManager
  
remove(item:IModelItem):void
Removes the provided item from this managers set of managed items.
HighlightPaintManager
 Inherited
Removes the canvas objects associated with the given descriptor handle.
ModelManager
  
Removes an item from the current highlight selection.
HighlightPaintManager
 Inherited
Updates the item in the canvas by uninstalling and reinstalling it into the canvas.
ModelManager
Protected Methods
 MethodDefined By
  
Callback used by install to retrieve the installer for the IDisplayObjectCreator that renders the highlighting for a given item.
HighlightPaintManager
  
install(member:Object):Array
[override] Installs the display object creator to highlight the given member.
HighlightPaintManager
 Inherited
uninstall(descriptor:IModelItemDescriptor, canvasObjects:Array):void
Simple implementation that removes all of the given canvasObjects.
ModelManager
Property Detail
groupProviderproperty
groupProvider:ICanvasGroupProvider

Gets or sets the group provider that will be used in install to determine the canvas group where the selection paint should be installed into.

By default this is an instance of DefaultCanvasGroupProvider.createTopGroupProvider().


Implementation
    public function get groupProvider():ICanvasGroupProvider
    public function set groupProvider(value:ICanvasGroupProvider):void

See also

inputModeContextproperty 
inputModeContext:IInputModeContext

Gets or sets the IInputModeContext to use for this instance.

The value returned will be passed to the IHighlightPaintableInstaller.installHighlightPaintables method.


Implementation
    public function get inputModeContext():IInputModeContext
    public function set inputModeContext(value:IInputModeContext):void

See also

selectionModelproperty 
selectionModel:ISelectionModel

Gets or sets the selection model that determines which items are highlighted. May be null, in which case no elements are considered highlighted.


Implementation
    public function get selectionModel():ISelectionModel
    public function set selectionModel(value:ISelectionModel):void
Constructor Detail
HighlightPaintManager()Constructor
public function HighlightPaintManager(canvas:CanvasComponent, selectionModel:ISelectionModel = null)

Creates an instance that for all selected items in the model dynamically installs a selection paint decoration.

Parameters
canvas:CanvasComponent — The canvas to add the selection marks to.
 
selectionModel:ISelectionModel (default = null) — The model that determines which items are highlighted. If null, a DefaultSelectionModel is used.
Method Detail
addHighlight()method
public function addHighlight(item:IModelItem):void

Adds another highlight.

Parameters

item:IModelItem — The item to highlight.

addSelection()method 
public function addSelection(item:IModelItem):IModelItemDescriptor

Adds an item to the current highlight selection.

Parameters

item:IModelItem — The item whose highlight decorator will added.

Returns
IModelItemDescriptor — the corresponding descriptor, or null if the item was already contained in the highlight selection.
clearHighlights()method 
public function clearHighlights():void

Removes all highlights.

create()method 
public static function create(inputMode:AbstractInputMode):HighlightPaintManager

Creates a manager for the given input mode, reusing it's canvas an input mode context.

Parameters

inputMode:AbstractInputMode — The input mode to use.

Returns
HighlightPaintManager
getHighlightPaintInstaller()method 
protected function getHighlightPaintInstaller(item:IModelItem):IHighlightPaintableInstaller

Callback used by install to retrieve the installer for the IDisplayObjectCreator that renders the highlighting for a given item. This implementation uses the lookup of the item.

Parameters

item:IModelItem — The item to find a display object creator installer for.

Returns
IHighlightPaintableInstaller — An installer or null
install()method 
override protected function install(member:Object):Array

Installs the display object creator to highlight the given member.

Parameters

member:Object — The member to install the display object creator for highlighting for.

Returns
Array — The canvas objects used.
remove()method 
public function remove(item:IModelItem):void

Removes the provided item from this managers set of managed items.

Parameters

item:IModelItem — The item to remove.

See also

removeHighlight()method 
public function removeHighlight(item:IModelItem):void

Removes an item from the current highlight selection.

Parameters

item:IModelItem — The item whose highlight decorator will be removed.