javamorph
Class CMain

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by javamorph.CMain
All Implemented Interfaces:
WindowListener, ImageObserver, LayoutManager, MenuContainer, Serializable, EventListener, Accessible

public class CMain
extends JPanel
implements WindowListener, LayoutManager

Version:
1.1
Author:
claus.erhard.wimmer@googlemail.com
Program: JavaMorph V 1.1.
Class: CMain.
License: GPLv2.
Description: Main entry of the morph application.
Hint: Merging two pictures (for example human faces) with intermediate steps.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  CAbout about
          Global info window of this program.
private  CConfig config
          Configuration dialog with file storing functionality.
private  JFrame frame
          JFrame, as top level window on the screen.
private  CFrame left
          Left picture's display.
static Dimension MIN_SIZE
          Minimum size of this application on the screen.
private  CProgress progress
          Progress bar, shown when morphing a number of intermediate pictures.
private  CFrame right
          Right picture's display.
private  CSeparator sep
          Separator line between both displays.
private static long serialVersionUID
          Java API.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CMain()
          Constructor.
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          Layout manager API.
 JFrame getFrame()
          Get function.
 void initMesh()
          Delete the contents of both meshes.
 void layoutContainer(Container parent)
          Setting the bounds of the application's main frame's components.
static void main(String[] args)
          Main entry.
 Dimension minimumLayoutSize(Container parent)
          Provide the minimum layout size of the JFrame.
 void morph()
          Perform the morph operation.
 Dimension preferredLayoutSize(Container parent)
          Ask nested components to calculate the JFrame window size on screen.
 void removeLayoutComponent(Component comp)
          Layout manager API.
 void showAboutDialog()
          Show the about global info.
 void showConfigDialog()
          Show the configuration dialog.
 void windowActivated(WindowEvent e)
          Event API.
 void windowClosed(WindowEvent e)
          Event API.
 void windowClosing(WindowEvent e)
          Event API.
 void windowDeactivated(WindowEvent e)
          Event API.
 void windowDeiconified(WindowEvent e)
          Event API.
 void windowIconified(WindowEvent e)
          Event API.
 void windowOpened(WindowEvent e)
          Event API.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Java API.

See Also:
Constant Field Values

MIN_SIZE

public static final Dimension MIN_SIZE
Minimum size of this application on the screen.


left

private CFrame left
Left picture's display.


right

private CFrame right
Right picture's display.


sep

private CSeparator sep
Separator line between both displays.


frame

private JFrame frame
JFrame, as top level window on the screen.


about

private CAbout about
Global info window of this program.


progress

private CProgress progress
Progress bar, shown when morphing a number of intermediate pictures.


config

private CConfig config
Configuration dialog with file storing functionality.

Constructor Detail

CMain

public CMain()
Constructor. Laying out the applicaiton window.

Method Detail

main

public static void main(String[] args)
Main entry.

Parameters:
args - Command line arguments.

showAboutDialog

public void showAboutDialog()
Show the about global info.


showConfigDialog

public void showConfigDialog()
Show the configuration dialog.


windowActivated

public void windowActivated(WindowEvent e)
Event API.

Specified by:
windowActivated in interface WindowListener

windowClosed

public void windowClosed(WindowEvent e)
Event API.

Specified by:
windowClosed in interface WindowListener

windowClosing

public void windowClosing(WindowEvent e)
Event API. Saving also the meshes on program exit.

Specified by:
windowClosing in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent e)
Event API.

Specified by:
windowDeactivated in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent e)
Event API.

Specified by:
windowDeiconified in interface WindowListener

windowIconified

public void windowIconified(WindowEvent e)
Event API.

Specified by:
windowIconified in interface WindowListener

windowOpened

public void windowOpened(WindowEvent e)
Event API.

Specified by:
windowOpened in interface WindowListener

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Layout manager API.

Specified by:
addLayoutComponent in interface LayoutManager

layoutContainer

public void layoutContainer(Container parent)
Setting the bounds of the application's main frame's components.

Specified by:
layoutContainer in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Provide the minimum layout size of the JFrame.

Specified by:
minimumLayoutSize in interface LayoutManager

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Ask nested components to calculate the JFrame window size on screen.

Specified by:
preferredLayoutSize in interface LayoutManager

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Layout manager API.

Specified by:
removeLayoutComponent in interface LayoutManager

morph

public void morph()
Perform the morph operation. Show the progress bar during rendering.


getFrame

public JFrame getFrame()
Get function.

Returns:
Top level window JFrame.

initMesh

public void initMesh()
Delete the contents of both meshes.