Constructor
new View(args)
Initializes a new instance of
During initialization, the constructor looks for a
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:
|
Throws:
Extends
- pureweb.events.EventTarget
Members
-
decodingTimer → pureweb.client.diagnostics.EventProfiler
-
A profiler that measures the time taken to decode images.
-
encodingType → pureweb.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. LAYOUT_CHANGED
string The event that gets dispatched when the page layout changes in such a way that the view should resize (for example, toggling the diagnostics panel). 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. -
fps → pureweb.client.diagnostics.FrequencyProfiler
-
A profiler that measures the rate at which the view's display is updated.
-
interactionTimer → pureweb.client.diagnostics.EventProfiler
-
A profiler that measures the time taken to process all mouse and keyboard events.
-
logger → goog.debug.Logger
-
Define logger.
-
mbps → pureweb.client.diagnostics.RateProfiler
-
A profiler that records the total rate of incoming imaging data, in MBPS.
-
renderingTimer → pureweb.client.diagnostics.EventProfiler
-
A profiler that measures the time taken to compose view images on the display.
-
<nullable> 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.
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.
getCollaborationLayer() → {pureweb.client.collaboration.CollaborationLayer}
Returns the instance of
CollaborationLayer
(used for acetate).
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.
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. |
refresh()
Refreshes the view.
Note: if your view width and height is zero
this command will do nothing
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:
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:
setViewName(viewName)
Sets the name of the client view and connects to service-side view of the same name.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
viewName |
string |
<optional> |
The name shared by the client and service application view. |
Type Definitions
-
KeyCommandundefined
-
-
MouseCommandundefined
-