Top Description Inners Fields Constructors Methods
org.apache.pdfbox.debugger.pagepane

public Class PagePane

extends Object
implements ActionListener, AncestorListener, MouseMotionListener, MouseListener
Class Inheritance
All Implemented Interfaces
java.awt.event.MouseListener, java.util.EventListener, java.awt.event.MouseMotionListener, javax.swing.event.AncestorListener, java.awt.event.ActionListener
Imports
java.awt.Graphics2D, .Component, .Cursor, .Desktop, .Dimension, .Font, .GraphicsEnvironment, .Point, .Toolkit, org.apache.pdfbox.cos.COSDictionary, org.apache.pdfbox.debugger.PDFDebugger, org.apache.pdfbox.debugger.ui.ImageUtil, .RotationMenu, .ViewMenu, .ZoomMenu, .ErrorDialog, .HighResolutionImageIcon, .ImageTypeMenu, .RenderDestinationMenu, .TextDialog, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, org.apache.pdfbox.rendering.PDFRenderer, javax.swing.BorderFactory, .BoxLayout, .JLabel, .JMenu, .JMenuItem, .JPanel, .SwingWorker, javax.swing.event.AncestorEvent, .AncestorListener, java.awt.event.ActionEvent, .ActionListener, .MouseEvent, .MouseListener, .MouseMotionListener, java.awt.geom.AffineTransform, java.awt.image.BufferedImage, java.io.IOException, java.net.URI, .URISyntaxException, java.util.HashMap, .HashSet, .Map, .Map.Entry, .Set, java.util.concurrent.ExecutionException, .TimeUnit, org.apache.commons.logging.Log, .LogFactory, org.apache.pdfbox.pdmodel.common.PDRectangle, org.apache.pdfbox.pdmodel.fixup.AcroFormDefaultFixup, .PDDocumentFixup, org.apache.pdfbox.pdmodel.interactive.action.PDAction, .PDActionGoTo, .PDActionURI, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, .PDAnnotationLink, .PDAnnotationWidget, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination, .PDNamedDestination, .PDPageDestination, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm, .PDField, org.apache.pdfbox.text.PDFTextStripper

Display the page number and a page rendering.
Authors
Tilman Hausherr, John Hewson

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
PagePane.RenderWorker

Note that PDDocument is not officially thread safe, caution advised.

Field Summary

Modifier and TypeField and Description
private String
private final AffineTransform
private final PDDocument
private ImageTypeMenu
private JLabel
private String
private static final Log
private final PDPage
private int
private JPanel
private final Map<PDRectangle, String>
private RenderDestinationMenu
private RotationMenu
private final JLabel
private ViewMenu
private ZoomMenu

Constructor Summary

AccessConstructor and Description
public
PagePane(PDDocument document, COSDictionary pageDict, JLabel statuslabel)

Method Summary

Modifier and TypeMethod and Description
public void
actionPerformed(ActionEvent
the event to be processed
actionEvent
)

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

public void
ancestorAdded(AncestorEvent
an AncestorEvent signifying a change in an ancestor-component's display-status
ancestorEvent
)

Implements javax.swing.event.AncestorListener.ancestorAdded.

Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy.

public void
ancestorMoved(AncestorEvent
an AncestorEvent signifying a change in an ancestor-component's display-status
ancestorEvent
)

Implements javax.swing.event.AncestorListener.ancestorMoved.

Called when either the source or one of its ancestors is moved.

public void
ancestorRemoved(AncestorEvent
an AncestorEvent signifying a change in an ancestor-component's display-status
ancestorEvent
)

Implements javax.swing.event.AncestorListener.ancestorRemoved.

Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being removed from the component hierarchy.

private void
private void
public Component

Returns:

JPanel instance
getPanel
()

Returns the main panel that hold all the UI elements.

private void
private void
public void
mouseClicked(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

public void
mouseDragged(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged.

public void
mouseEntered(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

public void
mouseExited(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

public void
mouseMoved(MouseEvent
mouse event with position
e
)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Catch mouse event to display cursor position in PDF coordinates in the status bar.

public void
mousePressed(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

public void
mouseReleased(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentURIback to summary
private String currentURI
defaultTransformback to summary
private final AffineTransform defaultTransform
documentback to summary
private final PDDocument document
imageTypeMenuback to summary
private ImageTypeMenu imageTypeMenu
labelback to summary
private JLabel label
labelTextback to summary
private String labelText
LOGback to summary
private static final Log LOG
pageback to summary
private final PDPage page
pageIndexback to summary
private int pageIndex
panelback to summary
private JPanel panel
rectMapback to summary
private final Map<PDRectangle, String> rectMap
renderDestinationMenuback to summary
private RenderDestinationMenu renderDestinationMenu
rotationMenuback to summary
private RotationMenu rotationMenu
statuslabelback to summary
private final JLabel statuslabel
viewMenuback to summary
private ViewMenu viewMenu
zoomMenuback to summary
private ZoomMenu zoomMenu

Constructor Detail

PagePaneback to summary
public PagePane(PDDocument document, COSDictionary pageDict, JLabel statuslabel)

Method Detail

actionPerformedback to summary
public void actionPerformed(ActionEvent actionEvent)

Implements java.awt.event.ActionListener.actionPerformed.

Doc from java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

Parameters
actionEvent:ActionEvent

the event to be processed

Annotations
@Override
ancestorAddedback to summary
public void ancestorAdded(AncestorEvent ancestorEvent)

Implements javax.swing.event.AncestorListener.ancestorAdded.

Doc from javax.swing.event.AncestorListener.ancestorAdded.

Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy. The method is only called if the source has actually become visible. For this to be true all its parents must be visible and it must be in a hierarchy rooted at a Window

Parameters
ancestorEvent:AncestorEvent

an AncestorEvent signifying a change in an ancestor-component's display-status

Annotations
@Override
ancestorMovedback to summary
public void ancestorMoved(AncestorEvent ancestorEvent)

Implements javax.swing.event.AncestorListener.ancestorMoved.

Doc from javax.swing.event.AncestorListener.ancestorMoved.

Called when either the source or one of its ancestors is moved.

Parameters
ancestorEvent:AncestorEvent

an AncestorEvent signifying a change in an ancestor-component's display-status

Annotations
@Override
ancestorRemovedback to summary
public void ancestorRemoved(AncestorEvent ancestorEvent)

Implements javax.swing.event.AncestorListener.ancestorRemoved.

Doc from javax.swing.event.AncestorListener.ancestorRemoved.

Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being removed from the component hierarchy. The method is only called if the source has actually become invisible. For this to be true at least one of its parents must by invisible or it is not in a hierarchy rooted at a Window

Parameters
ancestorEvent:AncestorEvent

an AncestorEvent signifying a change in an ancestor-component's display-status

Annotations
@Override
collectFieldLocationsback to summary
private void collectFieldLocations() throws IOException
collectLinkLocationsback to summary
private void collectLinkLocations() throws IOException
getPanelback to summary
public Component getPanel()

Returns the main panel that hold all the UI elements.

Returns:Component

JPanel instance

initRectMapback to summary
private void initRectMap()
initUIback to summary
private void initUI()
mouseClickedback to summary
public void mouseClicked(MouseEvent e)

Implements java.awt.event.MouseListener.mouseClicked.

Doc from java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

Parameters
e:MouseEvent

the event to be processed

Annotations
@Override
mouseDraggedback to summary
public void mouseDragged(MouseEvent e)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Doc from java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

Parameters
e:MouseEvent

the event to be processed

Annotations
@Override
mouseEnteredback to summary
public void mouseEntered(MouseEvent e)

Implements java.awt.event.MouseListener.mouseEntered.

Doc from java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

Parameters
e:MouseEvent

the event to be processed

Annotations
@Override
mouseExitedback to summary
public void mouseExited(MouseEvent e)

Implements java.awt.event.MouseListener.mouseExited.

Doc from java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

Parameters
e:MouseEvent

the event to be processed

Annotations
@Override
mouseMovedback to summary
public void mouseMoved(MouseEvent e)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Catch mouse event to display cursor position in PDF coordinates in the status bar.

Parameters
e:MouseEvent

mouse event with position

Annotations
@Override
mousePressedback to summary
public void mousePressed(MouseEvent e)

Implements java.awt.event.MouseListener.mousePressed.

Doc from java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

Parameters
e:MouseEvent

the event to be processed

Annotations
@Override
mouseReleasedback to summary
public void mouseReleased(MouseEvent e)

Implements java.awt.event.MouseListener.mouseReleased.

Doc from java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

Parameters
e:MouseEvent

the event to be processed

Annotations
@Override
startExtractingback to summary
private void startExtracting()
startRenderingback to summary
private void startRendering()
org.apache.pdfbox.debugger.pagepane back to summary

private final Class PagePane.RenderWorker

extends SwingWorker<BufferedImage, Integer>
Class Inheritance

Note that PDDocument is not officially thread safe, caution advised.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected BufferedImage
doInBackground()

Implements abstract javax.swing.SwingWorker.doInBackground.

Computes a result, or throws an exception if unable to do so.

protected void
done()

Overrides javax.swing.SwingWorker.done.

Executed on the Event Dispatch Thread after the doInBackground method is finished.

Inherited from javax.swing.SwingWorker:
addPropertyChangeListenercancelexecutefirePropertyChangegetgetgetProgressgetPropertyChangeSupportgetStateisCancelledisDoneprocesspublishremovePropertyChangeListenerrunsetProgress

Constructor Detail

RenderWorkerback to summary
private RenderWorker()

Method Detail

doInBackgroundback to summary
protected BufferedImage doInBackground() throws IOException

Implements abstract javax.swing.SwingWorker.doInBackground.

Doc from javax.swing.SwingWorker.doInBackground.

Computes a result, or throws an exception if unable to do so.

Note that this method is executed only once.

Note

this method is executed in a background thread.

Returns:BufferedImage

the computed result

Annotations
@Override
doneback to summary
protected void done()

Overrides javax.swing.SwingWorker.done.

Doc from javax.swing.SwingWorker.done.

Executed on the Event Dispatch Thread after the doInBackground method is finished. The default implementation does nothing. Subclasses may override this method to perform completion actions on the Event Dispatch Thread. Note that you can query status inside the implementation of this method to determine the result of this task or whether this task has been cancelled.

Annotations
@Override