ServerViewGroup

ServerViewGroup

The ServerViewGroup groups a number of ServerViews together into a single View, so that they can move together as one block. It is also responsible for interacting with the gesture handler. Each view always belongs to exactly one view group. The group is responsible for processing gestures for that view. In the case of multi-device gestures, the inputs to those gestures can come from many views, but are combined together into a single gesture response.

Constructor

new ServerViewGroup(messageHandler)

Source:
Parameters:
Name Type Description
messageHandler module:server.MessageHandler For responding to messages from clients.

Extends

Members

(nullable) [@@holder] :module:mixins.Locker

Description:
  • If the Lockable is locked, stores a reference to the holder of the lock.
Source:
Overrides:
Mixes In:
Default Value:
  • undefined
If the Lockable is locked, stores a reference to the holder of the lock.
Type:

(nullable) [@@lockedItem] :module:mixins.Lockable

Description:
  • The internally stored reference to the locked item. For access use the external getter. There is no external setter provided. The nature of Symbols makes this interal reference technically accessible, but it still should not be set directly.
Source:
Overrides:
Mixes In:
Default Value:
  • undefined
The internally stored reference to the locked item. For access use the external getter. There is no external setter provided. The nature of Symbols makes this interal reference technically accessible, but it still should not be set directly.
Type:

(nullable) [@@locked] :boolean

Description:
  • Whether this Lockable is locked.
Source:
Overrides:
Mixes In:
Default Value:
  • falsy
Whether this Lockable is locked.
Type:
  • boolean

gestureController :module:server.GestureController

Description:
  • Controls server-side gestures.
Source:
Controls server-side gestures.
Type:

lockedItem :module:mixins.Lockable

Description:
  • External getter for the locked item. There is no setter available.
Source:
Overrides:
Mixes In:
External getter for the locked item. There is no setter available.
Type:

views :Array.<module:server.ServerView>

Description:
  • The views belonging to this group.
Source:
The views belonging to this group.
Type:

Methods

add(view)

Description:
  • Add a view to this group.
Source:
Parameters:
Name Type Description
view module:server.ServerView View to add.

clearInputsFromView(id)

Description:
  • Clear the inputs associated with the given view from the gesture controller.
Source:
Parameters:
Name Type Description
id number Id of the view whose inputs should be cleared.

isLocked() → {boolean}

Description:
  • Checks whether this lockable is locked.
Source:
Overrides:
Mixes In:
Returns:
True if the item is locked, false otherwise.
Type
boolean

lock(locker)

Description:
  • Lock this item.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Description
locker module:mixins.Locker The holder of the lock.

moveBy(dxopt, dyopt)

Description:
  • Move the transformable by the given amounts.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Attributes Default Description
dx number <optional>
0 Movement along the x axis.
dy number <optional>
0 Movement along the y ayis.

moveTo(xopt, yopt)

Description:
  • Move the transformable to the given coordinates.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Attributes Default Description
x number <optional>
this.x x coordinate to move to.
y number <optional>
this.y y coordinate to move to.

obtainLockOnItem(item) → {boolean}

Description:
  • Obtain a lock on the given item for this view.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Description
item module:mixins.Lockable The item to lock down.
Returns:
True if the lock was obtained, false otherwise.
Type
boolean

releaseLockedItem()

Description:
  • Release the view's item lock.
Source:
Overrides:
Mixes In:

remove(view)

Description:
  • Remove a view from this group.
Source:
Parameters:
Name Type Description
view module:server.ServerView View to remove.

reversePoint(x, y) → {module:shared.Point2D}

Description:
  • Reverses "transformPoint"
Source:
Overrides:
Mixes In:
Parameters:
Name Type Description
x number x coordinate to transform.
y number y coordinate to transform.
Returns:
The transformed point.
Type
module:shared.Point2D

reversePointChange(dx, dy) → {module:shared.Point2D}

Description:
  • Reverses "transformPointChange"
Source:
Overrides:
Mixes In:
Parameters:
Name Type Description
dx number dx coordinate to transform.
dy number dy coordinate to transform.
Returns:
The transformed point.
Type
module:shared.Point2D

rotateBy(radiansopt, pxopt, pyopt)

Description:
  • Rotate the transformable by the given amount, in radians, around the given x,y point.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Attributes Default Description
radians number <optional>
0 The amount of rotation to apply to the transformable, in radians.
px number <optional>
this.x The x coordinate of the point around which to rotate.
py number <optional>
this.y The y coordinate of the point around which to rotate.

scaleBy(dsopt, mxopt, myopt, deltaFnopt)

Description:
  • Adjust the transformable by the given scale.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Attributes Default Description
ds number <optional>
1 Change in desired scale.
mx number <optional>
this.x The x coordinate of the point around which to scale.
my number <optional>
this.y The y coordinate of the point around which to scale.
deltaFn string <optional>
'times' The Point2D operation to apply to the delta point to extract the corrext this.x and this.y values. Should be one of 'times' or 'divideBy' depending on the use case.

transformPoint(x, y) → {module:shared.Point2D}

Description:
  • Transforms a point from the transformable space to the default space. That is, it applies to the point the same transformations that apply to this Transformable2D, but in reverse.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Description
x number x coordinate to transform.
y number y coordinate to transform.
Returns:
The transformed point.
Type
module:shared.Point2D

transformPointChange(dx, dy) → {module:shared.Point2D}

Description:
  • Transforms a "change" point from the transformable space to the default space. Very much like the 'transformPoint' function, except that it does not apply translation.
Source:
Overrides:
Mixes In:
Parameters:
Name Type Description
dx number dx coordinate to transform.
dy number dy coordinate to transform.
Returns:
The transformed point.
Type
module:shared.Point2D

unlock()

Description:
  • Unlock this item.
Source:
Overrides:
Mixes In: