## 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
`protected javax.swing.JSplitPane` `masterComponent` Contains all other components: the page panel, the outline tree, etc.
`protected RupsMenuBar` `menuBar` The JMenuBar for the Trapeze application.
`protected PdfFile` `pdfFile` The Pdf file that is currently open in the application.
`protected PdfReaderController` `reader` Object with the GUI components for iText.
`protected PdfRendererController` `renderer` Object with the GUI components for SUN's PDF Renderer.

Constructor Summary
`RupsController(java.awt.Dimension dimension)` Constructs the GUI components of the Trapeze application.

Method Summary
`int` `getCurrentPageNumber()` Returns the current page number of a document.
`java.awt.Component` `getMasterComponent()` Getter for the master component.
`RupsMenuBar` `getMenuBar()` Getter for the menubar.
`static javax.swing.JScrollPane` `getScrollPane(java.awt.Component component)` Adds a component to a ScrollPane.
`int` `getTotalNumberOfPages()` Returns the total number of pages in a document.
`int` `gotoFirstPage()` Goes to the first page in a document.
`int` `gotoLastPage()` Goes to the last page in a document.
`int` `gotoNextPage()` Goes to the previous page in a document.
`int` `gotoPage(int pageNumber)` Goes to a specific page number in a document.
`int` `gotoPreviousPage()` Goes to the previous page in a document.
`void` `notifyObservers(java.lang.Object obj)`
`void` `valueChanged(javax.swing.event.TreeSelectionEvent evt)`

Methods inherited from class java.util.Observable
`addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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.

Constructor Detail

### RupsController

    public RupsController(java.awt.Dimension dimension)

  Constructs the GUI components of the Trapeze application.

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:
    `notifyObservers` in class `java.util.Observable`
  See Also:
    `Observable.notifyObservers(java.lang.Object)`

### valueChanged

    public void valueChanged(javax.swing.event.TreeSelectionEvent evt)

  Specified by:
    `valueChanged` in interface `javax.swing.event.TreeSelectionListener`
  See Also:
    `TreeSelectionListener.valueChanged(javax.swing.event.TreeSelectionEvent)`

### getCurrentPageNumber

    public int getCurrentPageNumber()

  Description copied from interface: `PageNavigationListener`
  Returns the current page number of a document.

  Specified by:
    `getCurrentPageNumber` in interface `PageNavigationListener`
  Returns:
    the current page number.
  See Also:
    `PageNavigationListener.getCurrentPageNumber()`

### getTotalNumberOfPages

    public int getTotalNumberOfPages()

  Description copied from interface: `PageNavigationListener`
  Returns the total number of pages in a document.

  Specified by:
    `getTotalNumberOfPages` in interface `PageNavigationListener`
  Returns:
    the total number of pages in a document.
  See Also:
    `PageNavigationListener.getTotalNumberOfPages()`

### gotoFirstPage

    public int gotoFirstPage()

  Description copied from interface: `PageNavigationListener`
  Goes to the first page in a document.

  Specified by:
    `gotoFirstPage` in interface `PageNavigationListener`
  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: `PageNavigationListener`
  Goes to the previous page in a document.

  Specified by:
    `gotoPreviousPage` in interface `PageNavigationListener`
  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: `PageNavigationListener`
  Goes to a specific page number in a document.

  Specified by:
    `gotoPage` in interface `PageNavigationListener`
  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: `PageNavigationListener`
  Goes to the previous page in a document.

  Specified by:
    `gotoNextPage` in interface `PageNavigationListener`
  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: `PageNavigationListener`
  Goes to the last page in a document.

  Specified by:
    `gotoLastPage` in interface `PageNavigationListener`
  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

Hosted by Hostbasket