|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
eTextReader.DiscussionWindow
public class DiscussionWindow
Nested Class Summary | |
---|---|
(package private) class |
DiscussionWindow.DiscussionNotationEventHandler
This class extends OpenExternalPopupWindowHandler to ensure that the same discussion isn't opened more than once |
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 javax.swing.JButton |
backBtn
|
private int |
bodyOffset
|
private javax.swing.JScrollPane |
bodyPane
|
private WrappedJTextArea |
bodyText
|
private javax.swing.JButton |
cancelBtn
|
private DBClient |
client
|
private javax.swing.JMenuItem |
close
|
private javax.swing.JButton |
closeBtn
|
(package private) java.lang.String |
course
Which course the textbook is currently dealing with |
private static java.util.Map<java.lang.Integer,DiscussionWindow> |
currentDiscussionWindows
Maintains a mapping of all currently open discussion windows, which allows us to pull up a previously existing window if the user tries to open a discussion that is already open |
private int |
currentIndex
|
private java.util.Vector<Notation> |
discussionNotations
|
private NotationEvent |
discussionStart
|
private java.lang.String |
discussionURL
|
private javax.swing.JComboBox |
discussionView
|
private ContentPane |
editor
|
private javax.swing.JMenu |
file
|
private java.lang.String |
fragment
|
private java.util.Vector |
groupLimitList
|
private javax.swing.JCheckBox |
includeReply
|
(package private) InkAnnotationWindow |
inkWindow
Used to create ink discussion items |
(package private) Browser.LogListener |
loglistener
|
private javax.swing.JMenuBar |
menu
|
private javax.swing.text.Document |
message
|
private javax.swing.JEditorPane |
messageBody
|
private javax.swing.JLabel |
messageLabel
|
private javax.swing.text.Document |
messageList
|
private javax.swing.JPanel |
messagePanel
|
private javax.swing.JSplitPane |
messageReply
|
private javax.swing.JButton |
nextBtn
|
private javax.swing.text.html.HTMLEditorKit |
overviewKit
|
private PasteListener |
pastelisten
|
(package private) DiscussionWindow.DiscussionNotationEventHandler |
popupHandler
Used to handle annotations in our scrolling content pane |
private javax.swing.JButton |
postBtn
|
private AnnotationShareBox |
recipientsBox
|
private javax.swing.JButton |
replyAllBtn
|
private javax.swing.JButton |
replyBtn
|
private javax.swing.JPanel |
replyBtnPanel
|
private javax.swing.JPanel |
replyForm
|
private javax.swing.JButton |
returnBtn
|
private ScrollingContentPane |
scrollingEditor
|
private javax.swing.JScrollPane |
scrollMessage
|
private javax.swing.JButton |
senderBtn
|
private java.util.Vector |
shareSelected
|
private javax.swing.JTextField |
subjectField
|
private java.util.Vector |
targetSelected
|
private javax.swing.Box |
toolbar
|
private java.util.Vector |
userLimitList
|
private javax.swing.JSplitPane |
window
The discussion window |
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 | |
---|---|
DiscussionWindow(Browser.LogListener loglistener,
java.lang.String course)
|
|
DiscussionWindow(NotationEvent ne,
Browser.LogListener loglistener,
java.lang.String course)
Constructor for DiscussionWindow class |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent action)
Implements the ActionListener for navigation buttons. |
void |
cannotContactServer(java.lang.Exception e)
Called when the InkAnnotationWindow class cannot set up a connection with the windows server |
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 |
void |
closeAnnotation(Notation notation,
java.awt.Dimension size)
Called when the annotation editor has requested that the currently edited annotation be closed |
private int |
commonNewPost(Notation newMessage,
boolean load)
sets up information about a new posting that is common to both the ink and the text posting methods. |
private void |
createContentPane()
Creates content pane object to display the context of the discussion. |
private javax.swing.text.html.HTMLEditorKit |
createMessagePane()
Creates and sets up message pane which will display information and text of each discussion message. |
private void |
createReplyPane()
Creates and sets up reply pane which will allow the user to reply to a discussion message |
void |
deleteAnnotation(Notation notation,
java.awt.Dimension size)
Called when the annotation editor has requested the specified annotation to be deleted |
private void |
displayMessage(Notation msg,
Notation prevMsg)
Displays the header information and body of a message in the message detail window. |
private void |
displayNextMessage()
Prepares the window to display the next message in the discussion. |
private void |
displayPreviousMessage()
Prepares the window to display the previous message in the discussion. |
private OEBPackageFile |
getCurrentBook()
Refactored method that eliminates a local package file reference and retrieves it from the user class |
int |
getCurrentNotationID()
|
private java.lang.String |
getUserName()
Refactored method that eliminates a local user name reference and retrieves it from the user class |
private ViewingPrefs |
getViewPrefs()
Refactored method that eliminates a local ViewingPreferences reference and retrieves it from the user class |
void |
go(java.lang.String address)
Loads a web page into the ContentPage object. |
void |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent event)
Processes all hyperlink events that occur in the discussion window. |
private boolean |
isInkAnnotation(Notation note)
|
private void |
loadDiscussionMessages(NotationEvent start,
Criteria select)
Gets all messages in current discussion from the database and stores them in a Vector. |
java.lang.String |
makeHTML(java.util.Vector notations)
Creates the html syntax necessary to display an overview of the messages in a discussion. |
private java.lang.String |
makeParagraphs(java.lang.String text)
Makes HTML paragraphs out of plain text, replacing line breaks with end paragraph tags. |
private java.lang.String |
makeTableRow(java.lang.String label,
java.lang.String labelAttrs,
java.lang.String body,
java.lang.String bodyAttrs)
helper method for displayMessage that creates an HTML table row with one cell for a label, and one cell for the body |
void |
openDiscussion(NotationEvent ne)
|
private boolean |
postNewMessage()
Reconnects to the database and posts a new message to the end of the current discussion. |
private void |
postNotationModes(Notation newMessage)
Posts the correct entries into the NotationModes table based on the type of reply. |
static boolean |
queryCreateInkAnnotation()
|
private void |
recipientsOK()
|
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 |
void |
setFontSize(float size)
|
private void |
setRecipients(boolean replyToAuthor)
|
private void |
setupInkAnnotation(Notation notation)
called when we are creating a new reply. |
void |
setupReplyForm()
Creates form into which user will enter a reply to a discussion. |
void |
showDetails(Notation notation)
Called when the annotation editor has requested that the details of the specified annotation be shown |
void |
showRecipientsBox()
|
private void |
showReplyForm()
|
private void |
updateButtons()
Reset enabled properties of back and next buttons, according to whether the current message is the beginning or the end of the discussion message Vector. |
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 |
---|
private static java.util.Map<java.lang.Integer,DiscussionWindow> currentDiscussionWindows
private javax.swing.JSplitPane window
private ContentPane editor
private ScrollingContentPane scrollingEditor
private javax.swing.JPanel messagePanel
private javax.swing.JSplitPane messageReply
private javax.swing.JScrollPane scrollMessage
private javax.swing.text.html.HTMLEditorKit overviewKit
private javax.swing.JEditorPane messageBody
private javax.swing.text.Document messageList
private javax.swing.text.Document message
private javax.swing.JPanel replyBtnPanel
private javax.swing.JPanel replyForm
private int bodyOffset
private javax.swing.Box toolbar
private javax.swing.JButton nextBtn
private javax.swing.JButton backBtn
private javax.swing.JButton replyBtn
private javax.swing.JButton replyAllBtn
private javax.swing.JButton returnBtn
private javax.swing.JButton senderBtn
private javax.swing.JButton closeBtn
private javax.swing.JCheckBox includeReply
private javax.swing.JComboBox discussionView
private javax.swing.JLabel messageLabel
private javax.swing.JMenuBar menu
private javax.swing.JMenu file
private javax.swing.JMenuItem close
private DBClient client
private NotationEvent discussionStart
private java.lang.String discussionURL
private java.lang.String fragment
private java.util.Vector<Notation> discussionNotations
private int currentIndex
DiscussionWindow.DiscussionNotationEventHandler popupHandler
private javax.swing.JTextField subjectField
private WrappedJTextArea bodyText
private javax.swing.JScrollPane bodyPane
private javax.swing.JButton postBtn
private javax.swing.JButton cancelBtn
private AnnotationShareBox recipientsBox
private java.util.Vector shareSelected
private java.util.Vector targetSelected
private java.util.Vector userLimitList
private java.util.Vector groupLimitList
private PasteListener pastelisten
Browser.LogListener loglistener
InkAnnotationWindow inkWindow
java.lang.String course
Constructor Detail |
---|
public DiscussionWindow(Browser.LogListener loglistener, java.lang.String course)
public DiscussionWindow(NotationEvent ne, Browser.LogListener loglistener, java.lang.String course)
Method Detail |
---|
public void openDiscussion(NotationEvent ne)
private void createContentPane()
private void createReplyPane()
private javax.swing.text.html.HTMLEditorKit createMessagePane()
public void setupReplyForm()
private void recipientsOK()
public void showRecipientsBox()
public java.lang.String makeHTML(java.util.Vector notations)
notations
- the Vector of messages that make up the discussion.
private void displayNextMessage()
private void displayPreviousMessage()
private java.lang.String makeTableRow(java.lang.String label, java.lang.String labelAttrs, java.lang.String body, java.lang.String bodyAttrs)
private void displayMessage(Notation msg, Notation prevMsg) throws javax.swing.text.BadLocationException
msg
- the Notation containing the information for the message to
be displayed.
javax.swing.text.BadLocationException
- thrown if we try to insert text/html
at an invalid location in the Documentprivate java.lang.String makeParagraphs(java.lang.String text)
private void updateButtons()
private void loadDiscussionMessages(NotationEvent start, Criteria select)
start
- the NotationEvent that was clicked to open the
discussion window.private boolean postNewMessage()
private int commonNewPost(Notation newMessage, boolean load)
newMessage
- a notation object that will be modified
to contain the appropriate informationload
- if true, the discussion will be loaded into
the list, otherwise it won't (used to only look at one version
of the message for an ink posting)
private void postNotationModes(Notation newMessage)
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent event)
hyperlinkUpdate
in interface javax.swing.event.HyperlinkListener
event
- the hyperlink event being processed.public void go(java.lang.String address)
address
- the web page to be loadedprivate void showReplyForm()
private void setRecipients(boolean replyToAuthor)
public void actionPerformed(java.awt.event.ActionEvent action)
actionPerformed
in interface java.awt.event.ActionListener
action
- action performed by userpublic static boolean queryCreateInkAnnotation()
private void setupInkAnnotation(Notation notation)
private boolean isInkAnnotation(Notation note)
public void setFontSize(float size)
public int getCurrentNotationID()
public void saveAnnotation(Notation notation, java.lang.String subject, byte[] isfData, byte[] pngData, java.awt.Dimension size)
saveAnnotation
in interface InkCallback
notation
- public void deleteAnnotation(Notation notation, java.awt.Dimension size)
deleteAnnotation
in interface InkCallback
public void showDetails(Notation notation)
showDetails
in interface InkCallback
public void changeShareWith(Notation notation)
changeShareWith
in interface InkCallback
public void closeAnnotation(Notation notation, java.awt.Dimension size)
closeAnnotation
in interface InkCallback
public void changeDisplayType(Notation notation)
InkCallback
changeDisplayType
in interface InkCallback
public void cannotContactServer(java.lang.Exception e)
cannotContactServer
in interface InkCallback
e
- an exception describing the problemprivate OEBPackageFile getCurrentBook()
private ViewingPrefs getViewPrefs()
private java.lang.String getUserName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |