eTextReader
Class NotationEvent

java.lang.Object
  extended by java.util.EventObject
      extended by eTextReader.NotationEvent
All Implemented Interfaces:
java.io.Serializable

public class NotationEvent
extends java.util.EventObject

A class to hold a notation for a document.

Version:
1.0, 10/29/2002
Author:
Marty Kane and Emily Tennant
See Also:
NotationEventListener, Serialized Form

Field Summary
private  javax.swing.text.Element element
           
private  java.lang.String end
           
static int ERROR_HYPERLINK_DISABLED
          The hyperlink_disabled error type.
static int ERROR_INVALID_TYPE
          The invalid notation type error.
static int ERROR_INVALID_URL
          The invalid URL error type.
static int ERROR_NONE
          The null error type.
static int ERROR_PAGE_NOT_FOUND
          The page not found error type.
static int ERROR_SAME_PAGE
          The same page error.
private  int errorCode
           
static int EVENT_ERROR
          The error event type.
static int EVENT_NONE
          The NULL event type
static int EVENT_NOTATION_ENTERED
          The notation entered event type.
static int EVENT_NOTATION_EXITED
          The notation exited event type.
static int EVENT_NOTATION_SELECTED
          The notation selected event type.
static int EVENT_PAGE_CHANGE
          The page change event type.
private  int eventType
           
private  java.lang.Exception exception
           
private  int id
           
private  java.lang.String newPage
           
private  Notation notation
           
static int NOTATION_DELETED
          Indicates that the given annotation has been deleted from the content pane
private  java.lang.String notationBody
           
private  java.lang.String notationType
           
private  java.lang.String notationViewMode
           
private  java.lang.String oldPage
           
private  java.lang.Object parameter
           
private  java.lang.String start
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
private NotationEvent(java.lang.Object source)
           
  NotationEvent(java.lang.Object source, javax.swing.text.Element element, int eventType, Notation notation, java.lang.String oldPage, java.lang.String newPage, int errorCode)
          Constructs a new NotationEvent object.
  NotationEvent(java.lang.Object source, javax.swing.text.Element element, int eventType, Notation notation, java.lang.String oldPage, java.lang.String newPage, java.lang.Object parameter, int errorCode, java.lang.Exception exception)
          Constructs a new NotationEvent object.
  NotationEvent(java.lang.Object source, int eventType, java.lang.String oldPage, java.lang.String newPage, int errorCode)
           
  NotationEvent(java.lang.Object source, int eventType, java.lang.String oldPage, java.lang.String newPage, int errorCode, java.lang.Exception exception)
           
 
Method Summary
 javax.swing.text.Element getElement()
           
 java.lang.String getEnd()
          Get the ending address
 int getErrorCode()
          Get the error type
 int getEventType()
          Get the event type
 java.lang.Exception getException()
          Get the embedded exception
 int getId()
          Get the notation id
 java.lang.String getNewPage()
          Get the new page
 Notation getNotation()
           
 java.lang.String getNotationBody()
          Get the notation body
 java.lang.String getNotationType()
          Get the notation type
 java.lang.String getNotationViewMode()
          Get the notation view mode
 java.lang.String getOldPage()
          Get the old page
 java.lang.Object getParameter()
           
 java.lang.String getStart()
          Get the starting address
 void setNewPage(java.lang.String newPage)
           
 void setOldPage(java.lang.String oldPage)
          The following two methods exist to allow the URL's to be replaced by the Browser class when dealing with discussions, as the browser just passes a NotationEvent to the DiscussionWindow when it is created, and Browser needs to edit the URL's based on the book they came from
 void setParameter(java.lang.Object parameter)
           
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVENT_NONE

public static int EVENT_NONE
The NULL event type


EVENT_NOTATION_SELECTED

public static int EVENT_NOTATION_SELECTED
The notation selected event type. Indicates that a notation was clicked.


EVENT_NOTATION_ENTERED

public static int EVENT_NOTATION_ENTERED
The notation entered event type. Indicates that the curser was moved over a notation.


EVENT_NOTATION_EXITED

public static int EVENT_NOTATION_EXITED
The notation exited event type. Indicates that the curser was moved off of a notation.


EVENT_PAGE_CHANGE

public static int EVENT_PAGE_CHANGE
The page change event type. Indicates that the current page of the pane changed.


EVENT_ERROR

public static int EVENT_ERROR
The error event type. Indicates that an error occured in the pane


NOTATION_DELETED

public static final int NOTATION_DELETED
Indicates that the given annotation has been deleted from the content pane

See Also:
Constant Field Values

ERROR_NONE

public static int ERROR_NONE
The null error type. Indicates that there were no errors.


ERROR_PAGE_NOT_FOUND

public static int ERROR_PAGE_NOT_FOUND
The page not found error type. Indicates that the page was not found.


ERROR_INVALID_URL

public static int ERROR_INVALID_URL
The invalid URL error type. Indicates that the url the pane attempted to load was invalid.


ERROR_HYPERLINK_DISABLED

public static int ERROR_HYPERLINK_DISABLED
The hyperlink_disabled error type. This will be included in a page_changed event if navigation was disabled (meaning that the new page was not actually loaded).


ERROR_INVALID_TYPE

public static int ERROR_INVALID_TYPE
The invalid notation type error. Will be reported if a notation is passed to the loadNotationList function (which does type checking) with a type field that cannot be displayed by the ContentPane.


ERROR_SAME_PAGE

public static int ERROR_SAME_PAGE
The same page error. Not so much an error really. Just informs any listeners that the page did not actually change. Typically, this occurs when there is a setPage called with a new fragment and/or set of arguments appended to the specified url parameter.


element

private javax.swing.text.Element element

eventType

private int eventType

notation

private Notation notation

id

private int id

start

private java.lang.String start

end

private java.lang.String end

oldPage

private java.lang.String oldPage

newPage

private java.lang.String newPage

notationType

private java.lang.String notationType

notationViewMode

private java.lang.String notationViewMode

notationBody

private java.lang.String notationBody

errorCode

private int errorCode

exception

private java.lang.Exception exception

parameter

private java.lang.Object parameter
Constructor Detail

NotationEvent

private NotationEvent(java.lang.Object source)

NotationEvent

public NotationEvent(java.lang.Object source,
                     javax.swing.text.Element element,
                     int eventType,
                     Notation notation,
                     java.lang.String oldPage,
                     java.lang.String newPage,
                     int errorCode)
Constructs a new NotationEvent object.

Parameters:
source - the source of this event
eventType - the event type of this event
oldPage - the old page, or the current page if there was no change
newPage - the new page, if the page changed. If there was an error,
errorCode - indicates any error that occured

NotationEvent

public NotationEvent(java.lang.Object source,
                     int eventType,
                     java.lang.String oldPage,
                     java.lang.String newPage,
                     int errorCode,
                     java.lang.Exception exception)

NotationEvent

public NotationEvent(java.lang.Object source,
                     int eventType,
                     java.lang.String oldPage,
                     java.lang.String newPage,
                     int errorCode)

NotationEvent

public NotationEvent(java.lang.Object source,
                     javax.swing.text.Element element,
                     int eventType,
                     Notation notation,
                     java.lang.String oldPage,
                     java.lang.String newPage,
                     java.lang.Object parameter,
                     int errorCode,
                     java.lang.Exception exception)
Constructs a new NotationEvent object.

Parameters:
source - the source of this event
eventType - the event type of this event
id - the id of the notation that was selected
start - the starting address of the notation that was selected
end - the ending address of the notation that was selected
oldPage - the old page, or the current page if there was no change
newPage - the new page, if the page changed. If there was an error,
notationType - the type of the notation involved in the event
notationViewMode - the viewMode of the notation involved in the event
notationBody - the text of the notation involved in the event. This usually should only be present in a quick_note, to avoid fetching from the database.
parameter - An arbitrary object that can be used by different types of annotations to give more information about the event
errorCode - indicates any error that occured
exception - any embedded exception that caused this event to be thrown
Method Detail

getEventType

public int getEventType()
Get the event type

Returns:
the event type

getId

public int getId()
Get the notation id

Returns:
the id

getStart

public java.lang.String getStart()
Get the starting address

Returns:
the starting address

getEnd

public java.lang.String getEnd()
Get the ending address

Returns:
the ending address

getOldPage

public java.lang.String getOldPage()
Get the old page

Returns:
the URL of the old Page

getNewPage

public java.lang.String getNewPage()
Get the new page

Returns:
the URL of the new Page

getNotationType

public java.lang.String getNotationType()
Get the notation type

Returns:
the notation type

getNotationViewMode

public java.lang.String getNotationViewMode()
Get the notation view mode

Returns:
the notation view mode

getNotationBody

public java.lang.String getNotationBody()
Get the notation body

Returns:
the notation body

getErrorCode

public int getErrorCode()
Get the error type

Returns:
the error type

getException

public java.lang.Exception getException()
Get the embedded exception

Returns:
the exception that caused this event to be triggered, or null if there wasn't one

setOldPage

public void setOldPage(java.lang.String oldPage)
The following two methods exist to allow the URL's to be replaced by the Browser class when dealing with discussions, as the browser just passes a NotationEvent to the DiscussionWindow when it is created, and Browser needs to edit the URL's based on the book they came from


setNewPage

public void setNewPage(java.lang.String newPage)

getElement

public javax.swing.text.Element getElement()

getParameter

public java.lang.Object getParameter()

setParameter

public void setParameter(java.lang.Object parameter)

getNotation

public Notation getNotation()