Facemorph.psychomorph
Class PsychoMorphForm

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 Facemorph.psychomorph.PsychoMorphForm
All Implemented Interfaces:
TransformerListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class PsychoMorphForm
extends javax.swing.JFrame
implements TransformerListener

The main pyschomorph window, displaying 2 editable frames

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
static int TEXTURE_MAG
          static constant
static int TEXTURE_MRF
          static constant
static int TEXTURE_NONE
          static constant
 
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
PsychoMorphForm()
          Creates new PsychoMorphForm
 
Method Summary
 void addMenu(javax.swing.JMenu menu)
           
 void drawAverage(java.awt.Image img, Template tem, int i, int count)
          Draw the (partial or completed) average on the right hand side
 void drawImage(java.awt.Image img, Template tem, boolean warped)
          Draw the image on the left side
 boolean getAutoSize()
          Gets the value of the auto size menu item
 int getBorderModel()
          Get the border model used for the wavelet transforms.
 DelineatorForm getDelineator()
          Get the delineator Frame
 javax.swing.JFileChooser getFileChooser()
          Get the file chooser
 Filter[] getFilters()
          Get the filters used for wavelet stuff (averaging, transforms, MRF etc)
 java.awt.Image getLeftImage()
          Get the left image
 ImageZoomPanel getLeftImagePanel()
          Get the left image panel
 Template getLeftTemplate()
          Get the left template
 int getNormalisation()
          Get the value or normalisation selected
 boolean getOverlap()
          Returns the value of the overlap check box
 java.lang.String getProperty(java.lang.String key)
           
 java.awt.Image getRightImage()
          Get the right image
 ImageZoomPanel getRightImagePanel()
          Get the right image panel
 Template getRightTemplate()
          Get the right template
 int getTextureOption()
          Get the texture option selected
 int getWarpType()
          Gets the type of warp currently selected
static void main(java.lang.String[] args)
           
 void readConfig()
           
 void readFilters(java.io.File f)
           
 void removeMenu(javax.swing.JMenu menu)
           
 void setFileChooser(javax.swing.JFileChooser chooser)
          Set the file chooser
 void setProperty(java.lang.String key, java.lang.String value)
           
static javax.swing.JFileChooser setUpFileDialog(javax.swing.JFileChooser jFileChooser1, java.lang.String type, java.lang.String... exts)
          Set up the file dialog
 javax.swing.JFileChooser setUpFileDialog(java.lang.String type, java.lang.String... exts)
          Set up the file dialog
 void writeConfig()
           
 
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, 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

TEXTURE_NONE

public static int TEXTURE_NONE
static constant


TEXTURE_MAG

public static int TEXTURE_MAG
static constant


TEXTURE_MRF

public static int TEXTURE_MRF
static constant

Constructor Detail

PsychoMorphForm

public PsychoMorphForm()
Creates new PsychoMorphForm

Method Detail

readConfig

public void readConfig()
                throws java.io.FileNotFoundException,
                       java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

writeConfig

public void writeConfig()
                 throws java.io.IOException
Throws:
java.io.IOException

getProperty

public java.lang.String getProperty(java.lang.String key)

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)

addMenu

public void addMenu(javax.swing.JMenu menu)

getDelineator

public DelineatorForm getDelineator()
Get the delineator Frame

Returns:
returns the DelineatorForm JFrame

getLeftImage

public java.awt.Image getLeftImage()
Get the left image

Returns:
returns the left image

getLeftImagePanel

public ImageZoomPanel getLeftImagePanel()
Get the left image panel

Returns:
return the left image panel

getRightImagePanel

public ImageZoomPanel getRightImagePanel()
Get the right image panel

Returns:
returns the right image panel

getRightImage

public java.awt.Image getRightImage()
Get the right image

Returns:
return the right image

getLeftTemplate

public Template getLeftTemplate()
Get the left template

Returns:
return the left template

getRightTemplate

public Template getRightTemplate()
Get the right template

Returns:
return the right template

getFileChooser

public javax.swing.JFileChooser getFileChooser()
Get the file chooser

Returns:
return the file chooser

setFileChooser

public void setFileChooser(javax.swing.JFileChooser chooser)
Set the file chooser

Parameters:
chooser - the new chooser to use

getFilters

public Filter[] getFilters()
Get the filters used for wavelet stuff (averaging, transforms, MRF etc)

Returns:
return the filters

getBorderModel

public int getBorderModel()
Get the border model used for the wavelet transforms. Fo symmetrical filters this should be 1 and for antisymmetrical -1

Returns:
return the border model for the filters

drawImage

public void drawImage(java.awt.Image img,
                      Template tem,
                      boolean warped)
Draw the image on the left side

Specified by:
drawImage in interface TransformerListener
Parameters:
img - the image to draw
warped - if it is warped or unwarped (ignored)
tem - the template to draw

drawAverage

public void drawAverage(java.awt.Image img,
                        Template tem,
                        int i,
                        int count)
Draw the (partial or completed) average on the right hand side

Specified by:
drawAverage in interface TransformerListener
Parameters:
img - the image to draw
i - the number we're up to in the list
count - the total number in the list
tem - the template to draw

setUpFileDialog

public static javax.swing.JFileChooser setUpFileDialog(javax.swing.JFileChooser jFileChooser1,
                                                       java.lang.String type,
                                                       java.lang.String... exts)
Set up the file dialog

Parameters:
jFileChooser1 - used to get he current directory
type - the type of files to load / save (e.g. Images)
exts - the file extentions supported
Returns:
returns a new JFileChooser

setUpFileDialog

public javax.swing.JFileChooser setUpFileDialog(java.lang.String type,
                                                java.lang.String... exts)
Set up the file dialog

Parameters:
type - the type of files to load / save (e.g. Images)
exts - the file extentions supported
Returns:
returns a new JFileChooser

getOverlap

public boolean getOverlap()
Returns the value of the overlap check box

Returns:
true if overlap control is selected

getWarpType

public int getWarpType()
Gets the type of warp currently selected

Returns:
returns one of Warp.MULTISCALE, Warp.LINEAR or Warp.TPS

readFilters

public void readFilters(java.io.File f)
                 throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

removeMenu

public void removeMenu(javax.swing.JMenu menu)

getNormalisation

public int getNormalisation()
Get the value or normalisation selected

Returns:
one of ASM.NO_NORMALISATION, ASM.TWO_POINT_NORMALISATION, ASM.THREE_POINT_NORMALISATION or ASM.RIGID_BODY_NORMALISATION

getAutoSize

public boolean getAutoSize()
Gets the value of the auto size menu item

Returns:
returns true if auto size selected

getTextureOption

public int getTextureOption()
Get the texture option selected

Returns:
one of TEXTURE_NONE, TEXTURE_MAG or TEXTURE_MRF

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments