jsky.app.jskycat
Class JSkyCat

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by jsky.app.jskycat.JSkyCat
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class JSkyCat
extends javax.swing.JFrame

Main class for the JSkyCat application.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
protected static javax.swing.JDesktopPane desktop
          Main window, when using internal frames
protected  javax.swing.JFileChooser fileChooser
          File selection dialog, when using internal frames
protected  java.awt.Component imageFrame
          The main image frame (or internal frame)
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JSkyCat(java.lang.String imageFileOrUrl)
          Create the JSkyCat application class and display the contents of the given image file or URL, if not null.
JSkyCat(java.lang.String imageFileOrUrl, boolean internalFrames, boolean showNavigator)
          Create the JSkyCat application class and display the contents of the given image file or URL, if not null.
JSkyCat(java.lang.String imageFileOrUrl, boolean internalFrames, boolean showNavigator, int portNum)
          Create the JSkyCat application class and display the contents of the given image file or URL, if not null.
 
Method Summary
 void exit()
          Exit the application with the given status.
protected  java.lang.String getAppName()
          Return the name of this application.
protected  java.lang.String getAppVersion()
          Return the version number of this application as a String.
static javax.swing.JDesktopPane getDesktop()
          Return the JDesktopPane, if using internal frames, otherwise null
protected  MainImageDisplay getImageDisplay()
          Return the main image display
 java.awt.Component getImageFrame()
          Return the main image frame (JFrame or JInternalFrame)
static void main(java.lang.String[] args)
          The main class of the JSkyCat application.
 javax.swing.JFileChooser makeFileChooser()
          Create and return a new file chooser to be used to select a local catalog file to open.
protected  void makeFrameLayout(boolean showNavigator, java.lang.String imageFileOrUrl)
          Do the window layout using normal frames
protected  void makeInternalFrameLayout(boolean showNavigator, java.lang.String imageFileOrUrl)
          Do the window layout using internal frames
protected  javax.swing.JMenuBar makeMenuBar()
          Make and return the application menubar (used when internal frames are in use)
protected  NavigatorFrame makeNavigatorFrame(MainImageDisplay imageDisplay)
          Make and return a frame for displaying catalog information.
protected  NavigatorImageDisplayFrame makeNavigatorImageDisplayFrame(java.lang.String imageFileOrUrl)
          Make and return a frame for displaying the given image (may be null).
protected  NavigatorImageDisplayInternalFrame makeNavigatorImageDisplayInternalFrame(javax.swing.JDesktopPane desktop, java.lang.String imageFileOrUrl)
          Make and return an internal frame for displaying the given image (may be null).
protected  NavigatorInternalFrame makeNavigatorInternalFrame(javax.swing.JDesktopPane desktop, MainImageDisplay imageDisplay)
          Make and return an internal frame for displaying catalog information.
 void open()
          Display a file chooser to select a filename to display in a new internal frame.
 void open(java.lang.String fileOrUrl)
          Display the given file or URL in a new internal frame.
static void setDesktop(javax.swing.JDesktopPane dt)
          Set the JDesktopPane to use for top level windows, if using internal frames
protected  void setDesktopBackground()
          Set the desktop background pattern
 void setImageFrameVisible(boolean visible)
          Convenience method to set the visibility of the image JFrame (or JInternalFrame).
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

fileChooser

protected javax.swing.JFileChooser fileChooser
File selection dialog, when using internal frames


desktop

protected static javax.swing.JDesktopPane desktop
Main window, when using internal frames


imageFrame

protected java.awt.Component imageFrame
The main image frame (or internal frame)

Constructor Detail

JSkyCat

public JSkyCat(java.lang.String imageFileOrUrl,
               boolean internalFrames,
               boolean showNavigator,
               int portNum)
Create the JSkyCat application class and display the contents of the given image file or URL, if not null.

Parameters:
imageFileOrUrl - an image file or URL to display
internalFrames - if true, use internal frames
showNavigator - if true, display the catalog navigator on startup
portNum - if not zero, listen on this port for remote control commnds
See Also:
JSkyCatRemoteControl

JSkyCat

public JSkyCat(java.lang.String imageFileOrUrl,
               boolean internalFrames,
               boolean showNavigator)
Create the JSkyCat application class and display the contents of the given image file or URL, if not null.

Parameters:
imageFileOrUrl - an image file or URL to display
internalFrames - if true, use internal frames
showNavigator - if true, display the catalog navigator on startup

JSkyCat

public JSkyCat(java.lang.String imageFileOrUrl)
Create the JSkyCat application class and display the contents of the given image file or URL, if not null.

Parameters:
imageFileOrUrl - an image file or URL to display
Method Detail

getDesktop

public static javax.swing.JDesktopPane getDesktop()
Return the JDesktopPane, if using internal frames, otherwise null


setDesktop

public static void setDesktop(javax.swing.JDesktopPane dt)
Set the JDesktopPane to use for top level windows, if using internal frames


makeInternalFrameLayout

protected void makeInternalFrameLayout(boolean showNavigator,
                                       java.lang.String imageFileOrUrl)
Do the window layout using internal frames

Parameters:
showNavigator - if true, display the catalog navigator on startup
imageFileOrUrl - an image file or URL to display

makeFrameLayout

protected void makeFrameLayout(boolean showNavigator,
                               java.lang.String imageFileOrUrl)
Do the window layout using normal frames

Parameters:
showNavigator - if true, display the catalog navigator on startup
imageFileOrUrl - an image file or URL to display

makeMenuBar

protected javax.swing.JMenuBar makeMenuBar()
Make and return the application menubar (used when internal frames are in use)


makeNavigatorImageDisplayInternalFrame

protected NavigatorImageDisplayInternalFrame makeNavigatorImageDisplayInternalFrame(javax.swing.JDesktopPane desktop,
                                                                                    java.lang.String imageFileOrUrl)
Make and return an internal frame for displaying the given image (may be null).

Parameters:
desktop - used to display the internal frame
imageFileOrUrl - specifies the iamge file or URL to display

getAppName

protected java.lang.String getAppName()
Return the name of this application.


getAppVersion

protected java.lang.String getAppVersion()
Return the version number of this application as a String.


makeNavigatorImageDisplayFrame

protected NavigatorImageDisplayFrame makeNavigatorImageDisplayFrame(java.lang.String imageFileOrUrl)
Make and return a frame for displaying the given image (may be null).

Parameters:
imageFileOrUrl - specifies the iamge file or URL to display

makeNavigatorInternalFrame

protected NavigatorInternalFrame makeNavigatorInternalFrame(javax.swing.JDesktopPane desktop,
                                                            MainImageDisplay imageDisplay)
Make and return an internal frame for displaying catalog information.

Parameters:
desktop - used to display the internal frame
imageDisplay - used to display images from image servers

makeNavigatorFrame

protected NavigatorFrame makeNavigatorFrame(MainImageDisplay imageDisplay)
Make and return a frame for displaying catalog information.

Parameters:
imageDisplay - used to display images from image servers

setDesktopBackground

protected void setDesktopBackground()
Set the desktop background pattern


makeFileChooser

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


open

public void open()
Display a file chooser to select a filename to display in a new internal frame.


open

public void open(java.lang.String fileOrUrl)
Display the given file or URL in a new internal frame.


exit

public void exit()
Exit the application with the given status.


getImageFrame

public java.awt.Component getImageFrame()
Return the main image frame (JFrame or JInternalFrame)


getImageDisplay

protected MainImageDisplay getImageDisplay()
Return the main image display


setImageFrameVisible

public void setImageFrameVisible(boolean visible)
Convenience method to set the visibility of the image JFrame (or JInternalFrame).


main

public static void main(java.lang.String[] args)
The main class of the JSkyCat application.

Usage: java [-Djsky.catalog.skycat.config=$SKYCAT_CONFIG] JSkyCat [-[no]internalframes] [-shownavigator] [-port portNumber] [imageFileOrUrl]

The jsky.catalog.skycat.config property defines the Skycat style catalog config file to use. (The default uses the ESO Skycat config file).

If -internalframes is specified, internal frames are used. The -nointernalframes option has the opposite effect. (The default is to use internal frames under Windows only).

If -shownavigator is specified, the catalog navigator window is displayed on startup.

The -port option causes the main image window to listen on a socket for client connections. This can be used to remote control the application.

The imageFileOrUrl argument may be an image file or URL to load.