static fromEvent(event) {
    if (event.type === Blockly.Events.SELECTED) {
      return this.fromSelectedUiEvent_(
        /** @type {!Blockly.Events.Selected} */ (event),
      );
    } else if (
      event.type === Blockly.Events.CHANGE &&
      event.element === 'field'
    ) {
      return this.fromFieldChangeEvent_(
        /** @type {!Blockly.Events.Change} */ (event),
      );
    } else {
      throw Error('Cannot create position from this event.');
    }
  }
Create a Position from an event. Currently supports creating Positions for
blocks from a 'selected' UI event.
@param {!Blockly.Events.Abstract} event The event that creates a Position.
@returns {!PositionUpdate} The Position representative of the event.
@public