| Package | com.yworks.canvas.drawing |
| Class | public class GridPaintable |
| Inheritance | GridPaintable Object |
| Implements | IDisplayObjectCreator |
| Property | Defined By | ||
|---|---|---|---|
| gridInfo : GridInfo
The grid info that describes the geometry of the grid. | GridPaintable | ||
| gridStyle : Object
The grid style that is used by this implementation. | GridPaintable | ||
| stroke : IStroke
The stroke to use for painting the grid. | GridPaintable | ||
| visibilityThreshold : Number
The visibility threshold indicates the minimum distance in the view coordinate system between two grid points. | GridPaintable | ||
| visible : Boolean
If the grid shall be visible. | GridPaintable | ||
| Method | Defined By | ||
|---|---|---|---|
GridPaintable(gridInfo:GridInfo = null, stroke:IStroke = null)
Creates a new instance which will render the grid with the given grid size. | GridPaintable | ||
createDisplayObject(context:IDisplayObjectContext):DisplayObject | GridPaintable | ||
Paints the grid by delegating to a paint method matching the gridStyle. | GridPaintable | ||
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject | GridPaintable | ||
| Method | Defined By | ||
|---|---|---|---|
Draws a single cross point at the given location. | GridPaintable | ||
Draws a small cross as single dot point at the given location. | GridPaintable | ||
Paints a cross at each visible grid point by delegating to drawCrossPoint. | GridPaintable | ||
Paints a dot at each visible grid point by delegating to drawDotPoint. | GridPaintable | ||
Paints horizontal and vertical lines through all visible grid points. | GridPaintable | ||
| Constant | Defined By | ||
|---|---|---|---|
| GRID_STYLE_CROSSES : Object = GRID_STYLE_CROSSES [static]
For each grid point there is a small cross rendered. | GridPaintable | ||
| GRID_STYLE_DOTS : Object = GRID_STYLE_DOTS [static]
For each grid point there is a small dot rendered. | GridPaintable | ||
| GRID_STYLE_LINES : Object = GRID_STYLE_LINES [static]
Draws horizontal and vertical lines through the grid points. | GridPaintable | ||
| gridInfo | property |
gridInfo:GridInfoThe grid info that describes the geometry of the grid.
public function get gridInfo():GridInfo public function set gridInfo(value:GridInfo):void| gridStyle | property |
gridStyle:ObjectThe grid style that is used by this implementation.
The default value is GridPaintable#GRID_STYLE_DOTS.
public function get gridStyle():Object public function set gridStyle(value:Object):voidSee also
| stroke | property |
stroke:IStrokeThe stroke to use for painting the grid.
public function get stroke():IStroke public function set stroke(value:IStroke):void| visibilityThreshold | property |
visibilityThreshold:NumberThe visibility threshold indicates the minimum distance in the view coordinate system between two grid points. If the distance becomes smaller, the grid will not be rendered.
The default value is 10.
public function get visibilityThreshold():Number public function set visibilityThreshold(value:Number):void| visible | property |
visible:Boolean
If the grid shall be visible. If false no grid is painted.
The default value is true.
public function get visible():Boolean public function set visible(value:Boolean):void| GridPaintable | () | Constructor |
public function GridPaintable(gridInfo:GridInfo = null, stroke:IStroke = null)Creates a new instance which will render the grid with the given grid size.
ParametersgridInfo:GridInfo (default = null) — The info describing the grid.
| |
stroke:IStroke (default = null) — The stroke used to paint the grid.
|
| createDisplayObject | () | method |
public function createDisplayObject(context:IDisplayObjectContext):DisplayObjectParameters
context:IDisplayObjectContext |
DisplayObject |
| drawCrossPoint | () | method |
protected function drawCrossPoint(g:YGraphics, ctx:IPaintContext, x:Number, y:Number, dx:Number, dy:Number):voidDraws a single cross point at the given location.
Parameters
g:YGraphics — The graphics object to draw on.
| |
ctx:IPaintContext — The paint context.
| |
x:Number — The horizontal location of the center of the cross to draw.
| |
y:Number — The vertical location of the center of the cross to draw.
| |
dx:Number — The distance the cross shall stretch horizontally from the center.
| |
dy:Number — The distance the cross shall stretch vertically from the center.
|
| drawDotPoint | () | method |
protected function drawDotPoint(g:YGraphics, ctx:IPaintContext, x:Number, y:Number):voidDraws a small cross as single dot point at the given location.
Parameters
g:YGraphics — The graphics object to draw on.
| |
ctx:IPaintContext — The paint context.
| |
x:Number — The horizontal location of the center of the dot to draw.
| |
y:Number — The vertical location of the center of the dot to draw.
|
| paint | () | method |
public function paint(g:YGraphics, ctx:IPaintContext):void
Paints the grid by delegating to a paint method matching the gridStyle.
Parameters
g:YGraphics — The graphics context.
| |
ctx:IPaintContext — The paint context.
|
See also
| paintCrosses | () | method |
protected function paintCrosses(g:YGraphics, ctx:IPaintContext):void
Paints a cross at each visible grid point by delegating to drawCrossPoint.
Parameters
g:YGraphics — The graphics object to draw on.
| |
ctx:IPaintContext — The paint context.
|
See also
| paintDots | () | method |
protected function paintDots(g:YGraphics, ctx:IPaintContext):void
Paints a dot at each visible grid point by delegating to drawDotPoint.
Parameters
g:YGraphics — The graphics object to draw on.
| |
ctx:IPaintContext — The paint context.
|
See also
| paintLines | () | method |
protected function paintLines(g:YGraphics, ctx:IPaintContext):voidPaints horizontal and vertical lines through all visible grid points.
Parameters
g:YGraphics — The graphics object to draw on.
| |
ctx:IPaintContext — The paint context.
|
| updateDisplayObject | () | method |
public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObjectParameters
oldDisplayObject:DisplayObject | |
context:IDisplayObjectContext |
DisplayObject |
| GRID_STYLE_CROSSES | Constant |
public static const GRID_STYLE_CROSSES:Object = GRID_STYLE_CROSSESFor each grid point there is a small cross rendered.
| GRID_STYLE_DOTS | Constant |
public static const GRID_STYLE_DOTS:Object = GRID_STYLE_DOTSFor each grid point there is a small dot rendered.
| GRID_STYLE_LINES | Constant |
public static const GRID_STYLE_LINES:Object = GRID_STYLE_LINESDraws horizontal and vertical lines through the grid points.