public abstract class CatalogNavigator extends JPanel implements QueryResultDisplay, GenericToolBarTarget, HTMLQueryResultHandler
The tree display is based on a top level catalog directory. The details must be defined in a derived class.
Modifier and Type | Class and Description |
---|---|
class |
CatalogNavigator.EmptyPanel
Used to identify an empty query or result panel
|
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 |
---|
CatalogNavigator(Component parent,
CatalogTree catalogTree)
Construct a CatalogNavigator using the given CatalogTree widget
(Call setQueryResult to set the root catalog to display).
|
CatalogNavigator(Component parent,
CatalogTree catalogTree,
TablePlotter plotter)
Construct a CatalogNavigator using the given CatalogTree widget
and TablePlotter
(Call setQueryResult to set the root catalog to display).
|
Modifier and Type | Method and Description |
---|---|
protected void |
_resultComponentChanged()
Called whenever the display component is changed
|
void |
addChangeListener(ChangeListener l)
Register to receive change events from this object whenever a new
query result is displayed.
|
void |
addHistoryMenuItems(JMenu menu)
Add history items (for previously displayed components) to the given menu
|
void |
addRow()
If a table is being displayed, add an empty row in the table.
|
protected void |
addToHistory()
Add the current catalog to the history stack, removing duplicates.
|
protected void |
addToHistory(CatalogHistoryItem historyItem)
Add the given item to the history stack, removing duplicates.
|
void |
back()
Go back to the previous component in the history list
|
protected void |
cleanupHistoryList()
This method is called after the history list is deserialized to remove any
items in the list that can't be accessed.
|
protected void |
cleanupHistoryStack(Stack stack)
This method may be redefined in subclasses to do cleanup work before components are
removed from the given history stack (_backStack or _forwStack).
|
void |
clear()
Clear the display.
|
protected void |
clearHistory()
Add the current URL to the history list
|
void |
close()
Close the window
|
void |
deleteSelectedRows()
If a table is being displayed, delete the selected rows.
|
void |
displayHTMLPage(URL url)
Display the given HTML URL in a popup window containing a JEditorPane.
|
void |
displayPlainText(URL url)
Display the text pointed to by the given URL.
|
void |
exit()
Exit the application with the given status.
|
protected void |
fireChange(ChangeEvent e)
Notify any listeners that a new query result is being displayed.
|
void |
forward()
Go forward to the next component in the history list
|
AbstractAction |
getAddRowAction() |
AbstractAction |
getBackAction()
Return the action for "Back"
|
protected Stack |
getBackStack()
Return the stack of CatalogHistoryItems, used to go back to a previous panel
|
CatalogTree |
getCatalogTree()
Return the object displaying the catalog tree
|
AbstractAction |
getDeleteSelectedRowsAction() |
JDesktopPane |
getDesktop()
Return the JDesktopPane, if using internal frames, otherwise null
|
AbstractAction |
getForwAction()
Return the action for "Forward"
|
protected Stack |
getForwStack()
Return the stack of CatalogHistoryItems, used to go forward to the next panel
|
protected LinkedList |
getHistoryList()
List of CatalogHistoryItem, for previously viewed catalogs or query results.
|
int |
getMaxHistoryItems()
Return the max number of items in the history list.
|
AbstractAction |
getOpenAction()
Return the action for "Open"
|
Component |
getParentFrame()
Return the top level parent frame (or internal frame) for this window
|
TablePlotter |
getPlotter()
Return the object used to plot table data, or null if none was defined.
|
AbstractAction |
getPrintAction() |
protected ProgressPanel |
getProgressPanel()
Return the panel used to display download progress information
|
JComponent |
getQueryComponent()
Return the panel currently being displayed
|
QueryResult |
getQueryResult() |
protected JSplitPane |
getQuerySplitPane()
The pane dividing the catalog tree and the query panel
|
JComponent |
getResultComponent()
Return the panel currently being displayed
|
protected JSplitPane |
getResultSplitPane()
The pane dividing the query and the results panel
|
Component |
getRootComponent()
Return the top level parent frame (or internal frame) for this window
|
AbstractAction |
getSaveAsAction() |
AbstractAction |
getSaveAsHTMLAction() |
AbstractAction |
getSaveWithImageAction() |
boolean |
isMainWindow()
Return true if this is the main application window (enables exit menu item)
|
protected void |
loadHistory()
Try to load the history list from a file, and create an empty list if that fails.
|
protected JComponent |
makeCatalogComponent(Catalog catalog)
Return a new JComponent displaying the contents of (or the interface for searching)
the given catalog
|
protected JComponent |
makeCatalogDirectoryComponent(CatalogDirectory catalogDirectory)
Return a new JComponent displaying the contents of the given catalog directory
|
protected CatalogHistoryItem |
makeCatalogHistoryItem()
Return a new CatalogHistoryItem for the currently displayed catalog.
|
protected CatalogQueryTool |
makeCatalogQueryTool(Catalog catalog)
Make a panel for querying a catalog
|
protected JFileChooser |
makeFileChooser()
Create and return a new file chooser to be used to select a local catalog file
to open.
|
protected void |
makeProgressPanel()
If it does not already exist, make the panel used to display
the progress of network access.
|
protected JComponent |
makeQueryResultComponent()
Create and return a component displaying the given query result
|
protected JComponent |
makeQueryResultComponent(QueryResult queryResult)
Create and return a JComponent displaying the given query result.
|
protected void |
makeTablePopupMenu(TableDisplayTool t)
Add a popup menu to the given TableDisplayTool
|
protected JComponent |
makeTableQueryResultComponent(TableQueryResult tableQueryResult)
Return a new JComponent displaying the contents of the given table query result.
|
protected JComponent |
makeUnknownURLComponent(URL url,
String contentType)
Return a new JComponent displaying the contents of the given URL.
|
protected JComponent |
makeURLComponent(URL url)
Return a new JComponent displaying the contents of the given URL.
|
protected JComponent |
makeURLComponent(URL url,
String contentType)
Return a new JComponent displaying the contents of the given URL.
|
protected LinkedList |
mergeHistoryList()
Merge the _historyList with current serialized version (another instance
may have written it since we read it last).
|
void |
open()
Display a file chooser to select a local catalog file to open
|
void |
open(String fileOrUrl)
Open the given file or URL
|
void |
openURL()
Display a dialog to enter a URL to display
|
void |
print()
Pop up a dialog for printing the query results.
|
void |
removeChangeListener(ChangeListener l)
Stop receiving change events from this object.
|
void |
saveAs()
Pop up a dialog to ask the user for a file name, and then save the current query result
to the selected file.
|
void |
saveAs(String filename)
Save the current query result to the selected file.
|
void |
saveAsHTML()
Pop up a dialog to ask the user for a file name, and then save the current query result
to the selected file in HTML format.
|
void |
saveAsHTML(String filename)
Save the current query result to the selected file in HTML format.
|
protected void |
saveHistory(boolean merge)
Save the current history list to a file.
|
void |
saveWithImage()
Save the current table as a FITS table in the current FITS image
(Should be defined in a derived class).
|
void |
setAutoQuery(boolean b)
Set to true to query catalogs automatically when selected
|
void |
setComponent(JComponent component)
Set the query or result component to display.
|
void |
setDesktop(JDesktopPane desktop)
Set the JDesktopPane to use for top level windows, if using internal frames
|
static void |
setMainWindow(boolean b)
Set to true if this is the main application window (enables exit menu item)
|
void |
setMaxHistoryItems(int n)
Set the max number of items in the history list.
|
void |
setOrigURL(URL url)
Set the original URL for the current catalog or table.
|
void |
setPlotter(TablePlotter tp)
Set the object used to plot table data.
|
void |
setQueryComponent(JComponent component)
Set the query component to display
|
void |
setQueryResult(QueryResult queryResult)
Display the given query result.
|
void |
setResultComponent(JComponent component)
Set the result component to display
|
void |
setTableCellsEditable(boolean b)
Set the editable state of the cells in the displayed table.
|
void |
unplot()
Remove any plot symbols or graphics managed by any of the display components
|
protected void |
unplot(Stack stack)
Remove any plot symbols or graphics managed by any of the display
components in the given stack
|
protected void |
update()
Update the layout after a new component has been inserted
|
protected void |
updateTreeSelection()
Select the node in the catalog directory tree corresponding to the current
display component
|
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 CatalogNavigator(Component parent, CatalogTree catalogTree)
parent
- the parent componentcatalogTree
- a CatalogTree (normally a subclass of CatalogTree
that knows about certain types of catalogs)public CatalogNavigator(Component parent, CatalogTree catalogTree, TablePlotter plotter)
parent
- the parent componentcatalogTree
- a CatalogTree (normally a subclass of CatalogTree
that knows about certain types of catalogs)plotter
- the object to use to plot catalog table data
(when the plot button is pressed)public CatalogTree getCatalogTree()
protected JSplitPane getQuerySplitPane()
protected JSplitPane getResultSplitPane()
public JDesktopPane getDesktop()
public void setDesktop(JDesktopPane desktop)
public void setAutoQuery(boolean b)
public TablePlotter getPlotter()
public void setPlotter(TablePlotter tp)
public Component getParentFrame()
public void setComponent(JComponent component)
public void setQueryComponent(JComponent component)
public JComponent getQueryComponent()
public void setResultComponent(JComponent component)
public JComponent getResultComponent()
protected void _resultComponentChanged()
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireChange(ChangeEvent e)
protected void addToHistory()
protected void addToHistory(CatalogHistoryItem historyItem)
protected CatalogHistoryItem makeCatalogHistoryItem()
public int getMaxHistoryItems()
public void setMaxHistoryItems(int n)
public void addHistoryMenuItems(JMenu menu)
protected void cleanupHistoryList()
protected void cleanupHistoryStack(Stack stack)
protected LinkedList mergeHistoryList()
protected void clearHistory()
protected void saveHistory(boolean merge)
merge
- if true, merge the list with the existing list on disk.protected void loadHistory()
public void setOrigURL(URL url)
url
- the URL of the catalog, table or FITS fileprotected void unplot(Stack stack)
public void unplot()
protected void update()
protected void updateTreeSelection()
public QueryResult getQueryResult()
public void setQueryResult(QueryResult queryResult)
setQueryResult
in interface QueryResultDisplay
protected void makeProgressPanel()
protected JComponent makeQueryResultComponent()
protected JComponent makeQueryResultComponent(QueryResult queryResult)
protected JComponent makeCatalogDirectoryComponent(CatalogDirectory catalogDirectory)
protected JComponent makeTableQueryResultComponent(TableQueryResult tableQueryResult)
protected void makeTablePopupMenu(TableDisplayTool t)
protected JComponent makeCatalogComponent(Catalog catalog)
protected CatalogQueryTool makeCatalogQueryTool(Catalog catalog)
protected JComponent makeURLComponent(URL url) throws IOException
IOException
protected JComponent makeURLComponent(URL url, String contentType) throws IOException
IOException
public void displayHTMLPage(URL url)
displayHTMLPage
in interface HTMLQueryResultHandler
public void displayPlainText(URL url)
protected JComponent makeUnknownURLComponent(URL url, String contentType)
public void open()
protected JFileChooser makeFileChooser()
public void open(String fileOrUrl)
public void exit()
public void close()
public void back()
public void forward()
public AbstractAction getOpenAction()
GenericToolBarTarget
getOpenAction
in interface GenericToolBarTarget
public AbstractAction getSaveAsAction()
public AbstractAction getSaveAsHTMLAction()
public AbstractAction getSaveWithImageAction()
public AbstractAction getPrintAction()
public AbstractAction getBackAction()
GenericToolBarTarget
getBackAction
in interface GenericToolBarTarget
public AbstractAction getForwAction()
GenericToolBarTarget
getForwAction
in interface GenericToolBarTarget
public AbstractAction getAddRowAction()
public AbstractAction getDeleteSelectedRowsAction()
public Component getRootComponent()
public void openURL()
public void clear()
public void saveAs()
public void saveAs(String filename)
public void saveWithImage()
public void saveAsHTML()
public void saveAsHTML(String filename)
public void print()
public void addRow()
public void deleteSelectedRows()
public void setTableCellsEditable(boolean b)
public boolean isMainWindow()
public static void setMainWindow(boolean b)
protected ProgressPanel getProgressPanel()
protected Stack getBackStack()
protected Stack getForwStack()
protected LinkedList getHistoryList()
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.