Class SingleInputImageInterface

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--SingleInputImageInterface
Direct Known Subclasses:
ConSmoothInterface, ConvolutionInterface, CrimminsInterface, FFTInterface, GaussianSmoothInterface, InverseFFTInterface, LaplacianInterface, LogInterface, MeanSmoothInterface, MedianSmoothInterface, SingleBinaryImageInterface, UnsharpInterface

public class SingleInputImageInterface
extends javax.swing.JApplet

The base class for many non-binary image operators and also the base class for SingleBinaryImageInterface, containing the necessary functionality for displaying images onscreen and setting up the basic user interface.

Author:
Simon Horne.
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Field Summary
 java.awt.Container container
          The top level GUI container.
 java.lang.String imageName
          The filename of the input image.
 javax.swing.JTextField imageNameField
          The text box on the interface for displaying/entering the input image name.
 javax.swing.JPanel imagesPanel
          The panel used for displaying the input/output images.
 ImageTools imageTools
          Various tools for manipulating images.
 int[] inputArray
          An array of ints representing the input image.
 javax.swing.JLabel inputDims
          For displaying the input image dimensions.
 int inputHeight
          Height of the input image.
 javax.swing.ImageIcon inputIcon
          For displaying the input image on the screen.
 java.awt.Image inputImage
          The input image stored as an Image.
 javax.swing.JLabel inputLabel
          For displaying the input icon and therefore the input image.
 javax.swing.JPanel inputPanel
           
 int inputWidth
          Width of the input image.
 javax.swing.JButton load
          The button for loading a new image.
 javax.swing.JPanel loadPanel
          The panel containing the file load and status information and controls.
 javax.swing.JPanel operatorPanel
          The panel containing the leftPanel and the various FFT output images.
 int[] outputArray
          An array of ints representing the output image.
 javax.swing.JLabel outputDims
          For displaying the output image dimensions.
 int outputHeight
          Height of the output image.
 javax.swing.ImageIcon outputIcon
          For displaying the output image.
 java.awt.Image outputImage
          The output image stored as an Image.
 javax.swing.JLabel outputLabel
          For displaying the output image.
 javax.swing.JPanel outputPanel
           
 int outputWidth
          Width of the output image.
 StartStopInterface startstop
          The interface for stopping and starting the operator.
 javax.swing.JPanel startstopPanel
           
 javax.swing.JLabel status
          Label for displaying the current loading status.
 long time_msec
          For storing a record of the time taken by the operator.
 java.awt.MediaTracker tracker
          Keeps track of the image loading.
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
SingleInputImageInterface()
           
 
Method Summary
 javax.swing.JPanel createImagesPanel()
          Sets up the panel displaying the input and output images.
 javax.swing.JPanel createLoadPanel()
          Sets up the panel containing the load button and file loading information.
 java.lang.String getAppletInfo()
          Used by the browser to obtain details of the applet.
 void init()
           
 void initialImage(java.lang.String name)
          Sets the initial image name onscreen and internally.
 boolean initialiseImages()
          Initialises the images by loading the current input image from a file, then updating the input and output onscreen.
 void initialiseInput(java.awt.Image image)
          Initialises the input image by simply updating it onscreen.
 void setContainer()
          Sets up the top-level container for displaying the interface on the screen.
 void setLook()
          Sets the look and feel of the interface.
 void updateInput(java.awt.Image image)
          Updates the input image onscreen.
 void updateOutput(java.awt.Image output, int width, int height)
          Updates the output image onscreen.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

container

public java.awt.Container container
The top level GUI container.

imagesPanel

public javax.swing.JPanel imagesPanel
The panel used for displaying the input/output images.

startstopPanel

public javax.swing.JPanel startstopPanel

loadPanel

public javax.swing.JPanel loadPanel
The panel containing the file load and status information and controls.

operatorPanel

public javax.swing.JPanel operatorPanel
The panel containing the leftPanel and the various FFT output images.

inputPanel

public javax.swing.JPanel inputPanel

outputPanel

public javax.swing.JPanel outputPanel

imageNameField

public javax.swing.JTextField imageNameField
The text box on the interface for displaying/entering the input image name.

imageName

public java.lang.String imageName
The filename of the input image.

status

public javax.swing.JLabel status
Label for displaying the current loading status.

inputImage

public java.awt.Image inputImage
The input image stored as an Image.

tracker

public java.awt.MediaTracker tracker
Keeps track of the image loading.

outputImage

public java.awt.Image outputImage
The output image stored as an Image.

inputIcon

public javax.swing.ImageIcon inputIcon
For displaying the input image on the screen.

inputLabel

public javax.swing.JLabel inputLabel
For displaying the input icon and therefore the input image.

inputDims

public javax.swing.JLabel inputDims
For displaying the input image dimensions.

outputIcon

public javax.swing.ImageIcon outputIcon
For displaying the output image.

outputLabel

public javax.swing.JLabel outputLabel
For displaying the output image.

outputDims

public javax.swing.JLabel outputDims
For displaying the output image dimensions.

inputArray

public int[] inputArray
An array of ints representing the input image.

outputArray

public int[] outputArray
An array of ints representing the output image.

inputHeight

public int inputHeight
Height of the input image.

inputWidth

public int inputWidth
Width of the input image.

outputHeight

public int outputHeight
Height of the output image.

outputWidth

public int outputWidth
Width of the output image.

time_msec

public long time_msec
For storing a record of the time taken by the operator.

load

public javax.swing.JButton load
The button for loading a new image.

startstop

public StartStopInterface startstop
The interface for stopping and starting the operator.

imageTools

public ImageTools imageTools
Various tools for manipulating images.
Constructor Detail

SingleInputImageInterface

public SingleInputImageInterface()
Method Detail

initialImage

public void initialImage(java.lang.String name)
Sets the initial image name onscreen and internally.
Parameters:
name - the name of the new image

updateOutput

public void updateOutput(java.awt.Image output,
                         int width,
                         int height)
Updates the output image onscreen.
Parameters:
output - the new output image
width - the width of the new output image
height - the height of the new output image

initialiseInput

public void initialiseInput(java.awt.Image image)
Initialises the input image by simply updating it onscreen.
Parameters:
image - the new input image

updateInput

public void updateInput(java.awt.Image image)
Updates the input image onscreen.
Parameters:
image - the new output image

initialiseImages

public boolean initialiseImages()
Initialises the images by loading the current input image from a file, then updating the input and output onscreen.
Returns:
true if there was no problems, false if something went wrong
Throws:
java.lang.InterruptedException - error when loading image file
java.net.MalformedURLException - the url is not correctly entered

createLoadPanel

public javax.swing.JPanel createLoadPanel()
Sets up the panel containing the load button and file loading information.

createImagesPanel

public javax.swing.JPanel createImagesPanel()
Sets up the panel displaying the input and output images.

setLook

public void setLook()
Sets the look and feel of the interface.
Throws:
java.lang.Exception - if things don't go right

setContainer

public void setContainer()
Sets up the top-level container for displaying the interface on the screen.

init

public void init()
Overrides:
init in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Used by the browser to obtain details of the applet.
Returns:
Brief description of the applet.
Overrides:
getAppletInfo in class java.applet.Applet