Package com.lowagie.rups.controller
Class PdfReaderController
- java.lang.Object
-
- java.util.Observable
-
- com.lowagie.rups.controller.PdfReaderController
-
- All Implemented Interfaces:
java.util.Observer
public class PdfReaderController extends java.util.Observable implements java.util.ObserverControls the GUI components that get their content from iText's PdfReader.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JTabbedPaneeditorTabsTabbed Pane containing other components.protected FormTreeformTreeview of the form.protected javax.swing.JTabbedPanenavigationTabsTabbed Pane containing other components.protected TreeNodeFactorynodesThe factory producing tree nodes.protected PdfObjectPanelobjectPanelA panel that will show PdfObjects.protected OutlineTreeoutlinesTreeview of the outlines.protected PagesTablepagesJTable with all the pages and their labels.protected PdfTreepdfTreeTreeview of the PDF file.protected StreamTextAreastreamAreaA panel that will show a stream.protected XRefTablexrefJTable corresponding with the CrossReference table.
-
Constructor Summary
Constructors Constructor Description PdfReaderController(javax.swing.event.TreeSelectionListener treeSelectionListener, PageNavigationListener pageNavigationListener)Constructs the PdfReaderController.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JTabbedPanegetEditorTabs()Getter for the tabs with the editor windows (to which the Console window will be added).javax.swing.JTabbedPanegetNavigationTabs()Getter for the tabs that allow you to navigate through the PdfTree quickly (pages, form, outlines, xref table).PdfObjectPanelgetObjectPanel()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).PdfTreegetPdfTree()Getter for the PDF Tree.StreamTextAreagetStreamArea()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(java.lang.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.voidrender(PdfObject object)Renders 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(java.util.Observable observable, java.lang.Object obj)Forwards updates from the RupsController to the Observers of this class.
-
-
-
Field Detail
-
pdfTree
protected PdfTree pdfTree
Treeview of the PDF file.
-
navigationTabs
protected javax.swing.JTabbedPane navigationTabs
Tabbed Pane containing other components.
-
pages
protected PagesTable pages
JTable with all the pages and their labels.
-
outlines
protected OutlineTree outlines
Treeview of the outlines.
-
form
protected FormTree form
Treeview of the form.
-
xref
protected XRefTable xref
JTable corresponding with the CrossReference table.
-
objectPanel
protected PdfObjectPanel objectPanel
A panel that will show PdfObjects.
-
editorTabs
protected javax.swing.JTabbedPane editorTabs
Tabbed Pane containing other components.
-
streamArea
protected StreamTextArea streamArea
A panel that will show a stream.
-
nodes
protected TreeNodeFactory nodes
The factory producing tree nodes.
-
-
Constructor Detail
-
PdfReaderController
public PdfReaderController(javax.swing.event.TreeSelectionListener treeSelectionListener, PageNavigationListener pageNavigationListener)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 eventpageNavigationListener- when somebody changes a page, this listener changes accordingly
-
-
Method Detail
-
getPdfTree
public PdfTree getPdfTree()
Getter for the PDF Tree.- Returns:
- the PdfTree object
-
getNavigationTabs
public javax.swing.JTabbedPane getNavigationTabs()
Getter for the tabs that allow you to navigate through the PdfTree quickly (pages, form, outlines, xref table).- Returns:
- a JTabbedPane
-
getObjectPanel
public PdfObjectPanel 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
public javax.swing.JTabbedPane getEditorTabs()
Getter for the tabs with the editor windows (to which the Console window will be added).
-
getStreamArea
public StreamTextArea getStreamArea()
Getter for the object that holds the TextArea with the content stream of a PdfStream object.- Returns:
- a StreamTextArea
-
startObjectLoader
public void startObjectLoader(PdfFile file)
Starts loading the PDF Objects in background.- Parameters:
file- the wrapper object that holds the PdfReader as member variable
-
notifyObservers
public void notifyObservers(java.lang.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. As soon as this is done, the GUI components are notified.- Overrides:
notifyObserversin classjava.util.Observable- Parameters:
obj- in this case the Object should be an ObjectLoader- See Also:
Observable.notifyObservers(java.lang.Object)
-
selectNode
public void selectNode(PdfObjectTreeNode node)
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
public void render(PdfObject object)
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.
-
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
public void update(java.util.Observable observable, java.lang.Object obj)Forwards updates from the RupsController to the Observers of this class.- Specified by:
updatein interfacejava.util.Observer- Parameters:
observable- this should be the RupsControllerobj- the object that has to be forwarded to the observers of PdfReaderController- See Also:
Observer.update(java.util.Observable, java.lang.Object)
-
-