Class PdfReaderController
java.lang.Object
java.util.Observable
org.openpdf.rups.controller.PdfReaderController
- All Implemented Interfaces:
Observer
Controls the GUI components that get their content from iText's PdfReader.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JTabbedPaneTabbed Pane containing other components.protected FormTreeTreeview of the form.protected JTabbedPaneTabbed Pane containing other components.protected TreeNodeFactoryThe factory producing tree nodes.protected PdfObjectPanelA panel that will show PdfObjects.protected OutlineTreeTreeview of the outlines.protected PagesTableJTable with all the pages and their labels.protected PdfTreeTreeview of the PDF file.protected StreamTextAreaA panel that will show a stream.protected XRefTableJTable corresponding with the CrossReference table. -
Constructor Summary
ConstructorsConstructorDescriptionPdfReaderController(TreeSelectionListener treeSelectionListener, PageSelectionListener pageSelectionListener) Constructs the PdfReaderController. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the tabs with the editor windows (to which the Console window will be added).Getter for the tabs that allow you to navigate through the PdfTree quickly (pages, form, outlines, xref table).Getter for the panel that will show the contents of a PDF Object (except for PdfStreams: only the Stream Dictionary will be shown; the content stream is shown in a StreamTextArea object).Getter for the PDF Tree.Getter for the object that holds the TextArea with the content stream of a PdfStream object.voidgotoPage(int pageNumber) Selects the row in the pageTable that corresponds with a certain page number.voidnotifyObservers(Object obj) The GUI components that show the internals of a PDF file, can only be shown if all objects are loaded into the IndirectObjectFactory using the ObjectLoader.voidRenders the syntax of a PdfObject in the objectPanel.voidselectNode(int objectNumber) Selects a node in the PdfTree.voidselectNode(PdfObjectTreeNode node) Selects a node in the PdfTree.voidstartObjectLoader(PdfFile file) Starts loading the PDF Objects in background.voidupdate(Observable observable, Object obj) Forwards updates from the RupsController to the Observers of this class.Methods inherited from class Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
-
Field Details
-
pdfTree
Treeview of the PDF file. -
pages
JTable with all the pages and their labels. -
outlines
Treeview of the outlines. -
form
Treeview of the form. -
xref
JTable corresponding with the CrossReference table. -
objectPanel
A panel that will show PdfObjects. -
editorTabs
Tabbed Pane containing other components. -
streamArea
A panel that will show a stream. -
nodes
The factory producing tree nodes.
-
-
Constructor Details
-
PdfReaderController
public PdfReaderController(TreeSelectionListener treeSelectionListener, PageSelectionListener pageSelectionListener) Constructs the PdfReaderController. This is an Observable object to which all iText related GUI components are added as Observers.- Parameters:
treeSelectionListener- when somebody selects a tree node, this listener listens to the eventpageSelectionListener- when somebody changes a page, this listener changes accordingly
-
-
Method Details
-
getPdfTree
-
getObjectPanel
Getter for the panel that will show the contents of a PDF Object (except for PdfStreams: only the Stream Dictionary will be shown; the content stream is shown in a StreamTextArea object).- Returns:
- the PdfObjectPanel
-
getEditorTabs
Getter for the tabs with the editor windows (to which the Console window will be added).- Returns:
- the tabs with the editor windows
-
getStreamArea
Getter for the object that holds the TextArea with the content stream of a PdfStream object.- Returns:
- a StreamTextArea
-
startObjectLoader
Starts loading the PDF Objects in background.- Parameters:
file- the wrapper object that holds the PdfReader as member variable
-
notifyObservers
The GUI components that show the internals of a PDF file, can only be shown if all objects are loaded into the IndirectObjectFactory using the ObjectLoader. As soon as this is done, the GUI components are notified.- Overrides:
notifyObserversin classObservable- Parameters:
obj- in this case the Object should be an ObjectLoader- See Also:
-
selectNode
Selects a node in the PdfTree.- Parameters:
node- a node in the PdfTree
-
selectNode
public void selectNode(int objectNumber) Selects a node in the PdfTree.- Parameters:
objectNumber- a number of a node in the PdfTree
-
render
Renders the syntax of a PdfObject in the objectPanel. If the object is a PDF Stream, then the stream is shown in the streamArea too.- Parameters:
object- the object to render
-
gotoPage
public void gotoPage(int pageNumber) Selects the row in the pageTable that corresponds with a certain page number.- Parameters:
pageNumber- the page number that needs to be selected
-
update
Forwards updates from the RupsController to the Observers of this class.
-