Package com.lowagie.rups.controller
Class RupsController
- java.lang.Object
-
- java.util.Observable
-
- com.lowagie.rups.controller.RupsController
-
- All Implemented Interfaces:
PageNavigationListener,java.util.EventListener,javax.swing.event.TreeSelectionListener
public class RupsController extends java.util.Observable implements javax.swing.event.TreeSelectionListener, PageNavigationListener
This class controls all the GUI components that are shown in the Trapeze application: the menu bar, the panels,...
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JSplitPanemasterComponentContains all other components: the page panel, the outline tree, etc.protected RupsMenuBarmenuBarThe JMenuBar for the Trapeze application.protected PdfFilepdfFileThe Pdf file that is currently open in the application.protected PdfReaderControllerreaderObject with the GUI components for iText.protected PdfRendererControllerrendererObject with the GUI components for SUN's PDF Renderer.
-
Constructor Summary
Constructors Constructor Description RupsController(java.awt.Dimension dimension)Constructs the GUI components of the Trapeze application.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCurrentPageNumber()Returns the current page number of a document.java.awt.ComponentgetMasterComponent()Getter for the master component.RupsMenuBargetMenuBar()Getter for the menubar.static javax.swing.JScrollPanegetScrollPane(java.awt.Component component)Adds a component to a ScrollPane.intgetTotalNumberOfPages()Returns the total number of pages in a document.intgotoFirstPage()Goes to the first page in a document.intgotoLastPage()Goes to the last page in a document.intgotoNextPage()Goes to the previous page in a document.intgotoPage(int pageNumber)Goes to a specific page number in a document.intgotoPreviousPage()Goes to the previous page in a document.voidnotifyObservers(java.lang.Object obj)voidvalueChanged(javax.swing.event.TreeSelectionEvent evt)
-
-
-
Field Detail
-
pdfFile
protected PdfFile pdfFile
The Pdf file that is currently open in the application.
-
menuBar
protected RupsMenuBar menuBar
The JMenuBar for the Trapeze application.
-
masterComponent
protected javax.swing.JSplitPane masterComponent
Contains all other components: the page panel, the outline tree, etc.
-
renderer
protected PdfRendererController renderer
Object with the GUI components for SUN's PDF Renderer.
-
reader
protected PdfReaderController reader
Object with the GUI components for iText.
-
-
Method Detail
-
getMenuBar
public RupsMenuBar getMenuBar()
Getter for the menubar.
-
getMasterComponent
public java.awt.Component getMasterComponent()
Getter for the master component.
-
notifyObservers
public void notifyObservers(java.lang.Object obj)
- Overrides:
notifyObserversin classjava.util.Observable- See Also:
Observable.notifyObservers(java.lang.Object)
-
valueChanged
public void valueChanged(javax.swing.event.TreeSelectionEvent evt)
- Specified by:
valueChangedin interfacejavax.swing.event.TreeSelectionListener- See Also:
TreeSelectionListener.valueChanged(javax.swing.event.TreeSelectionEvent)
-
getCurrentPageNumber
public int getCurrentPageNumber()
Description copied from interface:PageNavigationListenerReturns the current page number of a document.- Specified by:
getCurrentPageNumberin interfacePageNavigationListener- Returns:
- the current page number.
- See Also:
PageNavigationListener.getCurrentPageNumber()
-
getTotalNumberOfPages
public int getTotalNumberOfPages()
Description copied from interface:PageNavigationListenerReturns the total number of pages in a document.- Specified by:
getTotalNumberOfPagesin interfacePageNavigationListener- Returns:
- the total number of pages in a document.
- See Also:
PageNavigationListener.getTotalNumberOfPages()
-
gotoFirstPage
public int gotoFirstPage()
Description copied from interface:PageNavigationListenerGoes to the first page in a document.- Specified by:
gotoFirstPagein interfacePageNavigationListener- Returns:
- the resulting page number. Can be different from 1 if the document is null
- See Also:
PageNavigationListener.gotoFirstPage()
-
gotoPreviousPage
public int gotoPreviousPage()
Description copied from interface:PageNavigationListenerGoes to the previous page in a document.- Specified by:
gotoPreviousPagein interfacePageNavigationListener- Returns:
- the resulting page number. Can be different from (current page - 1) if the document is null or the current page = 1.
- See Also:
PageNavigationListener.gotoPreviousPage()
-
gotoPage
public int gotoPage(int pageNumber)
Description copied from interface:PageNavigationListenerGoes to a specific page number in a document.- Specified by:
gotoPagein interfacePageNavigationListener- Returns:
- the resulting page number. Can be different from pageNumber if pageNumber doesn't exist.
- See Also:
PageNavigationListener.gotoPage(int)
-
gotoNextPage
public int gotoNextPage()
Description copied from interface:PageNavigationListenerGoes to the previous page in a document.- Specified by:
gotoNextPagein interfacePageNavigationListener- Returns:
- the resulting page number. Can be different from (current page + 1) if the document is null or the current page equals the total number of pages.
- See Also:
PageNavigationListener.gotoNextPage()
-
gotoLastPage
public int gotoLastPage()
Description copied from interface:PageNavigationListenerGoes to the last page in a document.- Specified by:
gotoLastPagein interfacePageNavigationListener- Returns:
- the resulting page number. Can be different from the total number of pages if the document is null
- See Also:
PageNavigationListener.gotoLastPage()
-
getScrollPane
public static javax.swing.JScrollPane getScrollPane(java.awt.Component component)
Adds a component to a ScrollPane.- Parameters:
component- the component that has to be scrollable- Returns:
- a JScrollPane
- Since:
- 2.1.0
-
-