|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JEditorPane
eTextReader.ContentPane
public class ContentPane
An extension of JScrollPane which displays text, and can display
annotations. This class also is used in conjunction with the
NotationEventListener interface, which allows a class to listen for events
from this pane.
ContentPane is based mostly on part of the Prototype class written by
Marty Kane and Carrie Halvorsen 10/2002.
Properties that affect the behavior of this class:
NotationEventListener
,
Serialized FormNested Class Summary | |
---|---|
(package private) class |
ContentPane.HyperlinkHandler
This class handles hyperlink events, including clicking on hyperlinks on the page, as well as mousing into and out of annotation icons |
(package private) class |
ContentPane.PopupMouseHandler
Keeps track of the current mouse pointer location. |
(package private) class |
ContentPane.QuickActionSelectionListener
This class listens for changes to the caret, and enables/disables the QuickAnnotation actions depending on whether a selection has been made |
class |
ContentPane.SelectionOffsets
A simple wrapper class to hold the starting and ending offsets of a selection |
Nested classes/interfaces inherited from class javax.swing.JEditorPane |
---|
javax.swing.JEditorPane.AccessibleJEditorPane, javax.swing.JEditorPane.AccessibleJEditorPaneHTML, javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
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 | |
---|---|
static java.lang.String |
ANNOT_ICON
|
private java.lang.Object |
annotationHighlight
|
private OEBPackageFile |
book
|
static int |
BOOK_VIEW
|
static java.lang.String |
BOOKMARK_ICON
|
private DBClient |
client
|
private int |
containerHeight
|
private AnnotationLinkInfo |
currentNotationInfo
|
private java.lang.String |
currentPage
|
private java.lang.String |
currentPageTitle
The title of the current page, or UNKNOWN_TITLE if not yet known |
static java.lang.String |
DEFAULT_PAGE
|
static java.lang.String |
DIAGRAM_ICON
|
static java.lang.String |
DISCUSS_ICON
|
private javax.swing.text.Document |
doc
|
static java.lang.String |
FIND_ICON
|
static java.lang.String |
GLOBAL_BOOKMARK_ICON
|
private static boolean |
globalSheetModified
|
static java.lang.String |
HIGHLIGHT_CURSOR
|
static java.lang.String |
HIGHLIGHT_ICON
|
private javax.swing.text.DefaultHighlighter |
highlighter
|
private java.util.ArrayList<HighlighterInfo> |
highlighterInfoList
|
private static java.lang.String |
homeDir
|
static java.lang.String |
INK_ICON
|
static java.lang.String |
INLINE_HREF
|
static int |
LAST_OFFSET
|
static java.lang.String |
LINK_ICON
|
private java.util.Vector<NotationEventListener> |
listeners
|
private boolean |
loadAnnotationsOnSetPage
Determines whether annotations should be loaded after a page is loaded. |
private java.util.Map<java.lang.Integer,Notation> |
loadedNotations
This map keeps track of the annotations that have been loaded into this page |
private java.lang.String |
loadPage
|
private java.util.Hashtable |
locations
|
protected eTextReader.loggingInterface.Logger |
log
Logs open page events |
private static org.apache.log4j.Logger |
logger
|
private static java.awt.event.ActionListener |
menulistener
|
private int |
mouseX
|
private int |
mouseY
|
private boolean |
navigation
|
static java.lang.String |
NO_HIGHLIGHT_ICON
|
protected boolean |
pageContainedReference
Determines whether currently loaded page contained a reference when it was loaded |
static java.lang.String |
POPUP_ICON
|
private ContentPane.PopupMouseHandler |
popupMouseHandler
|
static java.lang.String |
PROGRAM_ICON
|
private java.util.Vector |
selectAtt
|
private javax.swing.text.SimpleAttributeSet |
selectedAttributes
|
private java.util.Vector |
selectEnd
|
private java.util.Vector |
selectStart
|
private static java.lang.String |
STOP_HREF
|
static java.lang.String |
STOP_ICON
|
static java.lang.String |
TAGS_URL
|
static java.lang.String |
UNKNOWN_TITLE
|
private int |
viewMode
|
static int |
WEB_VIEW
|
Fields inherited from class javax.swing.JEditorPane |
---|
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ContentPane(OEBPackageFile currentBook)
Default Constructor |
Method Summary | |
---|---|
void |
activateLink()
|
void |
activateLink(boolean newTab)
|
void |
addNotationEventListener(NotationEventListener listener)
Register an object as a NotationEventListener of this pane. |
void |
copy()
|
void |
cut()
|
boolean |
deleteAnnotation(Notation notation)
Removes the specified annotation from the document (and the database) without prompting the user. |
boolean |
deleteAnnotation(Notation notation,
boolean prompt)
Removes the specified annotation from the document (and the database) without prompting the user. |
HighlighterInfo |
deleteHighlight(int offset)
Removes any highlight located which offset is contained within. |
void |
deleteHighlight(int offset,
boolean remove)
|
private Browser |
findParentBrowser()
|
private javax.swing.JViewport |
findViewport()
Helper function for scrollToReference, which locates the JViewport element containing this content pane |
void |
fireErrorEvent(NotationEvent ne)
Send a NotationEvent to all registered listeners. |
void |
fireNotationEvent(NotationEvent ne)
Send a NotationEvent to all registered listeners. |
void |
firePageChangeEvent(NotationEvent ne)
Send a NotationEvent to all registered listeners. |
static java.lang.String |
getAddress(int offset,
javax.swing.text.Document doc)
calls getAddress(int offset, Document doc, boolean end) with
the value of end defaulted to false |
static java.lang.String |
getAddress(int offset,
javax.swing.text.Document doc,
boolean end)
convert an offset in the document to an element-tree adress. |
java.lang.String |
getAddressEnd()
|
java.lang.String |
getAddressEnd(boolean inline)
Get the address of the end of the current selection in the content pane. |
java.lang.String |
getAddressStart()
|
java.lang.String |
getAddressStart(boolean inline)
Get the address of the start of the current selection in the content pane. |
java.lang.String |
getAddressTop()
Gets the address of the element currently loaded at the top of the page |
OEBPackageFile |
getBook()
|
static java.awt.Color |
getColor(java.lang.String color)
Convert a String of form R G B to a Color object. |
ContentPane |
getContent()
|
int |
getCurrentNotationID()
|
java.lang.String |
getCurrentPage()
Retrieves the URL of the currently loaded page. |
javax.swing.text.DefaultHighlighter |
getDefaultHighlighter()
Retrieve the default highlighter of this content pane |
int |
getExtraWhitespace()
|
float |
getFontSize()
|
java.util.ArrayList<HighlighterInfo> |
getHighlighterInfoList()
Retrieve the list of highlighter info from this content pane |
static java.lang.String |
getHomeDir()
retrieve the location where icons and the textbook are being loaded from |
void |
getHyperlinkListener(javax.swing.event.HyperlinkListener hl)
|
private static java.lang.String |
getID(javax.swing.text.Element element)
|
ContentPane |
getInstance()
|
private java.lang.String |
getMimeTypeFromStream(java.lang.String address)
Retrieves the content type returned by the URL at address address by making a connection to the URL and requesting the content type from the network. |
int |
getMode()
|
java.awt.Point |
getMousePosition()
Get the current location of the mouse pointer |
static int |
getOffset(java.lang.String address,
javax.swing.text.Document doc)
convert an address to an offset in the document. |
java.lang.String |
getPageTitle()
retrieves the title of the currently loaded page; it looks |
static java.lang.String |
getRGBString(java.awt.Color c)
Converts a color object object into a string of form RGB, using space as a delimiter. |
static java.lang.String |
getRGBString(java.awt.Color c,
char delimiter)
Convert a color object into a String of form R G B. |
java.lang.String |
getSelectedText()
|
java.lang.String |
getSelectedTextPreview(int maxLength)
|
ContentPane.SelectionOffsets |
getSelectionOffsets(java.lang.String startAddress,
java.lang.String endAddress)
Looks up the starting and ending offsets for a beginning, ending pair of addresses |
private void |
handlePagePropertyChange(java.beans.PropertyChangeEvent pce)
|
private void |
handleUnknownContentType(java.lang.String url,
java.lang.String contentType)
|
protected void |
insertInlineAnnotation(Notation notation,
int s,
int e)
|
boolean |
isHyperlinkEnabled()
Check whether hyperlink traversal is enabled in this ContentPane. |
boolean |
isLoadAnnotationsOnSetPage()
|
boolean |
isPageContainedReference()
Determines whether the most recently loaded page contained a reference |
void |
loadHighlight(java.awt.Color theColor,
java.lang.String start,
java.lang.String end)
Paints a single highlight. |
void |
loadHighlight(java.awt.Color color,
java.lang.String start,
java.lang.String end,
int IDtag,
java.lang.String user)
|
void |
loadHighlightList(java.util.Vector list)
Takes a Vector of Notations and paints the highlights. |
protected boolean |
loadLink(Notation next)
Loads an annotation of type Notation.AnnotationType.LINK into the document |
void |
loadNotationList(java.util.Vector list,
ViewingPrefs viewCategories)
Takes a Vector of Notations and displays the appropriate content in the pane. |
protected boolean |
loadReadingBookmark(Notation notation)
Loads a reading bookmark annotation into the content. |
protected boolean |
loadTextAnnotation(Notation notation)
Loads a single text annotation. |
void |
loadTextAnnotationList(java.util.Vector list)
Takes a Vector of Notations and insert the icons. |
private java.lang.String |
makeAnnotationHREF(Notation notation)
Constructs the anchor and image HTML associated with the given notation. |
static java.lang.String |
makeNotationHref(int id)
creates a file URL appropriate for the given diagram annotation |
static java.lang.String |
makeNotationHref(java.lang.String filename)
|
protected void |
markLinkVisited(Notation notation)
Marks the notation indicated by notation as having been visited before; it does this by changing the character attributes of the linked text/image |
void |
propertyChange(java.beans.PropertyChangeEvent pce)
Listens for changes in the property "page" of the content pane. |
static void |
registerMenuListener(java.awt.event.ActionListener ml)
|
void |
registerSelectionListener(javax.swing.event.CaretListener listener)
|
void |
removeAllHighlights()
|
void |
removeNotationEventListener(NotationEventListener listener)
Remove an object as a NotationEventListener of this pane. |
void |
scrollToReference(java.lang.String reference)
|
void |
setBook(OEBPackageFile book)
|
void |
setContainerHeight(int height)
|
void |
setCurrentPage(java.lang.String page)
|
void |
setCursorToDefault()
This method resets the cursor for this component to its default; it does this by forwarding the request to the HTMLEditorKit's getDefaultCursor method. |
void |
setCustomHighlight(java.awt.Color back,
java.awt.Color fore)
|
void |
setDefaultCursor(java.awt.Cursor cursor)
|
void |
setExtraWhitespace(int amount)
|
void |
setFontSize(float size)
Sets the font size associated with this content pane. |
void |
setHighlighterInfoList(java.util.ArrayList al)
|
void |
setHyperlinkEnabled(boolean enabled)
Set whether or not hyperlink traversal is enabled in this ContentPane. |
void |
setLoadAnnotationsOnSetPage(boolean loadAnnotationsOnSetPage)
|
void |
setLoadPage(java.lang.String page)
|
void |
setMode(int newMode)
|
void |
setPage(java.lang.String address)
|
void |
setPage(java.lang.String address,
boolean reload)
loads a new page and notifies listeners when loading is complete. |
void |
setPage(java.net.URL url)
Sets the current page to the URL specified. |
void |
setPage(java.net.URL url,
boolean reload)
Sets the page to the URL specified, potentially forcing a reload |
private void |
setPageTitle()
|
void |
showAnnotationSelection(java.lang.String start,
java.lang.String end)
|
protected void |
updateDocumentStyleSheet()
|
protected void |
updateGlobalStyleSheet()
Updates the global stylesheet by removing how inline annotations should be rendered; Also removes any style information associated with links, so that we can change the styling based on user preferences |
java.util.ArrayList |
updateSelection(int x,
int y)
|
Methods inherited from class javax.swing.JEditorPane |
---|
addHyperlinkListener, createDefaultEditorKit, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKit, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getPreferredSize, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getStream, getText, getUIClassID, paramString, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, replaceSelection, setContentType, setEditorKit, setEditorKitForContentType, setText |
Methods inherited from class javax.swing.text.JTextComponent |
---|
addCaretListener, addInputMethodListener, addKeymap, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.Map<java.lang.Integer,Notation> loadedNotations
public static final int BOOK_VIEW
public static final int WEB_VIEW
private int viewMode
public static final java.lang.String UNKNOWN_TITLE
public static final int LAST_OFFSET
private static boolean globalSheetModified
private boolean loadAnnotationsOnSetPage
private int mouseX
private int mouseY
private ContentPane.PopupMouseHandler popupMouseHandler
private java.lang.String currentPage
private java.lang.String loadPage
private java.lang.String currentPageTitle
private javax.swing.text.Document doc
private javax.swing.text.DefaultHighlighter highlighter
private java.util.ArrayList<HighlighterInfo> highlighterInfoList
private java.util.Vector selectAtt
private java.util.Vector selectStart
private java.util.Vector selectEnd
private javax.swing.text.SimpleAttributeSet selectedAttributes
private java.util.Hashtable locations
private java.util.Vector<NotationEventListener> listeners
private boolean navigation
private int containerHeight
private DBClient client
private static org.apache.log4j.Logger logger
public static final java.lang.String INLINE_HREF
private static final java.lang.String STOP_HREF
private static java.lang.String homeDir
public static final java.lang.String ANNOT_ICON
public static final java.lang.String POPUP_ICON
public static final java.lang.String DISCUSS_ICON
public static final java.lang.String HIGHLIGHT_ICON
public static final java.lang.String HIGHLIGHT_CURSOR
public static final java.lang.String NO_HIGHLIGHT_ICON
public static final java.lang.String DIAGRAM_ICON
public static final java.lang.String LINK_ICON
public static final java.lang.String INK_ICON
public static final java.lang.String PROGRAM_ICON
public static final java.lang.String BOOKMARK_ICON
public static final java.lang.String GLOBAL_BOOKMARK_ICON
public static final java.lang.String FIND_ICON
public static final java.lang.String DEFAULT_PAGE
public static final java.lang.String STOP_ICON
public static java.lang.String TAGS_URL
private java.lang.Object annotationHighlight
private static java.awt.event.ActionListener menulistener
private AnnotationLinkInfo currentNotationInfo
protected eTextReader.loggingInterface.Logger log
private OEBPackageFile book
protected boolean pageContainedReference
Constructor Detail |
---|
public ContentPane(OEBPackageFile currentBook)
Method Detail |
---|
protected void markLinkVisited(Notation notation)
notation
- public void setCursorToDefault()
public void setPage(java.net.URL url)
setPage
in class javax.swing.JEditorPane
public void setPage(java.net.URL url, boolean reload)
url
- the new URL to navigate toreload
- if true, forces a reload of the page, even if it is the current pagepublic void setPage(java.lang.String address)
setPage
in class javax.swing.JEditorPane
public void setPage(java.lang.String address, boolean reload)
address
- the page to loadreload
- if the currently displayed page and the specified address
are the same, true causes the page to reloadprivate java.lang.String getMimeTypeFromStream(java.lang.String address)
address
- the URL to retrieve
public java.lang.String getPageTitle()
public int getMode()
public void setMode(int newMode)
public void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
private void setPageTitle()
private void handlePagePropertyChange(java.beans.PropertyChangeEvent pce)
public void showAnnotationSelection(java.lang.String start, java.lang.String end)
public void activateLink()
public void activateLink(boolean newTab)
public void setLoadPage(java.lang.String page)
public void setCurrentPage(java.lang.String page)
public HighlighterInfo deleteHighlight(int offset)
offset
-
public void deleteHighlight(int offset, boolean remove)
public void removeAllHighlights()
private void handleUnknownContentType(java.lang.String url, java.lang.String contentType)
public void loadNotationList(java.util.Vector list, ViewingPrefs viewCategories)
loadHighlightList
or loadTextNotationList
may
be faster if all the notations to be displayed are known to be of the
same type.
list
- the Vector of Notations to display.viewCategories
- a ViewingPrefs object containing the user's preferencesprivate java.lang.String makeAnnotationHREF(Notation notation)
notation
- the annotation whose HTML is being generated
protected boolean loadTextAnnotation(Notation notation)
notation
- the Notation object representing this annotationstart
- the start address of the notation being loaded. If this
parameter is blank, no icon will be displayed.end
- the ending address of the notation being loaded. If this
parameter is blank, no icon will be displayed.type
- the type of the notation being loaded.body
- the body of the notation being loaded.regarding
- the value of the notation's regarding field - null
unless it is a reply to a discussionprotected boolean loadLink(Notation next)
next
- protected boolean loadReadingBookmark(Notation notation)
notation
- public void loadHighlightList(java.util.Vector list)
list
- the Vector of Notations to paint.public void loadHighlight(java.awt.Color theColor, java.lang.String start, java.lang.String end)
theColor
- the color of this highlight.start
- the start address.end
- the end address.public void loadHighlight(java.awt.Color color, java.lang.String start, java.lang.String end, int IDtag, java.lang.String user)
public void loadTextAnnotationList(java.util.Vector list)
list
- the Vector of Notations to insert icons for. This method does
not check the list contents, so only text notations should be included.
Note, the list of notations should include the id, the starting
and ending addresses, the type, and the body of the annotations.public boolean deleteAnnotation(Notation notation)
notation
- the annotation to delete
public boolean deleteAnnotation(Notation notation, boolean prompt)
notation
- the annotation to deleteprompt
- whether or not the user should be prompted for
confirmation before deleting the annotation
public ContentPane.SelectionOffsets getSelectionOffsets(java.lang.String startAddress, java.lang.String endAddress) throws javax.swing.text.BadLocationException
startAddress
- endAddress
-
javax.swing.text.BadLocationException
protected void insertInlineAnnotation(Notation notation, int s, int e) throws javax.swing.text.BadLocationException, java.io.IOException
javax.swing.text.BadLocationException
java.io.IOException
public void fireNotationEvent(NotationEvent ne)
ne
- the NotationEvent to send.public void firePageChangeEvent(NotationEvent ne)
ne
- the NotationEvent to send.public void fireErrorEvent(NotationEvent ne)
ne
- the NotationEvent to send.public void addNotationEventListener(NotationEventListener listener)
listener
- the listener object.public void removeNotationEventListener(NotationEventListener listener)
listener
- this listener object to be removedpublic java.lang.String getCurrentPage()
getCurrentPage
in interface ContentContainer
includeRef
- specifies whether or not to include the ref portion of the
URL
public java.lang.String getAddressStart(boolean inline)
public java.lang.String getAddressStart()
public java.lang.String getAddressTop()
public java.lang.String getAddressEnd(boolean inline)
public java.lang.String getAddressEnd()
public boolean isHyperlinkEnabled()
public void setHyperlinkEnabled(boolean enabled)
enabled
- true if hyperlinks are to be enabled, false otherwise.public static java.lang.String getAddress(int offset, javax.swing.text.Document doc)
getAddress(int offset, Document doc, boolean end)
with
the value of end defaulted to false
offset
- the integer offset in the document. This tells the method
where in the document the user clicked, and allows it to compute the
address.doc
- the Document model to use.public static java.lang.String makeNotationHref(int id)
id
- the id of the notation in question
public static java.lang.String makeNotationHref(java.lang.String filename)
public static java.lang.String getAddress(int offset, javax.swing.text.Document doc, boolean end)
offset
- the integer offset in the document. This tells the method
where in the document the user clicked, and allows it to compute the
address.doc
- the Document model to use.end
- if true, moves generated address to the end of the selected block
private static java.lang.String getID(javax.swing.text.Element element)
public static int getOffset(java.lang.String address, javax.swing.text.Document doc)
address
- the address to parse.doc
- the Document model to use.
public static java.awt.Color getColor(java.lang.String color)
color
- the String to convert.
public javax.swing.text.DefaultHighlighter getDefaultHighlighter()
public java.util.ArrayList<HighlighterInfo> getHighlighterInfoList()
public void setHighlighterInfoList(java.util.ArrayList al)
public void setDefaultCursor(java.awt.Cursor cursor)
public static java.lang.String getRGBString(java.awt.Color c)
getRGBString (c, ' ')
- Parameters:
c
- the Color object to convert
- Returns:
- a string representing the red, green and blue components of c
public static java.lang.String getRGBString(java.awt.Color c, char delimiter)
c
- the Color object to convert.delimiter
- the character used to separate the various components from each other in the string
public void getHyperlinkListener(javax.swing.event.HyperlinkListener hl)
public void copy()
copy
in class javax.swing.text.JTextComponent
public void cut()
cut
in class javax.swing.text.JTextComponent
public void setContainerHeight(int height)
public void setExtraWhitespace(int amount)
public int getExtraWhitespace()
public void setFontSize(float size)
protected void updateGlobalStyleSheet()
protected void updateDocumentStyleSheet()
public float getFontSize()
public static java.lang.String getHomeDir()
public ContentPane getInstance()
public java.awt.Point getMousePosition()
getMousePosition
in class java.awt.Component
Point
corresponding to the current location of the mouse pointerpublic void registerSelectionListener(javax.swing.event.CaretListener listener)
public static void registerMenuListener(java.awt.event.ActionListener ml)
public java.util.ArrayList updateSelection(int x, int y)
public java.lang.String getSelectedTextPreview(int maxLength)
public java.lang.String getSelectedText()
getSelectedText
in class javax.swing.text.JTextComponent
public void setCustomHighlight(java.awt.Color back, java.awt.Color fore)
public int getCurrentNotationID()
public OEBPackageFile getBook()
public void setBook(OEBPackageFile book)
book
- the book to setpublic void scrollToReference(java.lang.String reference)
scrollToReference
in class javax.swing.JEditorPane
private javax.swing.JViewport findViewport()
public boolean isLoadAnnotationsOnSetPage()
public void setLoadAnnotationsOnSetPage(boolean loadAnnotationsOnSetPage)
private Browser findParentBrowser()
public boolean isPageContainedReference()
public ContentPane getContent()
getContent
in interface ContentContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |