Class RegistryPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
uk.ac.starlink.vo.RegistryPanel
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Displays the parameters of a registry query and its results.
The URL of a registry and the text of a query are displayed at the
top of the window, with query submit and cancel buttons.
When the submit button is pushed, the specified query is performed
asynchronously on the selected registry.
Subclasses can be notified of the completion of a successful query
by overriding the gotData(RegResource[]) method.
- Since:
- 21 Dec 2004
- Author:
- Mark Taylor (Starlink)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionRegistryPanel(RegistryQueryFactory queryFactory, boolean showCapabilities) Constructs a RegistryPanel. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(ActionListener listener) Adds a listener to be notified when one of the resources has been selected (currently, double-click or hit Enter).voidInvoked when the cancel button is pressed.voiddisplayAdviceMessage(String[] lines) Displays a user-directed message in the panel which contains the results table.protected voidSends an action event to all registered action listeners.getCapabilities(RegResource resource) Returns an array of all the relevant capabilities of a given resource.Returns the selection model used by the user to select capability items from a completed query.Returns a container into which (small) additional controls can be added.Returns an action which will update the list of registries by making a search in the registry for suitable registry entries.Returns an array of all the results from the most recently completed registry query.Returns the selection model used by the user to select resource items from a completed query.Returns an array of all the capabilities associated with the currently selected resource which are themselves currently selected.Returns an array of any of the results from the most recent registry query which are currently selected by the user.Returns the action for submitting the query described by this component's current state.protected voidgotData(RegResource[] resources) Called from the event dispatch thread when a successful registry query which returns 1 or more records has been completed.Constructs a menu which allows the user to select which attributes of each displayed resource are visible.voidperformAutoQuery(String workingMsg) Invoking this method withdraws the parts of the GUI which permit the user to specify a registry query, and peforms a fixed query without further ado.voidperformQuery(RegistryQuery query, String workingMessage) Submits a query and inserts the results, when ready, into this panel.voidremoveActionListener(ActionListener listener) Removes a listener previously added by addActionListener.voidsetEnabled(boolean enabled) voidInvoked when the Submit button is pressed.Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class 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, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class 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, validateTreeMethods inherited from class 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
RegistryPanel
Constructs a RegistryPanel.- Parameters:
queryFactory- object which supplies the query details; if it has a graphical component, that will be displayed for the user to interact withshowCapabilities- true to display a selectable table ofRegCapabilityInterfaces below the table ofRegResources
-
-
Method Details
-
performAutoQuery
Invoking this method withdraws the parts of the GUI which permit the user to specify a registry query, and peforms a fixed query without further ado. This effect cannot be reversed.- Parameters:
workingMsg- message to display near progress bar while query is ongoing
-
gotData
Called from the event dispatch thread when a successful registry query which returns 1 or more records has been completed. The default implementation does nothing.- Parameters:
resources- non-empty array of resources returned from a successful query
-
getResources
Returns an array of all the results from the most recently completed registry query.- Returns:
- list of query results
-
getCapabilities
Returns an array of all the relevant capabilities of a given resource.- Parameters:
resource- resource- Returns:
- capability list
-
getSelectedResources
Returns an array of any of the results from the most recent registry query which are currently selected by the user.- Returns:
- list of any selected query results
-
getSelectedCapabilities
Returns an array of all the capabilities associated with the currently selected resource which are themselves currently selected. In the case that there is no capabilities table displayed, it's assumed that all capabilities of the selected resource are selected.- Returns:
- capability list
-
submitQuery
public void submitQuery()Invoked when the Submit button is pressed. Performs an asynchronous query on the registry. -
performQuery
Submits a query and inserts the results, when ready, into this panel.- Parameters:
query- query to executeworkingMessage- text to display to user while query is running
-
cancelQuery
public void cancelQuery()Invoked when the cancel button is pressed. Deactivates the current query. -
getResourceSelectionModel
Returns the selection model used by the user to select resource items from a completed query.- Returns:
- selection model (each item will be a
RegResource
-
getCapabilitySelectionModel
Returns the selection model used by the user to select capability items from a completed query.- Returns:
- selection model
(each item will be a
RegCapabilityInterface)
-
displayAdviceMessage
Displays a user-directed message in the panel which contains the results table. This will be obliterated when a query starts or completes; it is intended to contain advice for the user before any query has been initiated.- Parameters:
lines- lines of message text (one element per screen line)
-
getSubmitQueryAction
Returns the action for submitting the query described by this component's current state.- Returns:
- submit query action
-
makeColumnVisibilityMenu
-
getRegistryUpdateAction
Returns an action which will update the list of registries by making a search in the registry for suitable registry entries.- Returns:
- registry update action
-
getControlBox
Returns a container into which (small) additional controls can be added.- Returns:
- control box
-
addActionListener
Adds a listener to be notified when one of the resources has been selected (currently, double-click or hit Enter).- Parameters:
listener- listener to add
-
removeActionListener
Removes a listener previously added by addActionListener.- Parameters:
listener- listener to remove
-
fireAction
protected void fireAction()Sends an action event to all registered action listeners. -
setEnabled
public void setEnabled(boolean enabled) - Overrides:
setEnabledin classJComponent
-