|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
tnt.gui.ParametersDialog
public class ParametersDialog
This dialog allows the user to set metric parameters. Note that this
dialog presents and stores timing values in milliseconds, while
ModelDefinition
objects store timing values in seconds.
ModelDefinition
,
Workspace
,
Serialized FormNested Class Summary | |
---|---|
(package private) class |
ParametersDialog.WholeNumberVerifier
Verifies that inputs are whole numbers. |
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
javax.swing.JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
java.awt.Dialog.AccessibleAWTDialog |
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 | |
---|---|
protected javax.swing.JButton |
browseButton
The button that, when activated, allows the user to browse for a word-frequency file. |
protected javax.swing.JButton |
cancelButton
The button that, when activated, reverts the dialog's values and hides it. |
protected javax.swing.JComboBox |
catComboBox
The combo box that presents MHP categories. |
protected static int |
EXP
The constant used to index the expert MHP category. |
protected static java.lang.String |
FIELD_CARD
The name given to the panel displaying custom MHP values. |
protected static int |
FIELD_WIDTH
The column width of text fields. |
protected javax.swing.JFileChooser |
fileChooser
|
protected javax.swing.JTextField |
filePathField
The text field used to display the word-frequency file path. |
protected static int |
H_GAP
The magnitude of horizontal space between components. |
protected static java.lang.String |
LABEL_CARD
The name given to the panel displaying preset MHP values. |
protected javax.swing.JTextField |
leftIntField
The ( Integer -formatted) text field used to display and
input the left intercept. |
protected javax.swing.JTextField |
leftSlopeField
The text field used to display and input the left slope. |
protected java.lang.String[] |
mhp_categories
The selectable MHP categories. |
protected java.awt.CardLayout |
mhpCardLayout
A reference to the CardLayout in the MHP panel. |
protected int[][] |
mhpTimings
An array of MHP timings, indexed by [category][timing]. |
protected javax.swing.JPanel |
mhpValuesPanel
A reference to the panel organizing MHP values -- required to manipulate its CardLayout . |
protected static int |
NOV
The constant used to index the novice MHP category. |
protected javax.swing.JButton |
okButton
The button that, when activated, commits the dialog's values and hides it. |
protected javax.swing.JTextField |
rightIntField
The text field used to display and input the right intercept. |
protected javax.swing.JTextField |
rightSlopeField
The text field used to display and input the right slope. |
protected static int |
T_C
The constant used to index tC timings. |
protected static int |
T_E
The constant used to index tE timings. |
protected static int |
T_M
The constant used to index tM timings. |
protected static int |
T_P
The constant used to index tP timings. |
protected static int |
T_S
The constant used to index tS timings. |
protected javax.swing.JTextField |
tCCustom
The text field used to display and input the custom tC value. |
protected javax.swing.JLabel |
tCPreset
The label used to display preset tC timings |
protected javax.swing.JTextField |
tECustom
The text field used to display and input the custom tE value. |
protected javax.swing.JLabel |
tEPreset
The label used to display preset tE timings |
protected javax.swing.JTextField |
tMCustom
The text field used to display and input the custom tM value. |
protected javax.swing.JTextField |
tMinField
The text field used to display and input the tmin value. |
protected javax.swing.JLabel |
tMPreset
The label used to display preset tM timings |
protected javax.swing.JTextField |
tPCustom
The text field used to display and input the custom tP value. |
protected javax.swing.JLabel |
tPPreset
The label used to display preset tP timings |
protected javax.swing.JTextField |
tSCustom
The text field used to display and input the custom tS value. |
protected javax.swing.JLabel |
tSPreset
The label used to display preset tS timings |
protected static int |
TYP
The constant used to index the typical MHP category. |
protected static int |
US1
The constant used to index the custom (User-Specified) MHP category. |
protected static int |
V_GAP
The magnitude of vertical space between components. |
protected boolean |
validInputs
A flag to indicate whether or not all the inputs are valid. |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ParametersDialog(java.awt.Frame owner)
Initializes this modal dialog with default Workspace
values. |
|
ParametersDialog(java.awt.Frame owner,
Workspace w)
Initializes this dialog with value from the passed Workspace object. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
|
protected void |
cancelAction()
Reverts values and hides this dialog. |
protected javax.swing.JPanel |
createButtonPanel()
Creates the layout to display "OK" and "Cancel" buttons. |
protected javax.swing.JPanel |
createFilePanel()
Creates the layout to display and specify the word-frequency file path. |
protected javax.swing.JPanel |
createFittsPanel()
Creates the layout to display and specify Fitts' Law coefficient. |
protected javax.swing.JPanel |
createMHPPanel()
Creates the layout to display and specify MHP timings. |
java.lang.String |
getWordFreqFile()
Returns a String representing the path to the
word-frequency file. |
protected void |
iniFileChooser()
Initializes the file chooser. |
protected void |
iniMHPTimings()
Initializes preset MHP timings. |
void |
loadFromWorkspace(Workspace w)
Loads parameter values from the passed object. |
boolean |
okPressed()
Returns true iff the user closed this dialog by pressing
the "OK" button. |
ModelDefinition |
saveToModelDefinition(ModelDefinition m)
Saves applicable data values to a ModelDefinition object. |
Workspace |
saveToWorkspace(Workspace w)
Saves applicable data values to a Workspace object. |
void |
setVisible(boolean b)
|
void |
windowActivated(java.awt.event.WindowEvent we)
|
void |
windowClosed(java.awt.event.WindowEvent we)
|
void |
windowClosing(java.awt.event.WindowEvent we)
|
void |
windowDeactivated(java.awt.event.WindowEvent we)
|
void |
windowDeiconified(java.awt.event.WindowEvent we)
|
void |
windowIconified(java.awt.event.WindowEvent we)
|
void |
windowOpened(java.awt.event.WindowEvent we)
|
Methods inherited from class javax.swing.JDialog |
---|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int H_GAP
protected static final int V_GAP
protected static final int FIELD_WIDTH
protected static final java.lang.String LABEL_CARD
CardLayout
in the MHP timing panel.
protected static final java.lang.String FIELD_CARD
CardLayout
in the MHP timing panel.
protected static final int EXP
protected static final int TYP
protected static final int NOV
protected static final int US1
protected static final int T_E
protected static final int T_P
protected static final int T_M
protected static final int T_C
protected static final int T_S
protected boolean validInputs
protected java.awt.CardLayout mhpCardLayout
CardLayout
in the MHP panel.
protected java.lang.String[] mhp_categories
protected int[][] mhpTimings
protected javax.swing.JButton browseButton
protected javax.swing.JButton cancelButton
protected javax.swing.JButton okButton
protected javax.swing.JComboBox catComboBox
protected javax.swing.JFileChooser fileChooser
protected javax.swing.JLabel tEPreset
protected javax.swing.JLabel tPPreset
protected javax.swing.JLabel tMPreset
protected javax.swing.JLabel tCPreset
protected javax.swing.JLabel tSPreset
protected javax.swing.JPanel mhpValuesPanel
CardLayout
.
protected javax.swing.JTextField filePathField
protected javax.swing.JTextField leftIntField
Integer
-formatted) text field used to display and
input the left intercept.
protected javax.swing.JTextField leftSlopeField
protected javax.swing.JTextField rightIntField
protected javax.swing.JTextField rightSlopeField
protected javax.swing.JTextField tMinField
protected javax.swing.JTextField tECustom
protected javax.swing.JTextField tPCustom
protected javax.swing.JTextField tMCustom
protected javax.swing.JTextField tCCustom
protected javax.swing.JTextField tSCustom
Constructor Detail |
---|
public ParametersDialog(java.awt.Frame owner)
Workspace
values.
owner
- this dialog's parent frame.public ParametersDialog(java.awt.Frame owner, Workspace w)
Workspace
object.
owner
- this dialog's parent frame.w
- the Workspace
whose values should be used.Method Detail |
---|
protected void iniMHPTimings()
mhp_categories[EXP] = "Expert"; mhp_categories[TYP] = "Typical"; mhp_categories[NOV] = "Novice"; mhp_categories[US1] = "Custom"; mhpTimings[EXP][T_E] = 70; mhpTimings[EXP][T_P] = 50; mhpTimings[EXP][T_M] = 30; mhpTimings[EXP][T_C] = 25; mhpTimings[EXP][T_S] = 36; ...
protected void iniFileChooser()
protected javax.swing.JPanel createFilePanel()
protected javax.swing.JPanel createFittsPanel()
protected javax.swing.JPanel createMHPPanel()
protected javax.swing.JPanel createButtonPanel()
protected void cancelAction()
public java.lang.String getWordFreqFile()
String
representing the path to the
word-frequency file.
public boolean okPressed()
true
iff the user closed this dialog by pressing
the "OK" button.
true
iff the user pressed the "OK" button.public ModelDefinition saveToModelDefinition(ModelDefinition m)
ModelDefinition
object.
Note that this dialog presents and stores timing values in
milliseconds, while ModelDefinition
objects store timing
values in seconds.
m
- the ModelDefinition
object to which to save
applicable data values.
ModelDefinition
object with the saved data.ModelDefinition
public void loadFromWorkspace(Workspace w)
w
- the Workspace
whose values should be used.public Workspace saveToWorkspace(Workspace w)
Workspace
object.
w
- the Workspace
object to which to save
applicable data values.
Workspace
object with the saved data.public void setVisible(boolean b)
setVisible
in class java.awt.Component
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
public void windowActivated(java.awt.event.WindowEvent we)
windowActivated
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent we)
windowClosed
in interface java.awt.event.WindowListener
public void windowClosing(java.awt.event.WindowEvent we)
windowClosing
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent we)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent we)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent we)
windowIconified
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent we)
windowOpened
in interface java.awt.event.WindowListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |