public interface RenderedView extends InputEventReceiver
RenderedViewinterface is used for streaming images from a service application to a view container on a remote client. The interface includes methods for keeping the size of the view in sync between the service and the client, and for handling user input events within the client view.
About View Size
When the client application first launches, PureWeb automatically captures and stores the size of the client-side view's container. From there, in the background it will take care of keeping the service-side and client-side views in sync and responding appropriately to resizing events. As a developer, you only need to choose whether the size of the view on the service should reflect the size of the view on the client, or the other way around. If you want the view size to be based on the client (this is by far the most common approach), use
setClientSize. To match the
client-side view to the size of the view on the service, use
About User Input Events
Whenever the end user interacts with a view using either mouse or keyboard, the client API automatically sends a command to the service with the relevant details. On the service, a built-in handler for this command then calls either
The purpose of these methods is to map the PureWeb client event to
its equivalent event on the framework used by the service
(Windows Forms, Qt, MFC, and so on).
Because image rendering varies greatly between applications, and because handling of user input events vary between frameworks, it is difficult to provide a one-size fits all description of the methods in this interface. Refer to the sample applications for actual implementation examples.
|Modifier and Type||Method and Description|
Returns the size of this view as it is currently displayed in the service application.
Streams the specified image to the client-side view container.
Sets the desired size of the client rendering area, in pixels.
void setClientSize(java.awt.Dimension clientSize)
When you use this method, you are telling PureWeb to automatically resize
the service-side view whenever a resizing event occurs on the client,
for example if the end user resizes the browser window or rotates the
device. If you prefer that the client-side view always match the size
of the view on the service, stub out this method and implement
clientSize- The size of the view on the client, which will be used to set the size of the view on the service.
If this size and the client size are different, PureWeb will calculate
the size of the buffer provided by
automatically scale the client-side view appropriately, minimizing
bandwidth where possible.
If you prefer to have the service-side view change based on the size
of the view on the client, stub out this method and implement
void renderView(RenderTarget target)
Although PureWeb does the actual work of streaming the image, you must
tell it where to get that image, and this is the purpose of implementing
renderView. This involves populating the
RenderTargetImage parameter of the
RenderTarget with the actual image data.
© 2010 - 2018 Calgary Scientific Inc. All Rights Reserved.
This documentation shall not wholly or in part, in any form or by any means, electronic, mechanical, including photocopying, be reproduced or transmitted without the authorized, written consent of Calgary Scientific.