|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
com.lizardtech.djvubean.DjVuBean
public class DjVuBean
This Panel is designed for rendering a DjVuImage. Since normally a DjVuImage requires too much memory to render at full resolution, this panel should be added to either a JScrollPane or a ScrollPane. The borders of that pane will be used to automatically segment the DjVuImage, to avoid excessive memory usage.
Nested Class Summary |
---|
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 | |
---|---|
static java.lang.String |
FIRST_PAGE
Navigate to the first page. |
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. |
protected java.lang.Thread |
getImageThread
Thread used to get the current image for display |
protected DjVuImage |
image
The DjVuImage to be displayed. |
static int |
LAST_MODE
Constant to switch to the previous mode. |
static java.lang.String |
LAST_PAGE
Navigate to the last page. |
static int |
MATCH_CASE_MASK
This mask is used for case sensative searches. |
protected java.awt.event.MouseListener |
mlistener
The current mouse listener. |
static java.lang.String[] |
NAVIGATE_LIST
This is a list of special values used when navigating documents. |
static java.lang.String |
NEXT_PAGE
Navigate to the next page. |
static int |
PAN_MODE
Constant to switch to panning mode. |
static java.lang.String |
PREV_PAGE
Navigate to the previous page. |
java.util.Properties |
properties
Properties which may be used to initialize addOn's, and to pass extra values between add-on's. |
static int |
SEARCH_BACKWARD_MASK
This mask is used for backwards searches. |
static int |
TEXT_MODE
Constant to switch to text mode. |
static int |
WHOLE_DOCUMENT_MASK
This mask is used for multiple document searches. |
static int |
WHOLE_WORD_MASK
This mask is used for whole word searches. |
protected int |
zoom
Current zoom factor. |
static java.lang.String[] |
ZOOM_BUTTON_LIST
The list of strings for the setZoom() method. |
static java.lang.String |
ZOOM_FIT_PAGE
String used for selecting fit page zoom. |
static java.lang.String |
ZOOM_FIT_WIDTH
String used for selecting fit width zoom. |
static java.lang.String |
ZOOM_IN
String used for selecting in |
static int |
ZOOM_MODE
Constant to switch to zoom mode. |
static java.lang.String |
ZOOM_ONE_TO_ONE
String used for selecting fit one to one zoom. |
static java.lang.String |
ZOOM_OUT
String used for selecting in |
static java.lang.String[] |
ZOOM_SPECIAL_LIST
The list of strings for the setZoom() method. |
static java.lang.String[] |
ZOOM_STANDARD_LIST
The list of strings standard zoom settings. |
static java.lang.String |
ZOOM_STRETCH
String used for selecting stretch zoom |
static java.lang.String |
ZOOM100
String used for selecting 100% zoom. |
static java.lang.String |
ZOOM150
String used for selecting 150% zoom. |
static java.lang.String |
ZOOM25
String used for selecting 25% zoom. |
static java.lang.String |
ZOOM300
String used for selecting 300% zoom. |
static java.lang.String |
ZOOM50
String used for selecting 50% zoom. |
static java.lang.String |
ZOOM75
String used for selecting 75% zoom. |
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 | |
---|---|
DjVuBean()
Creates a new DjVuBean object. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a listener for property change events. |
java.lang.Object |
createAddOn(java.lang.String name)
This is used to create additional objects, like the TextFinder, toolbars and outline navigation. |
int |
getCaretPosition()
Query the current caret position, used for text searches. |
DjVuOptions |
getDjVuOptions()
Query the DjVuOptions used by this object. |
Document |
getDocument()
Query the document being browsed. |
int |
getDPI()
Query the resolution of the DjVuPage. |
DjVuImage |
getImage()
|
DjVuImage |
getImageWait()
Query the current DjVuImage being displayed. |
java.lang.Number |
getLastMode()
Query the previous mode value. |
protected java.awt.Dimension |
getMaximumPanelSize()
Query the Maximum Panel size. |
java.awt.Dimension |
getMaximumSize()
Query the maximum size. |
java.awt.Dimension |
getMinimumPanelSize()
Query the minimum size. |
java.awt.Dimension |
getMinimumSize()
Query the minimum size. |
int |
getMode()
Return the current mode. |
java.awt.Component |
getOutline()
Query and/or create the outline add-on component. |
int |
getPage()
Optain the current page number, starting from page 1. |
int |
getPageCount()
Query the number of pages in the current document. |
protected java.awt.Dimension |
getPreferredPanelSize()
Query the Preferred Panel size. |
java.awt.Dimension |
getPreferredSize()
Query the preferred size. |
java.util.Properties |
getProperties()
Called to obtain Properties which may be used by the add-on classes. |
java.awt.Point |
getScrollPosition()
Query the scroll position of the relevant ScrollPane or JScrollPane. |
int |
getSearchMask()
Query the current search mask. |
java.lang.String |
getSearchText()
Query the text used for the searching. |
java.awt.Rectangle |
getSelect()
Query the selected region of the image. |
java.lang.String |
getStatus()
Query the status string. |
int |
getTargetWidth()
Query the target width for toolbar type components. |
java.lang.String |
getText()
Query the hidden text for this document. |
java.awt.TextArea |
getTextArea()
Obtain a TextArea appropriate for displaying the hidden text layer. |
Codec |
getTextCodec(long maxWait)
Query the current DjVuText Codec. |
java.lang.Runnable |
getTextSearchObject()
Query the runnable object used for searching. |
java.awt.Component |
getToolbar()
Query and/or create the toolbar add-on component. |
java.net.URL |
getURL()
Query the URL being browsed. |
java.awt.Dimension |
getViewportSize()
Query the viewport size of the relevant ScrollPane or JScrollPane. |
protected int |
getXScale()
Return the zoom factor of the X dimension. |
protected int |
getYScale()
Return the zoom factor of the Y dimension. |
java.lang.String |
getZoom()
Called to query the current Zoom setting. |
boolean |
imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
This overloaded ImageObserver method ignores image updates until a full frame is available. |
protected java.lang.Object |
invokeMethod(java.lang.Object component,
java.lang.String[] methodName,
java.lang.Class[] parms,
java.lang.Object[] args)
Called to invoke a method of the container class. |
protected java.lang.Object |
invokeParentsMethod(java.lang.String[] methodName,
java.lang.Class[] parms,
java.lang.Object[] args,
int maxDepth)
Called to invoke a method of the parent classes. |
boolean |
isDecoding()
Query if image decoding is still in progress. |
boolean |
isOpaque()
Always returns true. |
void |
paint(java.awt.Graphics g)
Called to draw the DjVuPage |
void |
paintComponent(java.awt.Graphics g)
Called to draw the DjVuPage |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Called when a property has been changed. |
void |
recursiveRevalidate()
Called to recursively validate each parent. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a listener for PropertyChangeEvent. |
void |
repaintImageCoordinates(java.awt.Rectangle bounds)
Used to specify a rectangle in document coordinates to repaint. |
void |
run()
|
void |
scaleScrollPosition(int owidth,
int oheight,
int nwidth,
int nheight)
Called to adjust to adjust the scroll position after scaling the image. |
void |
setBackground(java.awt.Color color)
Sets the background color of this component. |
void |
setCaretPosition(int caretPosition)
Set the current caret position, used for text searches. |
void |
setDjVuOptions(DjVuOptions options)
Set the DjVuOptions used by this object. |
protected void |
setImage(DjVuImage image)
Set the image to display. |
void |
setImageSize(java.awt.Dimension size)
Set the scaled DjVuImage size. |
void |
setImageSize(int width,
int height)
Set the scaled size of the DjVuImage. |
void |
setMode(int mode)
Used to set the mouselistener for PAN_MODE (panning), or ZOOM_MODE (zoom selection). |
void |
setMode(java.lang.Object mode)
Set the display mode from the specified String or Number. |
void |
setPage(int page)
Browse to the specified page number, starting with page 1. |
void |
setPageString(java.lang.String page)
Browse to the specified page number, starting with page 1. |
protected void |
setPanelSize(java.awt.Dimension size)
Adjust the panel size. |
protected void |
setPanelSize(int width,
int height)
Adjust the panel size. |
void |
setProperties(java.util.Properties properties)
Called to set Properties which may be used by the add-ons. |
void |
setPropertyName(java.lang.String name)
Automatically called to indicated the specified property value has been changed. |
void |
setScrollPosition(int x,
int y)
Set the scroll position of the relevant ScrollPane or JScrollPane. |
void |
setScrollPosition(java.awt.Point p)
Set the scroll position of the relevant ScrollPane or JScrollPane. |
void |
setSearchMask(int mask)
Set the current search mask. |
void |
setSearchText(java.lang.String searchText)
Set the text used for searching. |
void |
setSelect(java.awt.Rectangle select)
Set the selected rectangle of the region. |
void |
setSelectionList(java.util.Vector list)
Called to set the list of selected text to highlight. |
void |
setSize(java.awt.Dimension size)
Set the new scaled size. |
void |
setSize(int width,
int height)
Set the new scaled size. |
void |
setStatus(java.lang.String status)
Set the status string and fire a property change event "status". |
void |
setSubmit(java.lang.Object link)
Called to generate a PropertyChangeEvent to tell the monitor load a new URL. |
void |
setTargetWidth(int width)
Sets the target width for toolbar type components. |
void |
setURL(java.net.URL url)
Set the URL being browsed. |
void |
setViewportSize(java.awt.Dimension size)
Set the viewport size of the relevant ScrollPane or JScrollPane. |
void |
setViewportSize(int width,
int height)
Set the viewport size of the relevant ScrollPane or JScrollPane. |
void |
setZoom(java.lang.String zoom)
Scale the current zoom to either a value specified in the ZOOM_SPECIAL_LIST, or a number followed by percent sign. |
static boolean |
stringToBoolean(java.lang.String value,
boolean retval)
Convert a string to a boolean using a case insensative comparison. |
void |
update(java.awt.Graphics g)
Called to draw the DjVuPage |
void |
validate()
Called to recursively validate. |
void |
zoomSelect()
Called to zoom to the current selected rectangle set with setSelect(). |
Methods inherited from class java.awt.Panel |
---|
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, 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, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, 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, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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 |
---|
public static final int FIT_WIDTH
public static final int FIT_PAGE
public static final int LAST_MODE
public static final int PAN_MODE
public static final int TEXT_MODE
public static final int ZOOM_MODE
public static final java.lang.String ZOOM300
public static final java.lang.String ZOOM150
public static final java.lang.String ZOOM100
public static final java.lang.String ZOOM75
public static final java.lang.String ZOOM50
public static final java.lang.String ZOOM25
public static final java.lang.String ZOOM_FIT_WIDTH
public static final java.lang.String ZOOM_FIT_PAGE
public static final java.lang.String ZOOM_ONE_TO_ONE
public static final java.lang.String ZOOM_STRETCH
public static final java.lang.String ZOOM_IN
public static final java.lang.String ZOOM_OUT
public static final java.lang.String[] ZOOM_STANDARD_LIST
public static final java.lang.String[] ZOOM_SPECIAL_LIST
public static final java.lang.String[] ZOOM_BUTTON_LIST
public static final java.lang.String FIRST_PAGE
public static final java.lang.String PREV_PAGE
public static final java.lang.String NEXT_PAGE
public static final java.lang.String LAST_PAGE
public static final java.lang.String[] NAVIGATE_LIST
public static final int SEARCH_BACKWARD_MASK
public static final int MATCH_CASE_MASK
public static final int WHOLE_WORD_MASK
public static final int WHOLE_DOCUMENT_MASK
public final java.util.Properties properties
protected java.awt.event.MouseListener mlistener
protected int zoom
protected DjVuImage image
protected java.lang.Thread getImageThread
Constructor Detail |
---|
public DjVuBean()
Method Detail |
---|
public void setStatus(java.lang.String status)
status
- new status stringpublic java.lang.String getStatus()
public void setBackground(java.awt.Color color)
setBackground
in class java.awt.Component
color
- The color to become the components background color. If
null the component will inherit the background color of its
parent.public int getCaretPosition()
public int getDPI()
public void setDjVuOptions(DjVuOptions options)
setDjVuOptions
in interface DjVuInterface
options
- The DjVuOptions used by this object.public DjVuOptions getDjVuOptions()
getDjVuOptions
in interface DjVuInterface
public final Document getDocument()
public DjVuImage getImageWait()
public void setImageSize(int width, int height)
width
- scaled Width.height
- scaled Height.public final void setImageSize(java.awt.Dimension size)
size
- Scaled size.public java.lang.Number getLastMode()
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class java.awt.Container
public java.awt.Dimension getMinimumPanelSize()
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Container
public void setMode(java.lang.Object mode)
mode
- object containing eithe a mode number or mode string.public void setMode(int mode)
mode
- the new mouse listening mode.public int getMode()
public boolean isOpaque()
isOpaque
in class java.awt.Component
public void setPage(int page)
page
- new page number to browse to.public final int getPage()
public void setPageString(java.lang.String page)
page
- new page number to browse to.public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
public final void setScrollPosition(java.awt.Point p)
p
- Position to scroll to.public void setSearchMask(int mask)
mask
- consisting of search options.public int getSearchMask()
public final void setSize(java.awt.Dimension size)
setSize
in class java.awt.Component
size
- to scale to.public void setScrollPosition(int x, int y)
x
- coordinate of position to scroll to.y
- coordinate of position to scroll to.public java.awt.Point getScrollPosition()
public void setSearchText(java.lang.String searchText)
searchText
- text to use in the next search.public java.lang.String getSearchText()
public void setSelect(java.awt.Rectangle select)
select
- the currently selected rectangle.public java.awt.Rectangle getSelect()
public void setSize(int width, int height)
setSize
in class java.awt.Component
width
- to scale to.height
- to scale to.public void setSubmit(java.lang.Object link)
link
- a anno.Rect, URL, or String to indicate the link to load.public final java.awt.TextArea getTextArea()
public java.lang.Runnable getTextSearchObject()
public void setURL(java.net.URL url) throws java.io.IOException
url
- to browse
java.io.IOException
- if an error occurs decoding the documentpublic final java.net.URL getURL()
public final void setViewportSize(java.awt.Dimension size)
size
- viewport size.public void setCaretPosition(int caretPosition)
caretPosition
- the new caret position.public boolean isDecoding()
public java.awt.Component getOutline()
public int getPageCount()
public void setProperties(java.util.Properties properties)
properties
- values to set.public final java.util.Properties getProperties()
public void setPropertyName(java.lang.String name)
name
- the name of the property which has changed.public void setSelectionList(java.util.Vector list)
list
- the list of selected GRect rectangles to highlight.public void setTargetWidth(int width)
width
- to use for the toolbar layout.public int getTargetWidth()
public java.lang.String getText()
public Codec getTextCodec(long maxWait)
maxWait
- the maximum time to wait in milliseconds.
public java.awt.Component getToolbar()
public void setViewportSize(int width, int height)
width
- of viewport.height
- of viewport.public java.awt.Dimension getViewportSize()
public void setZoom(java.lang.String zoom)
zoom
- The zoom factor to scale to.public java.lang.String getZoom()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in class java.awt.Container
listener
- to addpublic boolean imageUpdate(java.awt.Image image, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
imageUpdate
in class java.awt.Component
image
- Updated imageinfoflags
- Flags indicating the new data available.x
- Coordinate of left edge. (-1 if unknown)y
- Coordinate of top edge. (-1 if unknown)width
- Image width. (-1 if unknown)height
- Image height. (-1 if unknown)
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- indicates the changed property.public static boolean stringToBoolean(java.lang.String value, boolean retval)
value
- string to convert.retval
- default value to return.
public java.lang.Object createAddOn(java.lang.String name)
name
- class name of the add-on.
public void paint(java.awt.Graphics g)
paint
in class java.awt.Container
g
- Graphics device to draw to.public DjVuImage getImage()
public void paintComponent(java.awt.Graphics g)
g
- Graphics device to draw to.public void run()
run
in interface java.lang.Runnable
public void recursiveRevalidate()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in class java.awt.Component
listener
- to removepublic void repaintImageCoordinates(java.awt.Rectangle bounds)
bounds
- Rectangle to highlight.public void scaleScrollPosition(int owidth, int oheight, int nwidth, int nheight)
owidth
- old width.oheight
- old height.nwidth
- new width.nheight
- new height.public void update(java.awt.Graphics g)
update
in class java.awt.Container
g
- Graphics device to draw to.public void validate()
validate
in class java.awt.Container
public void zoomSelect()
protected void setImage(DjVuImage image)
image
- to display.protected java.awt.Dimension getMaximumPanelSize()
protected final void setPanelSize(java.awt.Dimension size)
size
- The new panel size.protected void setPanelSize(int width, int height)
width
- The new panel width.height
- The new panel height.protected java.awt.Dimension getPreferredPanelSize()
protected int getXScale()
protected int getYScale()
protected java.lang.Object invokeMethod(java.lang.Object component, java.lang.String[] methodName, java.lang.Class[] parms, java.lang.Object[] args) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
component
- to invoke method in.methodName
- name of method to invoke.parms
- parameter types of the method.args
- arguments to the method.
java.lang.NoSuchMethodException
- if the mothod does not exist.
java.lang.IllegalAccessException
- if access to the method is denied.
java.lang.reflect.InvocationTargetException
- if invocation fails.protected java.lang.Object invokeParentsMethod(java.lang.String[] methodName, java.lang.Class[] parms, java.lang.Object[] args, int maxDepth)
methodName
- name of method to invoke.parms
- parameter types of the method.args
- arguments to the method.maxDepth
- maximum number of parents to try.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |