Class SwingController

    • Constructor Detail

      • SwingController

        public SwingController()
        Create a Controller object, and its associated ViewerModel
        See Also:
        ViewModel
      • SwingController

        public SwingController​(ResourceBundle currentMessageBundle)
    • Method Detail

      • setDocumentViewController

        public void setDocumentViewController​(DocumentViewControllerImpl documentViewController)
        Sets a custom document view controller. Previously constructed documentView controllers are unregistered from the propertyChangeListener, the provided controller will be registered with the propertyChangeListener.
        Parameters:
        documentViewController - new document controller.
      • getMessageBundle

        public ResourceBundle getMessageBundle()
        Gets the message bundle used by this class. Message bundle resources are loaded via the JVM default locale.
        Specified by:
        getMessageBundle in interface Controller
        Returns:
        message bundle used by this class.
      • setPropertiesManager

        public void setPropertiesManager​(ViewerPropertiesManager propertiesManager)
        Called by SwingViewerBuilder, so that Controller has access to all properties
        Parameters:
        propertiesManager - current properties manager instance.
      • getPropertiesManager

        public ViewerPropertiesManager getPropertiesManager()
        Gets an instance of the PropertiesManager so that other builders can use the properties manager.
        Specified by:
        getPropertiesManager in interface Controller
        Returns:
        currently properties manager instance.
      • setOpenFileMenuItem

        public void setOpenFileMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setRecentFilesSubMenu

        public void setRecentFilesSubMenu​(JMenu mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setOpenURLMenuItem

        public void setOpenURLMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setCloseMenuItem

        public void setCloseMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setSaveFileMenuItem

        public void setSaveFileMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setSaveAsFileMenuItem

        public void setSaveAsFileMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setExportDocumentFileMenuItem

        public void setExportDocumentFileMenuItem​(JMenuItem mi)
      • setSendMailMenuItem

        public void setSendMailMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setExportTextMenuItem

        public void setExportTextMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setPermissionsMenuItem

        public void setPermissionsMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setPropertiesMenuItem

        public void setPropertiesMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setInformationMenuItem

        public void setInformationMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setFontInformationMenuItem

        public void setFontInformationMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setPrintSetupMenuItem

        public void setPrintSetupMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setPrintMenuItem

        public void setPrintMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setExitMenuItem

        public void setExitMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setUndoMenuItem

        public void setUndoMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setReduMenuItem

        public void setReduMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setCopyMenuItem

        public void setCopyMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setCopyContextMenuItem

        public void setCopyContextMenuItem​(JMenuItem mi)
      • setDeleteMenuItem

        public void setDeleteMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setSelectAllMenuItem

        public void setSelectAllMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setDeselectAllMenuItem

        public void setDeselectAllMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setPreferencesMenuItem

        public void setPreferencesMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setFitActualSizeMenuItem

        public void setFitActualSizeMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setInsertOutlineMenuItem

        public void setInsertOutlineMenuItem​(JMenuItem mi)
      • setFitPageMenuItem

        public void setFitPageMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setFitWidthMenuItem

        public void setFitWidthMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setFullScreenMenuItem

        public void setFullScreenMenuItem​(JMenuItem mi)
      • setZoomInMenuItem

        public void setZoomInMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setZoomOutMenuItem

        public void setZoomOutMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setRotateLeftMenuItem

        public void setRotateLeftMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setRotateRightMenuItem

        public void setRotateRightMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setShowHideToolBarMenuItem

        public void setShowHideToolBarMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setShowHideUtilityPaneMenuItem

        public void setShowHideUtilityPaneMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setFirstPageMenuItem

        public void setFirstPageMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setPreviousPageMenuItem

        public void setPreviousPageMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setNextPageMenuItem

        public void setNextPageMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setLastPageMenuItem

        public void setLastPageMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setSearchMenuItem

        public void setSearchMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setAdvancedSearchMenuItem

        public void setAdvancedSearchMenuItem​(JMenuItem mi)
        Called by SwingViewerbuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setSearchNextMenuItem

        public void setSearchNextMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setSearchPreviousMenuItem

        public void setSearchPreviousMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setGoToPageMenuItem

        public void setGoToPageMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setMinimiseAllMenuItem

        public void setMinimiseAllMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setBringAllToFrontMenuItem

        public void setBringAllToFrontMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setAnnotationPreviewMenuItem

        public void setAnnotationPreviewMenuItem​(JMenuItem mi)
      • setWindowListMenuItems

        public void setWindowListMenuItems​(List menuItems)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        menuItems - menu item of opened windows.
      • setAboutMenuItem

        public void setAboutMenuItem​(JMenuItem mi)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        mi - menu item to assign
      • setOpenFileButton

        public void setOpenFileButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setSaveFileButton

        public void setSaveFileButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setPrintButton

        public void setPrintButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setSearchButton

        public void setSearchButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setShowHideUtilityPaneButton

        public void setShowHideUtilityPaneButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setShowAnnotationUtilityPaneButton

        public void setShowAnnotationUtilityPaneButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setShowBookmarkUtilityPaneButton

        public void setShowBookmarkUtilityPaneButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFirstPageButton

        public void setFirstPageButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setPreviousPageButton

        public void setPreviousPageButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setNextPageButton

        public void setNextPageButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLastPageButton

        public void setLastPageButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setCurrentPageNumberTextField

        public void setCurrentPageNumberTextField​(JTextField textField)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        textField - current page number text field value.
      • setNumberOfPagesLabel

        public void setNumberOfPagesLabel​(JLabel lbl)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        lbl - number of pages label.
      • setZoomOutButton

        public void setZoomOutButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setZoomComboBox

        public void setZoomComboBox​(JComboBox<String> zcb,
                                    float[] zl)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        zcb - zoom level combo box values.
        zl - default zoom level.
      • setZoomInButton

        public void setZoomInButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setAnnotationPermissionComboBox

        public void setAnnotationPermissionComboBox​(JComboBox<String> zcb)
      • setFitActualSizeButton

        public void setFitActualSizeButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFitHeightButton

        public void setFitHeightButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFitWidthButton

        public void setFitWidthButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFullScreenButton

        public void setFullScreenButton​(JButton btn)
      • setRotateLeftButton

        public void setRotateLeftButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setRotateRightButton

        public void setRotateRightButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setPanToolButton

        public void setPanToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setZoomInToolButton

        public void setZoomInToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setTextSelectToolButton

        public void setTextSelectToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setSelectToolButton

        public void setSelectToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLinkAnnotationToolButton

        public void setLinkAnnotationToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setStrikeOutAnnotationToolButton

        public void setStrikeOutAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setUnderlineAnnotationToolButton

        public void setUnderlineAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLineAnnotationToolButton

        public void setLineAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLineArrowAnnotationToolButton

        public void setLineArrowAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setSquareAnnotationToolButton

        public void setSquareAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setCircleAnnotationToolButton

        public void setCircleAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setInkAnnotationToolButton

        public void setInkAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFreeTextAnnotationToolButton

        public void setFreeTextAnnotationToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setAnnotationSummaryButton

        public void setAnnotationSummaryButton​(JButton btn)
      • setAnnotationEditingModeToolButton

        public void setAnnotationEditingModeToolButton​(JToggleButton btn)
      • setDeleteAllButton

        public void setDeleteAllButton​(JButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLinkAnnotationPropertiesToolButton

        public void setLinkAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setHighlightAnnotationToolButton

        public void setHighlightAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setRedactionAnnotationToolButton

        public void setRedactionAnnotationToolButton​(JToggleButton btn)
      • setSignatureAnnotationToolButton

        public void setSignatureAnnotationToolButton​(JToggleButton btn)
      • setHighlightAnnotationPropertiesToolButton

        public void setHighlightAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setStrikeOutAnnotationPropertiesToolButton

        public void setStrikeOutAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setUnderlineAnnotationPropertiesToolButton

        public void setUnderlineAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLineAnnotationPropertiesToolButton

        public void setLineAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setLineArrowAnnotationPropertiesToolButton

        public void setLineArrowAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setSquareAnnotationPropertiesToolButton

        public void setSquareAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setCircleAnnotationPropertiesToolButton

        public void setCircleAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setInkAnnotationPropertiesToolButton

        public void setInkAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFreeTextAnnotationPropertiesToolButton

        public void setFreeTextAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setTextAnnotationToolButton

        public void setTextAnnotationToolButton​(AnnotationColorToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setFormHighlightButton

        public void setFormHighlightButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling for the form highlight button.
        Parameters:
        btn - button to assign
      • setQuickSearchToolBar

        public void setQuickSearchToolBar​(JToolBar toolBar)
        Called by SwingViewerBuilder, so that Controller can setup enabled/disabled state
        Parameters:
        toolBar - toolBar to assign
      • setTextAnnotationPropertiesToolButton

        public void setTextAnnotationPropertiesToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setZoomDynamicToolButton

        public void setZoomDynamicToolButton​(JToggleButton btn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        btn - button to assign
      • setCompleteToolBar

        public void setCompleteToolBar​(JToolBar toolbar)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        toolbar - assignment of complete toolbar.
      • setOutlineComponents

        public void setOutlineComponents​(JTree tree,
                                         JScrollPane scroll)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        tree - outline tree component
        scroll - outline scroll parent.
      • getOutlineTree

        public JTree getOutlineTree()
      • setSearchPanel

        public void setSearchPanel​(SearchPanel sp)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        sp - search panel
      • setAttachmentPanel

        public void setAttachmentPanel​(AttachmentPanel atp)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        atp - attachment panel
      • setThumbnailsPanel

        public void setThumbnailsPanel​(ThumbnailsPanel tn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        tn - thumbnails panel.
      • setLayersPanel

        public void setLayersPanel​(LayersPanel tn)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        tn - layers panel.
      • setAnnotationPanel

        public void setAnnotationPanel​(AnnotationPanel lp)
      • setUtilityTabbedPane

        public void setUtilityTabbedPane​(JTabbedPane util)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        util - utility tabbed pane.
      • setIsEmbeddedComponent

        public void setIsEmbeddedComponent​(boolean embeddableComponent)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        embeddableComponent - indicates usage of component viewer.
      • setUtilityAndDocumentSplitPane

        public void setUtilityAndDocumentSplitPane​(JSplitPane splitPane)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        splitPane - main split pain that divides utility from page view pane.
      • setStatusLabel

        public void setStatusLabel​(JLabel lbl)
        Called by SwingViewerBuilder, so that Controller can setup event handling
        Parameters:
        lbl - status label value.
      • setViewerFrame

        public void setViewerFrame​(Frame v)
        Called by SwingViewerBuilder, so that Controller can setup event handling.
        Parameters:
        v - paren view frame.
      • getViewerFrame

        public Frame getViewerFrame()
        Not all uses of Controller would result in there existing a Viewer Frame, so this may well return null.
        Specified by:
        getViewerFrame in interface Controller
        Returns:
        parent frame if one.
      • isPdfCollection

        public boolean isPdfCollection()
        Tests to see if the PDF document is a collection and should be treated as such.
        Returns:
        true if PDF collection otherwise false.
      • reflectStateInComponents

        protected void reflectStateInComponents()
        Utility method to set the state of all the different GUI elements. Mainly to enable/disable the GUI elements when a file is opened/closed respectively.
      • havePermissionToPrint

        public boolean havePermissionToPrint()
        Description copied from interface: Controller
        Check to see if document has permission to be printed.
        Specified by:
        havePermissionToPrint in interface Controller
        Returns:
        true if content printing should be allowed.
      • havePermissionToExtractContent

        public boolean havePermissionToExtractContent()
        Description copied from interface: Controller
        Check to see if document has permission to extract content.
        Specified by:
        havePermissionToExtractContent in interface Controller
        Returns:
        true if content extraction should be limited.
      • havePermissionToModifyDocument

        public boolean havePermissionToModifyDocument()
        Description copied from interface: Controller
        Check to see if document can be modified.
        Specified by:
        havePermissionToModifyDocument in interface Controller
        Returns:
        true if content editing is allowed.
      • setEnabled

        protected void setEnabled​(JComponent comp,
                                  boolean ena)
      • reflectUndoCommands

        public void reflectUndoCommands()
        Method to determine if the Undo and Redo menu items can be enabled This will query the UndoCaretaker for the status of the queue first
      • 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:
        • DISPLAY_TOOL_PAN - Changes the mouse icon to a hand and allows the user to click and drag the document view (Pan). This pan feature is only available when the display window has scrollbars.
        • DISPLAY_TOOL_ZOOM_IN - Changes the mouse icon to a magnifying glass and adds a left mouse click listener to the display panel. One left mouse click increases the zoom factor by 20%.
        • DISPLAY_TOOL_ZOOM_OUT - Changes the mouse icon to a magnifying glass and adds a left mouse click listener to the display panel. One left mouse click decreases the zoom factor by 20%.
        • DISPLAY_TOOL_NONE - Changes the mouse icon to the default icon and removes mouse properties from the display panel.
        Parameters:
        argToolName - DocumentViewModel tool name.
        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.
      • openFile

        public void openFile​(String initialDirPath)
        Utility method for opening a file. Shows a dialog for the user to select which file to open.
        Parameters:
        initialDirPath - The directory to show to the user when opening the FileDialog
      • openFileInSomeViewer

        public void openFileInSomeViewer​(String filename)
        Description copied from interface: Controller
        Opens the specified file in a new window if the window manager is present. If not the current document is closed and this path opened.
        Specified by:
        openFileInSomeViewer in interface Controller
        Parameters:
        filename - file name to open.
      • addRecentFileEntry

        protected void addRecentFileEntry​(Path path)
        Adds the recently opened file to the "Recently Opened" file list.
        Parameters:
        path - path to be added to recent files list.
      • refreshRecentFileMenuItem

        protected void refreshRecentFileMenuItem()
        Builds out the recent file list and assembles the menuItems.
      • setupSecurityHandler

        protected void setupSecurityHandler​(Document document,
                                            SecurityCallback securityCallback)
        Setup the security handle if specified, if not then creates and uses the default implementation.
        Parameters:
        document - document to set securityCallback on .
        securityCallback - security callback for prompting users or owner passwords.
      • openDocument

        public void openDocument​(String pathname)
        Open a file specified by the given path name.
        Specified by:
        openDocument in interface Controller
        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 specified by the location variable.
        Specified by:
        openDocument in interface Controller
        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) or openDocument(URL) as it may have to do intermediary data copying, using more memory.

        Specified by:
        openDocument in interface Controller
        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​(Document embeddedDocument,
                                 String fileName)
        Load the specified file in a new Viewer RI window.
        Specified by:
        openDocument in interface Controller
        Parameters:
        embeddedDocument - document to load in ne window
        fileName - file name of the document in question
      • openDocument

        public void openDocument​(byte[] data,
                                 int offset,
                                 int length,
                                 String description,
                                 String pathOrURL)
        Opens a Document via the specified byte array.
        Specified by:
        openDocument in interface Controller
        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 populate the default file name in the File..Save a Copy dialog summoned in saveFile()
      • commonNewDocumentHandling

        public void commonNewDocumentHandling​(String fileDescription)
      • closeDocument

        public void closeDocument()
        Close the currently opened PDF Document. The toolbar component's states are also changed to their default values and made inactive.

        Note: If you create several SwingControllers to manipulate a single Document, and each Controller 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, or alternatively implement reference counting, so that only the last Controller would call Document.dispose()
        See Also:
        Document
      • dispose

        public 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 Controller 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. Alternatively, implement reference counting, so that only the last Controller would call Document.dispose()
        Specified by:
        dispose in interface Controller
      • saveFile

        public void saveFile()
        Utility method for saving the current document to the same filename. As it's not possible to write to the file while the document is open, a temp file is created and this file will be renamed to the current open file when the window is closed.
        Specified by:
        saveFile in interface Controller
      • saveFileAs

        public void saveFileAs()
        Utility method for saving a copy of the currently opened PDF to a file. This will check all valid permissions and show a file save dialog for the user to select where to save the file to, and what name to give it.
        Specified by:
        saveFileAs in interface Controller
      • exportDocument

        public void exportDocument()
        Utility method for saving a document using a full document write. The file will be rewritten and indexed. All deleted objects will be removed. Any incremental updates will be flattened and only the current object version will be written. No previous document state will persist. A save dialog will be shown will not be possible to overwrite the original document.
      • hasUnburnedRedactions

        protected boolean hasUnburnedRedactions()
      • showRedactionWarningDialog

        protected int showRedactionWarningDialog()
      • generateNewSaveName

        protected String generateNewSaveName​(String fileName)
        Generates a file name based on the original file name but appends "-new". If new file extension exists a ".pdf" is automatically added.
        Parameters:
        fileName - file name that new file name is derived from.
        Returns:
        original file name with the "-new" appended to it.
      • enableUtilityTabbedPanel

        protected void enableUtilityTabbedPanel​(JComponent tabbedPanel)
      • exportText

        public void exportText()
        Utility method for exporting all of a Document's text to a text file. Shows a file save dialog for the user to select where to save the exported text file to, and what name to give that file.
      • toggleToolBarVisibility

        public void toggleToolBarVisibility()
        Flips the visibility of the toolbar to the opposite of what it was
        See Also:
        setToolBarVisible(boolean)
      • setToolBarVisible

        public void setToolBarVisible​(boolean show)
        Sets the visibility of the toolbar
        Parameters:
        show - The new visibility of the toolbar
      • showAboutDialog

        public void showAboutDialog()
        Show the About dialog. Subclasses may override this method to show an alternate About dialog
      • showDocumentPermissionsDialog

        public void showDocumentPermissionsDialog()
        Show the permissions set in the PDF file's Document, as relates to encryption, altering, or extracting information from, the Document
      • showDocumentInformationDialog

        public 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
      • showDocumentFontDialog

        public void showDocumentFontDialog()
        Show document font information.
      • showDocumentProperties

        public void showDocumentProperties()
        Show tabbed pane interface for document properties, info, security and fonts.
      • showViewerPreferences

        public void showViewerPreferences()
        Show tabbed pane interface for viewer preferences, info, security and fonts.
      • showViewerPreferences

        public void showViewerPreferences​(String selectedPreference)
        Show tabbed pane interface for viewer preferences, info, security and fonts.
        Specified by:
        showViewerPreferences in interface Controller
        Parameters:
        selectedPreference - tab to select, PropertiesManager.PROPERTY_SHOW_PREFERENCES_GENERAL
      • showAnnotationProperties

        public void showAnnotationProperties​(AnnotationComponent annotationComponent)
        Show tabbed pane interface for annotation properties.
        Specified by:
        showAnnotationProperties in interface Controller
        Parameters:
        annotationComponent - annotation to show properties of.
      • showAnnotationProperties

        public void showAnnotationProperties​(AnnotationComponent annotationComponent,
                                             Frame frame)
        Show tabbed pane interface for annotation properties centered on the given frame
        Specified by:
        showAnnotationProperties in interface Controller
        Parameters:
        annotationComponent - annotation to show properties of.
        frame - parent frame for centering dialog.
      • initializeOutline

        protected void initializeOutline()
      • showPrintSetupDialog

        public void showPrintSetupDialog()
        Show a print setup dialog, to alter the ViewerModel's PageFormat
        See Also:
        ViewModel
      • setPrintDefaultMediaSizeName

        public void setPrintDefaultMediaSizeName​(MediaSizeName mediaSize)
        Sets the default MediaSizeName and creates an new instance of the the PrintHelp with the new media size. The media size is also persisted to the PropertiesManager.
        Note: this method should only be called after a valid file or file stream has been loaded by the controller otherwise a null pointer will result.
        Parameters:
        mediaSize - MediaSizeName constant of paper size to print to.
      • print

        public void print​(boolean withDialog)
        Description copied from interface: Controller
        Print the given document
        Specified by:
        print in interface Controller
        Parameters:
        withDialog - If should show a print dialog before starting to print
      • printAndExit

        public void printAndExit​(boolean showDialog,
                                 String printer)
        Description copied from interface: Controller
        Prints the document with the given printer, assuming we're exiting after that
        Specified by:
        printAndExit in interface Controller
        Parameters:
        showDialog - If true show a print dialog before starting to print
        printer - The name of the printer
      • showPageFromTextField

        public 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
      • zoomIn

        public void zoomIn()
        Increases the current page visualization zoom factor by 20%.
      • zoomOut

        public void zoomOut()
        Decreases the current page visualization zoom factor by 20%.
      • setZoom

        public void setZoom​(float zoom)
        Zoom to a new zoom level, without centering on any new specific point
        Parameters:
        zoom - zoom value passed to view controller.
      • doCommonZoomUIUpdates

        public void doCommonZoomUIUpdates​(boolean becauseOfValidFitMode)
      • isCurrentPage

        public boolean isCurrentPage()
        Returns tree if there is a current page associated with this controller.
        Returns:
        true if their is a current page, otherwise false.
      • getPageTree

        public PageTree getPageTree()
        Gives access to the currently opened Document's Catalog's PageTree
        Returns:
        PageTree
      • showAnnotationPreviewWindow

        public void showAnnotationPreviewWindow()
      • showPage

        public void showPage​(int nPage)
        Sets the ViewerModel's current page index, and updates the display to show the newly selected page
        Parameters:
        nPage - Index of the Page to show
        See Also:
        DocumentViewControllerImpl.setCurrentPageIndex(int)
      • updateDocumentView

        public void updateDocumentView()
      • rotateLeft

        public void rotateLeft()
        Rotates the page visualization by 90 degrees in a counter-clockwise direction.
      • rotateRight

        public void rotateRight()
        Rotates the page visualization by 90 degrees in a clockwise direction.
      • isDocumentFitMode

        public boolean isDocumentFitMode​(int fitMode)
      • isDocumentViewMode

        public boolean isDocumentViewMode​(int viewMode)
      • setPageViewSinglePageConButton

        public void setPageViewSinglePageConButton​(JToggleButton btn)
      • setPageViewFacingPageConButton

        public void setPageViewFacingPageConButton​(JToggleButton btn)
      • setPageViewSinglePageNonConButton

        public void setPageViewSinglePageNonConButton​(JToggleButton btn)
      • setPageViewFacingPageNonConButton

        public void setPageViewFacingPageNonConButton​(JToggleButton btn)
      • setPageFitMode

        public void setPageFitMode​(int fitMode,
                                   boolean refresh)
        Set the ViewerModel's fit setting to fit the whole page, and update the display
        Parameters:
        fitMode - fit mode.
        refresh - true to refresh document page view.
      • setFullScreenMode

        public void setFullScreenMode()
      • setPageViewMode

        public void setPageViewMode​(int viewMode,
                                    boolean refresh)
      • setDocumentToolMode

        public void setDocumentToolMode​(int toolType)
        Description copied from interface: Controller
        Sets the tool mode used for the controller view. Tools such as text selection, panning and annotation selection can be used.
        Specified by:
        setDocumentToolMode in interface Controller
        Parameters:
        toolType - tool mode constants defined in DocumentViewModel
      • isUtilityPaneVisible

        public boolean isUtilityPaneVisible()
        If the utility pane is currently visible
        Returns:
        true if pane is visible false otherwise.
      • isAnnotationUtilityPaneVisible

        public boolean isAnnotationUtilityPaneVisible()
      • isBookmarkUtilityPaneVisible

        public boolean isBookmarkUtilityPaneVisible()
      • isComponentUtilityPaneVisible

        public boolean isComponentUtilityPaneVisible​(Component component)
      • setUtilityPaneVisible

        public void setUtilityPaneVisible​(boolean visible)
        Makes the component visible or invisible.
        Parameters:
        visible - true to make the component visible; false to make it invisible.
      • toggleUtilityPaneVisibility

        public void toggleUtilityPaneVisibility()
        Flips the visibility of the utility pane to the opposite of what it was
        See Also:
        setUtilityPaneVisible(boolean)
      • toggleFormHighlight

        public void toggleFormHighlight()
        Flips the visibility of the form highlight functionality ot hte opposite of what it was.
      • toggleAnnotationEditMode

        public void toggleAnnotationEditMode()
        Flips the visibility of the form highlight functionality ot hte opposite of what it was.
      • setAnnotationEditMode

        public void setAnnotationEditMode​(boolean enabled)
        Description copied from interface: Controller
        Sets visibility of the form highlight functionality ot hte opposite of what it was.
        Specified by:
        setAnnotationEditMode in interface Controller
        Parameters:
        enabled - true to enable mode; otherwise, false;
      • safelySelectUtilityPanel

        protected boolean safelySelectUtilityPanel​(Component comp)
        Method to select the currently visible tab in the utility pane Because tabs can be hidden via the properties file, we'll want to check first whether the desired panel even exists
        Parameters:
        comp - to select
        Returns:
        true on successful selection
      • isUtilityTabSelected

        protected boolean isUtilityTabSelected​(Component comp)
      • showSearch

        public void showSearch()
      • toggleShowSearchPanel

        public void toggleShowSearchPanel()
      • showSearchPanel

        public void showSearchPanel()
        Make the Search pane visible, and if necessary, the utility pane that encloses it
        See Also:
        setUtilityPaneVisible(boolean)
      • showSearchPanel

        public void showSearchPanel​(String searchPhrase)
      • nextSearchResult

        public void nextSearchResult()
      • previousSearchResult

        public void previousSearchResult()
      • showAnnotationDestinationPanel

        public void showAnnotationDestinationPanel​(DestinationComponent selectedDestination)
        Make the Annotation Link Panel visible, and if necessary, the utility pane that encloses it
        Parameters:
        selectedDestination - the destination to show in the panel
        See Also:
        setUtilityPaneVisible(boolean)
      • showAnnotationDestinationPanel

        public void showAnnotationDestinationPanel​(TreePath path)
      • showAnnotationPanel

        public void showAnnotationPanel​(boolean forceShow)
        Make the Annotation Link Panel visible, and if necessary, the utility pane that encloses it
        Parameters:
        forceShow - Forces the utility pane to be visible
        See Also:
        setUtilityPaneVisible(boolean)
      • showUtilityPanel

        protected boolean showUtilityPanel​(Component panelToShow,
                                           boolean forceShow)
        Shows the given component in the utility panel
        Parameters:
        panelToShow - The component to show
        forceShow - Whether to force showing the utility panel or not
        Returns:
        whether the panel has been selected or not
      • showOutlinePanel

        public void showOutlinePanel​(boolean forceShow)
        Make the outline panel panel visible
        Parameters:
        forceShow - Whether to force showing the utility pane or not
      • showPageSelectionDialog

        public void showPageSelectionDialog()
        Show a dialog, listing every page in the PDF Document, for the user to select which page to show.
        See Also:
        showPage(int)
      • applyViewerPreferences

        protected void applyViewerPreferences​(Catalog catalog,
                                              ViewerPropertiesManager propertiesManager)
        Method to try to read any ViewerPreferences present in the document, and apply them Otherwise we will try to check the properties file for any overriding to these values
        Parameters:
        catalog - to lookup view preferences from
        propertiesManager - to check properties in
      • getViewModel

        public ViewModel getViewModel()
        Gives access to this Controller's ViewerModel
        Specified by:
        getViewModel in interface Controller
        Returns:
        The Controller's ViewerModel
        See Also:
        ViewModel
      • getDocument

        public Document getDocument()
        A Document is the root of the object hierarchy, giving access to the contents of a PDF file. Significantly: getDocument().getCatalog().getPageTree().getPage(int pageIndex) gives access to each Page, so that it might be drawn.
        Specified by:
        getDocument in interface Controller
        Returns:
        Document root of the PDF file
      • getCurrentPageNumber

        public 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.
        Specified by:
        getCurrentPageNumber in interface Controller
        Returns:
        The zero-based index of the current Page being displayed
      • actionPerformed

        public void actionPerformed​(ActionEvent event)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        actionPerformed in interface ActionListener
      • focusGained

        public void focusGained​(FocusEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        focusGained in interface FocusListener
      • focusLost

        public void focusLost​(FocusEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        focusLost in interface FocusListener
      • itemStateChanged

        public void itemStateChanged​(ItemEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        itemStateChanged in interface ItemListener
      • followOutlineItem

        public void followOutlineItem​(OutlineItemTreeNode node)
        Description copied from interface: Controller
        Interprets the OutlineItemTreeNode loading ans displaying any associated Destination values.
        Specified by:
        followOutlineItem in interface Controller
        Parameters:
        node - node to interpret and navigate to.
      • followDestinationItem

        public void followDestinationItem​(NameTreeNode node)
        Description copied from interface: Controller
        Interprets the NameTreeNode loading ans displaying any associated Destination values.
        Specified by:
        followDestinationItem in interface Controller
        Parameters:
        node - node to interpret and navigate to.
      • windowActivated

        public void windowActivated​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowActivated in interface WindowListener
      • windowClosed

        public void windowClosed​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowClosed in interface WindowListener
      • windowClosing

        public void windowClosing​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowClosing in interface WindowListener
      • windowDeactivated

        public void windowDeactivated​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowDeactivated in interface WindowListener
      • windowDeiconified

        public void windowDeiconified​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowDeiconified in interface WindowListener
      • windowIconified

        public void windowIconified​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowIconified in interface WindowListener
      • windowOpened

        public void windowOpened​(WindowEvent e)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        windowOpened in interface WindowListener
      • dragOver

        public void dragOver​(DropTargetDragEvent event)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        dragOver in interface DropTargetListener
      • drop

        public void drop​(DropTargetDropEvent event)
        Handle drop event when a user drags and drops one or more files onto the viewer frame.
        Specified by:
        drop in interface DropTargetListener
        Parameters:
        event - information about the drag and drop data.
      • dragExit

        public void dragExit​(DropTargetEvent event)
        Controller takes AWT/Swing events, and maps them to its own events related to PDF Document manipulation
        Specified by:
        dragExit in interface DropTargetListener
      • prepareKeyMap

        protected void prepareKeyMap​(JComponent component)
      • propertyChange

        public void propertyChange​(PropertyChangeEvent evt)
        Listen for property change events from the page view. This method acts like a mediator passing on the new states to the interested parties.
        Specified by:
        propertyChange in interface PropertyChangeListener
        Parameters:
        evt - property change event
      • changeAnnotationsVisibility

        public void changeAnnotationsVisibility​(AnnotationFilter filter,
                                                boolean visible,
                                                boolean execInvert)
      • changeAnnotationsPrivacy

        public void changeAnnotationsPrivacy​(AnnotationFilter filter,
                                             boolean priv)
        Changes privacy flag of the MarkupAnnotations given by the annotations filter
        Parameters:
        filter - The filter used to filter the annotations
        priv - The privacy status to use (true = private)