com.jthomas.mailfaces
Class MailFaces

java.lang.Object
  |
  +--com.jthomas.mailfaces.MailFaces
All Implemented Interfaces:
java.lang.Runnable

public class MailFaces
extends java.lang.Object
implements java.lang.Runnable

This is the main class for the MailFaces application.

This application will examine the mail waiting at a Mail Server and display an Icon that represents the sender of the Mail. The user can either select unique images to be displayed based on information from the Mail headers or by default it will look up the From: user@host and search the PIcon Database for a matching image.

MailFaces creates 4 main Class Objects that work together along with some supporting Classes

The following are Classes that are used by the above.

There are also a number of GUI objects that are involved in displaying the results. These are documented in the FaceBoard documentation.

There are also some utility Objects that are involved

For additional details, refer to the MailFaces online documentation

Credits:

   ---------------------------
   ImageButton object from:
      Marty Hall:
      
        Java Resource Page. 
      
         hall@apl.jhu.edu
   -------------------------
   Regexp Object from:
      Copyright (c) 1995 Starwave Corporation.  All Rights Reserved.
      A perl-like regular expression matcher for java.
      Version 1.10, 02 Feb 1996
      Author Jonathan Payne
  
   --------------------------
   

Class: MailFaces.java

Main application object for MailFaces.

MailFaces.java contains the "main" method that is given control initially. It will create a MailFaces object and give control to the "init()" method. The init method will do the initial setup of the Mailfaces environment and then invoke the "run()" method that will start up the various threads that will actually do the work and then wait for the other threads to terminate. The main purpose of the MailFaces class (other than getting things started) is to act as the global namespace for communication between other components.

Author:
John Thomas jthomas@cruzio.com
See Also:
FaceResolver, FaceBoard, FaceFrame, FaceServer, FaceOptions, FaceSelect, FaceSelection, FaceSMS, FaceGroup, Queue, FaceMailbox, Mailmsg, PiconDB, FaceOptions

Method Summary
 void addFaceEventListener(FaceEventListener rcl)
          Adds the FaceEventListener to the collection of those interested in new FaceOptionsEvent
static void displayDebugInfo()
          displayDebugInfo is called by FaceFrame when the user clicks the DebugInfo It will display some debug info.
 void editOptions()
          editOptions() will invoke the JEditor internal editor on the .opt file
 boolean editOptionsSupported()
          editOptionsSupported() will verify that JEditor can be invoked (Requires Java 2)
 void fireFaceEvent(int id)
          Send a FaceEvent to all registered listeners
 FaceCache getCacheRef()
          This returns the reference to the one and Only FaceCache object
 int getDelay()
           
 FaceAudio getFaceAudioRef()
          Method to access the one and Only FaceAudio object
 FaceBoard getFaceBoardRef()
          Method to access the one and Only FaceBoard object
 FaceFrame getFaceFrameRef()
          Method to access the one and Only FaceFrame object
 FaceOptions getFaceOptionsRef()
          Method to access the one and Only Options object
 FaceSMS getFaceSMSRef()
          Method to access the one and Only Options object
 boolean getFlagAudio()
          return/set the _FlagAudio flag
 boolean getFlagCheckMail()
          return/set the _FlagCheckMail flag
 boolean getFlagQuitMail()
          return/set the _FlagQuitMail flag
 boolean getFlagResetMail()
          return/set the _FlagResetMail flag
 boolean getFlagResetServer()
          return/set the _FlagResetServer flag
 FaceMailbox getMailboxRef()
          This returns the reference to the current Mailbox object
 PiconDB getPiconDBRef()
          Method to access the one and Only PiconDB object
static MailFaces getRef()
          Class method that returns the reference to the only MailFaces Object
 FaceResolver getResolverRef()
          This returns the reference to the one and Only FaceResolver object
 void init()
          Called by MailFaces.main() to do initial setup.
static void main(java.lang.String[] args)
          The "main" class method is invoked when MailFaces is invoked as a Java application.
 void refreshOptions()
          Reprocess the Options file when User has made a Refresh request.
 void removeFaceEventListener(FaceEventListener rcl)
          Removes the FaceEventListener from the collection of those interested in new FaceOptionsEvents
 void run()
          Main processing loop for MailFaces.
 void setBusy(boolean busy)
          Method to allow the components to signal that the application is busy
 void setDelay(int delay)
          Method to allow the user to get/set the Delay interval
 void setFlagAudio(boolean flag)
           
 void setFlagCheckMail(boolean flag)
           
 void setFlagQuitMail(boolean flag)
           
 void setFlagResetMail(boolean flag)
           
 void setFlagResetServer(boolean flag)
           
 void setServer(int ServerNumber)
          Change the Server to be accessed.
static java.lang.String version()
          Returns the MailFaces application Version and release Date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

version

public static java.lang.String version()
Returns the MailFaces application Version and release Date. For Example:
V 1.2.1 - February 7, 1997

Returns:
String

getRef

public static MailFaces getRef()
Class method that returns the reference to the only MailFaces Object

Returns:
MailFaces Reference to MailFaces object

init

public void init()
Called by MailFaces.main() to do initial setup.
  - Setup FaceProperties object from MailFaces.ini file.
  - Call setupOptions to read the MailFaces Options file
  - Setup the FaceBoard object that will handle User interface
    
  - Setup the Mailbox object
  - Setup the Image Cache 
  - Setup the Resolver Object 
 

Returns:
void

editOptionsSupported

public boolean editOptionsSupported()
editOptionsSupported() will verify that JEditor can be invoked (Requires Java 2)

Returns:
true if can be JEditor can be created.

editOptions

public void editOptions()
editOptions() will invoke the JEditor internal editor on the .opt file

Returns:
void

refreshOptions

public void refreshOptions()
Reprocess the Options file when User has made a Refresh request.


setServer

public void setServer(int ServerNumber)
Change the Server to be accessed.

This method is called from the event handler for the menu bar "Server" item.


run

public void run()
Main processing loop for MailFaces.
   start processing threads
   While (not done)
      open Mailbox
      Check if any new mail and process it
      delay until time to check it again
 

Specified by:
run in interface java.lang.Runnable
Returns:
void

displayDebugInfo

public static void displayDebugInfo()
displayDebugInfo is called by FaceFrame when the user clicks the DebugInfo It will display some debug info. What it displays may change from time to time since this will often be used to chase different problems.


addFaceEventListener

public void addFaceEventListener(FaceEventListener rcl)
Adds the FaceEventListener to the collection of those interested in new FaceOptionsEvent

Parameters:
rcl - the FaceEventListener to add

removeFaceEventListener

public void removeFaceEventListener(FaceEventListener rcl)
Removes the FaceEventListener from the collection of those interested in new FaceOptionsEvents


fireFaceEvent

public void fireFaceEvent(int id)
Send a FaceEvent to all registered listeners

Parameters:
id - FaceEvent identifier
See Also:
FaceEvent

getCacheRef

public FaceCache getCacheRef()
This returns the reference to the one and Only FaceCache object

Returns:
FaceCache Reference to FaceCache object

getMailboxRef

public FaceMailbox getMailboxRef()
This returns the reference to the current Mailbox object

Returns:
FaceMailbox Reference to current FaceMailbox object

getResolverRef

public FaceResolver getResolverRef()
This returns the reference to the one and Only FaceResolver object

Returns:
_Resolver Reference to FaceResolver object

getPiconDBRef

public PiconDB getPiconDBRef()
Method to access the one and Only PiconDB object

Returns:
Reference to PiconDB object

getFaceBoardRef

public FaceBoard getFaceBoardRef()
Method to access the one and Only FaceBoard object

Returns:
FaceBoard Reference to FaceBoard object

getFaceFrameRef

public FaceFrame getFaceFrameRef()
Method to access the one and Only FaceFrame object

Returns:
_FaceFrame Reference to FaceFrame object

getFaceAudioRef

public FaceAudio getFaceAudioRef()
Method to access the one and Only FaceAudio object

Returns:
_FaceAudio Reference to FaceAudio object

getFaceOptionsRef

public FaceOptions getFaceOptionsRef()
Method to access the one and Only Options object

Returns:
_Options Reference to FaceOptions object

getFaceSMSRef

public FaceSMS getFaceSMSRef()
Method to access the one and Only Options object

Returns:
_Options Reference to FaceOptions object

setDelay

public void setDelay(int delay)
Method to allow the user to get/set the Delay interval


getDelay

public int getDelay()

setBusy

public void setBusy(boolean busy)
Method to allow the components to signal that the application is busy


getFlagCheckMail

public boolean getFlagCheckMail()
return/set the _FlagCheckMail flag


setFlagCheckMail

public void setFlagCheckMail(boolean flag)

getFlagResetMail

public boolean getFlagResetMail()
return/set the _FlagResetMail flag


setFlagResetMail

public void setFlagResetMail(boolean flag)

getFlagResetServer

public boolean getFlagResetServer()
return/set the _FlagResetServer flag


setFlagResetServer

public void setFlagResetServer(boolean flag)

getFlagQuitMail

public boolean getFlagQuitMail()
return/set the _FlagQuitMail flag


setFlagQuitMail

public void setFlagQuitMail(boolean flag)

getFlagAudio

public boolean getFlagAudio()
return/set the _FlagAudio flag


setFlagAudio

public void setFlagAudio(boolean flag)

main

public static void main(java.lang.String[] args)
The "main" class method is invoked when MailFaces is invoked as a Java application. It will create a MailFaces object. Then it will process the command line operands if present.
  Args:
     -d 			Debug flag
     
     name.opt 	Option file to be used
  
It will then call the MailFaces init method to get everything prepared. It will then startup the a new thread that invokes the MailFaces.run() method.

Returns:
void