Java Randomness Test Suite

JRandTest at SourceForge

com.fasteasytrade.JRandTest.GUI
Class Gui

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended bycom.fasteasytrade.JRandTest.GUI.Gui
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, ItemListener, MenuContainer, Serializable

public class Gui
extends Frame
implements ActionListener, ItemListener

Main Java application to run randomness tests on files and algorithms.

Author:
Zur Aougav
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  AboutDialog ad
           
(package private)  String algoclassname
           
(package private)  String[] algoClassNames
           
(package private)  Choice algolist
           
(package private)  String algoname
           
(package private)  String[] algoNames
           
(package private)  String[] cardNames
           
private  Panel cards
           
(package private)  String[] classNames
           
(package private)  int currentCard
           
(package private)  Cursor defaultCursor
           
(package private)  FileDialog fd
           
(package private)  String filename
           
(package private)  TextField filenameLabel
           
(package private)  int fontSize
           
(package private)  int fontSizeMax
           
(package private)  int fontSizeMin
           
private  CardLayout layout
           
(package private)  MsgBox msgbox
           
(package private)  int numCards
           
(package private)  String privateKeyFilename
           
(package private)  TextField privateKeyFilenameLabel
           
(package private)  String publicKeyFilename
           
(package private)  TextField publicKeyFilenameLabel
           
private  Panel tabs
           
(package private)  Choice testslist
           
(package private)  Label tLabel
           
(package private)  Vector vecSP
           
(package private)  Cursor waitCursor
           
 
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.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
Gui()
          constructor to gui application.
 
Method Summary
 void actionPerformed(ActionEvent evt)
          main method logic to process click/typed information.
 void addButton(String name)
          make new button in defualt panel, tabs panel
 void addButton(String name, Panel p)
          make new button and insert it into a panel
 void addButton(String name, Panel p, int width)
          make new button, with specified size, and insert it into a panel
 void addRadioButton(String name, CheckboxGroup cg)
           
 void addRadioButton(String name, Panel p, CheckboxGroup cg)
           
 void itemStateChanged(ItemEvent e)
           
private  Vector loadPropFile(String fn)
          read list of tests from property file named alltests.txt.
static void main(String[] args)
           
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, 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, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, 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, 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, isOpaque, 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, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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

cards

private Panel cards

tabs

private Panel tabs

layout

private CardLayout layout

fd

FileDialog fd

ad

AboutDialog ad

msgbox

MsgBox msgbox

filename

String filename

publicKeyFilename

String publicKeyFilename

privateKeyFilename

String privateKeyFilename

tLabel

Label tLabel

filenameLabel

TextField filenameLabel

publicKeyFilenameLabel

TextField publicKeyFilenameLabel

privateKeyFilenameLabel

TextField privateKeyFilenameLabel

cardNames

String[] cardNames

classNames

String[] classNames

algoNames

String[] algoNames

algoClassNames

String[] algoClassNames

vecSP

Vector vecSP

currentCard

int currentCard

numCards

int numCards

algoname

String algoname

algoclassname

String algoclassname

algolist

Choice algolist

testslist

Choice testslist

fontSize

int fontSize

fontSizeMin

int fontSizeMin

fontSizeMax

int fontSizeMax

waitCursor

Cursor waitCursor

defaultCursor

Cursor defaultCursor
Constructor Detail

Gui

public Gui()
constructor to gui application. Builds all frames, modal windows, panels and lists.

Method Detail

loadPropFile

private Vector loadPropFile(String fn)
read list of tests from property file named alltests.txt.

Property file contains:

shortname=classname

where shortname will be displayed toend user in GUI window.

classname is the real class name of the test to be laoded dynamically and run (as Base interface).


addButton

public void addButton(String name,
                      Panel p)
make new button and insert it into a panel

Parameters:
name - label of button
p - panel contains new button

addButton

public void addButton(String name,
                      Panel p,
                      int width)
make new button, with specified size, and insert it into a panel

Parameters:
name - label of button
p - panel contains new button
width - of button

addButton

public void addButton(String name)
make new button in defualt panel, tabs panel

Parameters:
name - label of button

addRadioButton

public void addRadioButton(String name,
                           Panel p,
                           CheckboxGroup cg)

addRadioButton

public void addRadioButton(String name,
                           CheckboxGroup cg)

itemStateChanged

public void itemStateChanged(ItemEvent e)
Specified by:
itemStateChanged in interface ItemListener

actionPerformed

public void actionPerformed(ActionEvent evt)
main method logic to process click/typed information.

buttons specify test/file/algorithm.

"run" buttons will load test class dynamically and invoked with setting TextArea as OutputDestination, and filename/algrorithm as input random stream.

Specified by:
actionPerformed in interface ActionListener

main

public static void main(String[] args)

Java Randomness Test Suite

JRandTest at SourceForge

JRandTest at SourceForge
Copyright © 2005 Zur Aougav. All Rights Reserved.