applications.cryptotoolj
Class CipherFrame

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 applications.cryptotoolj.CipherFrame
All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class CipherFrame
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.datatransfer.ClipboardOwner

Provides a user interface for performing encryption and decryption operations on a particular message. It supports file I/O (for the application version).

See Also:
Serialized Form

Field Summary
static int HEIGHT
           
 boolean isActivated
           
static int WIDTH
           
 
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, PROPERTIES, SOMEBITS
 
Constructor Summary
CipherFrame(CryptoToolJ ctj)
          This constructor creates a frame with a menubar and text areas for plaintext and ciphertext.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles all menu selections for the encode, decode and set key buttons.
 void activate()
          Causes this window to be the front window.
 boolean close()
          Closes this window, first saving the text in the TextAreas if necessary.
 void doCryptoAnalyzerCommand(java.lang.String cmd)
           
 void getEnglishFacts()
          Opens a separate frame and displays certain useful statistics for the selected text.
 void getPatternWords()
          Lets user search for pattern words.
 TextAreaPlus getTextAreaWithFocus()
          Returns a reference to the TextArea that currently has focus.
 java.lang.String getWindowId()
          Gets this window's id number.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Handles user's choices in the ChoiceBox.
 void lostOwnership(java.awt.datatransfer.Clipboard clip, java.awt.datatransfer.Transferable cont)
           
 void openFile()
          Opens a file and reads its text into the InputField
 void renameWithWindowId(java.lang.String id)
          Renames the window with descriptive title that refers to the type of cipher engine being used.
 void save(boolean rename)
          Implementation of the Save and SaveAs commands.
 boolean saveTextInTextAreas(boolean rename)
          Saves the text is response to Save or SaveAs commands.
 void setWindowId(int n)
          Sets this window's id number.
 void showStatistics()
          Opens a separate frame and displays certain useful statistics for the selected text.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          Closes this window and is subsidiary windows, if any.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.Frame
addNotify, 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, 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, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

WIDTH

public static final int WIDTH
See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
See Also:
Constant Field Values

isActivated

public boolean isActivated
Constructor Detail

CipherFrame

public CipherFrame(CryptoToolJ ctj)
This constructor creates a frame with a menubar and text areas for plaintext and ciphertext. The menubar includes a drop down list of the available cipher engines.

Method Detail

renameWithWindowId

public void renameWithWindowId(java.lang.String id)
Renames the window with descriptive title that refers to the type of cipher engine being used.


openFile

public void openFile()
Opens a file and reads its text into the InputField


saveTextInTextAreas

public boolean saveTextInTextAreas(boolean rename)
Saves the text is response to Save or SaveAs commands.


itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Handles user's choices in the ChoiceBox.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

showStatistics

public void showStatistics()
Opens a separate frame and displays certain useful statistics for the selected text.


getEnglishFacts

public void getEnglishFacts()
Opens a separate frame and displays certain useful statistics for the selected text.


getPatternWords

public void getPatternWords()
Lets user search for pattern words.


doCryptoAnalyzerCommand

public void doCryptoAnalyzerCommand(java.lang.String cmd)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles all menu selections for the encode, decode and set key buttons.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getTextAreaWithFocus

public TextAreaPlus getTextAreaWithFocus()
Returns a reference to the TextArea that currently has focus.


close

public boolean close()
Closes this window, first saving the text in the TextAreas if necessary.


save

public void save(boolean rename)
Implementation of the Save and SaveAs commands.


setWindowId

public void setWindowId(int n)
Sets this window's id number.


getWindowId

public java.lang.String getWindowId()
Gets this window's id number.


activate

public void activate()
Causes this window to be the front window.


windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

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

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Closes this window and is subsidiary windows, if any.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

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

windowDeiconified

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

windowIconified

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

windowOpened

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

lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clip,
                          java.awt.datatransfer.Transferable cont)
Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner