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
-
appDefaultConfigFile
-
-
appLogFile
-
-
appName
-
-
appVerbosity
-
-
DEFAULT_SERVER_PORT
-
-
defaultLog
-
-
myStatusBar
-
-
Jiflet()
- Creates a generic Jiflet
-
Jiflet(String)
- Creates a Jiflet with a title
-
Jiflet(String, String, String[])
- Creates a Jiflet with a title, a name, and arguments
-
Jiflet(String, String, String[], boolean)
- Creates a Jiflet with a title, a name, arguments, and optionally
verbose.
-
center()
- Call this method to center the jiflet on the screen
-
clearStatus()
- Clears the text of the status bar
-
enableStatusBar()
- Creates a status bar that sits on the bottom of the Frame
-
enableStatusBar(String)
- Creates a status bar that sits on the bottom of the Frame with text
to display.
-
endWait()
- Turns the cursor back to the old cursor before the startWait() was
called.
-
errorLog(String)
- Writes an error level entry to the system log
-
getConnector()
- Returns the current JifConnector
-
getParamenterString(String)
- Returns the parameter linked with key
-
getParameterString(String, String)
- Returns the parameter linked with key, or the default value if the
key is not found.
-
handleEvent(Event)
- The event handler
-
init()
-
-
log(char, String)
- Writes an entry to the system log
-
log(String)
- Writes an informational entry to the system log
-
paint(Graphics)
- In order to capture resizing events for the status bar, we over-
ride the paint() method.
-
parseArguments(String[])
- Parses the arguments passed into the application from the command line
and puts them into a Properties object.
-
parseConfigFile()
- Checks to see if a configuration file name was passed in via arguments.
-
setConnector(JifConnector)
- Sets the Jiflet's connector
-
setStatus(String)
- Sets the text of the status bar
-
setVerboseMode(boolean)
- Turns on and off verbose mode
-
startWait()
- Turns the cursor to the wait cursor.
-
suicide(Exception)
- Allows the Jiflet to kill itself
-
suicide(Exception, String)
- Allows the Jiflet to kill itself
-
suicide(Exception, String, int)
- Allows the Jiflet to kill itself
-
suicide(String)
- Allows the Jiflet to kill itself
-
suicide(String, int)
- Allows the Jiflet to kill itself
-
verboseLog(char, String)
- Writes an entry to the system log only if the application is in verbose mode.
-
verboseLog(String)
- Writes an entry to the system log only if the application is in verbose mode.
DEFAULT_SERVER_PORT
public final static int DEFAULT_SERVER_PORT
appName
protected String appName
appDefaultConfigFile
protected String appDefaultConfigFile
appVerbosity
protected boolean appVerbosity
appLogFile
protected DiskLog appLogFile
defaultLog
protected ScreenLog defaultLog
myStatusBar
protected StatusBar myStatusBar
Jiflet
public Jiflet()
- Creates a generic Jiflet
Jiflet
public Jiflet(String title)
- Creates a Jiflet with a title
- Parameters:
- title - The window title
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
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
setVerboseMode
public void setVerboseMode(boolean whichWay)
- Turns on and off verbose mode
- Parameters:
- whichWay - A boolean describing the verbosity
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
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
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
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
log
public void log(String logEntry)
- Writes an informational entry to the system log
- Parameters:
- logEntry - The string to write to the file
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
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.
handleEvent
public boolean handleEvent(Event anEvent)
- The event handler
- Parameters:
- anEvent - The event in question
- Overrides:
- handleEvent in class Component
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
suicide
public void suicide(String logLine)
- Allows the Jiflet to kill itself
- Parameters:
- logLine - What to write in the log about this suicide
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
suicide
public void suicide(Exception e)
- Allows the Jiflet to kill itself
- Parameters:
- e - An Exception that may have caused the fatality
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
center
public void center()
- Call this method to center the jiflet on the screen
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
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
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
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
clearStatus
public void clearStatus()
- Clears the text of the status bar
- See Also:
- enableStatusBar, setStatus
setConnector
protected void setConnector(JifConnector aConnector)
- Sets the Jiflet's connector
- Parameters:
- aConnector - The connector
- See Also:
- getConnector
getConnector
public JifConnector getConnector()
- Returns the current JifConnector
- See Also:
- setConnector
startWait
public void startWait()
- Turns the cursor to the wait cursor. Use for long operations.
- See Also:
- endWait
endWait
public void endWait()
- Turns the cursor back to the old cursor before the startWait() was
called.
- See Also:
- startWait
getParamenterString
public String getParamenterString(String key)
- Returns the parameter linked with key
- Parameters:
- key - The key value
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