Packagecom.yworks.canvas.drawing
Classpublic class PointSelectionPaintable
InheritancePointSelectionPaintable Inheritance Object
Implements ISelectionPaintable, IHitTestable

A simple ISelectionPaintable implementation that draws an ellipse centered at a given point in world coordinate space.



Public Properties
 PropertyDefined By
  fill : IFill
The fill to use for the point's ellipse in the view coordinate system.
PointSelectionPaintable
  stroke : IStroke
The stroke to use for drawing the point in the view coordinate system.
PointSelectionPaintable
Public Methods
 MethodDefined By
  
Creates a selection paintable that indicates a point.
PointSelectionPaintable
  
installSelectionPaintables(userObject:Object, canvas:CanvasComponent, selectionGroup:ICanvasObjectGroup):Array
Implements the interface and installs an ellipse into the canvas control.
PointSelectionPaintable
  
isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean
Determines if something has been hit at the given coordinates in the world coordinate system.
PointSelectionPaintable
Protected Methods
 MethodDefined By
  
getCenterPoint(userObject:Object):IPoint
Factory method that retrieves the center for a given user object.
PointSelectionPaintable
Property Detail
fillproperty
fill:IFill

The fill to use for the point's ellipse in the view coordinate system.


Implementation
    public function get fill():IFill
    public function set fill(value:IFill):void
strokeproperty 
stroke:IStroke

The stroke to use for drawing the point in the view coordinate system.


Implementation
    public function get stroke():IStroke
    public function set stroke(value:IStroke):void
Constructor Detail
PointSelectionPaintable()Constructor
public function PointSelectionPaintable(point:IPoint)

Creates a selection paintable that indicates a point.

Parameters
point:IPoint — The point to use for the center of the painting.
Method Detail
getCenterPoint()method
protected function getCenterPoint(userObject:Object):IPoint

Factory method that retrieves the center for a given user object.

This implementation simply returns the value provided to the constructor.

Parameters

userObject:Object

Returns
IPoint — the center for a given user object.
installSelectionPaintables()method 
public function installSelectionPaintables(userObject:Object, canvas:CanvasComponent, selectionGroup:ICanvasObjectGroup):Array

Implements the interface and installs an ellipse into the canvas control.

This method queries the getCenterPoint for a suitable point.

Parameters

userObject:Object — The item to create a selection for.
 
canvas:CanvasComponent — The canvas to add the display object creator for the selection painting 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.

See also

isHit()method 
public function isHit(x:Number, y:Number, ctx:ICanvasContext):Boolean

Determines if something has been hit at the given coordinates in the world coordinate system.

Parameters

x:Number — the x-coordinate in world coordinate system
 
y:Number — the y-coordinate in world coordinate system
 
ctx:ICanvasContext — the context the hit test is performed in

Returns
Boolean — whether something has been hit