Class VisionApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--VisionApplet
Direct Known Subclasses:
SAdapThreshScreen, SAffineScreen, SCannyScreen, SClassifyScreen, SContrastStretchScreen, SExponentialScreen, SHistogramScreen, SImageBitShiftScreen, SImageLabelScreen, SImageNotScreen, SLogScreen, SRandomNoiseScreen, SReflectScreen, SRobertsScreen, SRotateScreen, SScaleScreen, SSobelScreen, STranslateScreen, SZeroCrossingScreen

public class VisionApplet
extends javax.swing.JApplet

VisionApplet is a subclass of the JApplet class which is tailored for use in the HIPR application. It is used with operators which only require the use of one input image.

Author:
Timothy Sharman
See Also:
Serialized Form

Inner Class Summary
 class VisionApplet.PixelListener
          Handles the actions performed when the mouse is used in the interface to find information about image pixels.
 
Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Field Summary
 int actualx
          Co-ordiante points for finding the intensity value at a selected point
 int actualy
          Co-ordiante points for finding the intensity value at a selected point
 javax.swing.JPanel bl
          The bottom left panel
 java.awt.GridBagConstraints blc
          The constraints for the bottom left panel
 javax.swing.JLabel blIntensity
          The intensity label for the bottom left panel
 java.awt.GridBagLayout bllayout
          The layout for the bottom left panel
 VisionApplet.PixelListener blpl
          The pixel listener for the input image
 javax.swing.JLabel blPosition
          The position label for the bottom left panel
 javax.swing.JPanel br
          The bottom right panel
 java.awt.GridBagConstraints brc
          The constraints for the bottom right panel
 javax.swing.JLabel brIntensity
          The intensity label for the bottom right panel
 java.awt.GridBagLayout brlayout
          The layout for the bottom right panel
 VisionApplet.PixelListener brpl
          The pixel listener for the output image
 javax.swing.JLabel brPosition
          The position label for the bottom right panel
 java.awt.Container container
          The main container for the applet
 int d_h
          The output image height
 int d_w
          The output image width
 java.awt.Image dest
          The output image
 int[] dest_1d
          The output image array
 ImageCanvas dest_canvas
          The output image canvas
 int i_h
          The input image height
 int i_w
          The input image width
 java.lang.String image_url
          The URL of the initial image
 javax.swing.JTextField input
          The textfield used to get the URL of the input image
 javax.swing.JLabel insize
          The label for the input image size
 javax.swing.JButton load_image
          The load button
 javax.swing.JPanel mid
          The middle panel
 java.awt.GridBagConstraints midc
          The constraints for the middle panel
 java.awt.GridBagLayout midlayout
          The layout for the middle panel
 javax.swing.JLabel output
          The label for the output image
 javax.swing.JLabel outsize
          The label for the output image size
 java.awt.Image src
          The input image
 int[] src_1d
          The input image array
 ImageCanvas src_canvas
          The input image canvas
 java.net.URL theURL
          The address of the input image
 long time_msec
          The execution time
 
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
VisionApplet()
           
 
Method Summary
 void add_extra()
          add_extra is used to add extra components to the window of the operator.
 void apply_send_image()
          apply_send_image grabs the image from the URL and turns it into an array of pixels which the operators can manipulate
 java.lang.String getAppletInfo()
          Used by the browser to find out what the applet is for
 void gui_add_image()
          gui_add_image is used to add the default images to the interface
 void init()
          Called automatically when the applet is started.
 void set_image()
          Sets up the default image
 void set_interface()
          set_interface sets up the 'standard' interface that is the same regardless of which operator is being run
 void set_src_image(int[] input_img, int w, int h, java.lang.String name)
          set_src_image tells the applet of the image to be loaded and displayed on the screen.
 void set_src_image2(int[] input_img, int w, int h, java.lang.String name)
          set_src_image2 is used to add a newly loaded image to the interface It is called by set_src_image once the operator thread has been recreated.
 
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 main container for the applet

src

public java.awt.Image src
The input image

dest

public java.awt.Image dest
The output image

src_canvas

public ImageCanvas src_canvas
The input image canvas

dest_canvas

public ImageCanvas dest_canvas
The output image canvas

src_1d

public int[] src_1d
The input image array

dest_1d

public int[] dest_1d
The output image array

i_w

public int i_w
The input image width

i_h

public int i_h
The input image height

d_w

public int d_w
The output image width

d_h

public int d_h
The output image height

actualx

public int actualx
Co-ordiante points for finding the intensity value at a selected point

actualy

public int actualy
Co-ordiante points for finding the intensity value at a selected point

time_msec

public long time_msec
The execution time

midlayout

public java.awt.GridBagLayout midlayout
The layout for the middle panel

brlayout

public java.awt.GridBagLayout brlayout
The layout for the bottom right panel

bllayout

public java.awt.GridBagLayout bllayout
The layout for the bottom left panel

midc

public java.awt.GridBagConstraints midc
The constraints for the middle panel

blc

public java.awt.GridBagConstraints blc
The constraints for the bottom left panel

brc

public java.awt.GridBagConstraints brc
The constraints for the bottom right panel

mid

public javax.swing.JPanel mid
The middle panel

br

public javax.swing.JPanel br
The bottom right panel

bl

public javax.swing.JPanel bl
The bottom left panel

load_image

public javax.swing.JButton load_image
The load button

input

public javax.swing.JTextField input
The textfield used to get the URL of the input image

output

public javax.swing.JLabel output
The label for the output image

insize

public javax.swing.JLabel insize
The label for the input image size

outsize

public javax.swing.JLabel outsize
The label for the output image size

blPosition

public javax.swing.JLabel blPosition
The position label for the bottom left panel

brPosition

public javax.swing.JLabel brPosition
The position label for the bottom right panel

blIntensity

public javax.swing.JLabel blIntensity
The intensity label for the bottom left panel

brIntensity

public javax.swing.JLabel brIntensity
The intensity label for the bottom right panel

blpl

public VisionApplet.PixelListener blpl
The pixel listener for the input image

brpl

public VisionApplet.PixelListener brpl
The pixel listener for the output image

theURL

public java.net.URL theURL
The address of the input image

image_url

public java.lang.String image_url
The URL of the initial image
Constructor Detail

VisionApplet

public VisionApplet()
Method Detail

init

public void init()
Called automatically when the applet is started. Initialises the interface components ready for drawing on screen.
Overrides:
init in class java.applet.Applet

set_image

public void set_image()
Sets up the default image

set_interface

public void set_interface()
set_interface sets up the 'standard' interface that is the same regardless of which operator is being run

add_extra

public void add_extra()
add_extra is used to add extra components to the window of the operator. This is done by adding extra components into the blank mid panel. This panel is then added to the generic panels to make up the interface. The default is for this panel to be blank.

gui_add_image

public void gui_add_image()
gui_add_image is used to add the default images to the interface

set_src_image2

public void set_src_image2(int[] input_img,
                           int w,
                           int h,
                           java.lang.String name)
set_src_image2 is used to add a newly loaded image to the interface It is called by set_src_image once the operator thread has been recreated.
Parameters:
input_img - The new input image array
w - The width of the image
h - The height of the image
name - The name of the image

set_src_image

public void set_src_image(int[] input_img,
                          int w,
                          int h,
                          java.lang.String name)
set_src_image tells the applet of the image to be loaded and displayed on the screen. It also is required to recreate the operator which was running at the time. The method should be implemented by the subclass as this default doesn't do this.
Parameters:
input_img - The new input image array
w - The width of the image
h - The height of the image
name - The name of the image

apply_send_image

public void apply_send_image()
apply_send_image grabs the image from the URL and turns it into an array of pixels which the operators can manipulate

getAppletInfo

public java.lang.String getAppletInfo()
Used by the browser to find out what the applet is for
Returns:
the function of the applet
Overrides:
getAppletInfo in class java.applet.Applet