Class VisionApplet2

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--VisionApplet2
Direct Known Subclasses:
SImageAndScreen, SImageBlendScreen, SImageDifferenceScreen, SImageDivScreen, SImageMultScreen, SImageOrScreen, SImageSumScreen, SImageXorScreen

public class VisionApplet2
extends javax.swing.JApplet

VisionApplet2 is a subclass of the JApplet class which is tailored for use in the HIPR application. It is used with operators which require the use of two input images.

Author:
Timothy Sharman
See Also:
Serialized Form

Inner Class Summary
 class VisionApplet2.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
 VisionApplet2.PixelListener blpl
          The pixel listener for the first input image
 VisionApplet2.PixelListener brpl
          The pixel listener for the second input image
 java.awt.Container container
          The main container for the applet
 int d_h
          The destination image height
 int d_w
          The destination image width
 java.awt.Image dest
          The destination image
 int[] dest_1d
          The destination image array
 ImageCanvas dest_canvas
          The destination image canvas
 int i1_h
          The first input image height
 int i1_w
          The first input image width
 int i2_h
          The second input image height
 int i2_w
          The second input image width
 java.lang.String image_url
           
 java.lang.String image_url2
           
 javax.swing.JTextField input
           
 javax.swing.JTextField input2
           
 javax.swing.JLabel insize1
          The first input image size
 javax.swing.JLabel insize2
          The second input image sixe
 javax.swing.JButton load_image
          Load button 1
 javax.swing.JButton load_image2
          Load button 2
 javax.swing.JPanel mid
          The middle panel
 java.awt.GridBagConstraints midc
          The constraints for the middle panel
 java.awt.GridBagLayout midlayout
          The layout of the middle panel
 javax.swing.JPanel out
          The output panel
 java.awt.GridBagConstraints outc
          The constraints for the output panel
 java.awt.GridBagLayout outlayout
          The layout of the output panel
 VisionApplet2.PixelListener outpl
          The pixel listener for the output image
 javax.swing.JLabel output
          The output image label
 javax.swing.JLabel outsize
          The output image size
 java.awt.Image src1
          The first input image
 int[] src1_1d
          The first input image array
 ImageCanvas src1_canvas
          The first input image canvas
 java.awt.Image src2
          The second input image
 int[] src2_1d
          The second input image array
 ImageCanvas src2_canvas
          The second input image canvas
 java.net.URL theURL
          The URL from which to load an 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
VisionApplet2()
           
 
Method Summary
 void add_extra()
          add_extra is used to add extra components to the window of the operator.
 void apply_send_image(int button)
          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 init()
          Called automatically when the applet is started.
 void set_images()
          Sets up the default images
 void set_interface()
          set_interface sets up the 'standard' interface that is the same regardless of which operator is being run
 void set_src1_image(int[] input_img, int w, int h, java.lang.String name)
          set_src1_image tells the applet of the image to be loaded and displayed on the screen.
 void set_src1_image2(int[] input_img, int w, int h, java.lang.String name)
          set_src1_image2 is used to add a newly loaded image to the interface It is called by set_src1_image once the operator thread has been recreated.
 void set_src2_image(int[] input_img, int w, int h, java.lang.String name)
          set_src2_image tells the applet of the image to be loaded and displayed on the screen.
 void set_src2_image2(int[] input_img, int w, int h, java.lang.String name)
          set_src2_image2 is used to add a newly loaded image to the interface It is called by set_src1_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

src1

public java.awt.Image src1
The first input image

src2

public java.awt.Image src2
The second input image

dest

public java.awt.Image dest
The destination image

src1_canvas

public ImageCanvas src1_canvas
The first input image canvas

src2_canvas

public ImageCanvas src2_canvas
The second input image canvas

dest_canvas

public ImageCanvas dest_canvas
The destination image canvas

src1_1d

public int[] src1_1d
The first input image array

src2_1d

public int[] src2_1d
The second input image array

dest_1d

public int[] dest_1d
The destination image array

i1_w

public int i1_w
The first input image width

i1_h

public int i1_h
The first input image height

i2_w

public int i2_w
The second input image width

i2_h

public int i2_h
The second input image height

d_w

public int d_w
The destination image width

d_h

public int d_h
The destination image height

time_msec

public long time_msec
The execution time

midlayout

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

outlayout

public java.awt.GridBagLayout outlayout
The layout of the output panel

midc

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

outc

public java.awt.GridBagConstraints outc
The constraints for the output panel

mid

public javax.swing.JPanel mid
The middle panel

out

public javax.swing.JPanel out
The output panel

load_image

public javax.swing.JButton load_image
Load button 1

load_image2

public javax.swing.JButton load_image2
Load button 2

input

public javax.swing.JTextField input

input2

public javax.swing.JTextField input2

output

public javax.swing.JLabel output
The output image label

insize1

public javax.swing.JLabel insize1
The first input image size

insize2

public javax.swing.JLabel insize2
The second input image sixe

outsize

public javax.swing.JLabel outsize
The output image size

blpl

public VisionApplet2.PixelListener blpl
The pixel listener for the first input image

brpl

public VisionApplet2.PixelListener brpl
The pixel listener for the second input image

outpl

public VisionApplet2.PixelListener outpl
The pixel listener for the output image

theURL

public java.net.URL theURL
The URL from which to load an image

image_url

public java.lang.String image_url

image_url2

public java.lang.String image_url2
Constructor Detail

VisionApplet2

public VisionApplet2()
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_images

public void set_images()
Sets up the default images

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.

set_src1_image2

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

set_src1_image

public void set_src1_image(int[] input_img,
                           int w,
                           int h,
                           java.lang.String name)
set_src1_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 image width
h - The image height
name - The name of the image

set_src2_image2

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

set_src2_image

public void set_src2_image(int[] input_img,
                           int w,
                           int h,
                           java.lang.String name)
set_src2_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 image array
w - The image width
h - The image height
name - The image name

apply_send_image

public void apply_send_image(int button)
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