net.grelf.grip
Class GRIP

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 net.grelf.grip.GRIP_Base
                          extended by net.grelf.grip.GRIP
All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public final class GRIP
extends GRIP_Base
implements java.awt.datatransfer.ClipboardOwner

This is the main application class of GRIP, with the entry point. It displays a small window with a menu bar, the code for which is in this class. The menu bar has two menus: one for opening images, listing and selecting them, the other for applying batch processes to multiple selected image files. This window is the parent for all others in the application, so closing it closes all other windows (if the user confirms the closing operation).

This is a singleton class so its constructor is private and a reference to the one object is obtained by getInstance ().

GRIP is partly a general purpose image processor and measurer but it also has some specific purposes. It concentrates on things which Adobe Photoshop cannot do, or does only awkwardly:

  1. Measuring. There are two main ways by which GRIP enables image measuring:
  2. Combining images by addition (or averaging) and subtraction. This kind of thing can be done in Photoshop by putting images into layers, adjusting the layer opacities appropriately and then merging the layers. However, that is very awkward, especially when combining a sequence of many images. Again the impetus for this was astrophotography: enabling composite images to be built up from multiple exposures in order to overcome noise and be able to see fainter objects.
  3. Automatic object detection and matching across a sequence of images so that the images may be combined despite motion having ocurred between exposures. Once again this is primarily aimed at astrophotography. The aim is to take a series of short exposures (say 5 seconds each) with a fixed camera, not guiding the camera to counteract the earth's rotation, and yet still be able to add the images up to reduce noise and be able to see faint objects. The starting point for this processing is the option "Detect blobs" in class ImMenu. The matching across images is done by the class Analyser.
  4. Also designed for astrophotography (small light objects on a dark background which should be uniform but often is not, due to lens vignetting and scattered light pollution) there is a menu option for automatically flattening the background. Like many of GRIP's processes this may either be performed on a single image while it is being displayed or as an invisible batch process on a selected set of (maybe many) image files.

GRIP can handle 8- or 16-bit images, the latter being important for getting the maximum detail out of astrophotographs. In practice most digital SLRs collect 12 or 14 bits per channel in raw mode. GRIP can read raw format images directly, by using the jrawio plug-in. GRIP can load and save any image formats for which the relevant plug-in for the javax.imageio package is available. As supplied with GRIP at present that means TIFF, JPEG, PNG, GIF (reading GIF but not saving), BMP and most RAW formats.

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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static javax.swing.ImageIcon icon
           
protected static java.lang.String OK_STATUS
           
 
Fields inherited from class net.grelf.grip.GRIP_Base
GRIP_DEFAULT_CURSOR, GRIP_HAND_CURSOR, GRIP_WAIT_CURSOR, VERSION
 
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
 
Method Summary
static void about()
          Display the "about" message for the application.
protected static javax.swing.ImageIcon createImageIcon(java.lang.String path)
          Returns a javax.swing.ImageIcon, or null if the path was invalid.
protected  void exit()
           
 java.util.List<ImFrame> getAllStarChartFrames()
          Find all ImFrames that contain star charts.
static javax.swing.ImageIcon getIcon()
           
static java.util.List<ImFrame> getImFramesList()
          Get a list of all the ImFrames which are currently on display.
static GRIP getInstance()
          Get a reference to the application object itself (singleton).
static java.util.logging.Logger getLogger()
          Deprecated. 
protected static int getNNewImages()
          Get the number of images which have been created as new (empty) images rather than by loading from disc.
static ImTable getTable()
          Get the window displaying a list of all currently displayed ImFrames.
protected static void incNNewImages()
           
 void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
          Implementing ClipboardOwner but does nothing.
static void main(java.lang.String... args)
          Entry point for the application
 void openAAVSO_Chart()
          Open saved HTML reference sequence from AAVSO as a StarChart.
 void openBlobs()
          Enable the user to reopen serialised blob data and the image they came from.
 void openChart()
           
 void openFiles()
          Ask the user to select image file(s) and open it/them in ImFrame(s).
protected static void setTable(ImTable aTable)
           
 
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, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, 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 java.awt.MenuContainer
getFont, postEvent
 

Field Detail

OK_STATUS

protected static final java.lang.String OK_STATUS
See Also:
Constant Field Values

icon

protected static javax.swing.ImageIcon icon
Method Detail

main

public static void main(java.lang.String... args)
                 throws java.lang.Exception
Entry point for the application

Throws:
java.lang.Exception

getInstance

public static GRIP getInstance()
Get a reference to the application object itself (singleton).


exit

protected void exit()

about

public static void about()
Display the "about" message for the application.


getLogger

@Deprecated
public static java.util.logging.Logger getLogger()
Deprecated. 

10.4.5: Deprecated - instead use java.util.logging.Logger.getLogger ("net.grelf");. Get the application's logger, to be able to log things.


getNNewImages

protected static int getNNewImages()
Get the number of images which have been created as new (empty) images rather than by loading from disc.


incNNewImages

protected static void incNNewImages()

getImFramesList

public static java.util.List<ImFrame> getImFramesList()
Get a list of all the ImFrames which are currently on display.


getAllStarChartFrames

public java.util.List<ImFrame> getAllStarChartFrames()
Find all ImFrames that contain star charts. Returns empty list if none found.


getTable

public static ImTable getTable()
Get the window displaying a list of all currently displayed ImFrames.


setTable

protected static void setTable(ImTable aTable)

getIcon

public static javax.swing.ImageIcon getIcon()

createImageIcon

protected static javax.swing.ImageIcon createImageIcon(java.lang.String path)
Returns a javax.swing.ImageIcon, or null if the path was invalid.


openFiles

public void openFiles()
Ask the user to select image file(s) and open it/them in ImFrame(s).


openBlobs

public void openBlobs()
Enable the user to reopen serialised blob data and the image they came from.


openChart

public void openChart()

openAAVSO_Chart

public void openAAVSO_Chart()
Open saved HTML reference sequence from AAVSO as a StarChart.


lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                          java.awt.datatransfer.Transferable contents)
Implementing ClipboardOwner but does nothing.

Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner