Packagecom.yworks.canvas.input.snapLines
Classpublic class SnapState
InheritanceSnapState Inheritance Object

Describes the state of a snapping operation. This class is used by SnapContext to process snap results.

See also

SnapContext
SnapContext.processSnapResults


Public Properties
 PropertyDefined By
  location : IPoint
The current location.
SnapState
  snapType : uint
Gets or sets the type of the snap.
SnapState
Public Methods
 MethodDefined By
  
SnapState(point:IPoint, snapType:uint = 100)
Initializes a new instance of the SnapState class.
SnapState
  
snapTo(newLocation:IPoint):void
Sets the location to the given point and adjusts the snapType accordingly.
SnapState
  
snapX(newX:Number):void
Modifies the x property of the location and adjusts the snapType accordingly.
SnapState
  
snapY(newY:Number):void
Modifies the y property of the location and adjusts the snapType accordingly.
SnapState
  
toString():String
Returns a String representation of this SnapState containing it's location and snapType.
SnapState
Property Detail
locationproperty
location:IPoint

The current location. The value can be adjusted using the snapX, snapY and snapTo methods.


Implementation
    public function get location():IPoint
    public function set location(value:IPoint):void

See also

snapTypeproperty 
snapType:uint

Gets or sets the type of the snap.


Implementation
    public function get snapType():uint
    public function set snapType(value:uint):void
Constructor Detail
SnapState()Constructor
public function SnapState(point:IPoint, snapType:uint = 100)

Initializes a new instance of the SnapState class.

Parameters
point:IPoint — The initial location.
 
snapType:uint (default = 100) — The current type of the snap.
Method Detail
snapTo()method
public function snapTo(newLocation:IPoint):void

Sets the location to the given point and adjusts the snapType accordingly.

Parameters

newLocation:IPoint — The new location.

See also

snapX()method 
public function snapX(newX:Number):void

Modifies the x property of the location and adjusts the snapType accordingly.

Parameters

newX:Number — The new x.

See also

snapY()method 
public function snapY(newY:Number):void

Modifies the y property of the location and adjusts the snapType accordingly.

Parameters

newY:Number — The new y.

See also

toString()method 
public function toString():String

Returns a String representation of this SnapState containing it's location and snapType.

Returns
String