Packagecom.yworks.canvas
Classpublic class GridInfo
InheritanceGridInfo Inheritance Object

This class describes a grid by providing the grid's origin as well as the horizontal and vertical spacing between the grid points. It is used by the IGridConstraintProvider as well as by the GridSnapResultPaintable.

See also

IGridConstraintProvider
GridSnapResultPaintable


Public Properties
 PropertyDefined By
  horizontalSpacing : Number
The canonic grid spacing in horizontal direction.
GridInfo
  origin : IPoint
The canonic origin of the grid.
GridInfo
  verticalSpacing : Number
The canonic grid spacing in vertical direction.
GridInfo
Public Methods
 MethodDefined By
  
GridInfo(horizontalSpacing:Number = 25, verticalSpacing:Number = -1, origin:IPoint = null)
Creates a new instance using the given horizontal and vertical grid spacing as well as the given origin.
GridInfo
Property Detail
horizontalSpacingproperty
horizontalSpacing:Number

The canonic grid spacing in horizontal direction.

The default value is 25.


Implementation
    public function get horizontalSpacing():Number
    public function set horizontalSpacing(value:Number):void
originproperty 
origin:IPoint

The canonic origin of the grid.


Implementation
    public function get origin():IPoint
    public function set origin(value:IPoint):void
verticalSpacingproperty 
verticalSpacing:Number

The canonic grid spacing in vertical direction.

The default value is 25.


Implementation
    public function get verticalSpacing():Number
    public function set verticalSpacing(value:Number):void
Constructor Detail
GridInfo()Constructor
public function GridInfo(horizontalSpacing:Number = 25, verticalSpacing:Number = -1, origin:IPoint = null)

Creates a new instance using the given horizontal and vertical grid spacing as well as the given origin.

Parameters
horizontalSpacing:Number (default = 25) — The horizontal spacing between the grid points. If no value is passed, a spacing of 25 is used.
 
verticalSpacing:Number (default = -1) — The vertical spacing between the grid points. If a negative value is passed, the horizontalSpacing is used for the vertical spacing as well.
 
origin:IPoint (default = null) — The canonic origin of the grid. If null is passed, (0, 0) is used as origin.