C

RectangleHandle

A more sophisticated IHandle implementation that modifies a rectangle.
ImplementsInheritance Hierarchy

Remarks

Implementations of this class work on a mutable rectangle instance for handling drags of the handle. A separate point implementation is used for specifying the position of the handle. As a convenience, this class also implements the IMutablePoint interface which modifies the handle's position.

Members

Show:

Constructors

Creates a handle for the given rectangle at the given position.

The location is calculated for the rectangle using the position.

The instance modifies the instances using the IMutableRectangle interface. The handle will automatically trim changes of the rectangle to the specified minimum and maximum size.

Parameters

position: HandlePositions
The position of the handle.
rectangle: IMutableRectangle
The rectangle to change.

Properties

Gets or sets the cursor to display when the mouse hovers over or drags this handle.
conversionfinal

Implements

IHandle.cursor
Gets a view of the center of the handle.
The point describes the current world coordinate of the element that can be modified by this handle.
readonlyfinal
Gets or sets the largest allowed size for the rectangle.
The default is INFINITE, which does not restrict the area at all.
conversionfinal
Gets or sets the maximum size allowed for the rectangle.
The value is stored by reference. The default is INFINITE.
conversionfinal
Gets or sets the minimum enclosed area that needs to be encompassed by the rectangle.
The default is EMPTY, which does not restrict the area at all.
conversionfinal
Gets or sets the minimum size allowed for the rectangle.
The default is ZERO.
conversionfinal
Gets the position of the handle.
protectedreadonlyfinal
Gets the rectangle instance to modify.
protectedreadonlyfinal
Gets or sets the optional tag object associated with the handle.
final

Implements

IHandle.tag
Gets or sets the type of the handle that can be used by the rendering engine to render types differently.
conversionfinal

Implements

IHandle.type
Gets or sets the x coordinate.
The setter delegates to moveBy
final

Implements

IMutablePoint.x
Gets or sets the y coordinate.
The setter delegates to moveBy
final

Implements

IMutablePoint.y

Methods

Delegates the original values to set.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the coordinate of the location property at the time of initializeDrag.
Calculates the Euclidean distance between two points.

Parameters

point2: IPoint
The second point.

Return Value

number
The distance between the two points.
Returns the euclidean distance between this point and a given point.

Parameters

x: number
the x coordinate of the second point
y: number
the y coordinate of the second point

Return Value

number
the Euclidean distance between this point and the point (x,y).
This implementation does nothing.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the location property at the time of initializeDrag.
newLocation: Point
The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation the location may or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove
Ignore clicking the handle.

Parameters

evt: ClickEventArgs
Arguments describing the click.
Delegates to set.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the location property at the time of initializeDrag.
newLocation: Point
The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation the location may or may not be modified to reflect the new value.
This implementation does nothing.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
Modifies the rectangle.
The corner or side determined by position will be moved by delta.

Parameters

delta: Point
The Point representing the x- and y-direction by which to move the rectangle.
Delegates to moveBy.

Parameters

x: number
The amount to move in x-direction.
y: number
The amount to move in y-direction.
Sets the x and y values of this instance to the given values.

Parameters

location: IPoint
The new location.
Sets the x and y values of this instance to the given values.

Parameters

x: number
The new x-coordinate.
y: number
The new y-coordinate.
Creates a new Point instance with the same coordinates as this point.
This method is useful to obtain a copy of the state and for making use of the various utility methods that are provided by Point.

Return Value

Point
The current values of the coordinates of the point.

See Also

API
toMutablePoint

Defined in

IPoint.toPoint