|
||||||||||
| 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.MultiPageDocumentViewport
public class MultiPageDocumentViewport
A DocumentViewport that can display an entire document's pages
arranged in a vertical or horizontal orientation.
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 | |
|---|---|
MultiPageDocumentViewport()
Constructs a new MultiPageDocumentViewport with a vertical orientation. |
|
MultiPageDocumentViewport(int orientation)
Constructs a new multi-page document viewport with the specified orientation. |
|
| 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. |
Collection |
getPagePanels()
Returns a read only Collection containing all the PagePanels currently displayed in this Viewport. |
PDFPage |
getRenderingPage()
Return the page that is currently in the process of rendering. |
float |
getTargetZoom(int zoommode,
PDFPage page)
Return the appropriate zoom level when switching to the specified page. |
JComponent |
getView()
Get the JComponent that directly contains the PagePanel objects, not including scrollbars or other similar items. |
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 |
boolean |
isPageVisible(PDFPage page,
double x,
double y)
Indicates whether the specified point in the specified page is visible in the viewport. |
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 |
setAdjustableValues(int horizontal,
int vertical)
Set the values of the adjustables returned by DocumentViewport.getAdjustable(int). |
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. |
void |
setZoomMode(int zoommode)
Control how the document in the viewport is redrawn when the Viewport is resized. |
| Methods inherited from class org.faceless.pdf2.viewer2.DocumentViewport |
|---|
getDocumentPanel, getPage, getZoomMode |
| 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 MultiPageDocumentViewport()
public MultiPageDocumentViewport(int orientation)
orientation - Adjustable.VERTICAL or Adjustable.HORIZONTAL| Method Detail |
|---|
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. A value of one means 72dpi
public void ensureVisible(PDFPage page,
double x,
double y)
DocumentViewport
ensureVisible in class DocumentViewportx - the X position of the page in absolute PDF points (ie measured from the bottom left)y - the Y position of the page in absolute PDF points (ie measured from the bottom left)
public boolean isPageVisible(PDFPage page,
double x,
double y)
DocumentViewportx or y is
NaN, indicates whether any part of the page is visible.
isPageVisible in class DocumentViewportx - the X position of the page in pointsy - the Y position of the page in pointspublic JComponent getView()
DocumentViewport
getView in class DocumentViewportpublic float getZoom()
DocumentViewport
getZoom in class DocumentViewportpublic void setZoom(float zoom)
DocumentViewport
setZoom in class DocumentViewportpublic Dimension getViewportSize()
DocumentViewport
getViewportSize in class DocumentViewportpublic 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 Collection getPagePanels()
DocumentViewport
getPagePanels in class DocumentViewportpublic PDFPage getRenderingPage()
DocumentViewportDocumentViewport.getPage()
getRenderingPage in class DocumentViewportpublic Adjustable getAdjustable(int position)
DocumentViewportJScrollBar, although this method may
return null or accept other parameters. The adjustable is
measured in AWT space (pixels from the top left). This method may return
null if there is no adjustable.
getAdjustable in class DocumentViewportposition - one of Adjustable.HORIZONTAL or Adjustable.VERTICAL
public void setAdjustableValues(int horizontal,
int vertical)
DocumentViewportDocumentViewport.getAdjustable(int).
Calling this method is preferable to setting the values of each adjustable
individually when both are to be set
setAdjustableValues in class DocumentViewporthorizontal - the value for the Adjustable.HORIZONTAL adjustable.vertical - the value for the Adjustable.VERTICAL adjustable.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 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 redrawnpublic void setZoomMode(int zoommode)
DocumentViewportDocumentViewport.ZOOM_NONE, which means no action is performed, but other
actions include DocumentViewport.ZOOM_FIT, DocumentViewport.ZOOM_FITWIDTH and DocumentViewport.ZOOM_FITHEIGHT,
which will ensure that the document is always zoomed to fit completely, fit the width
or fit the height of the viewport respectively
setZoomMode in class DocumentViewport
public float getTargetZoom(int zoommode,
PDFPage page)
DocumentViewportzoommode is DocumentViewport.ZOOM_NONE then this
just returns the value of DocumentViewport.getZoom(), otherwise the returned zoom level
will correctly fit the page to the Viewport.
getTargetZoom in class DocumentViewportpage - the PDFPage that we are calculating the zoom for.DocumentViewport.getZoomMode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||