public class TableDisplay extends JPanel implements QueryResultDisplay, PrintableWithDialog, SaveableAsHTML
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
deselectRow(int row)
Deselect the given table row.
|
QueryResultDisplay |
getQueryResultDisplay()
Return the object used to display query results (when following links)
|
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).
|
static void |
main(String[] args)
test main
|
void |
print()
Display a print dialog to print the contents of this object.
|
void |
print(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
|
void |
saveAsHTML(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)
|
void |
update()
Update the table after the model has changed.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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
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, 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
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()
public SortedJTable getTable()
public 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 void setColumnRenderers()
public void print(String title) throws PrinterException
PrinterException
public void print() throws PrinterException
print
in interface PrintableWithDialog
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(String filename) throws IOException
saveAsHTML
in interface SaveableAsHTML
IOException
public static void main(String[] args)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.