|
|||||||||
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
com.lizardtech.djvubean.DjVuViewport
public class DjVuViewport
This extension to DjVuBean allows a DjVuPage to be viewed without the need for a ScrollPane or JScrollPane. The main this class should be used is to avoid the annoying flicker caused by ScrollPane repainting the screen when JScrollPane is not available. This panel will not render the scrollbars. Instead the scrollbars should be rendered in a parent component.
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 |
---|
Fields inherited from class com.lizardtech.djvubean.DjVuBean |
---|
FIRST_PAGE, FIT_PAGE, FIT_WIDTH, getImageThread, image, LAST_MODE, LAST_PAGE, MATCH_CASE_MASK, mlistener, NAVIGATE_LIST, NEXT_PAGE, PAN_MODE, PREV_PAGE, properties, SEARCH_BACKWARD_MASK, TEXT_MODE, WHOLE_DOCUMENT_MASK, WHOLE_WORD_MASK, zoom, ZOOM_BUTTON_LIST, ZOOM_FIT_PAGE, ZOOM_FIT_WIDTH, ZOOM_IN, ZOOM_MODE, ZOOM_ONE_TO_ONE, ZOOM_OUT, ZOOM_SPECIAL_LIST, ZOOM_STANDARD_LIST, ZOOM_STRETCH, ZOOM100, ZOOM150, ZOOM25, ZOOM300, ZOOM50, ZOOM75 |
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 | |
---|---|
DjVuViewport()
Creates a new DjVuViewport object. |
Method Summary | |
---|---|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
Called to process scrollbar events. |
java.awt.Dimension |
getMaximumSize()
Query the maximum panel size. |
java.awt.Dimension |
getMinimumSize()
Query the minimum panel size. |
java.awt.Dimension |
getPreferredSize()
Query the preferred panel size. |
java.awt.Scrollbar |
getScrollbar(int orientation)
Query the a scrollbar component. |
java.awt.Point |
getScrollPosition()
Query the current scroll position. |
java.awt.Dimension |
getViewportSize()
Query the size of this panel. |
void |
paint(java.awt.Graphics g)
Called to redraw the panel. |
void |
paintComponent(java.awt.Graphics g)
Called to draw the panel. |
protected void |
processEvent(java.awt.AWTEvent event)
Called to process events. |
void |
run()
|
void |
setImageSize(int width,
int height)
Adjust the image scale. |
void |
setScrollbar(int orientation,
java.awt.Scrollbar scrollbar)
Set either the horizontal or vertical scrollbar. |
void |
setScrollPosition(int x,
int y)
Set the scroll position. |
void |
setSize(int width,
int height)
Set the size of this panel. |
void |
setURL(java.net.URL url)
Called to set the URL to browse, and reset the scrollbars. |
void |
setViewportSize(int width,
int height)
Set the size of this panel. |
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, 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 |
Constructor Detail |
---|
public DjVuViewport()
Method Detail |
---|
public void setImageSize(int width, int height)
setImageSize
in class DjVuBean
width
- to scale the image to.height
- to scale the image to.public java.awt.Dimension getMaximumSize()
getMaximumSize
in class DjVuBean
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class DjVuBean
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class DjVuBean
public void setScrollPosition(int x, int y)
setScrollPosition
in class DjVuBean
x
- coordinate of upper left corner.y
- coordinate of upper left corner.public java.awt.Point getScrollPosition()
getScrollPosition
in class DjVuBean
public void setScrollbar(int orientation, java.awt.Scrollbar scrollbar)
orientation
- either Scrollbar.HORIZONTAL or Scrollbar.VERTICALscrollbar
- component.public java.awt.Scrollbar getScrollbar(int orientation)
orientation
- either Scrollbar.HORIZONTAL or Scrollbar.VERTICAL
public void setSize(int width, int height)
setSize
in class DjVuBean
width
- of this panel.height
- of this panel.public void setURL(java.net.URL url) throws java.io.IOException
setURL
in class DjVuBean
url
- indicates document to view.
java.io.IOException
- if an error occurespublic void setViewportSize(int width, int height)
setViewportSize
in class DjVuBean
width
- of this panel.height
- of this panel.public java.awt.Dimension getViewportSize()
getViewportSize
in class DjVuBean
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
event
- to process.public void paint(java.awt.Graphics g)
paint
in class DjVuBean
g
- Graphics device to draw the panel to.public void paintComponent(java.awt.Graphics g)
paintComponent
in class DjVuBean
g
- Graphics device to draw the panel to.protected void processEvent(java.awt.AWTEvent event)
processEvent
in class java.awt.Container
event
- to process.public void run()
run
in interface java.lang.Runnable
run
in class DjVuBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |