Class QETools

java.lang.Object
  extended by QETools

public class QETools
extends java.lang.Object

Contains tools like outputting debug messages for other classes to use. Basically, if code is going to be written over and over in different classes, this is the place to consolidate and write it once.

Author:
Michael Latham

Field Summary
static boolean m_debug
          Set to true if basic (non-db) debug messages should be written to std out
private static java.lang.String m_key
           
static java.lang.String m_lookAndFeel
          Attempted look and feel for the application
 
Constructor Summary
QETools()
          Constructor, though most of this class is static
 
Method Summary
static void debugMsg(java.lang.String msg)
          If basic debugging is turned on, output the message
static java.lang.String decrypt(java.lang.String in)
          Decrypt a string to save to file
static java.lang.String encrypt(java.lang.String in)
          Encrypt a string to save to file
private static byte[] getDesKeyData()
          Generate key base for encryption
static java.awt.Point getNewLocation(java.awt.Dialog p)
          Determine a reasonable location for a new dialog given the parent it will belong to.
static java.awt.Point getNewLocation(java.awt.Frame p)
          Determine a reasonable location for a new dialog given the parent it will belong to.
static void msg(java.lang.String val, java.awt.Dialog parent)
          Do pop-up to display the message Do pop-up to display the message
static void msg(java.lang.String val, java.awt.Frame parent)
          Do pop-up to display the message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_debug

public static final boolean m_debug
Set to true if basic (non-db) debug messages should be written to std out

See Also:
Constant Field Values

m_lookAndFeel

public static final java.lang.String m_lookAndFeel
Attempted look and feel for the application

See Also:
Constant Field Values

m_key

private static final java.lang.String m_key
See Also:
Constant Field Values
Constructor Detail

QETools

public QETools()
Constructor, though most of this class is static

Method Detail

debugMsg

public static void debugMsg(java.lang.String msg)
If basic debugging is turned on, output the message

Parameters:
msg - Debug message to output

getNewLocation

public static java.awt.Point getNewLocation(java.awt.Frame p)
Determine a reasonable location for a new dialog given the parent it will belong to.

Parameters:
p - Parent frame of a new dialog or frame
Returns:
The point location for the new dialog or frame

getNewLocation

public static java.awt.Point getNewLocation(java.awt.Dialog p)
Determine a reasonable location for a new dialog given the parent it will belong to.

Parameters:
p - Parent dialog of a new dialog or frame
Returns:
The point location for the new dialog or frame

msg

public static void msg(java.lang.String val,
                       java.awt.Frame parent)
Do pop-up to display the message

Parameters:
val - Message to display
parent - Parent frame to hold dialog

msg

public static void msg(java.lang.String val,
                       java.awt.Dialog parent)
Do pop-up to display the message Do pop-up to display the message

Parameters:
val - Message to display
parent - Parent dialog to hold dialog

encrypt

public static java.lang.String encrypt(java.lang.String in)
Encrypt a string to save to file

Parameters:
in - String to encrypt
Returns:
Encrypted string, or original if there was an error.

decrypt

public static java.lang.String decrypt(java.lang.String in)
Decrypt a string to save to file

Parameters:
in - String to encrypt
Returns:
Encrypted string, or original if there was an error.

getDesKeyData

private static byte[] getDesKeyData()
Generate key base for encryption

Returns:
byte array for use as key data