org.peace_tools.views
Class ESTTableView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.peace_tools.views.ESTTableView
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener

public class ESTTableView
extends javax.swing.JPanel
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener

The table model that provides a graphical display of fragments in a FASTA file. This class provides a tabular view of the fragments stored in a given FASTA file using a JTable. The JTable uses the data exposed via the ESTTableView class. The view is created on demand via the ViewFactory.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JSpinner basesPerCol
          A spinner that is displayed in the toolbar.
private  javax.swing.JTable clusterTable
          The actual Tree-table that provides a graphical view of the list of clusters in a given cluster file.
private  javax.swing.JCheckBox columization
          A checkbox that can be used by the user to enable or disable column-wise display of nucleotide sequences.
private static CustomTableCellRenderer ESTRenderer
          A simple/custom cell renderer that displays data using a monospaced font.
private  MainFrame mainFrame
          Convenient reference to the main frame class that logically owns this component.
private  ESTTableModel model
          The table model that is being used to display information in this view.
private  java.lang.String SELECT_EST_MSG
          A simple message that is displayed to the user.
private static long serialVersionUID
          A generated serialization UID (included just to keep the compiler happy).
private  javax.swing.JComboBox sortOrder
          Various options on how the clusters in the cluster tree table view are to be sorted.
private  javax.swing.JToolBar toolbar
          The toolbar that contains some commonly used tools with the jobs.
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ESTTableView(ESTTableModel model, MainFrame frame)
          The default constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
private  javax.swing.JLabel createSummaryInfo()
          Method to compute and setup summary information.
private  void createToolbar()
          Helper method to configure and setup various tools in the tool bar.
private  void saveSelectedESTs()
          Helper method to save the selected ESTs.
private  void setColumnWidths()
          Utility method to set the column widths.
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, 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, 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
add, 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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toolbar

private javax.swing.JToolBar toolbar
The toolbar that contains some commonly used tools with the jobs.


clusterTable

private javax.swing.JTable clusterTable
The actual Tree-table that provides a graphical view of the list of clusters in a given cluster file.


model

private final ESTTableModel model
The table model that is being used to display information in this view. This value is set in the constructor and is never changed.


mainFrame

private final MainFrame mainFrame
Convenient reference to the main frame class that logically owns this component. This value is set in the constructor and is never changed.


sortOrder

private javax.swing.JComboBox sortOrder
Various options on how the clusters in the cluster tree table view are to be sorted. The options are populated when this combo box is created in the createToolbar() method.


columization

private javax.swing.JCheckBox columization
A checkbox that can be used by the user to enable or disable column-wise display of nucleotide sequences.


basesPerCol

private javax.swing.JSpinner basesPerCol
A spinner that is displayed in the toolbar. This spinner can be used by the user to set the number of bases/nucleotides to be displayed in a single column in the table.


ESTRenderer

private static final CustomTableCellRenderer ESTRenderer
A simple/custom cell renderer that displays data using a monospaced font. This cell renderer is used to render all the sequence data so that entries in multiple rows appear to align consistently on the same boundary.


SELECT_EST_MSG

private java.lang.String SELECT_EST_MSG
A simple message that is displayed to the user.


serialVersionUID

private static final long serialVersionUID
A generated serialization UID (included just to keep the compiler happy).

See Also:
Constant Field Values
Constructor Detail

ESTTableView

public ESTTableView(ESTTableModel model,
                    MainFrame frame)
The default constructor. The default constructor sets up the table to display FASTA entries and configures the table to the default configuration.

Parameters:
model - The data model to be used to display the FASTA entries and associated information in the table.
frame - The main frame that logically owns this view.
Method Detail

setColumnWidths

private void setColumnWidths()
Utility method to set the column widths. This is a utility method that can be used set up default column sizes for the various columns displayed in this table.


createToolbar

private void createToolbar()
Helper method to configure and setup various tools in the tool bar. This method was introduced to streamline the code better and cut down the code clutter in the constructor.


createSummaryInfo

private javax.swing.JLabel createSummaryInfo()
Method to compute and setup summary information. This method is invoked from the constructor to create and populate the summary information tab. The summary information is computed once when the view is created. After that the summary information (which is reasonably small) is held in a text area. The user has the option to hide the summary information to gain some more screen real estate.

Returns:
The scroll pane that contains the summary information.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

saveSelectedESTs

private void saveSelectedESTs()
Helper method to save the selected ESTs. This method is invoked from the actionPerformed() method whenever the user clicks on the tool bar button to save selected ESTs. This method performs the following tasks:
  1. If no entries are selected, then this method displays a warning message and exits immediately with no further action.
  2. Otherwise, it prompts the user to select a file. If the user cancels the file selection operation then this method exits without any side effects.
  3. Once the user selects a valid file, it writes the ESTs corresponding to the selected entries to the file. Any errors that occur are suitably reported to the user.