stella.jview
Class JFitsDisplay

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 jview.JExitFrame
                          extended by jview.JConfirmExitFrame
                              extended by jview.JBorderFrame
                                  extended by jview.JOpenFrame
                                      extended by jview.JClientFrame
                                          extended by stella.jview.JMasterDisplay
                                              extended by stella.jview.JFitsDisplay
All Implemented Interfaces:
ActionListener, ItemListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, Remote, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants, BorderLabels, ClientLabels, Displayable, FitsLabels, PickListener, ClientObject, ExitCleaning, Initializable, PropertyAware, PropertyComposed, Refreshing

public class JFitsDisplay
extends JMasterDisplay
implements FitsLabels, ChangeListener, ItemListener, MouseMotionListener

A class that allows working with CcdDrivers, especially FechnerDrivers and have a graphical representation.

See Also:
Serialized Form

Nested Class Summary
private static class JFitsDisplay.HeadTailFileFilter
          Accepts files, whose name start with the constructor argument and which end with JFitsCanvas#FITSEXTENSION.
 
Nested classes/interfaces inherited from class stella.jview.JMasterDisplay
JMasterDisplay.Show
 
Nested classes/interfaces inherited from class jview.JClientFrame
JClientFrame.ClientListener
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  boolean color
          Colorize the image if true.
static String COLORACTION
          The action-event command for colorize check box.
private  JCheckBox colorbox
          The colorize check box.
private static String DEFFITSHEAD
          The part of the file name before unique.
private static String DEFFITSTAIL
          The part of the file name after unique.
private static String DEFLOCALDIR
          The name of the local directory.
private static String DEFRESOURCEBUNDLES
          The resource bundles for localized labels and text.
private static String DEFSCPCOMMAND
          The scp command to copy to local directory.
private static DateFormat DEFSUBDIRFORMAT
          The name of the local directory.
private static String DEFTMPDIR
          The name of the temp directory.
private static String DEFUNCOMPRESS
          The uncompress command to make the images readable.
private  JFitsCanvas fits
          Central panel is the fits canvas plus the brightness/contrast adjust.
static String FITZEXTENSION
          Default fitz extension.
private  JFormattedTextField histmax
          If the user enters min/max values rather than a keep level.
private  JFormattedTextField histmin
          If the user enters min/max values rather than a keep level.
private  JCheckBox invert
          The invert check box.
static String INVERTACTION
          The action-event command for invert check box.
private  JRationalSlider keep
          The slider for percentage of counts kept.
static String KEY_FITSCANVAS
          The properties of the fft canvas.
static String KEY_FITSHEAD
          The part of the file name before unique.
static String KEY_FITSTAIL
          The part of the file name after unique.
static String KEY_LOCALDIR
          The name of the local directory.
static String KEY_SCPCOMMAND
          The scp command to copy to local directory.
static String KEY_SUBDIRFORMAT
          The name of the local directory.
static String KEY_TMPDIR
          The name of the tmp directory.
static String KEY_UNCOMPRESS
          The command to uncompress fits file to make it readable.
private  boolean negative
          Invert colors if true.
private  JFormattedTextField precise
          The text field bound to the percentage slider.
static String REDRAWACTION
          The action-event command for redraw button.
static String RESETACTION
          The action-event command for reset button.
private  JComboBox scaling
          The scaling combo box.
private  JLabel value
          The value in the fits file at the mouse position.
private  int xorigin
          Record origin changes.
private  int yorigin
          Record origin changes.
 
Fields inherited from class stella.jview.JMasterDisplay
KEY_BINDNAME, KEY_REFRESH, KEY_ROBOTPROPS, KEY_ROBOTSEQUENCE, KEY_SWITCHMONITOR, KEY_TELESCOPECHAR
 
Fields inherited from class jview.JClientFrame
CONNECTACTION, DISCONNECTACTION, KEY_CONNECTONINIT, KEY_ICONCONNECT, KEY_ICONDISCONNECT
 
Fields inherited from class jview.JOpenFrame
EMPTYACTION, EXITACTION, EXPORTACTION, KEY_FILEACTIONS, KEY_FILEHOME, OPENACTION, PRINTACTION, SAVEACTION
 
Fields inherited from class jview.JBorderFrame
DATACLEANSE, KEY_ABOUTURL, KEY_ACTIONCLASS, KEY_AIPLOGO, KEY_BIGGERSTRUT, KEY_DATAANALYSER, KEY_EASTALIGNMENT, KEY_FITTERS, KEY_FITTERTIPS, KEY_HELPSIZE, KEY_LESSERSTRUT, KEY_NOLOGO, KEY_NORTHALIGNMENT, KEY_SOUTHALIGNMENT, KEY_WESTALIGNMENT, MODELFITTER
 
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 jview.FitsLabels
KEY_COLORLABEL, KEY_COLORTIP, KEY_GAUSSLABEL, KEY_GAUSSTIP, KEY_INVERTLABEL, KEY_INVERTTIP, KEY_KEEPTIP, KEY_REDRAWLABEL, KEY_REDRAWTIP, KEY_RESETLABEL, KEY_RESETTIP, KEY_SCALELABEL, KEY_SCALETIP
 
Fields inherited from interface jview.BorderLabels
KEY_ABOUT, KEY_ABOUTACC, KEY_FILEACCS, KEY_FILEITEMS, KEY_FILEMENU, KEY_FILEMNEMONIC, KEY_HELPMENU, KEY_HELPMNEMONIC, KEY_HELPTITLE, KEY_NOHELP, KEY_NOURLACCESS, KEY_TITLE
 
Fields inherited from interface jview.ClientLabels
KEY_CONNECTERROR, KEY_CONNECTTITLE, KEY_DISCONNECTERROR
 
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
JFitsDisplay(Map<String,String> prop)
          A simple info display that retrieves the fits header data for a specified pick.
JFitsDisplay(PropertyBearing prop)
          A simple info display that retrieves the fits header data for a specified pick.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Action events are issued by the scaling list and the buttons.
 Component getRepresentation()
          The representation is a JFitsComponent that allows adjustment of the contrast and the brightness.
protected  List<Object> getRightItems()
          Returns the list of components to be placed below the aip logo.
 void init()
          Initializes the jcamera.
 boolean isColorized()
          Returns true if the current image is false-colorized.
 boolean isNegative()
          Returns the current status of the negative image flag.
 void itemStateChanged(ItemEvent ie)
          Called when the state of the checkboxes changes.
static void main(String[] arg)
          The command line argument are the properties of the frame.
 void mouseDragged(MouseEvent me)
          Empty method.
 void mouseMoved(MouseEvent me)
          Mouse motions are captured for updating the counts number, changing the vertical cut and horizontal cuts.
protected  boolean processExternally(HistoryAware.Pick pick)
          This method is only called if we have not found the file locally.
protected  boolean processLocally(HistoryAware.Pick pick)
          We try to open the file.
 void setComposedProperties(PropertyBearing prop)
          Sets a PropertyBearing object as a composite of the canvas.
 void stateChanged(ChangeEvent ce)
          Called when the state of the percentage level slider changes.
 boolean toggleColorize()
          Toggles the colorization of the image.
 boolean toggleNegative()
          Toggles the image to be its negative.
private  boolean uncompress(File fitz, String localdir)
          Uncompresses a file to the local directory and deletes the old file.
private  boolean uncompressAll(File[] all, String localdir)
          Uncompresses all file to the given directory.
 
Methods inherited from class stella.jview.JMasterDisplay
connect, disconnect, execute, execute, getIcon, getRefreshInterval, isFixedRate, openFile, processPick, refresh, scanDir
 
Methods inherited from class jview.JClientFrame
abolishConnection, createConnect, establishConnection, exit, getBottomItems
 
Methods inherited from class jview.JOpenFrame
createCheckBoxMenuItem, createLocalizedCheckBoxMenuItem, exportCenter, getExportRepresentation, getHelpActions, getMenus, getOpenFilter, getPrintRepresentation, getSaveFilter, getSaveRepresentation, populateMenu, printCenter, saveFile
 
Methods inherited from class jview.JBorderFrame
analyserListenTo, createButton, createCheckBox, createDataAnalysers, createFitters, createHelp, createLabel, createLocalizedButton, createLocalizedCheckBox, createLocalizedHelp, createLocalizedLabel, createStatus, getAboutAction, getActiveFit, getBiggerStrut, getComposedProperties, getDataAnalysers, getFitterButtonGroup, getFitterComboBox, getLeftItems, getLesserStrut, getModelFittings, getStatusField, getTopItems, hasFired, printAlignment, setAlignment, setFired
 
Methods inherited from class jview.JConfirmExitFrame
disposeAndExit
 
Methods inherited from class jview.JExitFrame
setVisible
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, 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, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.PropertyComposed
getComposedProperties
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

FITZEXTENSION

public static final String FITZEXTENSION
Default fitz extension.

See Also:
Constant Field Values

INVERTACTION

public static final String INVERTACTION
The action-event command for invert check box.

See Also:
Constant Field Values

COLORACTION

public static final String COLORACTION
The action-event command for colorize check box.

See Also:
Constant Field Values

RESETACTION

public static final String RESETACTION
The action-event command for reset button.

See Also:
Constant Field Values

REDRAWACTION

public static final String REDRAWACTION
The action-event command for redraw button.

See Also:
Constant Field Values

KEY_FITSCANVAS

public static final String KEY_FITSCANVAS
The properties of the fft canvas.

See Also:
Constant Field Values

KEY_FITSHEAD

public static final String KEY_FITSHEAD
The part of the file name before unique.

See Also:
Constant Field Values

KEY_FITSTAIL

public static final String KEY_FITSTAIL
The part of the file name after unique.

See Also:
Constant Field Values

KEY_LOCALDIR

public static final String KEY_LOCALDIR
The name of the local directory.

See Also:
Constant Field Values

KEY_TMPDIR

public static final String KEY_TMPDIR
The name of the tmp directory.

See Also:
Constant Field Values

KEY_SUBDIRFORMAT

public static final String KEY_SUBDIRFORMAT
The name of the local directory.

See Also:
Constant Field Values

KEY_SCPCOMMAND

public static final String KEY_SCPCOMMAND
The scp command to copy to local directory.

See Also:
Constant Field Values

KEY_UNCOMPRESS

public static final String KEY_UNCOMPRESS
The command to uncompress fits file to make it readable.

See Also:
Constant Field Values

DEFRESOURCEBUNDLES

private static final String DEFRESOURCEBUNDLES
The resource bundles for localized labels and text.

See Also:
Constant Field Values

DEFFITSHEAD

private static final String DEFFITSHEAD
The part of the file name before unique.

See Also:
Constant Field Values

DEFFITSTAIL

private static final String DEFFITSTAIL
The part of the file name after unique.

See Also:
Constant Field Values

DEFLOCALDIR

private static final String DEFLOCALDIR
The name of the local directory.

See Also:
Constant Field Values

DEFTMPDIR

private static final String DEFTMPDIR
The name of the temp directory.

See Also:
Constant Field Values

DEFSUBDIRFORMAT

private static final DateFormat DEFSUBDIRFORMAT
The name of the local directory.


DEFSCPCOMMAND

private static final String DEFSCPCOMMAND
The scp command to copy to local directory.

See Also:
Constant Field Values

DEFUNCOMPRESS

private static final String DEFUNCOMPRESS
The uncompress command to make the images readable.

See Also:
Constant Field Values

fits

private JFitsCanvas fits
Central panel is the fits canvas plus the brightness/contrast adjust.


xorigin

private int xorigin
Record origin changes.


yorigin

private int yorigin
Record origin changes.


value

private JLabel value
The value in the fits file at the mouse position.


keep

private JRationalSlider keep
The slider for percentage of counts kept.


precise

private JFormattedTextField precise
The text field bound to the percentage slider.


histmin

private JFormattedTextField histmin
If the user enters min/max values rather than a keep level.


histmax

private JFormattedTextField histmax
If the user enters min/max values rather than a keep level.


scaling

private JComboBox scaling
The scaling combo box.


colorbox

private JCheckBox colorbox
The colorize check box.


invert

private JCheckBox invert
The invert check box.


negative

private boolean negative
Invert colors if true.


color

private boolean color
Colorize the image if true.

Constructor Detail

JFitsDisplay

public JFitsDisplay(Map<String,String> prop)
             throws RemoteException
A simple info display that retrieves the fits header data for a specified pick.

Throws:
RemoteException

JFitsDisplay

public JFitsDisplay(PropertyBearing prop)
             throws RemoteException
A simple info display that retrieves the fits header data for a specified pick.

Throws:
RemoteException
Method Detail

setComposedProperties

public void setComposedProperties(PropertyBearing prop)
Sets a PropertyBearing object as a composite of the canvas. Defaults the necessary parameter.

Specified by:
setComposedProperties in interface PropertyAware
Overrides:
setComposedProperties in class JMasterDisplay

init

public void init()
Initializes the jcamera. This method calls the super class init after its necessary setup has been generated. This includes constructing the fits canvas and the camera driver.

Specified by:
init in interface Initializable
Overrides:
init in class JMasterDisplay

getRepresentation

public Component getRepresentation()
The representation is a JFitsComponent that allows adjustment of the contrast and the brightness.

Specified by:
getRepresentation in interface Displayable
Overrides:
getRepresentation in class JBorderFrame

stateChanged

public void stateChanged(ChangeEvent ce)
Called when the state of the percentage level slider changes.

Specified by:
stateChanged in interface ChangeListener

itemStateChanged

public void itemStateChanged(ItemEvent ie)
Called when the state of the checkboxes changes. These are the invert and colorize check boxes.

Specified by:
itemStateChanged in interface ItemListener

isNegative

public boolean isNegative()
Returns the current status of the negative image flag. Should be queried in conjuncture with toggleNegative() if control over negative colors is desired.


toggleNegative

public boolean toggleNegative()
Toggles the image to be its negative. Applied two times restores the original image. If total control over negative is needed, use in conjuncture with isNegative().

Returns:
The new state of the negative flag.

isColorized

public boolean isColorized()
Returns true if the current image is false-colorized. Should be queried in conjuncture with toggleColorize() if total control is needed.


toggleColorize

public boolean toggleColorize()
Toggles the colorization of the image. If the current image is gray, we use the #KEY_FALSEPALETTE key to grab a look-up table to convert the gary to color. Otherwise we revert from fits.

Returns:
The new state of the colorization flag.

mouseMoved

public void mouseMoved(MouseEvent me)
Mouse motions are captured for updating the counts number, changing the vertical cut and horizontal cuts.

Specified by:
mouseMoved in interface MouseMotionListener
See Also:
mouseDragged(java.awt.event.MouseEvent)

mouseDragged

public void mouseDragged(MouseEvent me)
Empty method. Can be used for diagonal scan lines.

Specified by:
mouseDragged in interface MouseMotionListener

actionPerformed

public void actionPerformed(ActionEvent ae)
Action events are issued by the scaling list and the buttons.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class JClientFrame

getRightItems

protected List<Object> getRightItems()
Returns the list of components to be placed below the aip logo. This is a JViewportButton to allow resetting of the ccd frame, a button that pops up the histogramm, cut graph pop-up buttons and a field where the cursor can put its coordinates for proper reading.

Overrides:
getRightItems in class JBorderFrame

processLocally

protected boolean processLocally(HistoryAware.Pick pick)
We try to open the file. If it cannot be found, do nothing.

Specified by:
processLocally in class JMasterDisplay

processExternally

protected boolean processExternally(HistoryAware.Pick pick)
This method is only called if we have not found the file locally. We try to download from the remote server and then process locally again.

Specified by:
processExternally in class JMasterDisplay

uncompressAll

private boolean uncompressAll(File[] all,
                              String localdir)
Uncompresses all file to the given directory. May not be called with null.


uncompress

private boolean uncompress(File fitz,
                           String localdir)
Uncompresses a file to the local directory and deletes the old file.


main

public static void main(String[] arg)
                 throws RemoteException
The command line argument are the properties of the frame.

Throws:
RemoteException