Packagecom.yworks.canvas
Interfacepublic interface ICanvasContext extends ILookup

This interface describes the context for many operations performed on items in a CanvasComponent.



Public Properties
 PropertyDefined By
  hitTestRadius : Number
[read-only] The radius for hit tests and marquee selection tests in world coordinates.
ICanvasContext
  zoom : Number
[read-only] Returns the current zoom level, i.e.
ICanvasContext
Public Methods
 MethodDefined By
  
Returns the ICanvasObjects that represent the given item in the CanvasComponent or null.
ICanvasContext
  
Returns the main ICanvasObject that represents the given item in the CanvasComponent or null.
ICanvasContext
 Inherited
lookup(type:Class):Object
Returns an instance that implements the given type or null.
ILookup
  
Creates a point that corresponds to the given point in stage coordinates.
ICanvasContext
Property Detail
hitTestRadiusproperty
hitTestRadius:Number  [read-only]

The radius for hit tests and marquee selection tests in world coordinates. This value already takes the zoom level into account.


Implementation
    public function get hitTestRadius():Number
zoomproperty 
zoom:Number  [read-only]

Returns the current zoom level, i.e. the ratio of world coordinates to screen pixels.


Implementation
    public function get zoom():Number
Method Detail
getCanvasObjects()method
public function getCanvasObjects(forItem:IModelItem):Array

Returns the ICanvasObjects that represent the given item in the CanvasComponent or null.

Parameters

forItem:IModelItem — The item to get the canvas objects for.

Returns
Array — The canvas objects that represent the given item.
getMainCanvasObject()method 
public function getMainCanvasObject(forItem:IModelItem):ICanvasObject

Returns the main ICanvasObject that represents the given item in the CanvasComponent or null.

Parameters

forItem:IModelItem — The item to get the canvas object for.

Returns
ICanvasObject — The main canvas object that represent the given item.
worldToStage()method 
public function worldToStage(pView:IPoint):IPoint

Creates a point that corresponds to the given point in stage coordinates.

Parameters

pView:IPoint — A point in world coordinates

Returns
IPoint — The newly created point.