Class jif.jiflet.Jiflet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jif.jiflet.Jiflet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----jif.jiflet.Jiflet

public class Jiflet
extends Frame
implements JifApplication
The abstract Jiflet class should be the base class for any Jiflets you create. Implements the Application and Runnable interfaces.
See Also:
Application

Variable Index

 o appDefaultConfigFile
 o appLogFile
 o appName
 o appVerbosity
 o DEFAULT_SERVER_PORT
 o defaultLog
 o myStatusBar

Constructor Index

 o Jiflet()
Creates a generic Jiflet
 o Jiflet(String)
Creates a Jiflet with a title
 o Jiflet(String, String, String[])
Creates a Jiflet with a title, a name, and arguments
 o Jiflet(String, String, String[], boolean)
Creates a Jiflet with a title, a name, arguments, and optionally verbose.

Method Index

 o center()
Call this method to center the jiflet on the screen
 o clearStatus()
Clears the text of the status bar
 o enableStatusBar()
Creates a status bar that sits on the bottom of the Frame
 o enableStatusBar(String)
Creates a status bar that sits on the bottom of the Frame with text to display.
 o endWait()
Turns the cursor back to the old cursor before the startWait() was called.
 o errorLog(String)
Writes an error level entry to the system log
 o getConnector()
Returns the current JifConnector
 o getParamenterString(String)
Returns the parameter linked with key
 o getParameterString(String, String)
Returns the parameter linked with key, or the default value if the key is not found.
 o handleEvent(Event)
The event handler
 o init()
 o log(char, String)
Writes an entry to the system log
 o log(String)
Writes an informational entry to the system log
 o paint(Graphics)
In order to capture resizing events for the status bar, we over- ride the paint() method.
 o parseArguments(String[])
Parses the arguments passed into the application from the command line and puts them into a Properties object.
 o parseConfigFile()
Checks to see if a configuration file name was passed in via arguments.
 o setConnector(JifConnector)
Sets the Jiflet's connector
 o setStatus(String)
Sets the text of the status bar
 o setVerboseMode(boolean)
Turns on and off verbose mode
 o startWait()
Turns the cursor to the wait cursor.
 o suicide(Exception)
Allows the Jiflet to kill itself
 o suicide(Exception, String)
Allows the Jiflet to kill itself
 o suicide(Exception, String, int)
Allows the Jiflet to kill itself
 o suicide(String)
Allows the Jiflet to kill itself
 o suicide(String, int)
Allows the Jiflet to kill itself
 o verboseLog(char, String)
Writes an entry to the system log only if the application is in verbose mode.
 o verboseLog(String)
Writes an entry to the system log only if the application is in verbose mode.

Variables

 o DEFAULT_SERVER_PORT
  public final static int DEFAULT_SERVER_PORT
 o appName
  protected String appName
 o appDefaultConfigFile
  protected String appDefaultConfigFile
 o appVerbosity
  protected boolean appVerbosity
 o appLogFile
  protected DiskLog appLogFile
 o defaultLog
  protected ScreenLog defaultLog
 o myStatusBar
  protected StatusBar myStatusBar

Constructors

 o Jiflet
  public Jiflet()
Creates a generic Jiflet
 o Jiflet
  public Jiflet(String title)
Creates a Jiflet with a title
Parameters:
title - The window title
 o Jiflet
  public Jiflet(String title,
                String name,
                String args[])
Creates a Jiflet with a title, a name, and arguments
Parameters:
title - The window title
name - The name of the application
args - The arguments passed in to the program
 o Jiflet
  public Jiflet(String title,
                String name,
                String args[],
                boolean verbosity)
Creates a Jiflet with a title, a name, arguments, and optionally verbose.
Parameters:
title - The window title
name - The name of the application
args - The arguments passed in to the program
verbosity - On/Off setting indicating verbosity of log entries
See Also:
setVerboseMode

Methods

 o setVerboseMode
  public void setVerboseMode(boolean whichWay)
Turns on and off verbose mode
Parameters:
whichWay - A boolean describing the verbosity
 o verboseLog
  public void verboseLog(char logLevel,
                         String logEntry)
Writes an entry to the system log only if the application is in verbose mode.
Parameters:
logLevel - One of the logging levels from the JIFIApplication
logEntry - The string to write to the file
See Also:
setVerboseMode
 o verboseLog
  public void verboseLog(String logEntry)
Writes an entry to the system log only if the application is in verbose mode.
Parameters:
logEntry - The string to write to the file
 o errorLog
  public void errorLog(String logEntry)
Writes an error level entry to the system log
Parameters:
logEntry - The string to write to the log file
 o log
  public void log(char logLevel,
                  String logEntry)
Writes an entry to the system log
Parameters:
logLevel - One of the logging levels from the JIFIApplication
logEntry - The string to write to the file
 o log
  public void log(String logEntry)
Writes an informational entry to the system log
Parameters:
logEntry - The string to write to the file
 o parseArguments
  protected int parseArguments(String args[])
Parses the arguments passed into the application from the command line and puts them into a Properties object.
Parameters:
args - The arguments passed to parse
 o parseConfigFile
  protected int parseConfigFile()
Checks to see if a configuration file name was passed in via arguments. If there was not one there, it constructs a default configuration file name from the application's name. The resultant file is then opened and the configuration parameters are read into a Properties object.
 o handleEvent
  public boolean handleEvent(Event anEvent)
The event handler
Parameters:
anEvent - The event in question
Overrides:
handleEvent in class Component
 o suicide
  public void suicide(Exception e,
                      String logLine,
                      int level)
Allows the Jiflet to kill itself
Parameters:
e - An Exception that may have caused the fatality
logLine - What to write in the log about this suicide
level - The value to return via the System.exit() call
 o suicide
  public void suicide(String logLine)
Allows the Jiflet to kill itself
Parameters:
logLine - What to write in the log about this suicide
 o suicide
  public void suicide(String logLine,
                      int level)
Allows the Jiflet to kill itself
Parameters:
logLine - What to write in the log about this suicide
level - The value to return via the System.exit() call
 o suicide
  public void suicide(Exception e)
Allows the Jiflet to kill itself
Parameters:
e - An Exception that may have caused the fatality
 o suicide
  public void suicide(Exception e,
                      String logLine)
Allows the Jiflet to kill itself
Parameters:
e - An Exception that may have caused the fatality
logLine - What to write in the log about this suicide
 o center
  public void center()
Call this method to center the jiflet on the screen
 o paint
  public void paint(Graphics g)
In order to capture resizing events for the status bar, we over- ride the paint() method. Whenever the window is resized, it is repainted.
Parameters:
g - The graphics object
Overrides:
paint in class Component
 o enableStatusBar
  public void enableStatusBar(String text)
Creates a status bar that sits on the bottom of the Frame with text to display.
Parameters:
text - The text to display in the status bar
See Also:
clearStatus, setStatus
 o enableStatusBar
  public void enableStatusBar()
Creates a status bar that sits on the bottom of the Frame
Parameters:
text - The text to display in the status bar
See Also:
clearStatus, setStatus
 o setStatus
  public void setStatus(String text)
Sets the text of the status bar
Parameters:
text - The text to display in the status bar
See Also:
enableStatusBar, clearStatus
 o clearStatus
  public void clearStatus()
Clears the text of the status bar
See Also:
enableStatusBar, setStatus
 o setConnector
  protected void setConnector(JifConnector aConnector)
Sets the Jiflet's connector
Parameters:
aConnector - The connector
See Also:
getConnector
 o getConnector
  public JifConnector getConnector()
Returns the current JifConnector
See Also:
setConnector
 o startWait
  public void startWait()
Turns the cursor to the wait cursor. Use for long operations.
See Also:
endWait
 o endWait
  public void endWait()
Turns the cursor back to the old cursor before the startWait() was called.
See Also:
startWait
 o getParamenterString
  public String getParamenterString(String key)
Returns the parameter linked with key
Parameters:
key - The key value
 o getParameterString
  public String getParameterString(String key,
                                   String defaultValue)
Returns the parameter linked with key, or the default value if the key is not found.
Parameters:
key - The key value
defaultValue - The default value

All Packages  Class Hierarchy  This Package  Previous  Next  Index