vxmlsurfer
Class InputWindow

java.lang.Object
  extended by vxmlsurfer.InputWindow
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.util.EventListener

public class InputWindow
extends java.lang.Object
implements java.awt.event.FocusListener, java.awt.event.KeyListener

Input Window for the HearSay Application

Author:
First Author George John

Field Summary
static CustomField command
           
(package private) static java.util.List<java.lang.String> inputQ
           
static int QUEUE_SIZE
           
 
Constructor Summary
InputWindow(Processor proc)
          constructor for InputWindow.
 
Method Summary
static void addToQueue(java.lang.String text)
          this method adds commands to the input queue
 void clearText()
          clears text in the input window
 void closeInputWindow()
          exiting from the system
static void decreaseWindowSize()
          Method to decrease the size of input window
static void echoON(boolean status)
          To turn on/off echoing option
 void focusGained(java.awt.event.FocusEvent e)
          executed when input window gets focus
 void focusLost(java.awt.event.FocusEvent e)
           
 void getFocus()
          Get focus to the Input Window
 int getFontSize()
          Returns the fontsize so that it can be used to save user profile
 void getInputWindow(Terminator terminator)
          Creates Input Window
static InputWindow getInstance(Processor processThread)
          Get instance of the Input Window
 void getScreenResolution()
          Gets the system's screen resolution
 java.awt.Dimension getWindowDimension()
          Returns the dimensions of the window Dimensions may be used to save the user profile
static void increaseWindowSize()
          Method to increase the size of the input window
static boolean isUserinputMode()
          checks if input window has been set to accept input from field
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
          executed when a key is pressed
static void minimizeWindow()
          Method used to minimize InputWindow
static void multiLineWindow()
          Method used by shortcut "Ctrl+Enter" to go to the next line
 void selectAllText()
          selects all text in the input window
 void setBackColor(java.awt.Color backGround)
          sets background color of input window
 void setCaretPosotion(int pos)
          sets caret position in the input window
 void setColor(java.awt.Color backGround, java.awt.Color foreGround)
          sets foreground and background color of input window
 void setFontSize(int fontSize)
          Can be used to set the font size
 void setForeColor(java.awt.Color foreGround)
          sets foreground of input window
 void setPasswordMode(boolean mode)
           
 void setText(java.lang.String text)
          set text in the input window
static void setUserinputMode(boolean mode)
          sets mode to accept input from field
 void setWindowDimension(java.awt.Dimension d)
          Used to set the inout window based on the saved user profile
 void windowCreation(Terminator terminator)
          Creating the input window
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

public static CustomField command

QUEUE_SIZE

public static int QUEUE_SIZE

inputQ

static java.util.List<java.lang.String> inputQ
Constructor Detail

InputWindow

public InputWindow(Processor proc)
constructor for InputWindow.

Parameters:
proc -
Method Detail

getInstance

public static InputWindow getInstance(Processor processThread)
Get instance of the Input Window

Returns:
InputWindow

getFocus

public void getFocus()
Get focus to the Input Window


addToQueue

public static void addToQueue(java.lang.String text)
this method adds commands to the input queue

Parameters:
text -

closeInputWindow

public void closeInputWindow()
exiting from the system


windowCreation

public void windowCreation(Terminator terminator)
Creating the input window

Parameters:
terminator -

multiLineWindow

public static void multiLineWindow()
Method used by shortcut "Ctrl+Enter" to go to the next line


minimizeWindow

public static void minimizeWindow()
Method used to minimize InputWindow


echoON

public static void echoON(boolean status)
To turn on/off echoing option

Parameters:
status - boolean variable indicating status

getScreenResolution

public void getScreenResolution()
Gets the system's screen resolution


setWindowDimension

public void setWindowDimension(java.awt.Dimension d)
Used to set the inout window based on the saved user profile

Parameters:
d - Dimesion of the window

getWindowDimension

public java.awt.Dimension getWindowDimension()
Returns the dimensions of the window Dimensions may be used to save the user profile

Returns:
Dimesnsion

getFontSize

public int getFontSize()
Returns the fontsize so that it can be used to save user profile

Returns:
int

setFontSize

public void setFontSize(int fontSize)
Can be used to set the font size

Parameters:
fontSize -

getInputWindow

public void getInputWindow(Terminator terminator)
Creates Input Window

Parameters:
terminator - for proper termination

focusGained

public void focusGained(java.awt.event.FocusEvent e)
executed when input window gets focus

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
FocusEvent -

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

setColor

public void setColor(java.awt.Color backGround,
                     java.awt.Color foreGround)
sets foreground and background color of input window

Parameters:
background - color
foreground - color

setBackColor

public void setBackColor(java.awt.Color backGround)
sets background color of input window

Parameters:
background - color

setForeColor

public void setForeColor(java.awt.Color foreGround)
sets foreground of input window

Parameters:
foreground - color

setText

public void setText(java.lang.String text)
set text in the input window

Parameters:
text -

clearText

public void clearText()
clears text in the input window


setCaretPosotion

public void setCaretPosotion(int pos)
sets caret position in the input window

Parameters:
position -

selectAllText

public void selectAllText()
selects all text in the input window


setPasswordMode

public void setPasswordMode(boolean mode)

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
executed when a key is pressed

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
KeyEvent -

keyPressed

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

keyReleased

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

increaseWindowSize

public static void increaseWindowSize()
Method to increase the size of the input window


decreaseWindowSize

public static void decreaseWindowSize()
Method to decrease the size of input window


isUserinputMode

public static boolean isUserinputMode()
checks if input window has been set to accept input from field

Returns:
boolean

setUserinputMode

public static void setUserinputMode(boolean mode)
sets mode to accept input from field

Parameters:
mode -