Spot class

A Spot represents a relative point from (0,0) to (1,1) within the bounds of a rectangular area plus an absolute offset.

Use the static functions Spot.parse and Spot.stringify to convert to and from a standard string representation that is independent of the current locale.

When an instance of this class is the value of a property of a GraphObject class or Diagram or CommandHandler or a Tool class, you should treat the object as if it were frozen or read-only -- you cannot modify its properties. This allows the property to return a value without allocating a new instance. If you need to do your own calculations with the value, call #copy to make a new instance with the same values that you can modify.

Many methods modify the object's properties and then return a reference to "this" object. The only instance method to allocate a new object is the #copy method. The static Spot.parse method also allocates a new object.

The "Debug" implementation of this class is significantly slower than the "Release" implementation, mostly due to additional error checking.

You cannot inherit from this class.

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Spot([num? x, num? y, num? offx, num? offy])
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

allSides Spot
The set of points on all sides of the bounding rectangle.
getter/setter pair
bottom Spot
A synonym for Spot.BottomCenter.
getter/setter pair
bottomCenter Spot
The specific point at the middle of the bottom side of bounding rectangle.
getter/setter pair
bottomLeft Spot
The specific point at the bottom-left corner of the bounding rectangle.
getter/setter pair
bottomLeftSides Spot
The set of points at the left or bottom sides of the bounding rectangle.
getter/setter pair
bottomRight Spot
The specific point at the bottom-right corner of the bounding rectangle.
getter/setter pair
bottomRightSides Spot
The set of points at the right or bottom sides of the bounding rectangle.
getter/setter pair
bottomSide Spot
The set of points at the bottom side of the bounding rectangle.
getter/setter pair
center Spot
The specific point at the very center of the bounding rectangle.
getter/setter pair
default$ Spot
Use this value to indicate that the real spot value is inherited from elsewhere.
getter/setter pair
left Spot
A synonym for Spot.LeftCenter.
getter/setter pair
leftCenter Spot
The specific point at the middle of the left side of bounding rectangle.
getter/setter pair
leftRightSides Spot
The set of points at the left or right sides of the bounding rectangle.
getter/setter pair
leftSide Spot
The set of points at the left side of the bounding rectangle.
getter/setter pair
middleBottom Spot
A synonym for Spot.BottomCenter.
getter/setter pair
middleLeft Spot
A synonym for Spot.LeftCenter.
getter/setter pair
middleRight Spot
A synonym for Spot.RightCenter.
getter/setter pair
middleTop Spot
A synonym for Spot.TopCenter.
getter/setter pair
none Spot
Use this Spot value to indicate no particular spot -- code looking for a particular point on an element will need to do their own calculations to determine the desired point depending on the circumstances.
getter/setter pair
notBottomSide Spot
The set of points on all sides of bounding rectangle except bottom side.
getter/setter pair
notLeftSide Spot
The set of points on all sides of the bounding rectangle except left side.
getter/setter pair
notRightSide Spot
The set of points on all sides of the bounding rectangle except right side.
getter/setter pair
notTopSide Spot
The set of points on all sides of the bounding rectangle except top side.
getter/setter pair
A synonym for Spot.RightCenter.
getter/setter pair
rightCenter Spot
The specific point at the middle of the right side of bounding rectangle.
getter/setter pair
rightSide Spot
The set of points at the right side of the bounding rectangle.
getter/setter pair
top Spot
A synonym for Spot.TopCenter.
getter/setter pair
topBottomSides Spot
The set of points at the top or bottom sides of the bounding rectangle.
getter/setter pair
topCenter Spot
The specific point at the center of the top side of the bounding rectangle.
getter/setter pair
topLeft Spot
The specific point at the top-left corner of the bounding rectangle.
getter/setter pair
topLeftSides Spot
The set of points at the top or left sides of the bounding rectangle.
getter/setter pair
topRight Spot
The specific point at the top-right corner of the bounding rectangle.
getter/setter pair
topRightSides Spot
The set of points at the top or right sides of the bounding rectangle.
getter/setter pair
topSide Spot
The set of points at the top side of the bounding rectangle.
getter/setter pair

Static Methods

alloc() Spot
free(Spot temp) → void
parse(String str) Spot
This static function can be used to read in a Spot from a string that was produced by Spot.stringify.
stringify(Spot val) String
This static function can be used to write out a Spot as a string that can be read by Spot.parse.