org.jpedal.examples.simpleviewer
Class SimpleViewer

java.lang.Object
  extended by org.jpedal.examples.simpleviewer.SimpleViewer
Direct Known Subclasses:
ContentExtractor, MultiViewer, TableZoner

public class SimpleViewer
extends java.lang.Object

Fully featured GUI viewer and demonstration of JPedal's capabilities
This class provides the framework for the Viewer and calls other classes which provide the following functions:-
Values commonValues - repository for general settings Printer currentPrinter - All printing functions and access methods to see if printing active PdfDecoder decode_pdf - PDF library and panel ThumbnailPanel thumbnails - provides a thumbnail pane down the left side of page - thumbnails can be clicked on to goto page PropertiesFile properties - saved values stored between sessions SwingGUI currentGUI - all Swing GUI functions SearchWindow searchFrame (not GPL) - search Window to search pages and goto references on any page Commands currentCommands - parses and executes all options SwingMouseHandler mouseHandler - handles all mouse and related activity


Field Summary
 SwingGUI currentGUI
          general GUI functions
static boolean exitOnClose
          tell software to exit on close - default is true
static java.lang.String PREFERENCES_BEAN
           
static java.lang.String PREFERENCES_DEFAULT
          Location of Preferences Files
static java.lang.String PREFERENCES_NO_GUI
           
static java.lang.String PREFERENCES_NO_SIDE_BAR
           
static java.lang.String PREFERENCES_OPEN_AND_NAV_ONLY
           
static java.lang.String PREFERENCES_PDFHELP
           
 
Constructor Summary
SimpleViewer()
          setup and run client
SimpleViewer(java.awt.Container rootContainer, java.lang.String preferencesPath)
          setup and run client passing in parameter that points to the preferences file we should use.
SimpleViewer(int modeOfOperation)
          setup and run client passing in paramter to show if running as applet, webstart or JSP (only applet has any effect at present)
SimpleViewer(java.lang.String prefs)
          setup and run client passing in paramter that points to the preferences file we should use.
 
Method Summary
 void addExternalHandler(java.lang.Object newHandler, int type)
          Allows external helper classes to be added to JPedal to alter default functionality.
 void dispose()
           
 void executeCommand(int commandID, java.lang.Object[] args)
          Execute Jpedal functionality from outside of the library using this method.
 SwingGUI getSwingGUI()
          open the file passed in by user on startup (do not call directly)
 boolean isProcessing()
           
static void main(java.lang.String[] args)
          main method to run the software as standalone application
 void setRootContainer(java.awt.Container rootContainer)
           
 void setupViewer()
          initialise and run client (default as Application in own Frame)
 void setupViewer(java.lang.String defaultFile)
          setup and run client, loading defaultFile on startup
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentGUI

public SwingGUI currentGUI
general GUI functions


PREFERENCES_DEFAULT

public static final java.lang.String PREFERENCES_DEFAULT
Location of Preferences Files

See Also:
Constant Field Values

PREFERENCES_NO_GUI

public static final java.lang.String PREFERENCES_NO_GUI
See Also:
Constant Field Values

PREFERENCES_NO_SIDE_BAR

public static final java.lang.String PREFERENCES_NO_SIDE_BAR
See Also:
Constant Field Values

PREFERENCES_OPEN_AND_NAV_ONLY

public static final java.lang.String PREFERENCES_OPEN_AND_NAV_ONLY
See Also:
Constant Field Values

PREFERENCES_PDFHELP

public static final java.lang.String PREFERENCES_PDFHELP
See Also:
Constant Field Values

PREFERENCES_BEAN

public static final java.lang.String PREFERENCES_BEAN
See Also:
Constant Field Values

exitOnClose

public static boolean exitOnClose
tell software to exit on close - default is true

Constructor Detail

SimpleViewer

public SimpleViewer()
setup and run client


SimpleViewer

public SimpleViewer(int modeOfOperation)
setup and run client passing in paramter to show if running as applet, webstart or JSP (only applet has any effect at present)


SimpleViewer

public SimpleViewer(java.lang.String prefs)
setup and run client passing in paramter that points to the preferences file we should use.


SimpleViewer

public SimpleViewer(java.awt.Container rootContainer,
                    java.lang.String preferencesPath)
setup and run client passing in parameter that points to the preferences file we should use.

Method Detail

setupViewer

public void setupViewer(java.lang.String defaultFile)
setup and run client, loading defaultFile on startup


getSwingGUI

public SwingGUI getSwingGUI()
open the file passed in by user on startup (do not call directly)


setRootContainer

public void setRootContainer(java.awt.Container rootContainer)

setupViewer

public void setupViewer()
initialise and run client (default as Application in own Frame)


main

public static void main(java.lang.String[] args)
main method to run the software as standalone application


executeCommand

public void executeCommand(int commandID,
                           java.lang.Object[] args)
Execute Jpedal functionality from outside of the library using this method. EXAMPLES commandID = Commands.OPENFILE, args = {"/PDFData/Hand_Test/crbtrader.pdf}" commandID = Commands.OPENFILE, args = {byte[] = {0,1,1,0,1,1,1,0,0,1}, "/PDFData/Hand_Test/crbtrader.pdf}" commandID = Commands.ROTATION, args = {"90"} commandID = Commands.OPENURL, args = {"http://www.cs.bham.ac.uk/~axj/pub/papers/handy1.pdf"}

Parameters:
commandID - :: static int value from Commands to spedify which command is wanted
args - :: arguements for the desired command

isProcessing

public boolean isProcessing()

addExternalHandler

public void addExternalHandler(java.lang.Object newHandler,
                               int type)
Allows external helper classes to be added to JPedal to alter default functionality.

If Options.FormsActionHandler is the type then the newHandler should be of the form org.jpedal.objects.acroforms.ActionHandler

If Options.JPedalActionHandler is the type then the newHandler should be of the form Map which contains Command Integers, mapped onto their respective org.jpedal.examples.simpleviewer.gui.swing.JPedalActionHandler implementations. For example, to create a custom help action, you would add to your map, Integer(Commands.HELP) -> JPedalActionHandler. For a tutorial on creating custom actions in the SimpleViewer, see http://support.idrsolutions.com/default.asp?W103

Parameters:
newHandler -
type -

dispose

public void dispose()