|
|||||||||
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
uk.ac.starlink.vo.RegistryPanel
public class RegistryPanel
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(uk.ac.starlink.vo.RegResource[])
method.
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 | |
---|---|
RegistryPanel(RegistryQueryFactory queryFactory,
boolean showCapabilities)
Constructs a RegistryPanel. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener to be notified when one of the resources has been selected (currently, double-click or hit Enter). |
void |
cancelQuery()
Invoked when the cancel button is pressed. |
void |
displayAdviceMessage(String[] lines)
Displays a user-directed message in the panel which contains the results table. |
protected void |
fireAction()
Sends an action event to all registered action listeners. |
RegCapabilityInterface[] |
getCapabilities(RegResource resource)
Returns an array of all the relevant capabilities of a given resource. |
ListSelectionModel |
getCapabilitySelectionModel()
Returns the selection model used by the user to select capability items from a completed query. |
JComponent |
getControlBox()
Returns a container into which (small) additional controls can be added. |
RegResource[] |
getResources()
Returns an array of all the results from the most recently completed registry query. |
ListSelectionModel |
getResourceSelectionModel()
Returns the selection model used by the user to select resource items from a completed query. |
RegCapabilityInterface[] |
getSelectedCapabilities()
Returns an array of all the capabilities associated with the currently selected resource which are themselves currently selected. |
RegResource[] |
getSelectedResources()
Returns an array of any of the results from the most recent registry query which are currently selected by the user. |
Action |
getSubmitQueryAction()
Returns the action for submitting the query described by this component's current state. |
protected void |
gotData(RegResource[] resources)
Called from the event dispatch thread when a successful registry query which returns 1 or more records has been completed. |
JMenu |
makeColumnVisibilityMenu(String name)
Constructs a menu which allows the user to select which attributes of each displayed resource are visible. |
void |
performAutoQuery(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. |
void |
performQuery(RegistryQuery query,
String workingMessage)
Submits a query and inserts the results, when ready, into this panel. |
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by addActionListener. |
void |
setEnabled(boolean enabled)
|
void |
submitQuery()
Invoked when the Submit button is pressed. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RegistryPanel(RegistryQueryFactory queryFactory, boolean showCapabilities)
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 of
RegCapabilityInterface
s below the table of
RegResource
sMethod Detail |
---|
public void performAutoQuery(String workingMsg)
workingMsg
- message to display near progress bar while
query is ongoingprotected void gotData(RegResource[] resources)
resources
- non-empty array of resources returned from a
successful querypublic RegResource[] getResources()
public RegCapabilityInterface[] getCapabilities(RegResource resource)
resource
-
public RegResource[] getSelectedResources()
public RegCapabilityInterface[] getSelectedCapabilities()
public void submitQuery()
public void performQuery(RegistryQuery query, String workingMessage)
query
- query to executeworkingMessage
- text to display to user while query is runningpublic void cancelQuery()
public ListSelectionModel getResourceSelectionModel()
RegResource
public ListSelectionModel getCapabilitySelectionModel()
RegCapabilityInterface
)public void displayAdviceMessage(String[] lines)
lines
- lines of message text (one element per screen line)public Action getSubmitQueryAction()
public JMenu makeColumnVisibilityMenu(String name)
name
- menu namepublic JComponent getControlBox()
public void addActionListener(ActionListener listener)
listener
- listener to addpublic void removeActionListener(ActionListener listener)
listener
- listener to removeprotected void fireAction()
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |