jsky.navigator
Class Navigator

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by jsky.catalog.gui.CatalogNavigator
                      extended by jsky.navigator.Navigator
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, CatalogNavigatorOpener, QueryResultDisplay, HTMLQueryResultHandler, GenericToolBarTarget

public class Navigator
extends CatalogNavigator
implements CatalogNavigatorOpener

Extends CatalogNavigator to include support for displaying images and plotting catalog data in images.

See Also:
Serialized Form

Nested Class Summary
protected  class Navigator.NavigatorImageLoader
          This local class is used to load an image in the event dispatching thread.
 
Nested classes/interfaces inherited from class jsky.catalog.gui.CatalogNavigator
CatalogNavigator.EmptyPanel
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.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
Navigator(java.awt.Component parent, CatalogTree catalogTree, TablePlotter plotter)
          Construct a Navigator using the given CatalogTree widget (call setQueryResult to set the catalog or data to display).
Navigator(java.awt.Component parent, CatalogTree catalogTree, TablePlotter plotter, MainImageDisplay imageDisplay)
          Construct a Navigator using the given CatalogTree widget (call setQueryResult to set the catalog or data to display).
 
Method Summary
 void addPickedObjectToTable(PickObjectStatistics stats, boolean isUpdate)
          Add the object described by stats to the currently displayed table, or create a new table if none is being displayed.
protected  void addRowForPickedObject(TableQueryResult table, TableDisplayTool tableDisplayTool, PickObjectStatistics stats, boolean isUpdate)
          Add a row to the given table with information from the given stats object.
 MainImageDisplay getImageDisplay()
          Return the image display widget.
 javax.swing.Action getImageDisplayAction()
          Return the action to use to show the image window.
protected  void initSymbolPlotter()
          initialize the symbol plotter
protected  void loadImage(java.lang.String filename, java.net.URL url)
          Load and display the given image file.
protected  void loadImage(java.net.URL url, java.lang.String contentType)
          Download the given image URL to a temporary file and then display the image file when done.
protected  CatalogQueryTool makeCatalogQueryTool(Catalog catalog)
          Make a panel for querying a catalog (Redefined from the parent class to use a CatalogQueryTool subclass).
 javax.swing.JFileChooser makeFileChooser()
          Create and return a new file chooser to be used to select a local catalog file to open.
protected  void makeImageDisplayControlFrame()
          Make an ImageDisplayControlFrame or ...InternalFrame, depending on what type of frames are being used.
protected  TableQueryResult makePickObjectTable(PickObjectStatistics stats)
          Make a catalog table to use to hold the objects picked by the user and add the first row based on the given stats object.
protected  javax.swing.JComponent makeURLComponent(java.net.URL url, java.lang.String contentType)
          Return a new JComponent displaying the contents of the given URL.
protected  void notifyNewImageDisplay()
          Notify any panels that need to know about the new image display window.
protected  void notifyNewImageDisplay(java.util.Stack stack)
          Notify any panels in the given stack that need to know about the new image display window.
 void openCatalogWindow()
          Open the catalog navigator window (in this case, it is already open).
 void openCatalogWindow(Catalog cat)
          Open the catalog navigator window and display the interface for the given catalog, if not null (in this case, the window is already open).
 void openCatalogWindow(java.lang.String name)
          Open a catalog window for the named catalog, if found.
 void openLocalCatalog()
          Pop up a file browser to select a local catalog file to open.
 void saveWithImage()
          Save the current table as a FITS table in the current FITS image.
protected  void setImageDisplay(NavigatorImageDisplay imageDisplay)
          Set the image display to use for plotting catalog objects.
protected  void setImageDisplayControlFrame(java.awt.Component imageDisplayControlFrame)
          Set the frame belonging to the image display widget.
 void setImageDisplayManager(NavigatorImageDisplayManager imageDisplayMgr)
          Specify an (optional) object that can be used to create the image display frame when needed.
 void setImageDisplayNavigator(Navigator navigator)
          Set the instance of the catalog navigator to use with this image display.
 void showImageDisplay()
          Show the image display window.
 
Methods inherited from class jsky.catalog.gui.CatalogNavigator
_resultComponentChanged, addChangeListener, addHistoryMenuItems, addQueryMenuItems, addRow, addToHistory, back, clear, clearHistory, clearQueryList, close, deleteQuery, deleteSelectedRows, displayHTMLPage, displayPlainText, exit, fireChange, forward, getAddRowAction, getBackAction, getBackStack, getCatalogDirectory, getCatalogTree, getDeleteAllQueryAction, getDeleteSelectedRowsAction, getDesktop, getFileChooser, getForwAction, getForwStack, getOpenAction, getParentFrame, getPlotter, getPrintAction, getProgressPanel, getQueryComponent, getQueryResult, getQuerySplitPane, getResultComponent, getResultSplitPane, getRootComponent, getSaveAsAction, getSaveAsHTMLAction, getSaveWithImageAction, getStoreNewQueryAction, isMainWindow, makeCatalogComponent, makeCatalogDirectoryComponent, makeCatalogHistoryItem, makeProgressPanel, makeQueryResultComponent, makeQueryResultComponent, makeSaveFileChooser, makeTablePopupMenu, makeTableQueryResultComponent, makeUnknownURLComponent, makeURLComponent, open, open, openURL, print, removeChangeListener, saveAs, saveAs, saveAsHTML, saveAsHTML, setAutoQuery, setComponent, setDesktop, setMainWindow, setOpenAction, setOrigURL, setPlotter, setQueryComponent, setQueryResult, setResultComponent, setTableCellsEditable, storeNewQuery, storeQuery, unplot, unplot, update, updateTreeSelection
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Navigator

public Navigator(java.awt.Component parent,
                 CatalogTree catalogTree,
                 TablePlotter plotter,
                 MainImageDisplay imageDisplay)
Construct a Navigator using the given CatalogTree widget (call setQueryResult to set the catalog or data to display).

Parameters:
parent - the parent component
catalogTree - 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)
imageDisplay - optional widget to use to display images (if not specified, or null, a new window will be created)

Navigator

public Navigator(java.awt.Component parent,
                 CatalogTree catalogTree,
                 TablePlotter plotter)
Construct a Navigator using the given CatalogTree widget (call setQueryResult to set the catalog or data to display).

Parameters:
parent - the parent component
catalogTree - 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)
Method Detail

setImageDisplayManager

public void setImageDisplayManager(NavigatorImageDisplayManager imageDisplayMgr)
Specify an (optional) object that can be used to create the image display frame when needed.


getImageDisplay

public MainImageDisplay getImageDisplay()
Return the image display widget.


setImageDisplay

protected void setImageDisplay(NavigatorImageDisplay imageDisplay)
Set the image display to use for plotting catalog objects.


setImageDisplayControlFrame

protected void setImageDisplayControlFrame(java.awt.Component imageDisplayControlFrame)
Set the frame belonging to the image display widget.


setImageDisplayNavigator

public void setImageDisplayNavigator(Navigator navigator)
Set the instance of the catalog navigator to use with this image display.


getImageDisplayAction

public javax.swing.Action getImageDisplayAction()
Return the action to use to show the image window.


makeCatalogQueryTool

protected CatalogQueryTool makeCatalogQueryTool(Catalog catalog)
Make a panel for querying a catalog (Redefined from the parent class to use a CatalogQueryTool subclass).

Overrides:
makeCatalogQueryTool in class CatalogNavigator

makeImageDisplayControlFrame

protected void makeImageDisplayControlFrame()
Make an ImageDisplayControlFrame or ...InternalFrame, depending on what type of frames are being used.


loadImage

protected void loadImage(java.lang.String filename,
                         java.net.URL url)
Load and display the given image file. The URL is only needed for the image history, in case the file is deleted.


showImageDisplay

public void showImageDisplay()
Show the image display window.


loadImage

protected void loadImage(java.net.URL url,
                         java.lang.String contentType)
                  throws java.io.IOException
Download the given image URL to a temporary file and then display the image file when done. This method is called in a background thread.

Throws:
java.io.IOException

notifyNewImageDisplay

protected void notifyNewImageDisplay()
Notify any panels that need to know about the new image display window.


notifyNewImageDisplay

protected void notifyNewImageDisplay(java.util.Stack stack)
Notify any panels in the given stack that need to know about the new image display window.


initSymbolPlotter

protected void initSymbolPlotter()
initialize the symbol plotter


makeURLComponent

protected javax.swing.JComponent makeURLComponent(java.net.URL url,
                                                  java.lang.String contentType)
                                           throws java.io.IOException
Return a new JComponent displaying the contents of the given URL.

Overrides:
makeURLComponent in class CatalogNavigator
Throws:
java.io.IOException

openCatalogWindow

public void openCatalogWindow()
Open the catalog navigator window (in this case, it is already open).

Specified by:
openCatalogWindow in interface CatalogNavigatorOpener
See Also:
CatalogNavigatorOpener

openCatalogWindow

public void openCatalogWindow(Catalog cat)
Open the catalog navigator window and display the interface for the given catalog, if not null (in this case, the window is already open).

Specified by:
openCatalogWindow in interface CatalogNavigatorOpener
See Also:
CatalogNavigatorOpener

openCatalogWindow

public void openCatalogWindow(java.lang.String name)
Open a catalog window for the named catalog, if found.

Specified by:
openCatalogWindow in interface CatalogNavigatorOpener
See Also:
CatalogNavigatorOpener

openLocalCatalog

public void openLocalCatalog()
Pop up a file browser to select a local catalog file to open.

Specified by:
openLocalCatalog in interface CatalogNavigatorOpener
See Also:
CatalogNavigatorOpener

saveWithImage

public void saveWithImage()
Save the current table as a FITS table in the current FITS image.

Overrides:
saveWithImage in class CatalogNavigator

makeFileChooser

public javax.swing.JFileChooser makeFileChooser()
Create and return a new file chooser to be used to select a local catalog file to open.

Overrides:
makeFileChooser in class CatalogNavigator

addPickedObjectToTable

public void addPickedObjectToTable(PickObjectStatistics stats,
                                   boolean isUpdate)
Add the object described by stats to the currently displayed table, or create a new table if none is being displayed.

Parameters:
stats - describes the selected object
isUpdate - set to true if this is just an update of the previously selected position

makePickObjectTable

protected TableQueryResult makePickObjectTable(PickObjectStatistics stats)
Make a catalog table to use to hold the objects picked by the user and add the first row based on the given stats object.


addRowForPickedObject

protected void addRowForPickedObject(TableQueryResult table,
                                     TableDisplayTool tableDisplayTool,
                                     PickObjectStatistics stats,
                                     boolean isUpdate)
Add a row to the given table with information from the given stats object. The target table may or may not be compatible, so column names and types are checked.