|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jsky.catalog.gui.TableDisplay
public class TableDisplay
This widget displays the contents of a TableQueryResult in a JTable and implements scrolling, editing, searching and sorting methods.
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.BltBufferStrategy, java.awt.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 | |
---|---|
TableDisplay()
Initialize an empty table. |
|
TableDisplay(QueryResultDisplay queryResultDisplay)
Create an empty TableDisplay (Call setModel to set the data to display). |
|
TableDisplay(TableQueryResult tableQueryResult)
Create an empty TableDisplay (Call setModel to set the data to display). |
|
TableDisplay(TableQueryResult tableQueryResult,
QueryResultDisplay queryResultDisplay)
Create a TableDisplay for viewing the given table data. |
Method Summary | |
---|---|
void |
deselectRow(int row)
Deselect the given table row. |
QueryResultDisplay |
getQueryResultDisplay()
Return the object used to display query results (when following links) |
javax.swing.JScrollPane |
getScrollPane()
Return the JScrollPane used to scroll the table |
boolean[] |
getShow()
Return an array specifying which columns to show, if defined, otherwise null. |
SortedJTable |
getTable()
Return the widget used to display the table. |
TableQueryResult |
getTableQueryResult()
Return the current table query result (same as the table model). |
protected int |
initColumnSizes(javax.swing.JTable table,
boolean[] show)
|
static void |
main(java.lang.String[] args)
test main |
void |
print()
Display a print dialog to print the contents of this object. |
void |
print(java.lang.String title)
Display a print dialog to print the contents of this object with the specified table title. |
void |
resize()
Called when the table is resized |
boolean |
restoreSettings(java.lang.Object obj)
Restore the settings previously stored. |
void |
saveAsHTML(java.lang.String filename)
Save the table to the given filename in HTML format |
void |
selectRow(int row)
Select the given table row. |
protected void |
setColumnRenderers()
Set up any required JTable renderers, so that the values in the query result are displayed correctly by the JTable. |
void |
setModel(TableQueryResult tableQueryResult)
Set the data to display in the table. |
void |
setQueryResult(QueryResult queryResult)
If the given query result is a table, display it, otherwise do nothing. |
void |
setQueryResultDisplay(QueryResultDisplay q)
Set the object used to display query results (when following links) |
void |
setShow(boolean[] show)
Set an array specifying which columns to show (or null, for default) |
java.lang.Object |
storeSettings()
Store the current settings in a serializable object and return the object. |
void |
update()
Update the table after the model has changed. |
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, 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 |
Constructor Detail |
---|
public TableDisplay(TableQueryResult tableQueryResult, QueryResultDisplay queryResultDisplay)
tableQueryResult
- the table to use.queryResultDisplay
- used to display any query results (resulting from following links)public TableDisplay(TableQueryResult tableQueryResult)
tableQueryResult
- the table to use.public TableDisplay(QueryResultDisplay queryResultDisplay)
queryResultDisplay
- used to display any query results (resulting from following links)public TableDisplay()
Method Detail |
---|
public SortedJTable getTable()
public javax.swing.JScrollPane getScrollPane()
public void setQueryResultDisplay(QueryResultDisplay q)
public QueryResultDisplay getQueryResultDisplay()
public void setQueryResult(QueryResult queryResult)
setQueryResult
in interface QueryResultDisplay
public TableQueryResult getTableQueryResult()
public void setModel(TableQueryResult tableQueryResult)
public void update()
protected int initColumnSizes(javax.swing.JTable table, boolean[] show)
protected void setColumnRenderers()
public void print(java.lang.String title) throws java.awt.print.PrinterException
java.awt.print.PrinterException
public void print() throws java.awt.print.PrinterException
print
in interface PrintableWithDialog
java.awt.print.PrinterException
public void resize()
public void selectRow(int row)
row
- the index of the row (0 is the first row)public void deselectRow(int row)
row
- the index of the row (0 is the first row)public boolean[] getShow()
public void setShow(boolean[] show)
public void saveAsHTML(java.lang.String filename) throws java.io.IOException
saveAsHTML
in interface SaveableAsHTML
java.io.IOException
public java.lang.Object storeSettings()
storeSettings
in interface Storeable
public boolean restoreSettings(java.lang.Object obj)
restoreSettings
in interface Storeable
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |