anecho.JamochaMUD
Class DataIn

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 anecho.gui.SyncFrame
                      extended by anecho.JamochaMUD.DataIn
All Implemented Interfaces:
TelnetEventListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class DataIn
extends SyncFrame
implements java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.WindowListener, TelnetEventListener

This is the input window where the user may type to send info to the MUCK/MUD. In addition, if features scrolling of long messages and a variable-length command 'recall' feature implemented by a right mouse-click.

See Also:
Serialized Form

Nested Class Summary
 
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
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DataIn()
          The constructor for DataIn, producing a new data input area.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
 void append(java.lang.String text)
          Append the given string to whatever text exists in the DataIn window.
 void checkPopup(java.awt.event.MouseEvent mouse)
          Check for PopupTrigger to display command history
 java.awt.Component exportText()
          We export our TextArea for use in a "combined" JamochaMUD configuration, where both the input and output are shown in the same frame.
 int getCaretPosition()
          Get the location of our caret based on the number of characters from the beginning of the text area.
 int getColumns()
          Get the number of columns visible in our DataIn display
 java.lang.String getLastWord()
          Return the last word typed
 java.lang.String getText()
          Get all the text currently in the DataIn window.
 java.awt.Component getTextVariable()
          Return the variable representing our DataIn area.
 void hideFramesQuick()
          Method to hide all the frames.
 void jmGainFocus()
          This lets our other classes bring us into focus
 void jMSendText()
          Deprecated. The SendText method in CHandler should now be used
 void keyPressed(java.awt.event.KeyEvent event)
           
 void keyReleased(java.awt.event.KeyEvent event)
           
 void keyTyped(java.awt.event.KeyEvent event)
           
 void mouseClicked(java.awt.event.MouseEvent evt)
           
 void mouseEntered(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
 void restoreMinimizedFrames()
          Restore frames hidden by the 'Supervisor' function
 void restoreText()
          We are having our TextArea "returned" to us from the main window.
 void setAntiAliasing(boolean state)
          Enable or disable anti-aliasing
 void setBackgroundColour(java.awt.Color bgColour)
          Set the background colour for the DataIn window.
 void setCaretPosition(int pos)
          Set the caret's location based on the given index from the first character in the text area.
 void setFont(java.awt.Font newFont)
          Set the font to be used for the DataIn window.
 void setForegroundColour(java.awt.Color fgColour)
          Sets the foreground colour for the DataIn area.
 void setFromHistory(int currentPos)
          Set the current text from the scrollback menu, the item indicated by int pos
 void setLimit(int newLim)
          This method sets the maximum number of entries that will be saved in the command history pop-up.
 void setRows(int rows)
          Set the number of rows available in our DataIn area.
 void setSpellCheck(boolean state)
          Allow the auto spellcheck feature to be enabled / disabled.
 void setText(java.lang.String text)
          Set the text visible in the DataIn window.
 void setWindowTitle()
          Set the title of this frame on the basis of if the active MU* (the one visible at the moment) is connected or not.
 void showPopup(java.awt.Component origin, int xPos, int yPos)
          Display the pop-up menu
 void telnetMessageReceived(TelnetEvent event)
          Currently not used.
 void validate()
           
 void windowActivated(java.awt.event.WindowEvent event)
          Bring the frame into focus so the user may type
 void windowClosed(java.awt.event.WindowEvent event)
           
 void windowClosing(java.awt.event.WindowEvent event)
           
 void windowDeactivated(java.awt.event.WindowEvent event)
           
 void windowDeiconified(java.awt.event.WindowEvent event)
           
 void windowIconified(java.awt.event.WindowEvent event)
           
 void windowOpened(java.awt.event.WindowEvent event)
           
 
Methods inherited from class anecho.gui.SyncFrame
dispose, getCloseState, getTerminationState, isLocked, isSynced, paramString, processComponentEvent, processWindowEvent, setAllStates, setBounds, setBounds, setCloseState, setGroupSync, setLocation, setLocation, setLock, setSync, setSyncFrameGroup, setTerminationState
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, 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, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, 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, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, 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
 

Constructor Detail

DataIn

public DataIn()
The constructor for DataIn, producing a new data input area.

Method Detail

keyPressed

public void keyPressed(java.awt.event.KeyEvent event)
Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
event -

keyReleased

public void keyReleased(java.awt.event.KeyEvent event)
Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
event -

keyTyped

public void keyTyped(java.awt.event.KeyEvent event)
Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
event -

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event -

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt -

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
evt -

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
evt -

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
evt -

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
evt -

checkPopup

public void checkPopup(java.awt.event.MouseEvent mouse)
Check for PopupTrigger to display command history

Parameters:
mouse -

showPopup

public void showPopup(java.awt.Component origin,
                      int xPos,
                      int yPos)
Display the pop-up menu

Parameters:
origin - The Component that originally received the mouse click.
xPos - The x-position of the mouse within the origin component
yPos - The y-position of the mouse within the origin component

windowActivated

public void windowActivated(java.awt.event.WindowEvent event)
Bring the frame into focus so the user may type

Specified by:
windowActivated in interface java.awt.event.WindowListener
Parameters:
event -

windowClosed

public void windowClosed(java.awt.event.WindowEvent event)
Specified by:
windowClosed in interface java.awt.event.WindowListener
Parameters:
event -

windowClosing

public void windowClosing(java.awt.event.WindowEvent event)
Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
event -

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent event)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Parameters:
event -

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent event)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Parameters:
event -

windowIconified

public void windowIconified(java.awt.event.WindowEvent event)
Specified by:
windowIconified in interface java.awt.event.WindowListener
Parameters:
event -

windowOpened

public void windowOpened(java.awt.event.WindowEvent event)
Specified by:
windowOpened in interface java.awt.event.WindowListener
Parameters:
event -

telnetMessageReceived

public void telnetMessageReceived(TelnetEvent event)
Currently not used.

Specified by:
telnetMessageReceived in interface TelnetEventListener
Parameters:
event - A telnet event.

hideFramesQuick

public void hideFramesQuick()
Method to hide all the frames. The 'supervisor' function


restoreMinimizedFrames

public void restoreMinimizedFrames()
Restore frames hidden by the 'Supervisor' function


jMSendText

public void jMSendText()
Deprecated. The SendText method in CHandler should now be used

This is an "empty" method that allows other classes to request that we send our existing text to the MU*. This doesn't happen often, but can be a handy ability to have


setFromHistory

public void setFromHistory(int currentPos)
Set the current text from the scrollback menu, the item indicated by int pos

Parameters:
currentPos - The index of the command history to use as the text for the DataIn text area.

setText

public void setText(java.lang.String text)
Set the text visible in the DataIn window. This method will remove any text that may have previously been showing.

Parameters:
text - The text to display in the DataIn window.

setFont

public void setFont(java.awt.Font newFont)
Set the font to be used for the DataIn window.

Overrides:
setFont in class java.awt.Container
Parameters:
newFont - The Font to use.

append

public void append(java.lang.String text)
Append the given string to whatever text exists in the DataIn window.

Parameters:
text - The text to be appended.

getText

public java.lang.String getText()
Get all the text currently in the DataIn window.

Returns:
A String representing all the text currently in the DataIn area.

setCaretPosition

public void setCaretPosition(int pos)
Set the caret's location based on the given index from the first character in the text area.

Parameters:
pos - Location of the caret

getCaretPosition

public int getCaretPosition()
Get the location of our caret based on the number of characters from the beginning of the text area.

Returns:
Index of the caret's location.

getColumns

public int getColumns()
Get the number of columns visible in our DataIn display

Returns:
Number of columns visible.

setForegroundColour

public void setForegroundColour(java.awt.Color fgColour)
Sets the foreground colour for the DataIn area.

Parameters:
fgColour - The foreground colour to use.

setBackgroundColour

public void setBackgroundColour(java.awt.Color bgColour)
Set the background colour for the DataIn window.

Parameters:
bgColour - The background colour.

setWindowTitle

public void setWindowTitle()
Set the title of this frame on the basis of if the active MU* (the one visible at the moment) is connected or not. This method differs from the main window's setWindowTitle() method in that it takes the text being paused into consideration as well


exportText

public java.awt.Component exportText()
We export our TextArea for use in a "combined" JamochaMUD configuration, where both the input and output are shown in the same frame.

Returns:
A reference to the text area of our DataIn object.

restoreText

public void restoreText()
We are having our TextArea "returned" to us from the main window. We'll add it back to our frame and then set everything visible again.


getTextVariable

public java.awt.Component getTextVariable()
Return the variable representing our DataIn area.

Returns:
Variable representing our DataIn area.

setRows

public void setRows(int rows)
Set the number of rows available in our DataIn area. This is only useful if the DataIn frame is being viewed as a separate frame.

Parameters:
rows - The number of rows to set for the DataIn window.

jmGainFocus

public void jmGainFocus()
This lets our other classes bring us into focus


validate

public void validate()
Overrides:
validate in class java.awt.Container

getLastWord

public java.lang.String getLastWord()
Return the last word typed

Returns:
String representing the last "word" typed by the user.

setAntiAliasing

public void setAntiAliasing(boolean state)
Enable or disable anti-aliasing

Parameters:
state - true - enable anti-aliased text false - disable anti-aliased text

setLimit

public void setLimit(int newLim)
This method sets the maximum number of entries that will be saved in the command history pop-up.

Parameters:
newLim - The maximum number of lines to save for command history.

setSpellCheck

public void setSpellCheck(boolean state)
Allow the auto spellcheck feature to be enabled / disabled. This only works with a Swing interface

Parameters:
state - true - enable in-line spell checking false - disable in-line spell checking