Packagecom.yworks.graph.model
Classpublic class EdgeSelectionDisplayObjectCreator
InheritanceEdgeSelectionDisplayObjectCreator Inheritance Object
Implements ISelectionPaintable, IHighlightPaintableInstaller, IFocusPaintableInstaller, IDisplayObjectCreator

A display object creator that can be used to visualize selection, highlighting and/or focusing an edge.

The drawing is separated in drawing the edge path and the edge's bends to allow easier customization.



Public Properties
 PropertyDefined By
  stroke : IStroke
Gets or sets the stroke used to draw the edge path and the edge's bends.
EdgeSelectionDisplayObjectCreator
Protected Properties
 PropertyDefined By
  edge : IEdge
[read-only] The edge this display object creator is used for.
EdgeSelectionDisplayObjectCreator
Public Methods
 MethodDefined By
  
Creates a new instance for the passed edge.
EdgeSelectionDisplayObjectCreator
  
Creates a new DisplayObject from scratch.
EdgeSelectionDisplayObjectCreator
  
installFocusPaintables(context:IInputModeContext, focusGroup:ICanvasObjectGroup, item:Object):Array
Creates and installs one or more canvas objects into the canvas that indicate the focus decoration for an item.
EdgeSelectionDisplayObjectCreator
  
installHighlightPaintables(context:IInputModeContext, highlightGroup:ICanvasObjectGroup, item:Object):Array
Creates and installs one or more canvas objects into the canvas that indicate a selection decoration for an item.
EdgeSelectionDisplayObjectCreator
  
installSelectionPaintables(userObject:Object, canvas:CanvasComponent, selectionGroup:ICanvasObjectGroup):Array
Creates and installs one or more canvas objects into the canvas that indicate a selection decoration for an item.
EdgeSelectionDisplayObjectCreator
  
Performs the actual painting into the given graphics context.
EdgeSelectionDisplayObjectCreator
  
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject or creates a new one.
EdgeSelectionDisplayObjectCreator
Protected Methods
 MethodDefined By
  
Draws the bend assuming that the graphics context is correctly configured so that the bend is located at (0, 0).
EdgeSelectionDisplayObjectCreator
  
Transforms the graphics context to paint in view coordinates and iterates over the edge's bends.
EdgeSelectionDisplayObjectCreator
  
Looks up the IPathGeometry of the edge and draws its path.
EdgeSelectionDisplayObjectCreator
Property Detail
edgeproperty
edge:IEdge  [read-only]

The edge this display object creator is used for.


Implementation
    protected function get edge():IEdge
strokeproperty 
stroke:IStroke

Gets or sets the stroke used to draw the edge path and the edge's bends.


Implementation
    public function get stroke():IStroke
    public function set stroke(value:IStroke):void
Constructor Detail
EdgeSelectionDisplayObjectCreator()Constructor
public function EdgeSelectionDisplayObjectCreator(edge:IEdge)

Creates a new instance for the passed edge.

Parameters
edge:IEdge — The edge this display object creator is used for.
Method Detail
createDisplayObject()method
public function createDisplayObject(context:IDisplayObjectContext):DisplayObject

Creates a new DisplayObject from scratch.

Parameters

context:IDisplayObjectContext — The context for which the display object is created.

Returns
DisplayObject — A DisplayObject.
installFocusPaintables()method 
public function installFocusPaintables(context:IInputModeContext, focusGroup:ICanvasObjectGroup, item:Object):Array

Creates and installs one or more canvas objects into the canvas that indicate the focus decoration for an item.

Parameters

context:IInputModeContext — The context to add the IDisplayObjectCreator for the focus indicator.
 
focusGroup:ICanvasObjectGroup — The canvas object group to add the items to.
 
item:Object — The item to install the indicator for.

Returns
Array — An array of canvas objects this instance has installed into the CanvasComponent.
installHighlightPaintables()method 
public function installHighlightPaintables(context:IInputModeContext, highlightGroup:ICanvasObjectGroup, item:Object):Array

Creates and installs one or more canvas objects into the canvas that indicate a selection decoration for an item.

Parameters

context:IInputModeContext — The context to add the IDisplayObjectCreator for the highlighting.
 
highlightGroup:ICanvasObjectGroup — The canvas object group to add the items to.
 
item:Object — The item to create a highlight for.

Returns
Array — An array of canvas objects this instance has installed into the CanvasComponent.
installSelectionPaintables()method 
public function installSelectionPaintables(userObject:Object, canvas:CanvasComponent, selectionGroup:ICanvasObjectGroup):Array

Creates and installs one or more canvas objects into the canvas that indicate a selection decoration for an item.

Parameters

userObject:Object — The item to create a selection for.
 
canvas:CanvasComponent — The canvas to add the selection visualization to.
 
selectionGroup:ICanvasObjectGroup — The canvas object group to add the items to.

Returns
Array — An array of canvas objects this instance has installed into the canvas.
paint()method 
public function paint(g:YGraphics, ctx:IPaintContext):void

Performs the actual painting into the given graphics context.

This implementation applies the set stroke and delegates the rendering to paintPath and paintBends.

Parameters

g:YGraphics — The graphics context.
 
ctx:IPaintContext — The paint context.

See also

paintBend()method 
protected function paintBend(g:YGraphics, ctx:IPaintContext, bend:IBend):void

Draws the bend assuming that the graphics context is correctly configured so that the bend is located at (0, 0).

Parameters

g:YGraphics — The graphics context.
 
ctx:IPaintContext — The paint context.
 
bend:IBend — The bend to draw.

paintBends()method 
protected function paintBends(g:YGraphics, ctx:IPaintContext):void

Transforms the graphics context to paint in view coordinates and iterates over the edge's bends. For each bend the graphics context is translated to the bend coordinates and the painting is delegated to paintBend.

Parameters

g:YGraphics — The graphics context.
 
ctx:IPaintContext — The paint context.

See also

paintPath()method 
protected function paintPath(g:YGraphics, ctx:IPaintContext):void

Looks up the IPathGeometry of the edge and draws its path.

Parameters

g:YGraphics — The graphics context.
 
ctx:IPaintContext — The paint context.

See also

updateDisplayObject()method 
public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject

Updates the given DisplayObject or creates a new one.

Implementors can decide whether they update the given display object or create a new one. Updating can mean re-rendering or updating size and/or coordinates.

Parameters

oldDisplayObject:DisplayObject — The display object to update.
 
context:IDisplayObjectContext — The context for which the display object should be updated.

Returns
DisplayObject — The updated display object or a completely new display object.