core
Class ProjectWindow

java.lang.Object
  extended by core.ProjectWindow

public class ProjectWindow
extends java.lang.Object

Instances of this class represents a project in use by the main window. Every time a image file is opened by the main window a instance of this class is created to deal with all the aspects of the image.


Field Summary
 SubImage eyesSubImage
          The high quality eyes image area
 SubImage lipsSubImage
          The high quality lips image area
 int MAX_UNDO_HISTORY
          The maximum allowed history steps for doing undo
 
Constructor Summary
ProjectWindow(MainWindow parent, java.lang.String fileName)
          Creates a new instance of this class given it's parent, and the name of the file to be used by this project which if null then this class asks for a file using a FileDialog
 
Method Summary
 org.eclipse.swt.widgets.Composite getParentMainContainer()
          Returns the MainWindow's main container used as a parent for the tabs
 org.eclipse.swt.widgets.Shell getSShell()
          The shell used by this project
 void pushClear(org.eclipse.swt.widgets.Event e)
          Notifies the clear menu item with the given event
 void pushFullScreen(org.eclipse.swt.widgets.Event e)
          Notifies the full screen menu item with the given event
 void pushRedo(org.eclipse.swt.widgets.Event e)
          Notifies the redo menu item with the given event if the menu is enabled, otherwise nothing is done
 void pushUndo(org.eclipse.swt.widgets.Event e)
          Notifies the undo menu item with the given event if the menu is enabled, otherwise nothing is done
 void redrawImageArea()
          Asks the image area to redraw it's current content
 void registerMouseListener(java.awt.event.MouseListener mouseListener)
          Adds the specified mouse listener to receive mouse motion events from the project's drawing container.
 void registerMouseMotionListener(java.awt.event.MouseMotionListener mouseMotionListener)
          Adds the specified mouse motion listener to receive mouse motion events from the project's drawing container.
 void setEnabledRedo(boolean enabled)
          Enables the redo menu item if the argument is true, and disables it otherwise.
 void setEnabledUndo(boolean enabled)
          Enables the undo menu item if the argument is true, and disables it otherwise.
 void setEyesTracerEnabled(boolean enabled)
          Enables the eyes tracer menu item if the argument is true, and disables it otherwise.
 void setLensTracerEnabled(boolean enabled)
          Enables the lens tracer menu item if the argument is true, and disables it otherwise.
 void setLipsTracerEnabled(boolean enabled)
          Enables the lips tracer menu item if the argument is true, and disables it otherwise.
 void setShowHairEnabled(boolean enabled)
          Enables the showHair menu item if the argument is true, and disables it otherwise.
 void setShowHairSelected(boolean selected)
          Sets the selection state of the showHair menu item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_UNDO_HISTORY

public final int MAX_UNDO_HISTORY
The maximum allowed history steps for doing undo

See Also:
Constant Field Values

eyesSubImage

public SubImage eyesSubImage
The high quality eyes image area


lipsSubImage

public SubImage lipsSubImage
The high quality lips image area

Constructor Detail

ProjectWindow

public ProjectWindow(MainWindow parent,
                     java.lang.String fileName)
Creates a new instance of this class given it's parent, and the name of the file to be used by this project which if null then this class asks for a file using a FileDialog

Parameters:
parent - the main window parent
fileName - the file that should be opened by this instance or null
Method Detail

getParentMainContainer

public org.eclipse.swt.widgets.Composite getParentMainContainer()
Returns the MainWindow's main container used as a parent for the tabs

Returns:
this project MainWindow's main container

getSShell

public org.eclipse.swt.widgets.Shell getSShell()
The shell used by this project

Returns:
the shell used by this project

setEnabledUndo

public void setEnabledUndo(boolean enabled)
Enables the undo menu item if the argument is true, and disables it otherwise. A disabled menu item is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setEnabledRedo

public void setEnabledRedo(boolean enabled)
Enables the redo menu item if the argument is true, and disables it otherwise. A disabled menu item is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

pushUndo

public void pushUndo(org.eclipse.swt.widgets.Event e)
Notifies the undo menu item with the given event if the menu is enabled, otherwise nothing is done

Parameters:
e - the event used to notify the menu item
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

pushRedo

public void pushRedo(org.eclipse.swt.widgets.Event e)
Notifies the redo menu item with the given event if the menu is enabled, otherwise nothing is done

Parameters:
e - the event used to notify the menu item
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

redrawImageArea

public void redrawImageArea()
Asks the image area to redraw it's current content


pushFullScreen

public void pushFullScreen(org.eclipse.swt.widgets.Event e)
Notifies the full screen menu item with the given event

Parameters:
e - the event used to notify the menu item
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

pushClear

public void pushClear(org.eclipse.swt.widgets.Event e)
Notifies the clear menu item with the given event

Parameters:
e - the event used to notify the menu item
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setShowHairEnabled

public void setShowHairEnabled(boolean enabled)
Enables the showHair menu item if the argument is true, and disables it otherwise. A disabled menu item is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setEyesTracerEnabled

public void setEyesTracerEnabled(boolean enabled)
Enables the eyes tracer menu item if the argument is true, and disables it otherwise. A disabled menu item is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setLipsTracerEnabled

public void setLipsTracerEnabled(boolean enabled)
Enables the lips tracer menu item if the argument is true, and disables it otherwise. A disabled menu item is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setLensTracerEnabled

public void setLensTracerEnabled(boolean enabled)
Enables the lens tracer menu item if the argument is true, and disables it otherwise. A disabled menu item is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters:
enabled - the new enabled state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setShowHairSelected

public void setShowHairSelected(boolean selected)
Sets the selection state of the showHair menu item.

Parameters:
selected - the new selection state
Throws:
org.eclipse.swt.SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

registerMouseListener

public void registerMouseListener(java.awt.event.MouseListener mouseListener)
Adds the specified mouse listener to receive mouse motion events from the project's drawing container. If listener is null, no exception is thrown and no action is performed.

Parameters:
mouseListener - the mouse listener

registerMouseMotionListener

public void registerMouseMotionListener(java.awt.event.MouseMotionListener mouseMotionListener)
Adds the specified mouse motion listener to receive mouse motion events from the project's drawing container. If listener is null, no exception is thrown and no action is performed.

Parameters:
mouseMotionListener - the mouse motion listener