jsky.catalog.gui
Class TableDisplayTool

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 jsky.catalog.gui.TableDisplayTool
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, QueryResultDisplay, PrintableWithDialog, Saveable, SaveableAsHTML

public class TableDisplayTool
extends JPanel
implements QueryResultDisplay, Saveable, SaveableAsHTML, PrintableWithDialog

Combines a TableDisplay component for displaying query results in tabular form with a title and some buttons to perform various actions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
TableDisplayTool(TableQueryResult table, QueryResultDisplay queryResultDisplay, TablePlotter plotter)
          Create a TableDisplayTool for viewing the given table data.
 
Method Summary
protected  void addPlotterConfigPanel()
          Add a panel to the config window to configure the symbol plotting
 void addRow()
          Add an empty row to the table.
 void addRow(Vector v)
          Add a row to the table.
protected  void addTableColumnConfigPanel()
          Add a panel to the config window to configure the table columns
 void configure()
          Pop up a dialog to configure the plot symbols and table display.
 void deleteSelectedRows()
          Delete the selected rows.
 JPanel getButtonPanel()
          Return the button panel
 JButton getConfigButton()
           
 TabbedPanel getConfigPanel()
          Panel used to configure the table and plot symbol display
 String getName()
          Return the name of this component (based on the data being displayed)
 JButton getPlotButton()
           
 TablePlotter getPlotter()
          Return the object to use to plot the table data
 Vector getRow(int rowIndex)
          Return the vector for the given row.
 int getRowCount()
          Return the number of rows in the table.
protected  SortedJTable getSortedJTable()
          Return the table for displaying query results
 TableQueryResult getTable()
          Return the TableQueryResult corresponding to this object
 TableDisplay getTableDisplay()
          Return the table for displaying query results
 JButton getUnplotAllButton()
           
 JButton getUnplotButton()
           
 void hidePopups()
          Hide any popup windows associated with this window
protected  JPanel makeButtonPanel()
          make and return the button panel
protected  void makeLayout(QueryResultDisplay queryResultDisplay)
          Do the window layout
 void plot()
          Plot the contents of the table.
 void print()
          Display a print dialog to print the contents of this object.
 void replot()
          Replot any plot symbols for this table.
 void saveAs(String filename)
          Save the table to the given file.
 void saveAsHTML(String filename)
          Save the table to the given file in HTML format.
 void setPlotter(TablePlotter plotter)
          Set the object to use to plot the table data
 void setQueryResult(QueryResult queryResult)
          Display the given query results.
 void setTableCellsEditable(boolean b)
          Set the editable state of the cells in the displayed table.
 void unplot()
          Remove any plot symbols for this table.
 void unplotAll()
          Remove all plot symbols.
 void updateRow(int rowIndex, Vector v)
          Update a row in the table with the new data.
protected  void updateTitle()
          Update the table and frame titles to show the table title and number of rows
 
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, 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, 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, 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, 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
 

Constructor Detail

TableDisplayTool

public TableDisplayTool(TableQueryResult table,
                        QueryResultDisplay queryResultDisplay,
                        TablePlotter plotter)
Create a TableDisplayTool for viewing the given table data.

Parameters:
table - the table data
queryResultDisplay - object used to display any query results resulting from following links
plotter - object used to plot the table data
Method Detail

makeLayout

protected void makeLayout(QueryResultDisplay queryResultDisplay)
Do the window layout

Parameters:
queryResultDisplay - object used to display any query results resulting from following links

getTableDisplay

public TableDisplay getTableDisplay()
Return the table for displaying query results


makeButtonPanel

protected JPanel makeButtonPanel()
make and return the button panel


getButtonPanel

public JPanel getButtonPanel()
Return the button panel


getPlotButton

public JButton getPlotButton()

getUnplotButton

public JButton getUnplotButton()

getUnplotAllButton

public JButton getUnplotAllButton()

getConfigButton

public JButton getConfigButton()

plot

public void plot()
Plot the contents of the table.


unplot

public void unplot()
Remove any plot symbols for this table.


unplotAll

public void unplotAll()
Remove all plot symbols.


replot

public void replot()
Replot any plot symbols for this table.


getTable

public TableQueryResult getTable()
Return the TableQueryResult corresponding to this object


getSortedJTable

protected SortedJTable getSortedJTable()
Return the table for displaying query results


getPlotter

public TablePlotter getPlotter()
Return the object to use to plot the table data


setPlotter

public void setPlotter(TablePlotter plotter)
Set the object to use to plot the table data


configure

public void configure()
Pop up a dialog to configure the plot symbols and table display.


addPlotterConfigPanel

protected void addPlotterConfigPanel()
Add a panel to the config window to configure the symbol plotting


addTableColumnConfigPanel

protected void addTableColumnConfigPanel()
Add a panel to the config window to configure the table columns


getConfigPanel

public TabbedPanel getConfigPanel()
Panel used to configure the table and plot symbol display


hidePopups

public void hidePopups()
Hide any popup windows associated with this window


getName

public String getName()
Return the name of this component (based on the data being displayed)

Overrides:
getName in class Component

setQueryResult

public void setQueryResult(QueryResult queryResult)
Display the given query results. Tabular data is displayed in the table. Other query result types must be implemented in a derived class.

Specified by:
setQueryResult in interface QueryResultDisplay
Parameters:
queryResult - an object returned from the Catalog query method.

saveAs

public void saveAs(String filename)
Save the table to the given file.

Specified by:
saveAs in interface Saveable

saveAsHTML

public void saveAsHTML(String filename)
Save the table to the given file in HTML format.

Specified by:
saveAsHTML in interface SaveableAsHTML

print

public void print()
           throws PrinterException
Display a print dialog to print the contents of this object.

Specified by:
print in interface PrintableWithDialog
Throws:
PrinterException

updateTitle

protected void updateTitle()
Update the table and frame titles to show the table title and number of rows


addRow

public void addRow()
Add an empty row to the table.


addRow

public void addRow(Vector v)
Add a row to the table.


updateRow

public void updateRow(int rowIndex,
                      Vector v)
Update a row in the table with the new data. An exception will be thrown if the row index is out of range or the vector has the wrong size.


getRow

public Vector getRow(int rowIndex)
Return the vector for the given row.


deleteSelectedRows

public void deleteSelectedRows()
Delete the selected rows.


setTableCellsEditable

public void setTableCellsEditable(boolean b)
Set the editable state of the cells in the displayed table.


getRowCount

public int getRowCount()
Return the number of rows in the table.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.