|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
net.grelf.grip.ImFrame
public class ImFrame
This class is the window displayed for each image. It has a menu, the code for which is in class ImMenu. The image is displayed on the content pane of the window, in an object of class ImPane. For drawing lines for measuring, the glass pane of this window is used. The code for that is in class GlassPane.
All of the ImFrame objects which currently exist for the application are referenced from a list in the GRIP class.
The frame is only added to the list if an image is successfully opened in it.
| 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 LevelsMenu |
levelsMenu
|
protected javax.swing.JMenuBar |
menubar
|
protected ImFrame |
parentFrame
|
| 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 | |
|---|---|
ImFrame(java.lang.String title,
DrawingMode drawingMode,
java.lang.String imFilePath,
int newImageNo,
int width,
int height,
MeasurementHandler mh)
|
|
ImFrame(java.lang.String title,
DrawingMode drawingMode,
java.lang.String imFilePath,
int newImageNo,
int width,
int height,
MeasurementHandler mh,
boolean withMenu)
|
|
ImFrame(java.lang.String title,
DrawingMode drawingMode,
java.lang.String imFilePath,
int newImageNo,
int width,
int height,
MeasurementHandler mh,
boolean withMenu,
ImPane imPane,
ImFrame theParentFrame,
Image image)
The most general constructor, that all the others invoke. |
|
ImFrame(java.lang.String imFilePath,
Image image)
The file path is also used as the title. |
|
ImFrame(java.lang.String title,
ImPane imPane)
Make a new frame from an already existing ImPane. |
|
ImFrame(java.lang.String title,
int width,
int height)
No file loading, no menu. |
|
ImFrame(java.lang.String title,
int width,
int height,
boolean withMenu)
No file loading but can have menu. |
|
ImFrame(java.lang.String title,
int width,
int height,
boolean withMenu,
ImFrame parentFrame)
No file loading but can have a menu and has an associated set of blob measurements. |
|
ImFrame(java.lang.String title,
int newImageNo,
int width,
int height,
MeasurementHandler mh)
|
|
ImFrame(java.lang.String imFilePath,
MeasurementHandler mh)
|
|
| Method Summary | |
|---|---|
void |
addHistory(java.lang.String s)
Add a string to the history list for this frame. |
void |
analyseAsSpectrum()
|
void |
autoCrop()
Automatically remove any rectangular margin of black (0, 0, 0) pixels from the image, thereby cropping it. |
void |
autoStretch()
Stretch the contrast in the image so the full range of levels is used. |
void |
blurGaussian(int nx,
int ny)
Do Gaussian blurring of this image with 1D profiles of width nx (horizontal) and ny (vertical). |
void |
convertToMonochrome()
Convert the image to monochrome, using 0.325 x red + 0.5 * green + 0.175 * blue. |
void |
convertToMonochrome(double... f)
Convert the multi-channel image to monochrome, using the factors f to determine ratios of channels. |
void |
convolve(Kernel aKernel)
Convolve this image with the given kernel, setting the kernel as the current kernel field of this class. |
void |
correctBackground()
Level the background of the image by dividing the image into n x n cells and using the modal values of the histogram in every cell. |
void |
correctBackground(double scale,
int cellWidth)
Version which is given the 2 parameters rather than reading them from config.properties file. |
void |
crop(java.awt.Point pt1,
java.awt.Point pt2)
Crop the image by a drawn rectangle. |
void |
crop(java.awt.Point pt1,
java.awt.Point pt2,
boolean promptToConfirm)
Crop the image by a drawn rectangle and adjust any BlobMeasList it may have. |
void |
deconvolve(Kernel kernel,
int nPasses,
double deconvolutionWeight)
Deconvolve the image with the given kernel by the van Cittert method. |
BlobMeasList |
detectBlobs()
|
BlobMeasList |
detectBlobs(boolean includeSinglePixelBlobs)
|
BlobMeasList |
detectBlobs(boolean includeSinglePixelBlobs,
boolean replot)
|
void |
dispose()
Tidy up when the frame is closed. |
void |
divideByFlatField(ImFrame imf2)
Divide this image by flat field in imf2, pixel by pixel |
void |
doOpInBackground(OpThread.Ops op)
For particularly long operations, run them on an OpThread rather than clog up swing's event dispatch thread. |
void |
doOpInBackground(OpThread.Ops op,
int width)
For particularly long operations, run them on an OpThread rather than clog up swing's event dispatch thread. |
ImFrame |
duplicate()
Duplicate this ImFrame, making a new displayed frame. |
void |
fit(int width,
int height)
Scale the image so it fits into the given width and height (in pixels), without changing its proportions. |
void |
flipHorizontal()
Flip the image horizontally. |
void |
flipVertical()
Flip the image vertically. |
BlobMeasList |
getBlobMeases()
If this frame has a list of detected blob measurements return the list, otherwise return null. |
java.lang.String |
getCaption()
Get the caption of this frame. |
java.lang.String |
getFilePath()
Get the path from which the current image was loaded or into which it has been saved. |
GlassPane |
getGP()
Get a reference to this frame's overlaid GlassPane. |
TimeInterval |
getImageTimeSpan()
|
ImPane |
getImPane()
Get a reference to this frame's ImPane display component, which is on its scroll pane. |
java.lang.StringBuffer |
getInfo()
Get information about the current image in a format suitable for display (lines end with "\n"). |
ImFrame |
getParentFrame()
|
javax.swing.JScrollPane |
getScrollPane()
Get a reference to this frame's scroll pane, which is on its content pane. |
void |
gnomonicProjection()
Project from sphere to plane. |
void |
inverseGnomonicProjection()
Project from plane to sphere. |
void |
invert()
Invert the colour at every pixel in the image. |
void |
magnifier(int centreX,
int centreY)
Display a new frame which presents a magnified view from the current frame, around a given pixel position. |
void |
meanFilter()
Ask for neighbourhood size and replace every pixel in the image by the mean value of its neighbourhood. |
void |
medianFilter()
Ask for neighbourhood size and replace every pixel in the image by the median value of its neighbourhood. |
void |
multiply(ImFrame imf2)
Multiply imf2 into this image, pixel by pixel |
void |
nearestExtremeFilter()
Ask for neighbourhood size and replace every pixel in the image by the nearest of the max and min of its neighbourhood. |
void |
neutraliseBackground()
Automatically adjust colour balance by equating the modes of all channels. |
protected void |
popCaption()
Retrieve a caption from the stack and use it on the frame. |
protected void |
pushCaption()
Push the frame caption onto a stack so a temporary caption be displayed and the current one retrieved later. |
void |
rankFilter()
Replace every pixel in the image by its rank in its n x n neighbourhood, where n = 2.halfWidth + 1. |
void |
redisplay()
Convenience utility which rescales the image for display and repaints the ImPane and GlassPane. |
BlobMeasList |
replotBlobs()
|
void |
rotate()
Ask the user for an angle (in degrees), then rotate the image anticlockwise by that angle. |
void |
rotate(double angle)
Rotate the image anticlockwise by the given angle (in degrees). |
void |
saveAs()
Ask the user for a file path and save the current image there. |
void |
saveBlobMeasList()
User selects a file into which to serialise BlobMeasList data which are then written. |
void |
scale()
Ask the user for a factor, then scale the image by that factor. |
void |
scale(double factor,
boolean interpolating)
Scale the image by the given factor |
void |
setBlobMeases(BlobMeasList meases)
To enable hovering over detected blobs, give the frame a reference to the list of blob measurements. |
void |
setCaption(java.lang.String s)
Set the caption of this frame. |
protected void |
setFilePath(java.lang.String path)
Set the path from which the current image was loaded or into which it has been saved. |
void |
showHistory()
Show the history list of this frame in a message dialofue. |
void |
showInfo()
Display information about the current image in a message dialogue. |
ImFrame[] |
splitChannels()
Create 3 new images, one containing each of the channels of the original image, displaying them as new ImFrames, references to which are returned. |
ImFrame[] |
splitIntensity()
Create a monochrome image in which each pixel has the value I = sum of the band levels of the current image plus a colour image in which the pixel in each band has the value maxLevel * bandLevel / I. |
void |
stereo(ImFrame imf2)
Use this frame to display in red - green stereo the two images from this and imf2. |
void |
sub(ImFrame imf2)
Subtract imf2 from this image, pixel by pixel, the result being about the half-way brightness level so that both negative and positive results can be seen. |
void |
subToZero(ImFrame imf2)
Subtract imf2 from this image, pixel by pixel, keeping only positive results, base level 0. |
Threshold |
threshold()
Display dialogue for user to set thresholds (RGB or monochrome), then threshold the image. |
void |
threshold(Threshold thresh)
Threshold the image to detect pixels brighter than the given thresholds. |
void |
translate()
Ask the user for x and y displacements and then translate the image accordingly. |
void |
varianceFilter()
Ask for neighbourhood size and replace every pixel in the image by the variance of its neighbourhood. |
| 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, 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, 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, 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 |
|---|
protected javax.swing.JMenuBar menubar
protected LevelsMenu levelsMenu
protected ImFrame parentFrame
| Constructor Detail |
|---|
public ImFrame(java.lang.String title,
int width,
int height)
public ImFrame(java.lang.String title,
int width,
int height,
boolean withMenu)
public ImFrame(java.lang.String title,
int width,
int height,
boolean withMenu,
ImFrame parentFrame)
public ImFrame(java.lang.String imFilePath,
MeasurementHandler mh)
public ImFrame(java.lang.String title,
int newImageNo,
int width,
int height,
MeasurementHandler mh)
public ImFrame(java.lang.String title,
DrawingMode drawingMode,
java.lang.String imFilePath,
int newImageNo,
int width,
int height,
MeasurementHandler mh)
public ImFrame(java.lang.String title,
DrawingMode drawingMode,
java.lang.String imFilePath,
int newImageNo,
int width,
int height,
MeasurementHandler mh,
boolean withMenu)
public ImFrame(java.lang.String title,
ImPane imPane)
public ImFrame(java.lang.String imFilePath,
Image image)
public ImFrame(java.lang.String title,
DrawingMode drawingMode,
java.lang.String imFilePath,
int newImageNo,
int width,
int height,
MeasurementHandler mh,
boolean withMenu,
ImPane imPane,
ImFrame theParentFrame,
Image image)
| Method Detail |
|---|
public java.lang.String getFilePath()
protected final void setFilePath(java.lang.String path)
public void addHistory(java.lang.String s)
public void showHistory()
public void setBlobMeases(BlobMeasList meases)
public BlobMeasList getBlobMeases()
public void saveBlobMeasList()
public ImFrame getParentFrame()
public java.lang.String getCaption()
public void setCaption(java.lang.String s)
protected void pushCaption()
protected void popCaption()
public GlassPane getGP()
public ImPane getImPane()
public javax.swing.JScrollPane getScrollPane()
public void dispose()
dispose in class java.awt.Windowpublic void redisplay()
public ImFrame duplicate()
public void saveAs()
public java.lang.StringBuffer getInfo()
public void showInfo()
public TimeInterval getImageTimeSpan()
public void magnifier(int centreX,
int centreY)
public void analyseAsSpectrum()
public BlobMeasList detectBlobs()
public BlobMeasList detectBlobs(boolean includeSinglePixelBlobs)
public BlobMeasList detectBlobs(boolean includeSinglePixelBlobs,
boolean replot)
public BlobMeasList replotBlobs()
public void doOpInBackground(OpThread.Ops op)
public void doOpInBackground(OpThread.Ops op,
int width)
public void autoCrop()
public void autoStretch()
public void blurGaussian(int nx,
int ny)
public void convertToMonochrome()
public void convertToMonochrome(double... f)
public void convolve(Kernel aKernel)
public void correctBackground(double scale,
int cellWidth)
public void correctBackground()
public void crop(java.awt.Point pt1,
java.awt.Point pt2)
public void crop(java.awt.Point pt1,
java.awt.Point pt2,
boolean promptToConfirm)
public void deconvolve(Kernel kernel,
int nPasses,
double deconvolutionWeight)
public void divideByFlatField(ImFrame imf2)
public void fit(int width,
int height)
public void flipHorizontal()
public void flipVertical()
public void gnomonicProjection()
public void inverseGnomonicProjection()
public void invert()
public void meanFilter()
public void medianFilter()
public void multiply(ImFrame imf2)
public void nearestExtremeFilter()
public void neutraliseBackground()
public void rankFilter()
public void rotate()
public void rotate(double angle)
public void scale()
public void scale(double factor,
boolean interpolating)
public ImFrame[] splitChannels()
public ImFrame[] splitIntensity()
public void stereo(ImFrame imf2)
public void sub(ImFrame imf2)
public void subToZero(ImFrame imf2)
public Threshold threshold()
public void threshold(Threshold thresh)
public void translate()
public void varianceFilter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||