javamorph
Class CConfig

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by javamorph.CConfig
All Implemented Interfaces:
WindowListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class CConfig
extends JDialog
implements Runnable, WindowListener

Version:
1.1
Author:
claus.erhard.wimmer@googlemail.com
Program: JavaMorph V 1.1.
Class: CConfig.
License: GPLv2.
Description: Data list of the application's global data (shown as JDialog).
Hint: Loading and saving to the propertie's file.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
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  CEditField columns_of_mesh
          Edit field for the property with the same name.
static int COLUMNS_OF_MESH
          Columns of the mesh.
static int EDIT_MESH_ADD
          User is adding mesh points with the GUI.
static int EDIT_MESH_OFF
          User is moving mesh points with the GUI.
static int EDIT_MESH_SUB
          User is removing mesh points with the GUI.
static int EDIT_POLYGON_ADD
          User is adding polygon points with the GUI.
static int EDIT_POLYGON_OFF
          User is moving polygon points with the GUI.
static int EDIT_POLYGON_SUB
          User is removing polygon points with the GUI.
static int edit_state
          Equal edit mode of both picture display viewers.
private  CFrame left
          Left morph picture componenent.
static double[][] left_clip
          Smoothed clip polygon matrix of the left picture.
static BufferedImage left_image
          Left input image.
static Vector<Point> left_mesh
          Collection of points which represent the left picture's mesh.
static Vector<Point> left_polygon
          Collection of points which represent the left picture's polygon.
static Vector<CTriangle> left_triangles
          Triangulation of the left picture.
private  CEditField mark_size
          Size of cursor and also point marks.
static int MARK_SIZE
          Size of the marker points for mesh & polygon.
private  CEditField num_of_morph_steps
          Edit field for the property with the same name.
static int NUM_OF_MORPH_STEPS
          Number of morph steps.
private  JFrame parent
          Parent JFrame to enable modal behavior.
private  CEditField points_of_polygon
          Edit field for the property with the same name.
static int POINTS_OF_POLYGON
          Points of the left polygon.
private  Properties props
          Property object.
static BufferedImage result_image
          Current result image to be saved to disk.
static Vector<CTriangle> result_triangles
          Current result triangulation.
private  CFrame right
          Right morph picture component.
static double[][] right_clip
          Smoothed clip polygon matrix of the right picture.
static BufferedImage right_image
          Right input image.
static Vector<Point> right_mesh
          Collection of points which represent the right picture's mesh.
static Vector<Point> right_polygon
          Collection of points which represent the right picture's polygon.
static Vector<CTriangle> right_triangles
          Triangulation of the right picture.
private  CEditField rows_of_mesh
          Edit field for the property with the same name.
static int ROWS_OF_MESH
          Rows of the mesh.
private static long serialVersionUID
          Java API.
private  CEditField smooth_radius
          Edit field for the property with the same name.
static int SMOOTH_RADIUS
          Smooth radius of the polygon.
private  CEditField working_dir
          Display field for the working directory with the same name.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CConfig(JFrame parent, CFrame left, CFrame right)
          Constructor.
 
Method Summary
 void open()
          Show the config dialog when requested by user's menu.
 void run()
          Shutdown hook.
 void windowActivated(WindowEvent e)
          Event API.
 void windowClosed(WindowEvent e)
          Event API.
 void windowClosing(WindowEvent e)
          When the user closes the dialog -> assign the dialog content to this program's global configuration.
 void windowDeactivated(WindowEvent e)
          Event API.
 void windowDeiconified(WindowEvent e)
          Event API.
 void windowIconified(WindowEvent e)
          Event API.
 void windowOpened(WindowEvent e)
          When the user opens the dialog then read this application's global data into the shown dialog.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
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, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, paint, 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, remove, 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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Java API.

See Also:
Constant Field Values

EDIT_MESH_ADD

public static final int EDIT_MESH_ADD
User is adding mesh points with the GUI.

See Also:
Constant Field Values

EDIT_MESH_SUB

public static final int EDIT_MESH_SUB
User is removing mesh points with the GUI.

See Also:
Constant Field Values

EDIT_MESH_OFF

public static final int EDIT_MESH_OFF
User is moving mesh points with the GUI.

See Also:
Constant Field Values

EDIT_POLYGON_ADD

public static final int EDIT_POLYGON_ADD
User is adding polygon points with the GUI.

See Also:
Constant Field Values

EDIT_POLYGON_SUB

public static final int EDIT_POLYGON_SUB
User is removing polygon points with the GUI.

See Also:
Constant Field Values

EDIT_POLYGON_OFF

public static final int EDIT_POLYGON_OFF
User is moving polygon points with the GUI.

See Also:
Constant Field Values

ROWS_OF_MESH

public static int ROWS_OF_MESH
Rows of the mesh. Count of both windows is identical.


COLUMNS_OF_MESH

public static int COLUMNS_OF_MESH
Columns of the mesh. Count of both windows is identical.


POINTS_OF_POLYGON

public static int POINTS_OF_POLYGON
Points of the left polygon. Appears within the left window.


NUM_OF_MORPH_STEPS

public static int NUM_OF_MORPH_STEPS
Number of morph steps. Steps between the pictures counted.


SMOOTH_RADIUS

public static int SMOOTH_RADIUS
Smooth radius of the polygon. Fuzzy polygon clipping done.


MARK_SIZE

public static int MARK_SIZE
Size of the marker points for mesh & polygon.


left_mesh

public static final Vector<Point> left_mesh
Collection of points which represent the left picture's mesh.


right_mesh

public static final Vector<Point> right_mesh
Collection of points which represent the right picture's mesh.


left_polygon

public static final Vector<Point> left_polygon
Collection of points which represent the left picture's polygon.


right_polygon

public static final Vector<Point> right_polygon
Collection of points which represent the right picture's polygon.


left_image

public static BufferedImage left_image
Left input image.


right_image

public static BufferedImage right_image
Right input image.


result_image

public static BufferedImage result_image
Current result image to be saved to disk.


left_clip

public static double[][] left_clip
Smoothed clip polygon matrix of the left picture.


right_clip

public static double[][] right_clip
Smoothed clip polygon matrix of the right picture.


edit_state

public static int edit_state
Equal edit mode of both picture display viewers.


left_triangles

public static final Vector<CTriangle> left_triangles
Triangulation of the left picture.


right_triangles

public static final Vector<CTriangle> right_triangles
Triangulation of the right picture.


result_triangles

public static final Vector<CTriangle> result_triangles
Current result triangulation.


props

private Properties props
Property object. Can load and store the numerical data from file.


parent

private JFrame parent
Parent JFrame to enable modal behavior.


left

private CFrame left
Left morph picture componenent.


right

private CFrame right
Right morph picture component.


rows_of_mesh

private CEditField rows_of_mesh
Edit field for the property with the same name.


columns_of_mesh

private CEditField columns_of_mesh
Edit field for the property with the same name.


points_of_polygon

private CEditField points_of_polygon
Edit field for the property with the same name.


num_of_morph_steps

private CEditField num_of_morph_steps
Edit field for the property with the same name.


smooth_radius

private CEditField smooth_radius
Edit field for the property with the same name.


mark_size

private CEditField mark_size
Size of cursor and also point marks.


working_dir

private CEditField working_dir
Display field for the working directory with the same name.

Constructor Detail

CConfig

public CConfig(JFrame parent,
               CFrame left,
               CFrame right)
Constructor.

Parameters:
parent - The parent JFrame.
left - Left picture displaying component.
right - Right picture displaying component.
Method Detail

open

public void open()
Show the config dialog when requested by user's menu.


run

public void run()
Shutdown hook. On shutdown save the configuration data into the property file.

Specified by:
run in interface Runnable

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)
When the user closes the dialog -> assign the dialog content to this program's global configuration. Replace mesh & polygon separately if necessary.

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)
When the user opens the dialog then read this application's global data into the shown dialog.

Specified by:
windowOpened in interface WindowListener