com.icesoft.pdf.ri.common
Class SwingController

java.lang.Object
  extended bycom.icesoft.pdf.ri.common.SwingController
All Implemented Interfaces:
ActionListener, Controller, DropTargetListener, EventListener, FocusListener, ItemListener, KeyListener, PropertyChangeListener, TreeSelectionListener, WindowListener

public class SwingController
extends Object
implements Controller, ActionListener, FocusListener, ItemListener, TreeSelectionListener, WindowListener, DropTargetListener, KeyListener, PropertyChangeListener

SwingController is the meat of a PDF viewing application. It is the Controller aspect of the Model-View-Controller (MVC) framework.

SwingController acts as a bridge between a Swing user interface, as built by SwingViewerBuilder; the Document class, which is the root accessor to the PDF content; and the ViewerModel, which maintains the state of the user's perspective of said Document.

Since:
2.0
Author:
Mark Collette
See Also:
SwingViewBuilder, Document, ViewModel

Field Summary
static int CURSOR_CLOSE_HAND
           
static int CURSOR_DEFAULT
           
static int CURSOR_OPEN_HAND
           
static int CURSOR_SELECT
           
static int CURSOR_WAIT
           
static int CURSOR_ZOOM_IN
           
static int CURSOR_ZOOM_OUT
           
 
Constructor Summary
SwingController()
          Create a SwingController object, and its associated ViewerModel
SwingController(ResourceBundle messageBundle)
           
 
Method Summary
 void actionPerformed(ActionEvent event)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void closeDocument()
          Close the currently opened PDF Document.
 void dispose()
          Way to dispose of all memory references, and clean up the Document resources

Note: If you create several SwingControllers to manipulate a single Document, and each SwingController would be disposed of at a different time, while the others continue to use that same shared Document, then you should not call Document.dispose() inside of here.
 void doCommonZoomUIUpdates(boolean becauseOfValidFitMode)
           
 void dragEnter(DropTargetDragEvent event)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void dragExit(DropTargetEvent event)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void dragOver(DropTargetDragEvent event)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void drop(DropTargetDropEvent event)
          Handle drop event when a user drags and drops one or more files onto the viewer frame.
 void dropActionChanged(DropTargetDragEvent event)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void exit()
          If there is a WindowManagementCallback in place, then this will invoke its quit method
 void exportSVG()
          Utility method for exporting the current page of the Document to an SVG file.
 void exportText()
          Utility method for exporting all of a Document's text to a text file.
 void focusGained(FocusEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void focusLost(FocusEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void followOutlineItem(OutlineItem o)
          When the user selects an OutlineItem from the Outlines (Bookmarks) JTree, this displays the relevant target portion of the PDF Document
 Page getCurrentPage()
          Gives access to the current Page, as specified by the ViewerModel's current page index
 int getCurrentPageNumber()
          When viewing a PDF file, one or more pages may be viewed at a single time, but this is the single page which is most predominantly being displayed.
 Document getDocument()
          A Document is the root of the object hierarchy, giving access to the contents of a PDF file.
 DocumentViewController getDocumentViewController()
          Gets controller responsible for the page multiple page views.
 int getDocumentViewToolMode()
          Gets the current display tool value for the display panel.
 ResourceBundle getMessageBundle()
          Gets the message bundle used by this class.
 PageTree getPageTree()
          Gives access to the currently openned Document's Catalog's PageTree
 float getUserRotation()
          Each Page may have its own rotation, but on top of that, the user may select to have the Page further rotated, by 0, 90, 180, 270 degrees
 float getUserZoom()
          The Page being shown may be zoomed in or out, to show more detail, or provide an overview.
 JFrame getViewerFrame()
          Not all uses of SwingController would result in there existing a Viewer Frame, so this may well return null.
 ViewModel getViewModel()
          Gives access to this SwingController's ViewerModel
 WindowManagementCallback getWindowManagementCallback()
          The WindowManagementCallback is used for creating new Document windows, and quitting the application
 void goToDeltaPage(int delta)
          Adds delta to the ViewerModel's current page index, and updates the display to show the newly selected page.
 boolean isDocumentFitMode(int fitMode)
           
 boolean isDocumentViewMode(int viewMode)
           
 boolean isUtilityPaneVisible()
          If the utility pane is currently visible
 void itemStateChanged(ItemEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void keyPressed(KeyEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void keyReleased(KeyEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void keyTyped(KeyEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void openDocument(byte[] data, int offset, int length, String description, String pathOrURL)
          Opens a Document via the specified byte array.
 void openDocument(InputStream inputStream, String description, String pathOrURL)
          Opens a Document via the specified InputStream.
 void openDocument(String pathname)
          Open a file specified by the given path name.
 void openDocument(URL location)
          Open a URL specifed by the location variable.
 void openFile()
          Utility method for opening a file.
 void openURL()
          Utility method for opening a URL.
 void print(boolean withDialog)
          If the withDialog parameter is true, show a print dialog, defaulted to print all pages.
 void propertyChange(PropertyChangeEvent evt)
           
 void rotateLeft()
          Rotates the page visualization by 90 degrees in a counter-clockwise direction.
 void rotateRight()
          Rotates the page visualization by 90 degrees in a clockwise direction.
 void saveFile()
          Utility method for saving a copy of the currently opened PDF to a file.
 void setAboutMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setBringAllToFrontMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setCloseMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setCompleteToolBar(JToolBar toolbar)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setCurrentPageNumberTextField(JTextField textField)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setDisplayTool(int argToolName)
          Sets the display tool used when the document is viewed in interactive mode.
 void setDocumentToolMode(int toolType)
           
 void setExitMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setExportSVGMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setExportTextMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFirstPageButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFirstPageMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFitActualSizeButton(JToggleButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFitActualSizeMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFitHeightButton(JToggleButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFitPageMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFitWidthButton(JToggleButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setFitWidthMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setGoToPageMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setInformationMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setIsEmbeddedComponent(boolean embeddableComponent)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setLastPageButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setLastPageMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setMinimiseAllMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setNextPageButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setNextPageMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setNumberOfPagesLabel(JLabel lbl)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setOpenFileButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setOpenFileMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setOpenURLMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setOutlineComponents(JTree tree, JScrollPane scroll)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPageFitMode(int fitMode, boolean refresh)
          Set the ViewerModel's fit setting to fit the whole page, and update the display
 void setPageViewFacingPageConButton(JToggleButton btn)
           
 void setPageViewFacingPageNonConButton(JToggleButton btn)
           
 void setPageViewMode(int viewMode, boolean refresh)
           
 void setPageViewSinglePageConButton(JToggleButton btn)
           
 void setPageViewSinglePageNonConButton(JToggleButton btn)
           
 void setPanToolButton(JToggleButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPermissionsMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPreviousPageButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPreviousPageMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPrintButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPrintMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setPrintSetupMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setRotateLeftButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setRotateLeftMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setRotateRightButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setRotateRightMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setSaveAsFileButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setSaveAsFileMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setSearchButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setSearchMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setSearchPanel(SearchPanel sp)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setShowHideToolBarMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setShowHideUtilityPaneButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setShowHideUtilityPaneMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setStatusLabel(JLabel lbl)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setToolBarVisible(boolean show)
          Sets the visibility of the toolbar
 void setUtilityAndDocumentSplitPane(JSplitPane splitpane)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setUtilityPaneVisible(boolean visible)
          Makes the component visible or invisible.
 void setUtilityTabbedPane(JTabbedPane util)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setViewerFrame(JFrame v)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setWindowListMenuItems(List menuItems)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setWindowManagementCallback(WindowManagementCallback wm)
          The WindowManagementCallback is used for creating new Document windows, and quitting the application
 void setZoom(float zoom)
          Zoom to a new zoom level, without centering on any new specific point
 void setZoomComboBox(JComboBox zcb, float[] zl)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setZoomInButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setZoomInMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setZoomInToolButton(JToggleButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setZoomOutButton(JButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setZoomOutMenuItem(JMenuItem mi)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void setZoomOutToolButton(JToggleButton btn)
          Called by SwingViewerBuilder, so that SwingController can setup event handling
 void showAboutDialog()
          Show the About dialog.
 void showDocumentInformationDialog()
          Show information about the PDF file's Document, such as the title, subject, author, keywords, creator, producer, creation date, and last modification date
 void showDocumentPermissionsDialog()
          Show the permissions set in the PDF file's Document, as relates to encryption, altering, or extracting information from, the Document
 void showPage(int nPage)
          Sets the ViewerModel's current page index, and updates the display to show the newly selected page
 void showPageFromTextField()
          Takes the page number that the user has typed into the text field, converts it into a page index, and then displays that page
 void showPageSelectionDialog()
          Show a dialog, listing every page in the PDF Document, for the user to select which page to show.
 void showPrintSetupDialog()
          Show a print setup dialog, to alter the ViewerModel's PageFormat
 void showSearchPanel()
          Make the Search pane visible, and if necessary, the utility pane that encloses it
 void toggleToolBarVisibility()
          Flips the visibility of the toolbar to the opposite of what it was
 void toggleUtilityPaneVisibility()
          Flips the visibility of the utility pane to the opposite of what it was
 void updateDocumentView()
           
 void valueChanged(TreeSelectionEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowActivated(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowClosed(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowClosing(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowDeactivated(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowDeiconified(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowIconified(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void windowOpened(WindowEvent e)
          SwingController takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
 void zoomIn()
          Increases the current page visualization zoom factor by 20%.
 void zoomOut()
          Decreases the current page visualization zoom factor by 20%.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURSOR_OPEN_HAND

public static final int CURSOR_OPEN_HAND
See Also:
Constant Field Values

CURSOR_CLOSE_HAND

public static final int CURSOR_CLOSE_HAND
See Also:
Constant Field Values

CURSOR_ZOOM_IN

public static final int CURSOR_ZOOM_IN
See Also:
Constant Field Values

CURSOR_ZOOM_OUT

public static final int CURSOR_ZOOM_OUT
See Also:
Constant Field Values

CURSOR_WAIT

public static final int CURSOR_WAIT
See Also:
Constant Field Values

CURSOR_SELECT

public static final int CURSOR_SELECT
See Also:
Constant Field Values

CURSOR_DEFAULT

public static final int CURSOR_DEFAULT
See Also:
Constant Field Values
Constructor Detail

SwingController

public SwingController()
Create a SwingController object, and its associated ViewerModel

See Also:
ViewModel

SwingController

public SwingController(ResourceBundle messageBundle)
Method Detail

getDocumentViewController

public DocumentViewController getDocumentViewController()
Gets controller responsible for the page multiple page views.

Returns:
page view controller.

getMessageBundle

public ResourceBundle getMessageBundle()
Gets the message bundle used by this class. Message bundle resources are loaded via the JVM default locale.

Returns:
message bundle used by this class.

setWindowManagementCallback

public void setWindowManagementCallback(WindowManagementCallback wm)
The WindowManagementCallback is used for creating new Document windows, and quitting the application

Parameters:
wm - The new WindowManagementCallback
See Also:
getWindowManagementCallback()

getWindowManagementCallback

public WindowManagementCallback getWindowManagementCallback()
The WindowManagementCallback is used for creating new Document windows, and quitting the application

Returns:
The current WindowManagementCallback
See Also:
setWindowManagementCallback(com.icesoft.pdf.ri.common.WindowManagementCallback)

setOpenFileMenuItem

public void setOpenFileMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setOpenURLMenuItem

public void setOpenURLMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setCloseMenuItem

public void setCloseMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setSaveAsFileMenuItem

public void setSaveAsFileMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setExportTextMenuItem

public void setExportTextMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setExportSVGMenuItem

public void setExportSVGMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPermissionsMenuItem

public void setPermissionsMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setInformationMenuItem

public void setInformationMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPrintSetupMenuItem

public void setPrintSetupMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPrintMenuItem

public void setPrintMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setExitMenuItem

public void setExitMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFitActualSizeMenuItem

public void setFitActualSizeMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFitPageMenuItem

public void setFitPageMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFitWidthMenuItem

public void setFitWidthMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomInMenuItem

public void setZoomInMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomOutMenuItem

public void setZoomOutMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setRotateLeftMenuItem

public void setRotateLeftMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setRotateRightMenuItem

public void setRotateRightMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setShowHideToolBarMenuItem

public void setShowHideToolBarMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setShowHideUtilityPaneMenuItem

public void setShowHideUtilityPaneMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFirstPageMenuItem

public void setFirstPageMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPreviousPageMenuItem

public void setPreviousPageMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setNextPageMenuItem

public void setNextPageMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setLastPageMenuItem

public void setLastPageMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setSearchMenuItem

public void setSearchMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setGoToPageMenuItem

public void setGoToPageMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setMinimiseAllMenuItem

public void setMinimiseAllMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setBringAllToFrontMenuItem

public void setBringAllToFrontMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setWindowListMenuItems

public void setWindowListMenuItems(List menuItems)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setAboutMenuItem

public void setAboutMenuItem(JMenuItem mi)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setOpenFileButton

public void setOpenFileButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setSaveAsFileButton

public void setSaveAsFileButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPrintButton

public void setPrintButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setSearchButton

public void setSearchButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setShowHideUtilityPaneButton

public void setShowHideUtilityPaneButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFirstPageButton

public void setFirstPageButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPreviousPageButton

public void setPreviousPageButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setNextPageButton

public void setNextPageButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setLastPageButton

public void setLastPageButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setCurrentPageNumberTextField

public void setCurrentPageNumberTextField(JTextField textField)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setNumberOfPagesLabel

public void setNumberOfPagesLabel(JLabel lbl)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomOutButton

public void setZoomOutButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomComboBox

public void setZoomComboBox(JComboBox zcb,
                            float[] zl)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomInButton

public void setZoomInButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFitActualSizeButton

public void setFitActualSizeButton(JToggleButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFitHeightButton

public void setFitHeightButton(JToggleButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setFitWidthButton

public void setFitWidthButton(JToggleButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setRotateLeftButton

public void setRotateLeftButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setRotateRightButton

public void setRotateRightButton(JButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setPanToolButton

public void setPanToolButton(JToggleButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomInToolButton

public void setZoomInToolButton(JToggleButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setZoomOutToolButton

public void setZoomOutToolButton(JToggleButton btn)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setCompleteToolBar

public void setCompleteToolBar(JToolBar toolbar)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setOutlineComponents

public void setOutlineComponents(JTree tree,
                                 JScrollPane scroll)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setSearchPanel

public void setSearchPanel(SearchPanel sp)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setUtilityTabbedPane

public void setUtilityTabbedPane(JTabbedPane util)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setIsEmbeddedComponent

public void setIsEmbeddedComponent(boolean embeddableComponent)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setUtilityAndDocumentSplitPane

public void setUtilityAndDocumentSplitPane(JSplitPane splitpane)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setStatusLabel

public void setStatusLabel(JLabel lbl)
Called by SwingViewerBuilder, so that SwingController can setup event handling


setViewerFrame

public void setViewerFrame(JFrame v)
Called by SwingViewerBuilder, so that SwingController can setup event handling


getViewerFrame

public JFrame getViewerFrame()
Not all uses of SwingController would result in there existing a Viewer Frame, so this may well return null.


getDocumentViewToolMode

public int getDocumentViewToolMode()
Gets the current display tool value for the display panel.

Returns:
constant representing the state of the display tool for the display panel.
See Also:
setDisplayTool(int)

setDisplayTool

public void setDisplayTool(int argToolName)
Sets the display tool used when the document is viewed in interactive mode. A display changes the icon of the mouse when it is over the panel that displays a document page. There are currently four possible tool modes:

See Also:
getDocumentViewToolMode()

openFile

public void openFile()
Utility method for opening a file. Shows a dialog for the user to select which file to open.


openDocument

public void openDocument(String pathname)
Open a file specified by the given path name.

Parameters:
pathname - String representing a valid file path

openURL

public void openURL()
Utility method for opening a URL. Shows a dialog for the user to type what URL to open.


openDocument

public void openDocument(URL location)
Open a URL specifed by the location variable.

Parameters:
location - location of a valid PDF document

openDocument

public void openDocument(InputStream inputStream,
                         String description,
                         String pathOrURL)
Opens a Document via the specified InputStream. This method is a convenience method provided for backwards compatibility.

Note: This method is less efficient than openDocument(String pathname) or openDocument(URL location) as it may have to do intermediary data copying, using more memory.

Parameters:
inputStream - InputStream containing a valid PDF document.
description - When in the GUI for describing this document.
pathOrURL - Either a file path, or file name, or URL, describing the origin of the PDF file. This is typically null. If non-null, it is used to populate the default file name in the File..Save a Copy dialog summoned in saveFile()

openDocument

public void openDocument(byte[] data,
                         int offset,
                         int length,
                         String description,
                         String pathOrURL)
Opens a Document via the specified byte array.

Parameters:
data - Byte array containing a valid PDF document.
offset - the index into the byte array where the PDF data begins
length - the number of bytes in the byte array belonging to the PDF data
description - When in the GUI for describing this document.
pathOrURL - Either a file path, or file name, or URL, describing the origin of the PDF file. This is typically null. If non-null, it is used to popu