com.lizardtech.djview
Class Applet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by com.lizardtech.djview.Applet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
DjVuApplet

public class Applet
extends java.applet.Applet
implements java.beans.PropertyChangeListener, java.lang.Runnable

A class for displaying djvu documents. Very simmular to the LizardTech DjVu plugin.

Version:
$Revision: 1.20 $
Author:
Bill C. Riemers
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 java.awt.CardLayout cardLayout
          The cardlayout which displays either the image or the hidden text.
protected  Document document
          The current document being displayed.
protected  boolean first
          True until the first time the mouse is moved over the applet.
static int FIT_PAGE
          Magic scale value used to zoom to fit page.
static int FIT_WIDTH
          Magic scale value used to zoom to fit width.
static java.lang.String IMAGE_STRING
          Constant string indicating the image should be displayed.
 java.lang.String jarName
          The jar file which we should run, if main is invoked.
 java.lang.String mainClass
          The main class to use, if main is invoked and the jar file is not available.
protected  int scale
          The current zoom factor.
protected  java.awt.Container scrollPane
          This container will contain a scrollable DjVu Image
static java.lang.String TEXT_STRING
          Constant string indicating the hidden text should be displayed.
protected  java.net.URL url
          The current URL being displayed.
protected  boolean useScrollPane
          True if a scrollpane should be used.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Applet()
          Creates a new Applet object.
 
Method Summary
 java.awt.CardLayout getCardLayout()
          Query and/or create the cardlayout for displaying text or image.
 java.awt.Container getCenterPane()
          Query and/or create the center pane.
 DjVuBean getDjVuBean()
          Query and/or create the DjVuBean being displayed.
 java.lang.String[][] getParameterInfo()
          Method to obtain an array of parameters accepted by this applet.
 java.awt.Component getScrollPane()
          Query and/or create the component to use as scroll pane by the DjVuBean.
 java.awt.Component getSplitPane(java.awt.Component leftPane, java.awt.Component centerPane)
          Called to create a split pane for displaying outline navigation along side of the DjVuBean.
 java.net.URL getURL()
          Query the URL displayed by this applet.
 void init()
          Initialize the currently selected url, and render the first page of the document.
 boolean isValidDjVu()
          Query if a DjVu document has been successfully initialized.
static void main(java.lang.String[] args)
          This applet may also be invoked as a program using javaw.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Called when a DjVuBean propery has changed.
 void run()
          Perform regular garbage collection...
 void setURL(java.net.URL url)
          Set the url to be rendered.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIT_WIDTH

public static final int FIT_WIDTH
Magic scale value used to zoom to fit width.

See Also:
Constant Field Values

FIT_PAGE

public static final int FIT_PAGE
Magic scale value used to zoom to fit page.

See Also:
Constant Field Values

IMAGE_STRING

public static final java.lang.String IMAGE_STRING
Constant string indicating the image should be displayed.

See Also:
Constant Field Values

TEXT_STRING

public static final java.lang.String TEXT_STRING
Constant string indicating the hidden text should be displayed.

See Also:
Constant Field Values

jarName

public final java.lang.String jarName
The jar file which we should run, if main is invoked.

See Also:
Constant Field Values

mainClass

public final java.lang.String mainClass
The main class to use, if main is invoked and the jar file is not available.

See Also:
Constant Field Values

cardLayout

public java.awt.CardLayout cardLayout
The cardlayout which displays either the image or the hidden text.


scrollPane

protected java.awt.Container scrollPane
This container will contain a scrollable DjVu Image


document

protected Document document
The current document being displayed.


url

protected java.net.URL url
The current URL being displayed.


first

protected boolean first
True until the first time the mouse is moved over the applet.


useScrollPane

protected boolean useScrollPane
True if a scrollpane should be used. This is intended for debug purposes.


scale

protected int scale
The current zoom factor.

Constructor Detail

Applet

public Applet()
Creates a new Applet object.

Method Detail

main

public static void main(java.lang.String[] args)
This applet may also be invoked as a program using javaw. In that event we first try running a jar file. If that fails we try the mainClass.

Parameters:
args - Should contain the target URL to view.

getCardLayout

public java.awt.CardLayout getCardLayout()
                                  throws java.io.IOException
Query and/or create the cardlayout for displaying text or image.

Returns:
the cardlayout.
Throws:
java.io.IOException - if an error occures decoding the document

getCenterPane

public java.awt.Container getCenterPane()
                                 throws java.io.IOException
Query and/or create the center pane.

Returns:
the center pane.
Throws:
java.io.IOException - if an error occures decoding the document

getDjVuBean

public DjVuBean getDjVuBean()
                     throws java.io.IOException
Query and/or create the DjVuBean being displayed.

Returns:
the DjVuBean.
Throws:
java.io.IOException - if an error occures decoding the document

getParameterInfo

public java.lang.String[][] getParameterInfo()
Method to obtain an array of parameters accepted by this applet.

Overrides:
getParameterInfo in class java.applet.Applet
Returns:
array of parameters accepted by this applet.

getScrollPane

public java.awt.Component getScrollPane()
                                 throws java.io.IOException
Query and/or create the component to use as scroll pane by the DjVuBean.

Returns:
the component to use as a scroll pane.
Throws:
java.io.IOException - if an error occures decoding the document

getSplitPane

public java.awt.Component getSplitPane(java.awt.Component leftPane,
                                       java.awt.Component centerPane)
Called to create a split pane for displaying outline navigation along side of the DjVuBean.

Parameters:
leftPane - outline navigation.
centerPane - DjVuBean.
Returns:
the component to display.

setURL

public void setURL(java.net.URL url)
Set the url to be rendered. The page will not be updated until init() is called.

Parameters:
url - to render.

getURL

public java.net.URL getURL()
Query the URL displayed by this applet.

Returns:
URL to display.

isValidDjVu

public boolean isValidDjVu()
Query if a DjVu document has been successfully initialized.

Returns:
True if init() was successfull.

init

public void init()
Initialize the currently selected url, and render the first page of the document.

Overrides:
init in class java.applet.Applet

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Called when a DjVuBean propery has changed.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - describing the property change.

run

public void run()
Perform regular garbage collection...

Specified by:
run in interface java.lang.Runnable