Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mitre.cvw
Class RoomScrollback  view RoomScrollback download RoomScrollback.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.text.JTextComponent
                  extended byjavax.swing.JEditorPane
                      extended byjavax.swing.JTextPane
                          extended byorg.mitre.cvw.RoomScrollback
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

public class RoomScrollback
extends javax.swing.JTextPane

This is the class that represents the room scrollback. It knows which window it belongs to, how to launch urls, and how to print various messages.

Version:
1.0

Nested Class Summary
 
Nested classes inherited from class javax.swing.JEditorPane
javax.swing.JEditorPane.AccessibleJEditorPane, javax.swing.JEditorPane.AccessibleJEditorPaneHTML, javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport
 
Nested classes inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  int areaWidth
           
(package private)  int charCount
           
private static org.mitre.cvw.search.TextSearcher currentSearch
           
(package private)  TextStyle currStyle
           
(package private)  boolean delete
           
(package private)  boolean dragging
           
(package private)  CVWCoordinator jcvw
           
(package private)  int lineCount
           
(package private)  int maxLineLen
           
(package private)  RoomScrollbackClient myApp
           
(package private)  java.util.Vector pastScrollback
           
(package private)  boolean scrollLock
           
(package private)  javax.swing.JScrollPane scrollPane
           
(package private)  boolean warning
           
 
Fields inherited from class javax.swing.JEditorPane
 
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.Container
 
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
RoomScrollback(RoomScrollbackClient app)
          Constructor
RoomScrollback(RoomScrollbackClient app, boolean b)
           
 
Method Summary
 void addMinimizeButton(javax.swing.JButton btn)
           
 void append(java.lang.String str)
          Appends some text with the current style.
 void append(java.lang.String str, java.awt.Color color)
          Appends some text in a particular color.
 void append(java.lang.String str, javax.swing.text.Style style)
          Appends some text to the scrollback with a particular style.
 void appendBold(java.lang.String str)
          Appends some text with the current style bolded.
 void clearScrollback()
          Clears all the text from the scrollback.
 int containsURL(java.lang.String str)
          Returns the starting position of a url in a string.
protected  void createPopup(java.awt.Point p)
          Creates and shows the "standard" edit menu.
 void displayMudText(java.lang.String theLine)
          Display the text to the scrollback, scanning for items to be highlighted.
 void displayPrvCommMsg(java.lang.String messageString)
          Displays a private communication message to the current user that no one else in the room sees
 void displayPrvSysMsg(java.lang.String messageString)
          Displays a private system message to the current user that no one else sees.
 void displayPrvURL(java.lang.String messageString, java.lang.String url)
          Displays a private url to the current user that no one else in the room sees.
 void displayPubCommMsg(java.lang.String messageString)
          Displays a public communication message that everyone in the room sees.
 void displayPubSysMsg(java.lang.String messageString)
          Displays a public system message to the current user everyone in the room sees
 void displayPubURL(java.lang.String messageString, java.lang.String url)
          Displays a public url that everyone in the room sees.
 void displayScrollbackError(java.lang.String errorString)
          Displays an error to the scrollback.
 void displayURL(java.lang.String messageString, java.lang.String url)
          Displays a url with some additional text.
static org.mitre.cvw.search.TextSearcher getCurrentSearch(RoomScrollback anInstance)
           
 javax.swing.text.Style getCurrentStyle()
          Returns the current style of the scrollback.
 javax.swing.JScrollPane getScrollPane()
           
 javax.swing.text.Document getTextObject()
           
 boolean isScrollAtBottom()
           
 void processDoubleClick()
          Processes the double clicking on a URL in the scrollback.
 void resetFonts()
          5/7/00 dage - this is because, if the ui font is different, the document doesnt know about the new font, and therefore used the default monospaced font.
 void saveScrollback()
          Starts the process of saving of the entire scrollback.
 void saveSelectedText()
          Starts the process of saving of the selected text in the scrollback.
 void saveText(java.lang.String title, java.lang.String text)
          Saves text to a local file on users workstation.
 void searchAgain()
           
 void selectAll()
          Selects the whole content of the text component.
protected  void setCurrentStyle(javax.swing.text.Style s)
           
 void setFixedFont(boolean b)
          Sets the font to be fixed (Courier) if true is sent as parameter.
 void setScrollLock(boolean b)
           
 void setScrollPane(javax.swing.JScrollPane scroll)
           
 void setScrollToBottom()
           
private  void setupHotKeys()
          Sets up all hot keys known to this component ctrl+shift+l clear scrollback
 void startSearch()
           
 java.lang.String toString()
          Returns a string representation of this component and its values.
 
Methods inherited from class javax.swing.JTextPane
addStyle, createDefaultEditorKit, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getStyledEditorKit, getUIClassID, insertComponent, insertIcon, paramString, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument
 
Methods inherited from class javax.swing.JEditorPane
addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKit, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getPreferredSize, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getStream, getText, isFocusCycleRoot, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setContentType, setEditorKitForContentType, setPage, setPage, setText
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodListeners, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, read, removeCaretListener, removeInputMethodListener, removeKeymap, select, setCaret, setCaretColor, setCaretPosition, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodRequests, 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, 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, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jcvw

CVWCoordinator jcvw

myApp

RoomScrollbackClient myApp

maxLineLen

int maxLineLen

areaWidth

int areaWidth

lineCount

int lineCount

charCount

int charCount

warning

boolean warning

delete

boolean delete

pastScrollback

java.util.Vector pastScrollback

currStyle

TextStyle currStyle

scrollPane

javax.swing.JScrollPane scrollPane

scrollLock

boolean scrollLock

dragging

boolean dragging

currentSearch

private static org.mitre.cvw.search.TextSearcher currentSearch
Constructor Detail

RoomScrollback

public RoomScrollback(RoomScrollbackClient app)
Constructor


RoomScrollback

public RoomScrollback(RoomScrollbackClient app,
                      boolean b)
Method Detail

getCurrentSearch

public static org.mitre.cvw.search.TextSearcher getCurrentSearch(RoomScrollback anInstance)

resetFonts

public void resetFonts()
5/7/00 dage - this is because, if the ui font is different, the document doesnt know about the new font, and therefore used the default monospaced font. this bug is not in JTextArea which is the mudEntry and tjt.Notepad


setupHotKeys

private void setupHotKeys()
Sets up all hot keys known to this component ctrl+shift+l clear scrollback


addMinimizeButton

public void addMinimizeButton(javax.swing.JButton btn)

getScrollPane

public javax.swing.JScrollPane getScrollPane()

setScrollPane

public void setScrollPane(javax.swing.JScrollPane scroll)

setScrollLock

public void setScrollLock(boolean b)

isScrollAtBottom

public boolean isScrollAtBottom()

setScrollToBottom

public void setScrollToBottom()

selectAll

public void selectAll()
Description copied from class: javax.swing.text.JTextComponent
Selects the whole content of the text component.


searchAgain

public void searchAgain()

startSearch

public void startSearch()

createPopup

protected void createPopup(java.awt.Point p)
Creates and shows the "standard" edit menu.


append

public void append(java.lang.String str,
                   javax.swing.text.Style style)
Appends some text to the scrollback with a particular style. Checks for urls within the text and bolds them.


containsURL

public int containsURL(java.lang.String str)
Returns the starting position of a url in a string.


append

public void append(java.lang.String str,
                   java.awt.Color color)
Appends some text in a particular color.


append

public void append(java.lang.String str)
Appends some text with the current style.


appendBold

public void appendBold(java.lang.String str)
Appends some text with the current style bolded.


getTextObject

public javax.swing.text.Document getTextObject()

getCurrentStyle

public javax.swing.text.Style getCurrentStyle()
Returns the current style of the scrollback.


setCurrentStyle

protected void setCurrentStyle(javax.swing.text.Style s)

setFixedFont

public void setFixedFont(boolean b)
Sets the font to be fixed (Courier) if true is sent as parameter.


displayMudText

public void displayMudText(java.lang.String theLine)
Display the text to the scrollback, scanning for items to be highlighted.


displayScrollbackError

public void displayScrollbackError(java.lang.String errorString)
Displays an error to the scrollback.


displayPrvSysMsg

public void displayPrvSysMsg(java.lang.String messageString)
Displays a private system message to the current user that no one else sees.


displayPubSysMsg

public void displayPubSysMsg(java.lang.String messageString)
Displays a public system message to the current user everyone in the room sees


displayPubCommMsg

public void displayPubCommMsg(java.lang.String messageString)
Displays a public communication message that everyone in the room sees.


displayPrvCommMsg

public void displayPrvCommMsg(java.lang.String messageString)
Displays a private communication message to the current user that no one else in the room sees


displayPrvURL

public void displayPrvURL(java.lang.String messageString,
                          java.lang.String url)
Displays a private url to the current user that no one else in the room sees.


displayPubURL

public void displayPubURL(java.lang.String messageString,
                          java.lang.String url)
Displays a public url that everyone in the room sees.


displayURL

public void displayURL(java.lang.String messageString,
                       java.lang.String url)
Displays a url with some additional text.


processDoubleClick

public void processDoubleClick()
Processes the double clicking on a URL in the scrollback.


saveScrollback

public void saveScrollback()
Starts the process of saving of the entire scrollback.


saveSelectedText

public void saveSelectedText()
Starts the process of saving of the selected text in the scrollback.


saveText

public void saveText(java.lang.String title,
                     java.lang.String text)
Saves text to a local file on users workstation.


clearScrollback

public void clearScrollback()
Clears all the text from the scrollback.


toString

public java.lang.String toString()
Returns a string representation of this component and its values.