biggests.tables
Class TableValues

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by biggests.tables.TableValues
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.RowSorterListener, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable
Direct Known Subclasses:
TableColors, TableSymbols, TableValuesWithMissingValues

public class TableValues
extends javax.swing.JTable

Title: Table of Values

Description:

Defines a table of values with the following data:
- header -> conditions' names (more widely, Strings)
- first column -> genes' names (more widely, Strings)
- all other columns' cells -> gene expression values (more widely, float values)

This is a simple table that shows the raw values that are assigned when using one of the constructors and implements sorting functionality on the columns, i.e., allows the reordering of the rows, sorting them by a specific column's cells values in ascending or descending order.

Copyright: Copyright (C) 2007 Joana Gonçalves This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See Also:
Serialized Form

Nested Class Summary
protected static class TableValues.FloatCellRenderer
          Title: FloatCellRenderer: A renderer for cells which contain float numbers.
protected static class TableValues.NumberCellRenderer
          Title: NumberCellRenderer: A renderer for cells which contain numbers.
 
Nested classes/interfaces inherited from class javax.swing.JTable
javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
 
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
protected  smadeira.ontologizer.GOFrontEnd goFrontEnd
           
protected  java.awt.Component parent
           
 
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
 
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
  TableValues(smadeira.biclustering.NodeObjectInterface nodeObject)
          Creates a new values table from the data of a node object.
  TableValues(smadeira.biclustering.NodeObjectInterface nodeObject, smadeira.ontologizer.GOFrontEnd go, java.awt.Component parent)
          Creates a new values table from the data of a node object.
protected TableValues(java.lang.Object[][] rowData, java.lang.Object[] columnNames)
          Creates a new values table with the given row data and column names.
protected TableValues(TableSorterValues tableSorterModel)
          Creates a new values table with the given row data and column names.
 
Method Summary
protected static java.lang.Object[] constructColumnNames(smadeira.biclustering.NodeObjectInterface nodeObject)
          Constructs the column names' array with data retrieved from the node object.
protected static java.lang.Object[][] constructRowData(smadeira.biclustering.NodeObjectInterface nodeObject)
          Constructs the row data matrix with data retrieved from the node object.
protected  javax.swing.table.JTableHeader createDefaultTableHeader()
          Overrides JTable's createDefaultTableHeader method.
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
          Overrides JTable's getToolTipText method in order to allow the renderer's tips to be used if they have text set.
 java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer, int row, int column)
          Overrides JTable's prepareRenderer method.
 void this_mouseClicked(java.awt.event.MouseEvent e)
           
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, 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, 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

goFrontEnd

protected smadeira.ontologizer.GOFrontEnd goFrontEnd

parent

protected java.awt.Component parent
Constructor Detail

TableValues

public TableValues(smadeira.biclustering.NodeObjectInterface nodeObject,
                   smadeira.ontologizer.GOFrontEnd go,
                   java.awt.Component parent)
            throws InvalidNodeObjectTypeException
Creates a new values table from the data of a node object. A table of values contains the following data:
- header -> conditions' names
- first column -> genes' names
- all other columns' cells -> gene expression float values
This table also displays the terms annotated with each gene (when a specific table's row is clicked by the user).

Parameters:
nodeObject - the NodeObjectInterface from which the values table is created
go - the GOFrontEnd
parent - the GUI's parent Component
Throws:
InvalidNodeObjectTypeException - if the type of the node object is not valid
See Also:
constructRowData(NodeObjectInterface nodeObject), constructColumnNames(NodeObjectInterface nodeObject), #TableValues(Object[][] rowData, Object[] columnNames))

TableValues

public TableValues(smadeira.biclustering.NodeObjectInterface nodeObject)
            throws InvalidNodeObjectTypeException
Creates a new values table from the data of a node object. A table of values contains the following data:
- header -> conditions' names
- first column -> genes' names
- all other columns' cells -> gene expression float values

Parameters:
nodeObject - the NodeObjectInterface from which the values table is created
Throws:
InvalidNodeObjectTypeException - when the type of the node object is not valid
See Also:
constructRowData(NodeObjectInterface nodeObject), constructColumnNames(NodeObjectInterface nodeObject), #TableValues(Object[][] rowData, Object[] columnNames))

TableValues

protected TableValues(java.lang.Object[][] rowData,
                      java.lang.Object[] columnNames)
Creates a new values table with the given row data and column names. A table of values contains the following data:
- header -> conditions' names (more widely, Strings)
- first column -> genes' names (more widely, Strings)
- all other columns' cells -> gene expression values (more widely, float values)

Parameters:
rowData - the Object[][] row data (for all table cells except the ones from the table header)
columnNames - the Object[] column names (for the table header)
See Also:
TableValues(TableSorterValues tableSorterModel), applicationgui.utils.TableSorter#TableSorter(TableModel tableModel), DefaultTableModel.DefaultTableModel(Object[][] rowData, Object[] columnNames)

TableValues

protected TableValues(TableSorterValues tableSorterModel)
Creates a new values table with the given row data and column names. A table of values contains the following data:
- header -> conditions' names (more widely, Strings)
- first column -> genes' names (more widely, Strings)
- all other columns' cells -> gene expression values (more widely, float values)

Parameters:
tableSorterModel - the TableSorter model for the table
See Also:
JTable.JTable(TableModel dm)
Method Detail

prepareRenderer

public java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer,
                                          int row,
                                          int column)
Overrides JTable's prepareRenderer method. Prepares the renderer by querying the data model for the value and selection state of the cell at row, column. Returns the component (may be a Component or a JComponent) under the event location.

Overrides:
prepareRenderer in class javax.swing.JTable
Parameters:
renderer - the TableCellRenderer to prepare
row - the row of the cell to render, where 0 is the first row
column - the column of the cell to render, where 0 is the first column
Returns:
the Component under the event location
See Also:
JTable.prepareRenderer(TableCellRenderer renderer, int row, int column)

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Overrides JTable's getToolTipText method in order to allow the renderer's tips to be used if they have text set.

Overrides:
getToolTipText in class javax.swing.JTable
Parameters:
event - MouseEvent the event that triggered the tool tip display
Returns:
String the message set as tool tip for the pointed table cell
See Also:
JTable.getToolTipText(MouseEvent event)

createDefaultTableHeader

protected javax.swing.table.JTableHeader createDefaultTableHeader()
Overrides JTable's createDefaultTableHeader method.
Creates the default table header for a values' table, that is, a header with specific text tool tips for this kind of table.

Overrides:
createDefaultTableHeader in class javax.swing.JTable
Returns:
an instance of TableHeader, i.e, a specific table header for a table of values
See Also:
JTable.columnModel, JTable.createDefaultTableHeader(), applicationgui.utils.TableHeader#TableHeader(TableColumnModel cm)

constructRowData

protected static java.lang.Object[][] constructRowData(smadeira.biclustering.NodeObjectInterface nodeObject)
                                                throws InvalidNodeObjectTypeException
Constructs the row data matrix with data retrieved from the node object.

The final structure of the row data is:
- the first column corresponds to the names of the genes
- the other cells of the matrix contain float values, which are the gene expression values under certain conditions

protected: it's intended to be used only by the TableValues constructor and constructors of TableValues's subclasses.
static: because object this cannot be referrenced by the constructor before it is actually created.

Parameters:
nodeObject - the NodeObjectInterface which provides the data needed to create the row data matrix
Returns:
the Object[][] row data matrix, ready to be used by TableValues's constructor
Throws:
InvalidNodeObjectTypeException - when the type of the node object is not valid

constructColumnNames

protected static java.lang.Object[] constructColumnNames(smadeira.biclustering.NodeObjectInterface nodeObject)
                                                  throws InvalidNodeObjectTypeException
Constructs the column names' array with data retrieved from the node object.

The final structure of the column names' array is:
- the first cell contains the gene column name
- the remaining cells contain the condition names.

protected: it's intended to be used only by the TableValues's constructor and TableValues subclasses' constructors.
static: because object this cannot be referrenced by the constructor before it is actually created.

Parameters:
nodeObject - the NodeObjectInterface which provides the data needed to create the column names' array
Returns:
the Object[] array with the column names
Throws:
InvalidNodeObjectTypeException - when the type of the node object is not valid

this_mouseClicked

public void this_mouseClicked(java.awt.event.MouseEvent e)