Creating a standalone viewer application
You can build a document viewer that is a standalone application.
About this task
As you complete the following steps, see the Application Programming Reference in the information center. Also see the samples for the standalone viewer application, TGenericDocViewer.java, that are in the samples directory.
To begin, instantiate
the CMBGenericDocViewer object. When instantiating the
CMBGenericDocViewer object, you must create an instance
of each of the CMBStreamingDocServices and
CMBAnnotationServices class objects by implementing the
following callback classes:
To create a standalone viewer application, complete the following
steps:- CMBStreamingDocServicesCallbacks abstract class
- CMBAnnotationServicesCallbacks abstract class
Procedure
Example
The following code shows how to
create the CMBGenericDocViewer object:
// Create streaming doc services object
docServices = new CMBStreamingDocServices(
new StreamingDocServicesCallbacks(), null);
// Create annotation services object
annoServices = new CMBAnnotationServices(
new AnnotationServicesCallbacks());
// Create generic doc viewer object
genericDocViewer = new CMBGenericDocViewer(
docServices, annoServices, configProps);
// Add generic doc viewer GUI to content pane
getContentPane().add(genericDocViewer, BorderLayout.CENTER);