Packagecom.yworks.canvas.drawing
Classpublic class DefaultPaintContext
InheritanceDefaultPaintContext Inheritance Object
Implements IPaintContext

Default implementation of the paint context interface that is used by painting routines.

The viewTransform, worldTransform and transform are initialized as identity matrices.



Public Properties
 PropertyDefined By
  canvasComponent : CanvasComponent
[read-only] The canvas component that the painting is performed to.
DefaultPaintContext
  transform : Matrix
The transform that is used to convert between the viewTransform and the resulting worldTransform.
DefaultPaintContext
  viewTransform : Matrix
A transform that can be applied to the graphics context in order to paint in the view coordinate system.
DefaultPaintContext
  worldTransform : Matrix
The transform that can be applied to the graphics context in order to paint into the world coordinate system.
DefaultPaintContext
Public Methods
 MethodDefined By
  
DefaultPaintContext
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
DefaultPaintContext
  
Converts the given set of world coordinates to a coordinate pair that can be used to paint within the viewTransform.
DefaultPaintContext
  
DefaultPaintContext
Property Detail
canvasComponentproperty
canvasComponent:CanvasComponent  [read-only]

The canvas component that the painting is performed to.


Implementation
    public function get canvasComponent():CanvasComponent
transformproperty 
transform:Matrix

The transform that is used to convert between the viewTransform and the resulting worldTransform.

Coordinates transformed using this matrix can be drawn into a graphics context that has the viewTransform applied to appear to be drawn into the world coordinate system.

viewTransform transform = worldTransform


Implementation
    public function get transform():Matrix
    public function set transform(value:Matrix):void
viewTransformproperty 
viewTransform:Matrix

A transform that can be applied to the graphics context in order to paint in the view coordinate system.


Implementation
    public function get viewTransform():Matrix
    public function set viewTransform(value:Matrix):void
worldTransformproperty 
worldTransform:Matrix

The transform that can be applied to the graphics context in order to paint into the world coordinate system.


Implementation
    public function get worldTransform():Matrix
    public function set worldTransform(value:Matrix):void
Constructor Detail
DefaultPaintContext()Constructor
public function DefaultPaintContext(canvasComponent:CanvasComponent)

Parameters
canvasComponent:CanvasComponent
Method Detail
lookup()method
public function lookup(type:Class):Object

Returns an instance that implements the given type or null.

Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.

Parameters

type:Class — the type for which an instance shall be returned

Returns
Object — an instance that is assignable to type or null

See also

toViewCoordinates()method 
public function toViewCoordinates(worldP:IMutablePoint):void

Converts the given set of world coordinates to a coordinate pair that can be used to paint within the viewTransform.

Parameters

worldP:IMutablePoint — The point in the world coordinate system.

See also

toWorldCoordinates()method 
public function toWorldCoordinates(viewP:IMutablePoint):void

Parameters

viewP:IMutablePoint

See also