jsky.catalog.gui
Class CatalogTree
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jsky.catalog.gui.CatalogTree
- All Implemented Interfaces:
- ImageObserver, MenuContainer, Serializable, Accessible, QueryResultDisplay, QueryResultHandler
public class CatalogTree
- extends JPanel
- implements QueryResultDisplay, QueryResultHandler
Used to display a catalog hierarchy.
- See Also:
- Serialized Form
Method Summary |
void |
addQueryResult(QueryResult queryResult)
Add the given query result to the tree at the currently selected node. |
void |
copy()
Copy the selected catalog to the clipboard. |
void |
cut()
Cut the selected catalog to the clipboard. |
AbstractAction |
getCopyAction()
|
AbstractAction |
getCutAction()
|
AbstractAction |
getMoveDownAction()
|
AbstractAction |
getMoveUpAction()
|
AbstractAction |
getPasteAction()
|
QueryResult |
getQueryResult()
Return a reference to the QueryResult being displayed (in this case,
it should be a CatalogDirectory object of some kind). |
QueryResult |
getQueryResult(URL url)
This method is called in a background thread to get the contents of the
given URL and return a QueryResult object representing it. |
QueryResultDisplay |
getQueryResultDisplay()
Return the object used to display leaf items, such as tables, etc. |
Catalog |
getSelectedNode()
Return the currently selected tree node |
AbstractAction |
getToBottomAction()
|
AbstractAction |
getToTopAction()
|
JTree |
getTree()
Return the internal JTree |
static void |
main(String[] args)
test main |
JMenuItem |
makeReloadMenuItem()
Return a menu item to reload the catalog config file and rebuild the
tree with the new data. |
void |
moveNode(boolean up)
Move the the selected catalog up or down in the tree. |
void |
moveNodeToEnd(boolean up)
Move the the selected catalog all the way up or down in the tree, as far as possible. |
void |
paste()
Paste the selected catalog from the clipboard. |
void |
reload()
If there is a URL corresponding to the root node, read it again and
rebuild the tree (in case the file changed...). |
void |
selectNode(Catalog node)
Select the given tree node |
void |
setHTMLQueryResultHandler(HTMLQueryResultHandler handler)
Optional handler, used to report HTML format errors from servers |
void |
setQueryResult(QueryResult queryResult)
Display the tree structure of the given query result, which may be
either a CatalogDirectory or a URLQueryResult, where an HTTP get
of the URL returns a CatalogDirectory. |
void |
setQueryResultDisplay(QueryResultDisplay q)
Set the object used to display leaf items, such as tables, etc. |
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 |
CatalogTree
public CatalogTree(CatalogDirectory catDir)
- Create a CatalogTree and display the given catalog directory hierarchy
setHTMLQueryResultHandler
public void setHTMLQueryResultHandler(HTMLQueryResultHandler handler)
- Optional handler, used to report HTML format errors from servers
setQueryResultDisplay
public void setQueryResultDisplay(QueryResultDisplay q)
- Set the object used to display leaf items, such as tables, etc.
getQueryResultDisplay
public QueryResultDisplay getQueryResultDisplay()
- Return the object used to display leaf items, such as tables, etc.
getTree
public JTree getTree()
- Return the internal JTree
setQueryResult
public void setQueryResult(QueryResult queryResult)
- Display the tree structure of the given query result, which may be
either a CatalogDirectory or a URLQueryResult, where an HTTP get
of the URL returns a CatalogDirectory.
- Specified by:
setQueryResult
in interface QueryResultDisplay
getQueryResult
public QueryResult getQueryResult()
- Return a reference to the QueryResult being displayed (in this case,
it should be a CatalogDirectory object of some kind).
selectNode
public void selectNode(Catalog node)
- Select the given tree node
getSelectedNode
public Catalog getSelectedNode()
- Return the currently selected tree node
addQueryResult
public void addQueryResult(QueryResult queryResult)
- Add the given query result to the tree at the currently selected node.
makeReloadMenuItem
public JMenuItem makeReloadMenuItem()
- Return a menu item to reload the catalog config file and rebuild the
tree with the new data.
reload
public void reload()
- If there is a URL corresponding to the root node, read it again and
rebuild the tree (in case the file changed...).
getQueryResult
public QueryResult getQueryResult(URL url)
throws IOException
- This method is called in a background thread to get the contents of the
given URL and return a QueryResult object representing it.
- Specified by:
getQueryResult
in interface QueryResultHandler
- Throws:
IOException
cut
public void cut()
- Cut the selected catalog to the clipboard.
copy
public void copy()
- Copy the selected catalog to the clipboard.
paste
public void paste()
- Paste the selected catalog from the clipboard.
moveNode
public void moveNode(boolean up)
- Move the the selected catalog up or down in the tree.
moveNodeToEnd
public void moveNodeToEnd(boolean up)
- Move the the selected catalog all the way up or down in the tree, as far as possible.
getCutAction
public AbstractAction getCutAction()
getCopyAction
public AbstractAction getCopyAction()
getPasteAction
public AbstractAction getPasteAction()
getMoveUpAction
public AbstractAction getMoveUpAction()
getMoveDownAction
public AbstractAction getMoveDownAction()
getToTopAction
public AbstractAction getToTopAction()
getToBottomAction
public AbstractAction getToBottomAction()
main
public static void main(String[] args)
- test main
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.