|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.faceless.pdf2.viewer2.DocumentViewport
org.faceless.pdf2.viewer2.SinglePageDocumentViewport
public class SinglePageDocumentViewport
A type of DocumentViewport that displays a single page. The Page can be zoomed
in or out, and if it grows beyond the size of this viewport scrollbars will be displayed.
Zoom levels are translated to DPI (as required by the PagePainter} using the
Toolkit.getScreenResolution() method.
This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
DocumentPanel,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class org.faceless.pdf2.viewer2.DocumentViewport |
|---|
ZOOM_FIT, ZOOM_FITHEIGHT, ZOOM_FITWIDTH, ZOOM_NONE |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
SinglePageDocumentViewport()
Create a new SinglePageDocumentViewporpt |
|
| Method Summary | |
|---|---|
void |
addPagePanelInteractionListener(PagePanelInteractionListener listener)
Add a PagePanelInteractionListener to any PagePanel objects that have been
or will be created by this DocumentViewport |
void |
addPagePanelListener(PagePanelListener listener)
Add a PagePanelListener to any PagePanel objects that have been
or will be created by this DocumentViewport |
void |
ensureVisible(PDFPage page,
double x,
double y)
Ensure the specified point on the page is visible. |
Adjustable |
getAdjustable(int position)
Return the "Adjustable" object for the specified position - typically this is the horizontal or vertical JScrollBar, although this method may
return null or accept other parameters. |
PagePanel |
getPagePanel()
Get the currently displayed PagePanel. |
PDFPage |
getRenderingPage()
Return the page that is currently in the process of rendering. |
Rectangle2D |
getViewport()
Return the section of the page returned by DocumentViewport.getPage() that's currently
being displayed, in points. |
Dimension |
getViewportSize()
Return the size in pixels of the space available to display pages in this viewport, not including scrollbars or other decoration |
float |
getZoom()
Get the current zoom level |
void |
redraw(Object o)
Redraw the specified object. |
void |
removePagePanelInteractionListener(PagePanelInteractionListener listener)
Remove a PagePanelInteractionListener from any PagePanel objects
that have been created by this DocumentViewport |
void |
removePagePanelListener(PagePanelListener listener)
Remove a PagePanelListener from any PagePanel objects that have been
created by this DocumentViewport |
void |
setDocumentPanel(DocumentPanel panel)
|
void |
setMaxPixels(int pixels)
Set the maximum number of pixels that can be displayed in the full backing image. |
void |
setPage(PDFPage page,
double x,
double y,
double zoom)
Set the currently displayed page. |
void |
setRenderingHints(RenderingHints hints)
Set the RenderingHints that should be used when rendering the pages |
void |
setZoom(float zoom)
Set the zoom level of this DocumentViewport. |
| Methods inherited from class org.faceless.pdf2.viewer2.DocumentViewport |
|---|
getDocumentPanel, getPage, getTargetZoom, getZoomMode, setZoomMode |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SinglePageDocumentViewport()
| Method Detail |
|---|
public void setRenderingHints(RenderingHints hints)
DocumentViewportRenderingHints that should be used when rendering the pages
setRenderingHints in class DocumentViewportpublic void addPagePanelListener(PagePanelListener listener)
DocumentViewportPagePanelListener to any PagePanel objects that have been
or will be created by this DocumentViewport
addPagePanelListener in class DocumentViewportlistener - the listenerpublic void removePagePanelListener(PagePanelListener listener)
DocumentViewportPagePanelListener from any PagePanel objects that have been
created by this DocumentViewport
removePagePanelListener in class DocumentViewportlistener - the listenerpublic void addPagePanelInteractionListener(PagePanelInteractionListener listener)
DocumentViewportPagePanelInteractionListener to any PagePanel objects that have been
or will be created by this DocumentViewport
addPagePanelInteractionListener in class DocumentViewportlistener - the listenerpublic void removePagePanelInteractionListener(PagePanelInteractionListener listener)
DocumentViewportPagePanelInteractionListener from any PagePanel objects
that have been created by this DocumentViewport
removePagePanelInteractionListener in class DocumentViewportlistener - the listenerpublic void setDocumentPanel(DocumentPanel panel)
public PagePanel getPagePanel()
DocumentViewportsetPage(), the exact
implementation of this method depends on the type of viewport, but the idea is
it returns the PagePanel that is the primary focus of this viewport
getPagePanel in class DocumentViewportpublic Adjustable getAdjustable(int position)
DocumentViewportJScrollBar, although this method may
return null or accept other parameters.
getAdjustable in class DocumentViewportposition - one of Adjustable.HORIZONTAL or Adjustable.VERTICAL
public void ensureVisible(PDFPage page,
double x,
double y)
DocumentViewport
ensureVisible in class DocumentViewportx - the X position of the page in pointsy - the Y position of the page in pointspublic PDFPage getRenderingPage()
DocumentViewportDocumentViewport.getPage()
getRenderingPage in class DocumentViewportpublic void setMaxPixels(int pixels)
public Dimension getViewportSize()
DocumentViewport
getViewportSize in class DocumentViewportpublic float getZoom()
DocumentViewport
getZoom in class DocumentViewportpublic Rectangle2D getViewport()
DocumentViewport.getPage() that's currently
being displayed, in points. Zero is the top of the page, to match the values
supplied to setPage(org.faceless.pdf2.PDFPage, double, double, double)
public void setZoom(float zoom)
DocumentViewport
setZoom in class DocumentViewport
public void setPage(PDFPage page,
double x,
double y,
double zoom)
DocumentViewport
setPage in class DocumentViewportpage - the page to displayx - the left-most X position of the page, relative to PagePanel.getFullPageView(org.faceless.pdf2.PDFPage). A value of NaN means keep the current valuey - the top-most Y position of the page, relative to PagePanel.getFullPageView(org.faceless.pdf2.PDFPage). A value of NaN means keep the current valuezoom - the zoom level. A value of <= 0 or NaN means keep the current zoom.public void redraw(Object o)
DocumentViewportPagePanel.redrawAnnotation(org.faceless.pdf2.PDFAnnotation) or PagePanel.setPage(org.faceless.pdf2.PDFPage, java.awt.geom.Rectangle2D, float) method
for the PagePanels in use by this Viewport, as appropriate.
redraw in class DocumentViewporto - the Object that is to be redrawn
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||