public class fourchoice extends javax.swing.JPanel implements TestInterface, java.awt.event.KeyListener
| Modifier and Type | Class and Description |
|---|---|
static class |
fourchoice.DesignContainer
Contains the trials included in this design.
|
static class |
fourchoice.Trial
This class resembles one trial of the study experiment.
|
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static int |
BOARDER_H
The boarder's height to help drawing boarder.
|
static int |
BOARDER_W
The boarder's width to help drawing boarder.
|
int |
currentTrial
The current trial number on going.
|
static boolean |
debug
Debugmode: false - no debug, true - debug
|
static fourchoice.DesignContainer |
design
design is the object of DesignContainer and holds the information and functions to do the actual test.
|
int |
PRINT_CHOOSE_KEYS
Sentence starting with PRINT_ tells what mode the test is currently doing.
Print the key selection-mode first |
int |
PRINT_GREETING
Sentence starting with PRINT_ tells what mode the test is currently doing.
Print greeting is the mode when test starts and the greeting text is printed. |
int |
PRINT_TRIAL
Sentence starting with PRINT_ tells what mode the test is currently doing.
If printMode is set to this the trial is shown and we'r waiting for user keypress. |
int |
printMode
This variable is the printMode which tells what phase the test is going through at the moment.
|
static int[] |
quads
Different quad-markings
|
static int |
repeats
Amount of repeats in the design
|
static int |
SCREEN_H
Screen height
|
static int |
SCREEN_W
Screen width
|
static java.lang.String |
subjectGuy
Holds the subject-number.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
fourchoice()
fourchoice class construcor.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getRandomNumber(int range)
Generates a random number from given range.
|
static long |
getScreenTimeMs()
Returns the screentime which is the time past after resetScreenTime() was
called.
|
static long |
getTestTimeMs()
Returns the test time which is the time past after resetTestTime() was
called.
|
void |
ghostWriter(java.lang.String str,
int x,
int y,
int w,
int h,
java.awt.Graphics g)
Draws a text to screen into specified x,y position and the paragraph size
For example "Thank you for taking part in the study" inthe middle.
|
void |
keyPressed(java.awt.event.KeyEvent e) |
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
keyTyped(java.awt.event.KeyEvent e) |
void |
paint(java.awt.Graphics g)
This function draws according the current situation of the test.
|
static void |
resetScreenTime()
Resets screen time.
|
static void |
resetTestTime()
Resets test time.
|
static void |
runTest(java.lang.String subjectNumber)
Nothing overwhelming..
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static boolean debug
public static int SCREEN_W
public static int SCREEN_H
public static int BOARDER_W
public static int BOARDER_H
public int PRINT_CHOOSE_KEYS
printModepublic int PRINT_GREETING
printModepublic int PRINT_TRIAL
printModepublic int currentTrial
public int printMode
PRINT_TRIALpublic static int repeats
public static int[] quads
public static java.lang.String subjectGuy
public static fourchoice.DesignContainer design
public fourchoice()
MouseAdapterpublic static int getRandomNumber(int range)
range - which should be positive number ie. 100public static void runTest(java.lang.String subjectNumber)
subjectNumber - subject's individual numberThreadpublic static void resetScreenTime()
getScreenTimeMs(),
resetTestTime(),
getTestTimeMs()public static long getScreenTimeMs()
resetScreenTime(),
resetTestTime(),
getTestTimeMs()public static void resetTestTime()
getScreenTimeMs(),
resetScreenTime(),
getTestTimeMs()public static long getTestTimeMs()
resetScreenTime(),
resetTestTime(),
getScreenTimeMs()public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - The Graphics to draw.printModepublic void ghostWriter(java.lang.String str,
int x,
int y,
int w,
int h,
java.awt.Graphics g)
str - String that contains the text to print.x - The starting X-position of text to print.y - The starting Y-position of text to print.w - The width of the area for printing.h - The heigth of the text-area.g - This holds the graphic-class where text is drawn.Graphicspublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListener