edu.harvard.mgh.purcell.gPLINK2.baseForm
Class InputPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTabbedPane
                  extended by edu.harvard.mgh.purcell.gPLINK2.baseForm.InputPane
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

public final class InputPane
extends javax.swing.JTabbedPane

A Tabbed Pane subclass that contains the binary, standard and alternative phenotype options. This is designed to be included in a a form.

Author:
Kathe Todd-Brown
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
private  Form.BrowseButton altBrowse
          A BrowseButton that selects the alternative pheotype file name.
private  javax.swing.JTextField altField
          A JTextField that holds the alternative pheotype file name.
private  Form.BrowseButton bedBrowse
          A BrowseButton that selects the bed file
private  javax.swing.JTextField bedField
          A JTextField that holds the bed file name
private  Form.BrowseButton bimBrowse
          A BrowseButton thta selects the bim file
private  javax.swing.JTextField bimField
          A JTextField that holds the bim file name.
private  javax.swing.JCheckBox binCheck
          A JCheckBox that flags a quick binary input file format (--bfile filename).
private  javax.swing.JComboBox binShort
          A JComboBox that holds the quick binary file roots
(package private)  javax.swing.event.DocumentListener checkFields
           
private  Form.BrowseButton famBrowse
          A BrowseButton that selects the fam file.
private  javax.swing.JTextField famField
          A JTextField that holds the fam file name.
private static org.apache.log4j.Logger logger
          Optionally log messages.
private  Form.BrowseButton mapBrowse
          A BrowseButton that selects the map file.
private  javax.swing.JTextField mapField
          A JTextField that holds the map file name.
private  javax.swing.JTextField mphenoText
          A JTextField that contains the column you wish to use on the alternative pheotype file.
private static float my_alignment
           
private  GPLINK parent
          The GPLINK istance this is attached to.
private  Form parentForm
          The dialog that we want to attach our file name browsing window to.
private  Form.BrowseButton pedBrowse
          A BrowseButton that selects the ped file.
private  javax.swing.JTextField pedField
          A JTextField that holds the ped file name
private  javax.swing.JCheckBox stdCheck
          A JCheckBox that flags the short standard input format (--file fileroot)
private  javax.swing.JComboBox stdShort
          A JComboBox that holds the file root options for the short standard input format
private  javax.swing.JCheckBox useAlt
          A JCheckBox that flags an alternative phenotype
private  javax.swing.JCheckBox useColm
          A JCheckBox that adds a column option to the alternative pheontype
 boolean validInput
           
 
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
InputPane(GPLINK p, Form p2)
          Create an input pane for PLINK forms.
 
Method Summary
private  javax.swing.JPanel bundle(javax.swing.JLabel label, javax.swing.JTextField field, Form.BrowseButton browse)
          Create a JPanel that contains a lable, textfield and browse button.
private  javax.swing.JPanel createAltPheno()
          Create a JPanel that contains the alternative phenotype options.
private  javax.swing.JPanel createBinary()
          Create a JPanel that has the binary input options.
private  javax.swing.JPanel createStd()
          Create JPanel that contains the options for a standard text input files.
 java.util.Vector<java.lang.String> getBinRoots()
          Get a list of possible short binary roots.
 java.util.Vector<java.lang.String> getStdRoots()
          Get a list of possible short standard roots.
private  void intialize()
          Intialize all the private class variables we all so add any ItemListeners here.
 boolean okInput()
          Check to see if the form is filled out correctly.
 java.lang.String process()
          Based on the fields in the input pane generate the input section of the PLINK command line.
 
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, update
 
Methods inherited from class java.awt.Container
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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private static org.apache.log4j.Logger logger
Optionally log messages.


parent

private GPLINK parent
The GPLINK istance this is attached to.


parentForm

private Form parentForm
The dialog that we want to attach our file name browsing window to.


validInput

public boolean validInput

my_alignment

private static float my_alignment

binCheck

private javax.swing.JCheckBox binCheck
A JCheckBox that flags a quick binary input file format (--bfile filename).


binShort

private javax.swing.JComboBox binShort
A JComboBox that holds the quick binary file roots


bedField

private javax.swing.JTextField bedField
A JTextField that holds the bed file name


bedBrowse

private Form.BrowseButton bedBrowse
A BrowseButton that selects the bed file


bimField

private javax.swing.JTextField bimField
A JTextField that holds the bim file name.


bimBrowse

private Form.BrowseButton bimBrowse
A BrowseButton thta selects the bim file


famField

private javax.swing.JTextField famField
A JTextField that holds the fam file name.


famBrowse

private Form.BrowseButton famBrowse
A BrowseButton that selects the fam file.


stdCheck

private javax.swing.JCheckBox stdCheck
A JCheckBox that flags the short standard input format (--file fileroot)


stdShort

private javax.swing.JComboBox stdShort
A JComboBox that holds the file root options for the short standard input format


pedField

private javax.swing.JTextField pedField
A JTextField that holds the ped file name


pedBrowse

private Form.BrowseButton pedBrowse
A BrowseButton that selects the ped file.


mapField

private javax.swing.JTextField mapField
A JTextField that holds the map file name.


mapBrowse

private Form.BrowseButton mapBrowse
A BrowseButton that selects the map file.


useAlt

private javax.swing.JCheckBox useAlt
A JCheckBox that flags an alternative phenotype


altField

private javax.swing.JTextField altField
A JTextField that holds the alternative pheotype file name.


altBrowse

private Form.BrowseButton altBrowse
A BrowseButton that selects the alternative pheotype file name.


useColm

private javax.swing.JCheckBox useColm
A JCheckBox that adds a column option to the alternative pheontype


mphenoText

private javax.swing.JTextField mphenoText
A JTextField that contains the column you wish to use on the alternative pheotype file.


checkFields

javax.swing.event.DocumentListener checkFields
Constructor Detail

InputPane

public InputPane(GPLINK p,
                 Form p2)
Create an input pane for PLINK forms.

Parameters:
p - The GPLINK instance that this form works with.
Method Detail

bundle

private javax.swing.JPanel bundle(javax.swing.JLabel label,
                                  javax.swing.JTextField field,
                                  Form.BrowseButton browse)
Create a JPanel that contains a lable, textfield and browse button. This allows us to bundle these more effectively

Parameters:
label - A JLabel that discribes this panel.
field - A JTextField that holds the file name.
browse - A BrowseButton that selectes the file name.
Returns:
A JPanel that contains the given label, field and browse button.

createStd

private javax.swing.JPanel createStd()
Create JPanel that contains the options for a standard text input files.

Returns:
A JPanel that contains the standard input options.

createBinary

private javax.swing.JPanel createBinary()
Create a JPanel that has the binary input options.

Returns:
A JPanel that contains the binary input options.

createAltPheno

private javax.swing.JPanel createAltPheno()
Create a JPanel that contains the alternative phenotype options.

Returns:
A JPanel that contains the alternative pheotype options.

getStdRoots

public java.util.Vector<java.lang.String> getStdRoots()
Get a list of possible short standard roots. This is done by grabing all the files in the home directory and saving the file roots that have both ped and map files.

Returns:
A Vector of possible short standard roots in the home folder.

getBinRoots

public java.util.Vector<java.lang.String> getBinRoots()
Get a list of possible short binary roots. This is done by grabing all the files in the home directory and saving the file roots that have bed, bim and fam files.

Returns:
A Vector of possible short binary roots in the home folder.

intialize

private void intialize()
Intialize all the private class variables we all so add any ItemListeners here.


process

public java.lang.String process()
Based on the fields in the input pane generate the input section of the PLINK command line.

Returns:
A String that is the input section of a PLINK command.

okInput

public boolean okInput()
Check to see if the form is filled out correctly.

Returns:
true if this form is filled out in a valid way, false otherwise.