pureweb.client. View

The View class provides methods to display the images streamed from the service application, and to remote input events (mouse, resize) that occur when the end user interacts with these views.

A view is a rectangular area in the client interface, in which are rendered the service images. Views are rendered using a ViewRenderer, which may render using an embedded canvas, image or video object.

Method Summary

clear
Clears the view.
createLayeredCanvas
Creates a transparent canvas element, layered on top of the view, and returns this element.
deactivateAcetateToolsOnThisView_
Deactivates all acetate tools currently active on this view, and returns an array of the tools that were deactivated (for use in the reactivation method).
dispose
Preps this view object to be nulled out.
getAcetateToolset
Returns the instance of AcetateToolset, or null if there is none.
getActiveRenderer
Returns the renderer which is currently active for this view.
getCanvasElement
Returns the canvas element for this view.
getEncoderConfiguration
Returns the current EncoderConfiguration for this view.
getEncodingType
Returns the mime type of the last image decoded.
getFocusFollowsMouse
Returns a Boolean value that indicates whether the focus-follows-mouse policy is in effect.
getFramework
Returns the Framework instance for this view.
getHDPIRatio
Returns the High DPI downscaling ratio being used (1 is no scaling).
getImageSize
Returns the size (width and height) of the last image received from the service application.
getSize
Returns the size (width and height) of the view, in pixels.
getViewElement
Returns the HTML (DOM) element for this view.
getViewName
Returns the name of the view.
isConnected
Returns a Boolean value that indicates whether this view is connected.
isInputTransmissionEnabled
Returns a Boolean value that indicates whether this view sends input events to the service application.
isViewConnected
Returns a Boolean value that indicates whether this view is connected.
loadBytes
Triggers the view to load and display an image stored in memory.
onTransformsChanged
The handler function triggered when a view renderer transform has changed.
onViewUpdated
The handler function triggered when a view is rendered.
reactivateAcetateToolsOnThisView_
Reactivates the acetate tools, using the array returned from deactivateAcetateToolsOnThisView.
refresh
Refreshes the view.
removeLayeredCanvas
Removes a layered canvas element, and returns a Boolean value that indicates whether the remove operation was successful.
resize
Sends to the service application a command to resize the view.
setAcetateToolset
Sets the AcetateToolset for the view.
setEncoderConfiguration
Sets the EncoderConfiguration for this view.
setFocusFollowsMouse
Enables or disables the focus-follows-mouse policy.
setHDPIRatio
Sets the High DPI downscaling ratio to be used (should be >0 and <=1, 1 is no scaling)
setInputTransmissionEnabled
Sets a value that indicates whether this view sends input events to the service application.
setMouseWheelScale
Sets the multiplier applied to mouse wheel deltas.
setSize
Sets the width and height of this view.
setViewName
Sets the name of the client view and connects to service-side view of the same name.

Constructor

new View(args)

Initializes a new instance of View.

During initialization, the constructor looks for a div element on the page with the specified ID, and uses this to build the PureWeb view. Optionally, if no ID is present, a div element with the css class "purewebview" can be provided. If neither the div ID and nor the element can be found, and no class:purewebview exists, the constructor creates one, with the specified size.
Parameters:
Name Type Description
args Object The constructor arguments object:
  • id: The ID of the div element on the page with the class "purewebview".
  • element: A DOM div element with the class "purewebview" (used if the ID is not provided).
  • viewName: The name of the view.
  • width: The width of the view, in pixels.
  • height: The height of the view, in pixels.
  • focusAfterCreate: A boolean that says if this view should grab browser focus after it is created.
Throws:
pureweb.IllegalArgumentException

Extends

  • pureweb.events.EventTarget

Members

decodingTimerpureweb.client.diagnostics.EventProfiler

A profiler that measures the time taken to decode images.

encodingTypepureweb.client.diagnostics.SimpleValueProfiler

A profiler that provides a simple value. EncodingType is the value of the mime type to expose to the profiler.

<static> EventType → string

An enumeration of the types of events for which client applications can listen on the view.
Properties:
Name Type Default Description
VIEW_NAME_CHANGED string The event that gets dispatched when the view name is changed.
IS_VIEW_CONNECTED_CHANGED string The event that gets dispatched when the view connection status changes.
VIEW_UPDATED string The event that gets dispatched when the view is updated with a new image.
VIEW_RESIZED string The event that gets dispatched when the view is resized.
MOUSE_EVENT_FIRING string The event that gets dispatched before a mouse event is sent to the server, to allow individual events to be cancelled.
KEY_EVENT_FIRING string The event that gets dispatched before a key event is sent to the server, to allow individual events to be cancelled.
MOUSE_EVENT_QUEUED string The event that gets dispatched after a mouse input command is created, but before it is transmitted to the service.
MOUSE_EVENT_RECEIVED string The event that gets dispatched when the browser receives a mouse event from user input.
TOUCH_EVENT_RECEIVED string The event that gets dispatched when the browser receives a touch event from user input.
KEY_EVENT_QUEUED string The event that gets dispatched after a keyboard input command is created, but before it is transmitted to the service.
TRANSFORMS_CHANGED string The event that gets dispatched when the source or client geometery has changed.

fpspureweb.client.diagnostics.FrequencyProfiler

A profiler that measures the rate at which the view's display is updated.

interactionTimerpureweb.client.diagnostics.EventProfiler

A profiler that measures the time taken to process all mouse and keyboard events.

<protected> logger → goog.debug.Logger

Define logger.

mbpspureweb.client.diagnostics.RateProfiler

A profiler that records the total rate of incoming imaging data, in MBPS.

renderingTimerpureweb.client.diagnostics.EventProfiler

A profiler that measures the time taken to compose view images on the display.

viewName_ → string

Method Detail

clear()

Clears the view.

createLayeredCanvas() → {Element}

Creates a transparent canvas element, layered on top of the view, and returns this element. The canvas element can be used to render over top of the view.

deactivateAcetateToolsOnThisView_() → {Array}

Deactivates all acetate tools currently active on this view, and returns an array of the tools that were deactivated (for use in the reactivation method).

dispose()

Preps this view object to be nulled out. Cleans up DOM, detaches event listeners, etc.

getAcetateToolset() → {pureweb.client.collaboration.AcetateToolset}

Returns the instance of AcetateToolset, or null if there is none.

getActiveRenderer() → {pureweb.client.ViewRenderer}

Returns the renderer which is currently active for this view.

getCanvasElement() → {Element}

Returns the canvas element for this view.

getEncoderConfiguration() → {pureweb.client.EncoderConfiguration}

Returns the current EncoderConfiguration for this view. The encoder configuration specifies the required image format for rendering views.

getEncodingType() → {string}

Returns the mime type of the last image decoded.

getFocusFollowsMouse() → {boolean}

Returns a Boolean value that indicates whether the focus-follows-mouse policy is in effect. Will return true if it is, or false otherwise.

getFramework() → {pureweb.client.Framework}

Returns the Framework instance for this view.

getHDPIRatio()

Returns the High DPI downscaling ratio being used (1 is no scaling).

getImageSize() → {Object}

Returns the size (width and height) of the last image received from the service application.

getSize() → {Object}

Returns the size (width and height) of the view, in pixels.

getViewElement() → {Element}

Returns the HTML (DOM) element for this view.

getViewName() → {string}

Returns the name of the view. This is the name that was assigned to the view when it was first registered on the service, using the RegisterView method from the service-side ViewManager class.

isConnected() → {boolean}

Returns a Boolean value that indicates whether this view is connected. Will return true if it is, or false otherwise.

isInputTransmissionEnabled() → {boolean}

Returns a Boolean value that indicates whether this view sends input events to the service application. Will return true if it does, or false otherwise.

isViewConnected() → {boolean}

Returns a Boolean value that indicates whether this view is connected. Will return true if it is, or false otherwise.

loadBytes()

Triggers the view to load and display an image stored in memory.

onTransformsChanged(e)

The handler function triggered when a view renderer transform has changed.
Parameters:
Name Type Description
e goog.events.Event The event object.

onViewUpdated(e)

The handler function triggered when a view is rendered.
Parameters:
Name Type Description
e goog.events.Event The event object.

reactivateAcetateToolsOnThisView_(tools)

Reactivates the acetate tools, using the array returned from deactivateAcetateToolsOnThisView.
Parameters:
Name Type Description
tools Array The array of tools to reactivate (from the deactivation method).

refresh()

Refreshes the view.

removeLayeredCanvas() → {boolean}

Removes a layered canvas element, and returns a Boolean value that indicates whether the remove operation was successful. Will return true if it was, or false otherwise.

resize()

Sends to the service application a command to resize the view.

setAcetateToolset(toolset)

Sets the AcetateToolset for the view.
Parameters:
Name Type Description
toolset pureweb.client.collaboration.AcetateToolset The acetate toolset for this view, or null if there is none.

setEncoderConfiguration(encoderConfig)

Sets the EncoderConfiguration for this view. The encoder configuration specifies the required image format for rendering views.
Parameters:
Name Type Description
encoderConfig pureweb.client.EncoderConfiguration The EncoderConfiguration object to set.
Throws:
pureweb.IllegalArgumentException

setFocusFollowsMouse(focusFollowsMouse)

Enables or disables the focus-follows-mouse policy. If disabled, the focus model is click to gain focus.
Parameters:
Name Type Description
focusFollowsMouse boolean Set to true to enable focus-follows-mouse, or to false otherwise.

setHDPIRatio(HDPIRatio)

Sets the High DPI downscaling ratio to be used (should be >0 and <=1, 1 is no scaling)
Parameters:
Name Type Description
HDPIRatio number | string The downscaling ratio to apply to high DPI displays.
Throws:

setInputTransmissionEnabled(enable)

Sets a value that indicates whether this view sends input events to the service application.
Parameters:
Name Type Description
enable boolean Set to true if mouse and keyboard events will be sent the the server, or to false otherwise.

setMouseWheelScale(scale)

Sets the multiplier applied to mouse wheel deltas.
Parameters:
Name Type Description
scale number The number by which to scale mouse wheel delta.

setSize(width, height)

Sets the width and height of this view.
Parameters:
Name Type Description
width number The width, in pixels.
height number The height, in pixels.
Throws:
pureweb.IllegalArgumentException

setViewName(viewName)

Sets the name of the client view and connects to service-side view of the same name.
Parameters:
Name Type Description
viewName string | null | undefined The name shared by the client and service application view.

Type Definitions

KeyCommandundefined

MouseCommandundefined