Class: Collection

bu.interaction. Collection

Collection of interactions which affect a viewer (e.g. keyboard, mouse, touch). Interactions added of type bu.interaction.AxisInteraction are combined to calculate the final parameters to change.


new Collection(opts)

Parameters:
Name Type Description
opts Object

Options.

Source:
bu/interaction/collection.js

Extends

  • ol.Object

Members


clock :function

Function to calculate current time.

Type:
  • function
Source:
bu/interaction/collection.js

composedInteractions :Array.<bu.interaction.ComposedInteraction>

Array of AxisInteractions that are currently active to be composed.

Type:
Source:
bu/interaction/collection.js

composedParameters :Object.<string, number>

Object with composed parameters of AxisInteractions.

Type:
  • Object.<string, number>
Source:
bu/interaction/collection.js

composedReturn :bu.interaction.ComposedReturn

Object with the result of composing the AxisInteraction parameters.

Type:
Source:
bu/interaction/collection.js

interactions :Object.<string, bu.InteractionStatus>

Object with the interaction status of added interactions to collecion. Property names are the interaction keys and values are the InteractionStatus.

Type:
  • Object.<string, bu.InteractionStatus>
Source:
bu/interaction/collection.js

Methods


addInteraction(id, interaction [, active])

Parameters:
Name Type Argument Description
id string

ID.

interaction bu.interaction.Interaction

Interaction.

active boolean <optional>

If set the interaction as active or not. Default is false.

Source:
bu/interaction/collection.js

getComposedParameters()

Returns an object with the composed parameters.

Source:
bu/interaction/collection.js
Returns:
Type
bu.interaction.ComposedReturn

getParameters(interactionName)

Returns the current parameters for the given interaction.

Parameters:
Name Type Description
interactionName string

Name of the interaction.

Source:
bu/interaction/collection.js
Returns:
Type
Object.<string, Object>

indexOfInstance(instance)

Obtains the index of a bu.interaction.Interaction in the list of composed interactions.

Parameters:
Name Type Description
instance bu.interaction.Interaction

Interaction instance.

Source:
bu/interaction/collection.js
Returns:

Returns the positive index if found or -1 if not found.

Type
number

interaction(id)

Return the bu.interaction.Interaction for the given id.

Parameters:
Name Type Description
id string

ID.

Source:
bu/interaction/collection.js
Returns:
Type
bu.interaction.Interaction

isComposed(instance)

Checks if a bu.interaction.Interaction has been added or not to composed interactions.

Parameters:
Name Type Description
instance bu.interaction.Interaction

Interaction instance.

Source:
bu/interaction/collection.js
Returns:

Returns true if found or false if not found.

Type
boolean

removeInteraction(id)

Parameters:
Name Type Description
id string

ID.

Source:
bu/interaction/collection.js

resetComposedParameters()

Resets the composed parameters for all the parametes.

Source:
bu/interaction/collection.js

setInteractionActive(interaction, active)

Set a bu.interaction.Interaction active or not.

Parameters:
Name Type Description
interaction bu.interaction.Interaction

Interaction to change.

active boolean

If set the interaction active or not.

Source:
bu/interaction/collection.js

updateDynamics(storedDynamics, event)

Updates the bu.interaction.Dynamics objects.

Parameters:
Name Type Description
storedDynamics Object

An object that has parameters as property names and objects as values containing a pair of bu.interaction.Dynamics and time values.

event Event

Event.

Source:
bu/interaction/collection.js