eTextReader
Class Browser

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by eTextReader.Browser
All Implemented Interfaces:
DatabaseEventListener, ContentContainer, DocEventListener, InkCallback, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class Browser
extends javax.swing.JFrame
implements java.lang.Runnable, DatabaseEventListener, DocEventListener, InkCallback, ContentContainer

An application to implement the browsing capability of an electronic textbook reader. This class is based on the Prototype class written by Marty Kane and Carrie Halvorsen 10/2002.

Several properties can be set that will affect the operation of this class:

Version:
1.0 10/28/2002
Author:
Marty Kane
See Also:
Serialized Form

Nested Class Summary
 class Browser.AlertsBoxListener
          Class to handle action events involving the search box
 class Browser.AlertsThread
           
 class Browser.AnnotationListener
          Class to handle action events involving Annotations Author: Liz Dahm
 class Browser.BookmarkListener
          Class to handle action events involving bookmarks Author: Josh Morse
 class Browser.BottomListener
          Class to handle action events involving the menu at the bottom of the screen Author: Josh Morse
(package private)  class Browser.gotoAddressThread
           
 class Browser.HighlightPrefsListener
          Class to handle action events involving highlight preferences Author: Josh Morse Drastically changed when the highlighter preference material was refactored out of browser and into HighlightPrefsBox/User.
 class Browser.LinkDestListener
          used to be notified when a call to setPage has completed so that a particular location within the page can be scrolled to
(package private)  class Browser.LocationChangeListener
           
 class Browser.LoginListener
          Class to handle action events involving logging in Author: Josh Morse
 class Browser.LogListener
          Class to handle action, hyperlink, and window events involving the logging of user activities Author: Josh Morse
 class Browser.MenuListener
          Class to handle action events involving page navigation Author: Josh Morse
 class Browser.MouseClickListener
          Class to handle action events involving mouse clicks
 class Browser.NavListener
          Class to handle action events involving page navigation Author: Josh Morse
 class Browser.NotationEventHandler
          This class handles the tasks that are specific to the browser only in regard to handling notation events.
(package private) static class Browser.NotationState
           
 class Browser.PasswordListener
          Class to handle action events involving changing a password
protected  class Browser.QuickButtonListener
           
 class Browser.SelectionEvent
           
 class Browser.SelectionListener
          Class to handle and listen for events dealing with textbook selection
(package private)  class Browser.TextUpdateThread
          Utility class to allow updating text of components from outside the EventListener thread
 class Browser.ViewPrefsListener
          Class to handle action events involving viewing preferences Author: Josh Morse
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  int activeTab
           
private  java.util.Vector alerts
           
private  AlertsBox alertsBox
           
private  Browser.AlertsBoxListener alertsboxlistener
           
private  Browser.AlertsThread alertsThread
           
private  java.util.Vector allAlerts
           
private  java.util.Hashtable annbookmarkkeys
           
private  javax.swing.JMenu annbookmarkmenu
           
private  java.util.Hashtable annbookmarkpages
           
private  java.util.Hashtable annbookmarks
           
private  AnnotationBar annotationBar
           
private  AnnotationBox annotationBox
           
private  Browser.AnnotationListener annotationlistener
           
private  javax.swing.JMenu annotationListingMenu
           
private  AnnotationViewBar annotationViewBar
           
private  AnnotationShareBox annShareBox
           
private  WrappedJTextArea bodyText
           
static java.lang.String BOOK_LOCATION_120
           
protected static int BOOK_VIEW
          indicates that the current page is contained in the currently loaded book
static java.util.Vector bookHistory
           
private  java.lang.String bookLocation
           
static java.lang.String BOOKMARK_CANCEL
           
static java.lang.String BOOKMARK_SELECTED_LOCATION
           
static java.lang.String BOOKMARK_TOP_OF_PAGE
           
private  boolean bookmarkAnnotation
           
private  BookmarkBox bookmarkBox
           
private  BookmarkEditBox bookmarkEditBox
           
private  java.util.Hashtable bookmarkkeys
           
private  Browser.BookmarkListener bookmarklistener
           
private  javax.swing.JMenu bookmarkmenu
           
private  java.util.Hashtable bookmarkpages
           
private  java.util.Hashtable bookmarks
           
private  javax.swing.JComboBox bookmarkselect
           
private  Browser.BottomListener bottomlistener
           
private  javax.swing.JMenuItem bugReportMI
           
private  DBClient client
           
private static DefaultComponentFactory componentFactory
           
private  boolean containsHighlight
           
private  javax.swing.JViewport contentView
           
 java.lang.String course
          The course the user is currently working on
private  javax.swing.Box createPanel
           
(package private)  StringCrypto crypto
           
private  javax.swing.Box currentBar
           
private  OEBPackageFile currentBook
           
private  OEBItem currentItem
          the item currently being viewed in the textbook
private  java.lang.String currentItemAddress
          an address that stores the position in the currently viewed book item.
private  Notation currentNotation
           
private  CursorHandler cursorHandler
           
private  javax.swing.JTextField dateCreatedViewField
           
private  javax.swing.JTextField dateModifiedViewField
           
(package private)  NotationDateSelect dateSelect
          lets the user select a date range when displaying notations
static java.lang.String DEFAULT_LIBRARY_LOCATION
           
private  javax.swing.JButton delete
           
private  Diagram diagram
           
private  java.awt.Image diagramimage
           
static java.util.regex.Pattern diagramPattern
           
private  DiscussionWindow discWindow
           
private  java.lang.Thread discWindowThread
           
protected static boolean displayDefaultAppPreferencesDialog
          Should a dialog be displayed when a user with no application preferences logs in?
private  boolean edit
           
private  boolean enableCheck
           
private  javax.swing.JCheckBoxMenuItem enableNotations
           
private  javax.swing.JMenuItem featureRequestMI
           
private  javax.swing.JMenuItem featuresMI
           
protected  javax.swing.JTabbedPane findPane
          Provides a tabbed interface between the find/results portions of the find interface
private  FindPanel findPanel
           
static java.lang.Integer FIRST_OFFSET
          constant indicating that the offset that should be scrolled to is the first offset in the document
private  FontSizeBox fsb
           
private  java.util.Hashtable globalbookmarkkeys
           
private  javax.swing.JMenu globalbookmarkmenu
           
private  java.util.Hashtable globalbookmarkpages
           
private  java.util.Hashtable globalbookmarks
           
protected static java.lang.String GOTO_BOOK
          action command constant for switching to book mode
protected static java.lang.String GOTO_WEB
          action command constant for switching to web mode
private  javax.swing.JDialog groupsBox
           
private  javax.swing.JMenu helpMenu
           
static java.lang.String HIGHLIGHTER_MODE
          preference names used in retrieving/maintaining viewing preferences
private  HighlightPrefsBox highlightPrefBox
           
private  Browser.HighlightPrefsListener highlightprefslistener
           
private  javax.swing.JCheckBoxMenuItem highlightToggler
           
static java.util.Vector history
           
private  int historyPos
           
private static java.lang.String[] howToVideos
          a list of the how to videos that are available to be executed
private  HTMLTitleHandler HTMLth
           
private  int id
           
static java.util.HashMap indexedWebpages
           
static IndexingThread indexingThread
           
protected  java.awt.Point inkWindowPosition
          information about the position of the tablet PC ink input window
protected  java.awt.Dimension inkWindowSize
          information about the size of the tablet PC ink input window
private static java.lang.String[] instructorNames
           
static java.util.Set instructors
           
(package private)  IntToBool inttobool
           
private  boolean isHighlighter
           
private  boolean isOnline
           
private  boolean isReference
           
static java.lang.String LAST_LOGIN_FILE
           
static java.lang.Integer LAST_OFFSET
          constant indicating that the offset that should be scrolled to is the last offset in the document
private  long lastscroll
           
private  java.lang.String lastUserName
           
private  LinkDestinationBox ldb
           
private  java.util.LinkedList library
           
private  java.lang.String linkAddressEnd
           
private  java.lang.String linkAddressStart
           
private  LinkBar linkBar
           
private  java.lang.String linkPreviewText
           
private  java.lang.String linkTitle
           
private  java.lang.String linkURL
           
private  boolean loadIndexOnStartup
          Determines whether or not the book index is loaded when the application starts up
protected static boolean loadLastLogin
          Should the Browser attempt to log in using any stored credentials it finds on the disk?
private  LoginDialog loginBox
           
private  Browser.LoginListener loginlistener
           
private  Browser.LogListener loglistener
           
private  java.util.List manifest
           
private  Bookmark markpage
           
private  Browser.MenuListener menulistener
           
private  int mode
          holds information about whether the user is currently reading the textbook or browsing the web
private  Browser.MouseClickListener mouseclicklistener
           
private  NavigationBar navBar
           
private  Browser.NavListener navlistener
           
private  NotationDetailBox ndBox
           
private  int newAlerts
           
private  NewAnnotationBox newannbox
           
private  OEBItem nextItem
          the item after the current item, or NULL if one does not exist
private  Browser.NotationEventHandler notationHandler
          The object that handles notation events from the Content Pane
private  int notationID
           
private  NotationListing notationLister
           
static java.lang.String NOTATIONS_LOADED_PROPERTY
           
(package private)  Browser.NotationState notationState
          Maintains current Notation state
private  java.lang.String notationType
           
private  java.lang.String notationViewMode
           
private  boolean offlineWarned
           
private  int oldAlerts
           
private  javax.swing.JMenu onlineMenu
           
private  boolean openLastPageOnStartup
          Determines whether or not the browser should navigate to the user's last location when the application starts up
static int PAGE_LOCATION
          constant indicating that the page should be scrolled to a particular address when it has completed loading
static int PAGE_OFFSET
          constant indicating that the page should be scrolled to a particular offset when it has completed loading
private  Browser.LogListener.PageScrollListener pagescrolllistener
           
private  java.lang.String partialColor
           
private  javax.swing.JPasswordField passwdField
           
private  PasswordBox passwordBox
           
private  Browser.PasswordListener passwordlistener
           
private  PasteListener pastelisten
           
static java.lang.String POPUP_WINDOW_MODE
           
private  OEBItem previousItem
          the item before the current item, or NULL if one does not exist
static java.lang.String PROPERTY_LOAD_TOC_ON_STARTUP
           
static java.lang.String PROPERTY_START_ALERTS_THREAD
           
private  Browser.QuickButtonListener quickbuttonlistener
           
(package private)  java.util.Map quickLaunchPrefs
          the current users quick lauch preferences
private  javax.swing.JMenu readingbookmarkmenu
           
private  java.util.Hashtable readingBookmarks
           
private  javax.swing.JCheckBox referenceBox
           
private  javax.swing.JCheckBox referenceViewBox
           
private  ResultsPanel resultsPanel
           
private  Browser.SelectionListener selectionlistener
           
private  javax.swing.JMenuItem selectionMI
           
static java.util.HashMap sensitiveIndexedWebpages
           
private  javax.swing.JComboBox shareBox
           
private  java.util.Vector shareSelected
           
private  javax.swing.JList shareViewList
           
private  javax.swing.JSplitPane split
           
private  StatusBar statBar
           
private  javax.swing.JTextField subjectField
           
private  javax.swing.JMenuItem synchMI
           
private  TabbedContentPane tabbed
           
private static java.lang.String TABLE_OF_CONTENTS_TITLE
           
static int TABLET_SCROLLBAR_ADJUST
           
private  java.util.Vector targetSelected
           
private  javax.swing.JList targetViewList
           
private  TOCThread tocThread
           
private  javax.swing.JTextField toField
           
private  javax.swing.JComboBox typeBox
           
private  javax.swing.JTextField typeViewField
           
private  javax.swing.JButton updateAnnButton
           
private  java.lang.String updatename
           
private static java.lang.String userName
          The name of the currently logged in user
private  javax.swing.JTextField userNameField
           
private  int userViewLevel
           
private  javax.swing.JButton view
          toggle button to switch between book mode and web mode
private  ViewPanel viewPanel
           
private  ViewPrefBox viewPrefBox
           
private  java.util.ArrayList viewPrefChecks
           
private  Browser.ViewPrefsListener viewprefslistener
           
private  boolean warned
           
static java.lang.String WARNING_NO_SELECTION_BOOKMARK
           
protected static int WEB_VIEW
          indicates that the current page is not contained in the currently loaded book
private  Notation workingNewAnnotation
           
private  javax.swing.JMenuItem workOnlineMI
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Browser(java.lang.String bookLocation)
           
Browser(java.lang.String bookLocation, java.lang.String courseID)
           
Browser(java.lang.String bookLocation, java.lang.String courseID, java.lang.String userName, java.lang.String password, boolean loadIndexOnStartup, boolean openLastPageOnStartup)
          Constructs a Browser object, and attempts to log in to the database using the given user name and password
 
Method Summary
 void addNewTab(java.lang.String url)
           
 void annotate()
           
 void back()
           
 void bookmarkClear()
           
 void bookmarkOK()
           
 void bookmarkRemove(java.lang.String name, java.lang.String selectedType)
           
 void bookmarkSelect()
           
 void bookmarkUpdate()
           
 void cannotContactServer(java.lang.Exception e)
          Called when the InkAnnotationWindow class cannot set up a connection with the windows server
 void changeColor(java.awt.event.ActionEvent e)
           
private  void changeCursor(int cursor)
           
 void changeDisplayType(Notation notation)
          Called when the annotation editor has requested that the user be allowed to change the display type of the specified annotation
 void changeShareWith(Notation notation)
          Called when the annotation editor has requested that the user be allowed to change who the specified annnotation is shared with
private  void changeUserFontSize(float size)
           
 void checkEnable()
           
private  void checkEnableNext()
           
private  void checkEnablePrevious()
           
 void checkError(int c)
           
private  java.lang.String checkFileURL(java.lang.String base)
           
private  int checkForAlerts()
           
private  int checkForAllAlerts()
           
 boolean checkForAnnotationSelectionChanges(Notation original)
          checks to see whether a new selection has been made for Notation object original
private  int checkInfo(java.lang.String userName, java.lang.String password)
           
private  boolean checkReturnInfo(java.lang.String userName, java.lang.String password)
           
private  java.lang.String checkURL(java.lang.String base)
           
private  void clearAlerts(boolean dispose)
           
private  void clearStatus()
           
 boolean closeAllButThisTab(int index)
          Closes all tabs except for the tab specified by index.
 void closeAnnotation(Notation notation, java.awt.Dimension browserSize)
          Called when the annotation editor has requested that the currently edited annotation be closed
 void closeSplitView()
           
 void colorSelected()
           
 boolean commonUpdateNotation(AnnotationBox annotationBox, Notation n, DBClient client, java.lang.String userName)
          This method deals with updating the appropriate properties in the notation n based on the values stored in the AnnotationBox annotationBox.
private  void completeLogin(java.lang.String user, java.lang.String pw, boolean savePW)
           
 void createDiagram()
           
private  void createLink()
          Starts creating the link annotation.
 void databaseEventOccurred(DatabaseEvent de)
           
 void decreaseFontSize()
           
private  java.lang.String decryptPassword(java.lang.String pwd)
           
 void delete()
           
 void delete(boolean prompt)
           
 void deleteAlert()
           
 void deleteAnnotation(Notation notation, java.awt.Dimension size)
          Called when the annotation editor has requested the specified annotation to be deleted
protected  void deleteHighlight(int offset, boolean remove)
           
private  void deleteHighlight(int startIndex, int endIndex)
           
 void docEventOccurred(DocEvent de)
           
private  void doChangeShareWith(Notation notation)
           
 void enableNotes()
           
private  java.lang.String encryptPassword(java.lang.String pwd)
           
 void exit()
           
private  void fontSizeCanel()
           
private  void fontSizeOk()
           
 void forward()
           
protected  java.lang.Class[] getActionsWithAccelerators()
          This method returns an array of classes that extend BaseAction for which accelerators should be added to the action map associated with the Browser
static java.lang.String getAnnotationURL(OEBPackageFile currentBook, java.lang.String currentPage)
           
 java.lang.String getAnnotationURL(java.lang.String currentPage)
           
protected  Authenticator getAuthenticator()
          This method returns the authenticator which the Browser is configured to use.
 ContentPane getContent()
           
 OEBPackageFile getCurrentBook()
           
private  void getCurrentContentNotation()
           
 java.lang.String getCurrentPage()
          Returns the page currently loaded in the active tab of the tabbed content pane contained in this Browser
protected  java.lang.String getCurrentTopAddress()
          compute an address representing the offset viewable at the top of the currently viewed page
static java.lang.String getFileURL(java.lang.String fileName)
          constructs a file URL referencing the file fileName located in the current directory
 javax.swing.JMenu getGlobalbookmarkmenu()
           
protected  Browser.NotationEventHandler getNotationHandler()
           
private  void getOldAlerts()
           
private  java.util.Hashtable<ApplicationPreferences,java.lang.Object> getPreferences()
          Delegates retrieval of application preferences to the User object.
private  Notation getRootDiscussion(Notation replyDiscussion)
           
protected  TabbedContentPane getTabbedPane()
           
static java.lang.String getUserName()
           
 void goAlert(boolean all)
           
 void gotoAddress(java.lang.String address)
          scrolls the document so that the position requested is at the top of the ContentPane
 void gotoBook()
          returns to the last viewed location in the book
 void gotoFirstDocument()
          Moves to the first document in the current publication
 void gotoLastDocument()
          Moves to the last document in the current publication
 void gotoNextDocument()
          moves to the next document in the current publication, if one exists; otherwise a dialog box is displayed indicating that the end of the publication has been reached
 void gotoPreviousDocument(java.lang.String actionCommand)
          moves to the next document in the current publication.
 void gotoWeb()
          returns to the last web page viewed
 void handleChangeType()
          This method pops up an AnnotationBox, and allows the user to change the type of the annotation, and the display mode.
 void highlight()
           
 void highlightDefault()
           
 void highlightPrefsCancel()
           
 void highlightPrefsOK()
           
 void increaseFontSize()
          Increases the current user's font size by 2 points
private static boolean isDisplayDefaultAppPreferencesDialog()
          Determines whether or not the browser should display a message when a user logs in and no application preferences are available for that user
static boolean isLoadLastLogin()
          Determines whether any Browser instances that get created will look for the lastLogin file when they start
private  boolean isUser(java.lang.String userName)
           
 void listNotations()
           
 void loadAnnBookmark(java.awt.event.ActionEvent actionevent)
           
private  void loadAnnotationBookmarks()
           
 void loadBookmark(java.awt.event.ActionEvent actionevent)
           
 void loadBookmark(Bookmark b)
           
private  void loadBookmarks()
           
private  void loadBookmarks(Criteria select, javax.swing.JMenu addMenu, java.lang.String actionCommand, java.util.Hashtable bookmarks, java.util.Hashtable pages, java.util.Hashtable keys)
          loads a particular set of bookmarks based on the criteria specified, which in particular specify the type of bookmark and an author, except for global bookmarks
private  void loadDiagram(Notation notation)
          helper method for the notationEventOccurred method; loads the specified diagram into a Diagram window, or an ink annotation window
 void loadGlobalBookmark(java.awt.event.ActionEvent actionevent)
           
private  void loadGlobalBookmarks()
           
private  void loadLastTabs()
          Loads the tabs that the user had open when the application was last closed.
private  void loadUserBookmarks()
           
 void loginCancel()
           
 void loginClear()
           
 boolean loginOK()
           
static void main(java.lang.String[] args)
           
 void makeHighlight()
           
 void onWindowClose(java.awt.event.WindowEvent we)
           
 void openFile()
           
private  void openLinkDestinationTab(java.lang.String url)
           
 void openTOC()
           
 void openWeb()
           
 void passwordOK()
           
 void paste()
           
private  void popActivateAnnotation()
          Activates the current annotation as if it were left clicked
private  void popChangeLinkDest()
          Chages the destination of the link
private  void popChangeShare()
          Loads the annotation which was last clicked to Browser instance "notation" , and opens the share prefernces window for it
private  void popChangeView()
          Loads the annotation which was last clicked to Browser instance "notation", and opens the type prefernces window for it
private  void popDeleteAnnotation()
          Loads the annotation which was last clicked to Browser instance "notation", and deletes it
private  void popNewTab()
          Opens a new tab and inserts the current content
private  void popOpenLink(boolean newPage)
          Opens the link which was clicked last either in current window or in a new window
private  void popViewDetails()
          Loads the annotation which was last clicked to Browser instance "notation", and opens the view details window for it
 void post_link()
           
 void post_part1()
           
 void post_part2()
           
 int post_part3(java.lang.String subject)
           
 int post_part3(java.lang.String subject, boolean loadIcon)
           
 int post_part3(java.lang.String subject, boolean loadIcon, boolean computeUniqueTitle)
           
protected  void postAnnotationBookmark(java.lang.String subject, java.lang.String url, java.lang.String addressStart, java.lang.String id)
           
private  void postNotationModes(int id, java.util.Vector shareWith, java.util.Vector targetTo)
           
protected  void registerScrollToCurrentLocation()
          forces the browser to return to the currently viewable position when page loading is complete
 void reload()
          requests that the document be reloaded
private  void restoreCursor()
           
private  void restoreSizeAndPosition()
          Loads the last size and position information from the database, then sizes and positions the window according to the information retrieved.
 void run()
           
 void saveAnnotation(Notation notation, java.lang.String subject, byte[] isfData, byte[] pngData, java.awt.Dimension size)
          Called when the annotation editor has requested the specified annotation to be saved
private  void saveApplicationPrefs()
           
 void selectBook()
           
private  void setCurrentBar(javax.swing.Box bar)
           
static void setDisplayDefaultAppPreferencesDialog(boolean displayDefaultAppPreferencesDialog)
          Records whether or not a dialog box should be shown when a user with no application preferences logs in
private  void setLastPage()
           
static void setLoadLastLogin(boolean load)
          Sets whether any Browser instances will look for the last login file when they start
private  void setMergeSelection(int startIndex, int endIndex)
           
protected  void setMode(int mode)
          puts the Browser into either book reading mode or web browsing mode.
protected  void setNextItem(OEBItem nextItem)
          records the location of the next item in the book, and enables/disables navigational controls as needed
private  void setOldAlerts(int old)
           
 void setPage(java.lang.String url, java.lang.String startAddress)
          causes the Browser to load a particular page and then scroll to a starting address within that page This is made necessary by the lack of the integration of a ScrollPane in the ContentPane class, and should be migrated away from in future implementation
protected  void setPreviousItem(OEBItem previousItem)
          records the location of the previous item in the book, and enables/disables navigational controls as needed
private  void setStatus(java.lang.String message)
           
protected  void setupActionMap()
          Sets up the action map so that those actions with accelerators can have their accelerator actions forwarded to this component when it is in focus.
private  void setupCreatePanel()
           
private  void setupFindInterface()
          Sets up the portion of the user interface that is shown when the find button is clicked on.
protected  void setupInkAnnotation(Notation notation)
           
private  void setupLibrary(java.lang.String bookLocation)
          loads the publication library from disk, or creates a new one and adds the 120 textbook to the library if no previous library exists
private  void setupMenuBar()
           
private  void setupOnlineMenu(boolean online)
           
private  void setViewPreferences()
           
private  void showAlertsBox(boolean all)
           
private  void showAnnBox()
           
private  void showAnnotationPrefs()
           
private  void showAnnShareBox()
           
private  void showBookmarkBox()
           
private  void showBookmarkEditBox()
           
 void showDetails(Notation notation)
          Called when the annotation editor has requested that the details of the specified annotation be shown
 void showFindPanel()
           
private  void showFontSizeBox()
           
private  void showGroupsManagerBox()
           
private  void showHighlightPrefsBox()
           
private  void showLoginBox(java.lang.String password)
          equivalent to showLoginBox (password, true, true)
private  void showLoginBox(java.lang.String password, boolean show, boolean startThreads)
          creates a login box the login box is actually shown if the boolean parameter show is set to true.
private  void showNotationDetails(Notation theNotation)
           
private  void showPasswordBox()
           
private  void showResultsPanel(java.util.PriorityQueue<WebpageRelevance> pagesToReturn)
           
private  void showViewPrefsBox()
           
 Browser.AlertsThread startAlertsThread(NavigationBar navBar)
           
 void startAnnotation(java.awt.event.ActionEvent e)
           
static void startBrowser(java.lang.String bookLocation, java.lang.String courseID)
           
protected  void updateCurrentItemFromSelectedTab()
          Updates the currentItem member based on the currently selected tab, and then updates the Next and Previous page actions based on the current item
 void viewPrefsCancel()
           
 void viewPrefsOK()
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

TABLE_OF_CONTENTS_TITLE

private static final java.lang.String TABLE_OF_CONTENTS_TITLE
See Also:
Constant Field Values

PROPERTY_LOAD_TOC_ON_STARTUP

public static final java.lang.String PROPERTY_LOAD_TOC_ON_STARTUP
See Also:
Constant Field Values

PROPERTY_START_ALERTS_THREAD

public static final java.lang.String PROPERTY_START_ALERTS_THREAD
See Also:
Constant Field Values

userName

private static java.lang.String userName
The name of the currently logged in user


diagramPattern

public static java.util.regex.Pattern diagramPattern

howToVideos

private static java.lang.String[] howToVideos
a list of the how to videos that are available to be executed


instructorNames

private static java.lang.String[] instructorNames

instructors

public static java.util.Set instructors

BOOK_LOCATION_120

public static final java.lang.String BOOK_LOCATION_120
See Also:
Constant Field Values

DEFAULT_LIBRARY_LOCATION

public static final java.lang.String DEFAULT_LIBRARY_LOCATION
See Also:
Constant Field Values

WARNING_NO_SELECTION_BOOKMARK

public static final java.lang.String WARNING_NO_SELECTION_BOOKMARK
See Also:
Constant Field Values

LAST_LOGIN_FILE

public static final java.lang.String LAST_LOGIN_FILE
See Also:
Constant Field Values

BOOKMARK_TOP_OF_PAGE

public static final java.lang.String BOOKMARK_TOP_OF_PAGE
See Also:
Constant Field Values

BOOKMARK_SELECTED_LOCATION

public static final java.lang.String BOOKMARK_SELECTED_LOCATION
See Also:
Constant Field Values

BOOKMARK_CANCEL

public static final java.lang.String BOOKMARK_CANCEL
See Also:
Constant Field Values

TABLET_SCROLLBAR_ADJUST

public static int TABLET_SCROLLBAR_ADJUST

BOOK_VIEW

protected static final int BOOK_VIEW
indicates that the current page is contained in the currently loaded book

See Also:
Constant Field Values

WEB_VIEW

protected static final int WEB_VIEW
indicates that the current page is not contained in the currently loaded book

See Also:
Constant Field Values

GOTO_BOOK

protected static final java.lang.String GOTO_BOOK
action command constant for switching to book mode

See Also:
Constant Field Values

GOTO_WEB

protected static final java.lang.String GOTO_WEB
action command constant for switching to web mode

See Also:
Constant Field Values

NOTATIONS_LOADED_PROPERTY

public static final java.lang.String NOTATIONS_LOADED_PROPERTY
See Also:
Constant Field Values

componentFactory

private static DefaultComponentFactory componentFactory

inkWindowSize

protected java.awt.Dimension inkWindowSize
information about the size of the tablet PC ink input window


inkWindowPosition

protected java.awt.Point inkWindowPosition
information about the position of the tablet PC ink input window


findPane

protected javax.swing.JTabbedPane findPane
Provides a tabbed interface between the find/results portions of the find interface


notationState

Browser.NotationState notationState
Maintains current Notation state


quickLaunchPrefs

java.util.Map quickLaunchPrefs
the current users quick lauch preferences


PAGE_OFFSET

public static final int PAGE_OFFSET
constant indicating that the page should be scrolled to a particular offset when it has completed loading

See Also:
Constant Field Values

PAGE_LOCATION

public static final int PAGE_LOCATION
constant indicating that the page should be scrolled to a particular address when it has completed loading

See Also:
Constant Field Values

LAST_OFFSET

public static final java.lang.Integer LAST_OFFSET
constant indicating that the offset that should be scrolled to is the last offset in the document


FIRST_OFFSET

public static final java.lang.Integer FIRST_OFFSET
constant indicating that the offset that should be scrolled to is the first offset in the document


HIGHLIGHTER_MODE

public static final java.lang.String HIGHLIGHTER_MODE
preference names used in retrieving/maintaining viewing preferences

See Also:
Constant Field Values

POPUP_WINDOW_MODE

public static final java.lang.String POPUP_WINDOW_MODE
See Also:
Constant Field Values

loadIndexOnStartup

private boolean loadIndexOnStartup
Determines whether or not the book index is loaded when the application starts up


openLastPageOnStartup

private boolean openLastPageOnStartup
Determines whether or not the browser should navigate to the user's last location when the application starts up


cursorHandler

private CursorHandler cursorHandler

notationLister

private NotationListing notationLister

dateSelect

NotationDateSelect dateSelect
lets the user select a date range when displaying notations


tocThread

private TOCThread tocThread

indexingThread

public static IndexingThread indexingThread

discWindowThread

private java.lang.Thread discWindowThread

manifest

private java.util.List manifest

lastUserName

private java.lang.String lastUserName

course

public java.lang.String course
The course the user is currently working on


history

public static java.util.Vector history

bookHistory

public static java.util.Vector bookHistory

historyPos

private int historyPos

userViewLevel

private int userViewLevel

bookLocation

private java.lang.String bookLocation

mode

private int mode
holds information about whether the user is currently reading the textbook or browsing the web


indexedWebpages

public static java.util.HashMap indexedWebpages

sensitiveIndexedWebpages

public static java.util.HashMap sensitiveIndexedWebpages

loadLastLogin

protected static boolean loadLastLogin
Should the Browser attempt to log in using any stored credentials it finds on the disk?


displayDefaultAppPreferencesDialog

protected static boolean displayDefaultAppPreferencesDialog
Should a dialog be displayed when a user with no application preferences logs in?


library

private java.util.LinkedList library

currentBook

private OEBPackageFile currentBook

currentItem

private OEBItem currentItem
the item currently being viewed in the textbook


previousItem

private OEBItem previousItem
the item before the current item, or NULL if one does not exist


nextItem

private OEBItem nextItem
the item after the current item, or NULL if one does not exist


currentItemAddress

private java.lang.String currentItemAddress
an address that stores the position in the currently viewed book item. Only updated when the user switches to web mode!


notationID

private int notationID

notationType

private java.lang.String notationType

notationViewMode

private java.lang.String notationViewMode

isReference

private boolean isReference

bookmarkAnnotation

private boolean bookmarkAnnotation

navBar

private NavigationBar navBar

alertsThread

private Browser.AlertsThread alertsThread

view

private javax.swing.JButton view
toggle button to switch between book mode and web mode


annotationListingMenu

private javax.swing.JMenu annotationListingMenu

bookmarkmenu

private javax.swing.JMenu bookmarkmenu

readingBookmarks

private java.util.Hashtable readingBookmarks

readingbookmarkmenu

private javax.swing.JMenu readingbookmarkmenu

bookmarks

private java.util.Hashtable bookmarks

bookmarkpages

private java.util.Hashtable bookmarkpages

bookmarkkeys

private java.util.Hashtable bookmarkkeys

globalbookmarkmenu

private javax.swing.JMenu globalbookmarkmenu

globalbookmarks

private java.util.Hashtable globalbookmarks

globalbookmarkpages

private java.util.Hashtable globalbookmarkpages

globalbookmarkkeys

private java.util.Hashtable globalbookmarkkeys

annbookmarkmenu

private javax.swing.JMenu annbookmarkmenu

annbookmarks

private java.util.Hashtable annbookmarks

annbookmarkpages

private java.util.Hashtable annbookmarkpages

annbookmarkkeys

private java.util.Hashtable annbookmarkkeys

updatename

private java.lang.String updatename

bookmarkselect

private javax.swing.JComboBox bookmarkselect

bookmarkEditBox

private BookmarkEditBox bookmarkEditBox

markpage

private Bookmark markpage

navlistener

private Browser.NavListener navlistener

menulistener

private Browser.MenuListener menulistener

highlightprefslistener

private Browser.HighlightPrefsListener highlightprefslistener

viewprefslistener

private Browser.ViewPrefsListener viewprefslistener

loginlistener

private Browser.LoginListener loginlistener

passwordlistener

private Browser.PasswordListener passwordlistener

bookmarklistener

private Browser.BookmarkListener bookmarklistener

alertsboxlistener

private Browser.AlertsBoxListener alertsboxlistener

mouseclicklistener

private Browser.MouseClickListener mouseclicklistener

bottomlistener

private Browser.BottomListener bottomlistener

loglistener

private Browser.LogListener loglistener

pagescrolllistener

private Browser.LogListener.PageScrollListener pagescrolllistener

quickbuttonlistener

private Browser.QuickButtonListener quickbuttonlistener

selectionlistener

private Browser.SelectionListener selectionlistener

pastelisten

private PasteListener pastelisten

fsb

private FontSizeBox fsb

lastscroll

private long lastscroll

diagram

private Diagram diagram

diagramimage

private java.awt.Image diagramimage

tabbed

private TabbedContentPane tabbed

split

private javax.swing.JSplitPane split

contentView

private javax.swing.JViewport contentView

createPanel

private javax.swing.Box createPanel

viewPanel

private ViewPanel viewPanel

client

private DBClient client

toField

private javax.swing.JTextField toField

subjectField

private javax.swing.JTextField subjectField

typeBox

private javax.swing.JComboBox typeBox

shareBox

private javax.swing.JComboBox shareBox

referenceBox

private javax.swing.JCheckBox referenceBox

bodyText

private WrappedJTextArea bodyText

targetViewList

private javax.swing.JList targetViewList

typeViewField

private javax.swing.JTextField typeViewField

shareViewList

private javax.swing.JList shareViewList

dateCreatedViewField

private javax.swing.JTextField dateCreatedViewField

dateModifiedViewField

private javax.swing.JTextField dateModifiedViewField

referenceViewBox

private javax.swing.JCheckBox referenceViewBox

delete

private javax.swing.JButton delete

updateAnnButton

private javax.swing.JButton updateAnnButton

loginBox

private LoginDialog loginBox

userNameField

private javax.swing.JTextField userNameField

passwdField

private javax.swing.JPasswordField passwdField

passwordBox

private PasswordBox passwordBox

bookmarkBox

private BookmarkBox bookmarkBox

viewPrefBox

private ViewPrefBox viewPrefBox

enableNotations

private javax.swing.JCheckBoxMenuItem enableNotations

viewPrefChecks

private java.util.ArrayList viewPrefChecks

enableCheck

private boolean enableCheck

linkAddressStart

private java.lang.String linkAddressStart

linkAddressEnd

private java.lang.String linkAddressEnd

linkPreviewText

private java.lang.String linkPreviewText

ldb

private LinkDestinationBox ldb

linkURL

private java.lang.String linkURL

activeTab

private int activeTab

highlightPrefBox

private HighlightPrefsBox highlightPrefBox

isHighlighter

private boolean isHighlighter

containsHighlight

private boolean containsHighlight

partialColor

private java.lang.String partialColor

highlightToggler

private javax.swing.JCheckBoxMenuItem highlightToggler

findPanel

private FindPanel findPanel

resultsPanel

private ResultsPanel resultsPanel

groupsBox

private javax.swing.JDialog groupsBox

annShareBox

private AnnotationShareBox annShareBox

ndBox

private NotationDetailBox ndBox

annotationBox

private AnnotationBox annotationBox

newannbox

private NewAnnotationBox newannbox

shareSelected

private java.util.Vector shareSelected

targetSelected

private java.util.Vector targetSelected

annotationlistener

private Browser.AnnotationListener annotationlistener

statBar

private StatusBar statBar

linkBar

private LinkBar linkBar

annotationBar

private AnnotationBar annotationBar

annotationViewBar

private AnnotationViewBar annotationViewBar

currentBar

private javax.swing.Box currentBar

workingNewAnnotation

private Notation workingNewAnnotation

currentNotation

private Notation currentNotation

id

private int id

edit

private boolean edit

alertsBox

private AlertsBox alertsBox

alerts

private java.util.Vector alerts

allAlerts

private java.util.Vector allAlerts

oldAlerts

private int oldAlerts

newAlerts

private int newAlerts

warned

private boolean warned

isOnline

private boolean isOnline

offlineWarned

private boolean offlineWarned

onlineMenu

private javax.swing.JMenu onlineMenu

workOnlineMI

private javax.swing.JMenuItem workOnlineMI

synchMI

private javax.swing.JMenuItem synchMI

selectionMI

private javax.swing.JMenuItem selectionMI

helpMenu

private javax.swing.JMenu helpMenu

featuresMI

private javax.swing.JMenuItem featuresMI

bugReportMI

private javax.swing.JMenuItem bugReportMI

featureRequestMI

private javax.swing.JMenuItem featureRequestMI

HTMLth

private HTMLTitleHandler HTMLth

inttobool

IntToBool inttobool

discWindow

private DiscussionWindow discWindow

crypto

StringCrypto crypto

notationHandler

private Browser.NotationEventHandler notationHandler
The object that handles notation events from the Content Pane


linkTitle

private java.lang.String linkTitle
Constructor Detail

Browser

public Browser(java.lang.String bookLocation)

Browser

public Browser(java.lang.String bookLocation,
               java.lang.String courseID)

Browser

public Browser(java.lang.String bookLocation,
               java.lang.String courseID,
               java.lang.String userName,
               java.lang.String password,
               boolean loadIndexOnStartup,
               boolean openLastPageOnStartup)
Constructs a Browser object, and attempts to log in to the database using the given user name and password

Parameters:
bookLocation -
courseID -
userName -
password -
loadIndexOnStartup -
openLastPageOnStartup - if true, then the browser will attempt to open the user's last viewing position when constructed
Method Detail

setDisplayDefaultAppPreferencesDialog

public static void setDisplayDefaultAppPreferencesDialog(boolean displayDefaultAppPreferencesDialog)
Records whether or not a dialog box should be shown when a user with no application preferences logs in

Parameters:
displayDefaultAppPreferencesDialog - true if a dialog should be shown, false otherwise

isLoadLastLogin

public static boolean isLoadLastLogin()
Determines whether any Browser instances that get created will look for the lastLogin file when they start

Returns:

setLoadLastLogin

public static void setLoadLastLogin(boolean load)
Sets whether any Browser instances will look for the last login file when they start

Parameters:
load - true if the Browser should try to login using stored credentials, false otherwise

setupFindInterface

private void setupFindInterface()
Sets up the portion of the user interface that is shown when the find button is clicked on. This includes the panel showing the find interface, the results interface, and some buttons that allow closing of the interface


setupOnlineMenu

private void setupOnlineMenu(boolean online)

setupLibrary

private void setupLibrary(java.lang.String bookLocation)
loads the publication library from disk, or creates a new one and adds the 120 textbook to the library if no previous library exists


gotoFirstDocument

public void gotoFirstDocument()
Moves to the first document in the current publication


gotoNextDocument

public void gotoNextDocument()
moves to the next document in the current publication, if one exists; otherwise a dialog box is displayed indicating that the end of the publication has been reached


checkEnableNext

private void checkEnableNext()

gotoLastDocument

public void gotoLastDocument()
Moves to the last document in the current publication


gotoPreviousDocument

public void gotoPreviousDocument(java.lang.String actionCommand)
moves to the next document in the current publication. A dialog box is displayed if there is no such document


checkEnablePrevious

private void checkEnablePrevious()

docEventOccurred

public void docEventOccurred(DocEvent de)
Specified by:
docEventOccurred in interface DocEventListener

openTOC

public void openTOC()

changeCursor

private void changeCursor(int cursor)

restoreCursor

private void restoreCursor()

registerScrollToCurrentLocation

protected void registerScrollToCurrentLocation()
forces the browser to return to the currently viewable position when page loading is complete


reload

public void reload()
requests that the document be reloaded


showLoginBox

private void showLoginBox(java.lang.String password)
equivalent to showLoginBox (password, true, true)


showLoginBox

private void showLoginBox(java.lang.String password,
                          boolean show,
                          boolean startThreads)
creates a login box the login box is actually shown if the boolean parameter show is set to true. It is only set to false if we are attempting to login with saved credentials. Because of the way loginOK works, we need to set up the LoginDialog box even if it isn't shown

Parameters:
switchUsers: - indicates whether users are being switched

showPasswordBox

private void showPasswordBox()

checkReturnInfo

private boolean checkReturnInfo(java.lang.String userName,
                                java.lang.String password)

getAuthenticator

protected Authenticator getAuthenticator()
This method returns the authenticator which the Browser is configured to use. Currently this is hardcoded to return an instance of DBAuthenticator, but in the future should be replaced with code to determine the configured Authenticator class and create an instance of that class

Returns:

checkInfo

private int checkInfo(java.lang.String userName,
                      java.lang.String password)

checkError

public void checkError(int c)

createLink

private void createLink()
Starts creating the link annotation. First, the instances of linkAddress and linkDestination must be initialized Opens the TOC in a new tab using the OpenDestinationTab method. James Boerkoel


openLinkDestinationTab

private void openLinkDestinationTab(java.lang.String url)

popNewTab

private void popNewTab()
Opens a new tab and inserts the current content


popOpenLink

private void popOpenLink(boolean newPage)
Opens the link which was clicked last either in current window or in a new window

Parameters:
newPage - - boolean to open in new page or not

popChangeLinkDest

private void popChangeLinkDest()
Chages the destination of the link


popChangeShare

private void popChangeShare()
Loads the annotation which was last clicked to Browser instance "notation" , and opens the share prefernces window for it


popChangeView

private void popChangeView()
Loads the annotation which was last clicked to Browser instance "notation", and opens the type prefernces window for it


popViewDetails

private void popViewDetails()
Loads the annotation which was last clicked to Browser instance "notation", and opens the view details window for it


popDeleteAnnotation

private void popDeleteAnnotation()
Loads the annotation which was last clicked to Browser instance "notation", and deletes it


popActivateAnnotation

private void popActivateAnnotation()
Activates the current annotation as if it were left clicked


showAnnBox

private void showAnnBox()

showAnnShareBox

private void showAnnShareBox()

doChangeShareWith

private void doChangeShareWith(Notation notation)

showBookmarkBox

private void showBookmarkBox()

showBookmarkEditBox

private void showBookmarkEditBox()

showViewPrefsBox

private void showViewPrefsBox()

showAnnotationPrefs

private void showAnnotationPrefs()

showHighlightPrefsBox

private void showHighlightPrefsBox()

showFindPanel

public void showFindPanel()

showResultsPanel

private void showResultsPanel(java.util.PriorityQueue<WebpageRelevance> pagesToReturn)

showAlertsBox

private void showAlertsBox(boolean all)

showGroupsManagerBox

private void showGroupsManagerBox()

checkURL

private java.lang.String checkURL(java.lang.String base)

checkFileURL

private java.lang.String checkFileURL(java.lang.String base)

deleteHighlight

protected void deleteHighlight(int offset,
                               boolean remove)

deleteHighlight

private void deleteHighlight(int startIndex,
                             int endIndex)

setMergeSelection

private void setMergeSelection(int startIndex,
                               int endIndex)

gotoAddress

public void gotoAddress(java.lang.String address)
scrolls the document so that the position requested is at the top of the ContentPane

Parameters:
address - the address identifying the offset in question

getCurrentTopAddress

protected java.lang.String getCurrentTopAddress()
compute an address representing the offset viewable at the top of the currently viewed page


loadLastTabs

private void loadLastTabs()
Loads the tabs that the user had open when the application was last closed.


restoreSizeAndPosition

private void restoreSizeAndPosition()
Loads the last size and position information from the database, then sizes and positions the window according to the information retrieved.


addNewTab

public void addNewTab(java.lang.String url)

setLastPage

private void setLastPage()

setViewPreferences

private void setViewPreferences()

saveApplicationPrefs

private void saveApplicationPrefs()

loadBookmarks

private void loadBookmarks(Criteria select,
                           javax.swing.JMenu addMenu,
                           java.lang.String actionCommand,
                           java.util.Hashtable bookmarks,
                           java.util.Hashtable pages,
                           java.util.Hashtable keys)
loads a particular set of bookmarks based on the criteria specified, which in particular specify the type of bookmark and an author, except for global bookmarks

Parameters:
select - the criteria used to filter the entries from the database

loadBookmarks

private void loadBookmarks()

loadUserBookmarks

private void loadUserBookmarks()

loadGlobalBookmarks

private void loadGlobalBookmarks()

loadAnnotationBookmarks

private void loadAnnotationBookmarks()

databaseEventOccurred

public void databaseEventOccurred(DatabaseEvent de)
Specified by:
databaseEventOccurred in interface DatabaseEventListener

getCurrentContentNotation

private void getCurrentContentNotation()

loadDiagram

private void loadDiagram(Notation notation)
helper method for the notationEventOccurred method; loads the specified diagram into a Diagram window, or an ink annotation window


setPreviousItem

protected void setPreviousItem(OEBItem previousItem)
records the location of the previous item in the book, and enables/disables navigational controls as needed

Parameters:
previousItem - an item from the OEBPackageFile holding information about the previous item, or null if there is no previous item

setNextItem

protected void setNextItem(OEBItem nextItem)
records the location of the next item in the book, and enables/disables navigational controls as needed

Parameters:
nextItem - an item from the OEBPackageFile holding information about the next item, or null if there is no next item

checkForAlerts

private int checkForAlerts()

checkForAllAlerts

private int checkForAllAlerts()

clearAlerts

private void clearAlerts(boolean dispose)

onWindowClose

public void onWindowClose(java.awt.event.WindowEvent we)

setupMenuBar

private void setupMenuBar()

setupActionMap

protected void setupActionMap()
Sets up the action map so that those actions with accelerators can have their accelerator actions forwarded to this component when it is in focus.


getActionsWithAccelerators

protected java.lang.Class[] getActionsWithAccelerators()
This method returns an array of classes that extend BaseAction for which accelerators should be added to the action map associated with the Browser

Returns:

setMode

protected void setMode(int mode)
puts the Browser into either book reading mode or web browsing mode. sets the text, action command and mnenomic of the back and forward buttons depending on the current viewing mode

Parameters:
mode - an integer representing whether the browser is in BOOK_VIEW or WEB_VIEW

setupCreatePanel

private void setupCreatePanel()

setupInkAnnotation

protected void setupInkAnnotation(Notation notation)

showNotationDetails

private void showNotationDetails(Notation theNotation)

setStatus

private void setStatus(java.lang.String message)

clearStatus

private void clearStatus()

setCurrentBar

private void setCurrentBar(javax.swing.Box bar)

closeSplitView

public void closeSplitView()

back

public void back()

forward

public void forward()

colorSelected

public void colorSelected()

highlight

public void highlight()

makeHighlight

public void makeHighlight()

createDiagram

public void createDiagram()

annotate

public void annotate()

getAnnotationURL

public static java.lang.String getAnnotationURL(OEBPackageFile currentBook,
                                                java.lang.String currentPage)

getAnnotationURL

public java.lang.String getAnnotationURL(java.lang.String currentPage)

post_link

public void post_link()

post_part1

public void post_part1()

post_part2

public void post_part2()

post_part3

public int post_part3(java.lang.String subject)

post_part3

public int post_part3(java.lang.String subject,
                      boolean loadIcon)

post_part3

public int post_part3(java.lang.String subject,
                      boolean loadIcon,
                      boolean computeUniqueTitle)

postNotationModes

private void postNotationModes(int id,
                               java.util.Vector shareWith,
                               java.util.Vector targetTo)

delete

public void delete()

delete

public void delete(boolean prompt)

exit

public void exit()

listNotations

public void listNotations()

openWeb

public void openWeb()

openFile

public void openFile()

gotoBook

public void gotoBook()
returns to the last viewed location in the book


gotoWeb

public void gotoWeb()
returns to the last web page viewed


paste

public void paste()

enableNotes

public void enableNotes()

checkEnable

public void checkEnable()

showFontSizeBox

private void showFontSizeBox()

fontSizeCanel

private void fontSizeCanel()

fontSizeOk

private void fontSizeOk()

increaseFontSize

public void increaseFontSize()
Increases the current user's font size by 2 points


decreaseFontSize

public void decreaseFontSize()

changeUserFontSize

private void changeUserFontSize(float size)

highlightPrefsOK

public void highlightPrefsOK()

highlightPrefsCancel

public void highlightPrefsCancel()

highlightDefault

public void highlightDefault()

changeColor

public void changeColor(java.awt.event.ActionEvent e)

viewPrefsOK

public void viewPrefsOK()

viewPrefsCancel

public void viewPrefsCancel()

bookmarkSelect

public void bookmarkSelect()

loadBookmark

public void loadBookmark(java.awt.event.ActionEvent actionevent)

loadGlobalBookmark

public void loadGlobalBookmark(java.awt.event.ActionEvent actionevent)

loadAnnBookmark

public void loadAnnBookmark(java.awt.event.ActionEvent actionevent)

loadBookmark

public void loadBookmark(Bookmark b)

bookmarkOK

public void bookmarkOK()

bookmarkClear

public void bookmarkClear()

bookmarkUpdate

public void bookmarkUpdate()

bookmarkRemove

public void bookmarkRemove(java.lang.String name,
                           java.lang.String selectedType)

goAlert

public void goAlert(boolean all)

getRootDiscussion

private Notation getRootDiscussion(Notation replyDiscussion)

deleteAlert

public void deleteAlert()

loginOK

public boolean loginOK()

selectBook

public void selectBook()

completeLogin

private void completeLogin(java.lang.String user,
                           java.lang.String pw,
                           boolean savePW)

isDisplayDefaultAppPreferencesDialog

private static boolean isDisplayDefaultAppPreferencesDialog()
Determines whether or not the browser should display a message when a user logs in and no application preferences are available for that user

Returns:

getOldAlerts

private void getOldAlerts()

setOldAlerts

private void setOldAlerts(int old)

isUser

private boolean isUser(java.lang.String userName)

loginClear

public void loginClear()

loginCancel

public void loginCancel()

passwordOK

public void passwordOK()

decryptPassword

private java.lang.String decryptPassword(java.lang.String pwd)

encryptPassword

private java.lang.String encryptPassword(java.lang.String pwd)

setPage

public void setPage(java.lang.String url,
                    java.lang.String startAddress)
causes the Browser to load a particular page and then scroll to a starting address within that page This is made necessary by the lack of the integration of a ScrollPane in the ContentPane class, and should be migrated away from in future implementation


commonUpdateNotation

public boolean commonUpdateNotation(AnnotationBox annotationBox,
                                    Notation n,
                                    DBClient client,
                                    java.lang.String userName)
This method deals with updating the appropriate properties in the notation n based on the values stored in the AnnotationBox annotationBox. It then uses client to update the notation based on the values stored in n

Parameters:
annotationBox: - the AnnotationBox containing the type, display type, bookmark and reference properties to use. This method is called when updating text annotations via the button on the AnnotationBar within Browser; it is also called when requested by the InkAnnotationWindow editing an ink diagram
n: - the notation object containing at least the id value for the annotation to be updated
client: - a DBClient object used to perform the update
userName: - the user name of the currently logged in user
Returns:
true if this change should make the caller refresh any ContentPane objects it knows about containing notation n; false otherwise

checkForAnnotationSelectionChanges

public boolean checkForAnnotationSelectionChanges(Notation original)
checks to see whether a new selection has been made for Notation object original

Returns:
true if changes requiring a reload were made

handleChangeType

public void handleChangeType()
This method pops up an AnnotationBox, and allows the user to change the type of the annotation, and the display mode.


getFileURL

public static java.lang.String getFileURL(java.lang.String fileName)
constructs a file URL referencing the file fileName located in the current directory


run

public void run()
Specified by:
run in interface java.lang.Runnable

startAnnotation

public void startAnnotation(java.awt.event.ActionEvent e)

postAnnotationBookmark

protected void postAnnotationBookmark(java.lang.String subject,
                                      java.lang.String url,
                                      java.lang.String addressStart,
                                      java.lang.String id)

saveAnnotation

public void saveAnnotation(Notation notation,
                           java.lang.String subject,
                           byte[] isfData,
                           byte[] pngData,
                           java.awt.Dimension size)
Called when the annotation editor has requested the specified annotation to be saved

Specified by:
saveAnnotation in interface InkCallback

deleteAnnotation

public void deleteAnnotation(Notation notation,
                             java.awt.Dimension size)
Called when the annotation editor has requested the specified annotation to be deleted

Specified by:
deleteAnnotation in interface InkCallback

showDetails

public void showDetails(Notation notation)
Called when the annotation editor has requested that the details of the specified annotation be shown

Specified by:
showDetails in interface InkCallback

changeDisplayType

public void changeDisplayType(Notation notation)
Description copied from interface: InkCallback
Called when the annotation editor has requested that the user be allowed to change the display type of the specified annotation

Specified by:
changeDisplayType in interface InkCallback

changeShareWith

public void changeShareWith(Notation notation)
Called when the annotation editor has requested that the user be allowed to change who the specified annnotation is shared with

Specified by:
changeShareWith in interface InkCallback

closeAnnotation

public void closeAnnotation(Notation notation,
                            java.awt.Dimension browserSize)
Called when the annotation editor has requested that the currently edited annotation be closed

Specified by:
closeAnnotation in interface InkCallback

cannotContactServer

public void cannotContactServer(java.lang.Exception e)
Called when the InkAnnotationWindow class cannot set up a connection with the windows server

Specified by:
cannotContactServer in interface InkCallback
Parameters:
e - an exception describing the problem

startAlertsThread

public Browser.AlertsThread startAlertsThread(NavigationBar navBar)

main

public static void main(java.lang.String[] args)

startBrowser

public static void startBrowser(java.lang.String bookLocation,
                                java.lang.String courseID)

getNotationHandler

protected Browser.NotationEventHandler getNotationHandler()

getUserName

public static java.lang.String getUserName()

getGlobalbookmarkmenu

public javax.swing.JMenu getGlobalbookmarkmenu()

getCurrentBook

public OEBPackageFile getCurrentBook()
Returns:

getCurrentPage

public java.lang.String getCurrentPage()
Returns the page currently loaded in the active tab of the tabbed content pane contained in this Browser

Specified by:
getCurrentPage in interface ContentContainer
Returns:
the URL of the currently loaded page

getTabbedPane

protected TabbedContentPane getTabbedPane()
Returns:

getPreferences

private java.util.Hashtable<ApplicationPreferences,java.lang.Object> getPreferences()
Delegates retrieval of application preferences to the User object. This method exists for backwards compatibility only

Returns:
a Hashtable of preferences associated with the application

getContent

public ContentPane getContent()
Specified by:
getContent in interface ContentContainer

updateCurrentItemFromSelectedTab

protected void updateCurrentItemFromSelectedTab()
Updates the currentItem member based on the currently selected tab, and then updates the Next and Previous page actions based on the current item


closeAllButThisTab

public boolean closeAllButThisTab(int index)
Closes all tabs except for the tab specified by index. If the value for index passed is invalid, then the method returns false and no changes are made.

Parameters:
index - the tab to keep open
Returns:
true if the tab specified by index exists, false otherwise