Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tanksoftware.juk
Class Copernicus  view Copernicus download Copernicus.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended bycom.tanksoftware.juk.Copernicus
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class Copernicus
extends javax.swing.JFrame

The main classes for the running of the application Copernicus.

Title: Copernicus

Description: Internet Password and Username tracking software

Copyright: Copyright (c) 2002 William Denniss

Company: Tank Software

Version:
1.4.0

Nested Class Summary
(package private)  class Copernicus.PopupListener
          Class to handle the Popup Menus
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JComboBox accList
           
static java.lang.String AUTHOR
           
private  java.lang.String baseDirectory
           
private  javax.swing.JTextArea comment
           
private  javax.swing.JLabel commentLabel
           
private  javax.swing.JTextArea commentText
           
private  javax.swing.JScrollPane commentTextScrollPane
           
private  java.util.List componentEnableList
           
private  WXMLSection currentLogin
           
private  WXMLSection currentSite
           
private  WXMLSection[] currentSortedSites
           
private  WXML currentUser
           
private  java.lang.String currentUserFile
           
private  java.lang.String currentUserFileName
           
static java.lang.String DATE_CREATED
           
static java.lang.String DATE_UPDATED
           
private static java.lang.String defaultLAF
           
private  javax.swing.JTextField filter
           
private static java.lang.String INI_FILE_NAME
           
private  java.lang.String lastLoadedFile
           
private  WXMLSection lastLogin
           
private  WXMLSection lastSite
           
private  int lastUser
           
private  MultiLingual lingual
           
private  javax.swing.JLabel loginLabel
           
private  javax.swing.JTextField loginNameText
           
private  WXMLSection[] logins
           
private  javax.swing.JButton lookup
           
private  Ini mainIni
           
private  javax.swing.JMenuItem menuCreateNewUser
           
private  javax.swing.JMenu menuLanguages
           
private  int menulimit
           
private  javax.swing.JMenuItem menuLogout
           
private  javax.swing.JMenu menuSites
           
private  javax.swing.JMenu menuUsers
           
private  javax.swing.JCheckBoxMenuItem mUseEncryption
           
private  boolean newuser
           
private  javax.swing.JButton nextAccountButton
           
private  javax.swing.JTextField password
           
private  javax.swing.JLabel passwordLabel
           
private  javax.swing.JTextField passwordText
           
private static java.lang.String pname
           
static java.lang.String PROGRAM_NAME
           
private  boolean saveConfirm
           
private  int searchNum
           
(package private)  int selLogin
           
(package private)  int selSite
           
private  javax.swing.JList siteList
           
private  javax.swing.JTextField siteNameText
           
(package private)  WXMLSection[] sites
          Populates the menu site list alphabetically, and limiting the number of sites listed per sub menu to 20 (or the number read in from the ini).
private  javax.swing.JSplitPane split
           
private  javax.swing.JCheckBox useEncryption
           
private  javax.swing.JTextField username
           
private  javax.swing.JLabel usernameLabel
           
private  javax.swing.JTextField usernameText
           
private  java.util.List users
           
private  java.util.HashMap users_filename
           
private  java.util.HashMap users_name
           
static java.lang.String VERSION_NUMBER
           
private static WillTank willTankPanel
           
private  SunFileFilter wxmlFilter
           
private  XYLayout xYLayout1
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Copernicus()
           
 
Method Summary
(package private)  void addLogin_actionPerformed(java.awt.event.ActionEvent e)
          Prompts the user for a login name, and greates that login.
 void addNewLogin()
           
 void addNewSite()
           
(package private)  void addSite_actionPerformed(java.awt.event.ActionEvent e)
          Creates a new site, requesting the name from the user.
private  void addUserFile()
          Adds a new user to the system, and writes it to disk.
private  void changeLanguage(java.lang.String newLanguage)
          Changes the current lannguage.
private  void changeUserName(java.lang.String newUsername)
           
private  boolean checkLoginChanged(boolean showConfirm)
          Check to see if the login was changed.
 boolean closeUser()
           
(package private)  void createNewSite(java.lang.String newSiteText)
          Creates a new site in memory.
private  void deleteCurrentUser()
          Removes the current user from the user list, and the ini file.
(package private)  void deleteLogin_actionPerformed(java.awt.event.ActionEvent e)
          Deletes the current login
 void deleteLogin()
           
(package private)  void deleteSite_actionPerformed(java.awt.event.ActionEvent e)
          Deletes the current site from memory.
 void deleteSite()
           
private  void editUsername_actionPerformed(java.awt.event.ActionEvent e)
          Allows the user to change the Copernicus display name of the user
 void exitCopernicus()
           
static java.lang.String firstSettings(java.lang.String baseDirectory)
          Returns the default ini file for the given directory.
static java.lang.String firstUser(java.lang.String number)
           
private  WXMLSection[] getOrdedLogins()
          Returns a list of all of the logins, listed alphabetically.
(package private)  void keypressed_action(java.awt.event.KeyEvent e)
          Used to work out enabled state of login buttons
private  void loadUser(java.lang.String filename)
          Loads a given user.
 void loginSelected()
           
private  void logout()
          Logs off a user.
private  void lookupLogin(java.lang.String login)
          Used to lookup an existing login, or create a new one.
private  void lookupSite(boolean createNew, boolean startFromStart)
          Performs the site search.
static void main(java.lang.String[] args)
          Runs Copernicus.
 void navigateLogin(int direction)
          Code that is executed when the next and back buttons are pressed.
private  void newUser()
          Creates a new user.
 void nextLogin()
           
private  void populateSiteList()
           
private  void populateUsersList()
          Populates the user menu list.
 void refreshCurrentLogin()
           
 void refreshLoginList()
           
 void refreshSiteList()
           
 void reloadCurrentUser()
          Reloads Copernicus using the currentUser WXML data.
 void renameLogin()
           
 void renameSite()
           
 void resortSiteList()
           
private  void save_actionPerformed(java.awt.event.ActionEvent evt)
          Saves the current user to disk.
 void saveCurrentLogin()
           
private  void saveCurrentLogin(WXMLSection current, boolean updateLoginName)
          Updates the passed login with the text from the loginPanel.
private  void saveIni()
          Writes the ini file to disk.
(package private)  void saveLogin_actionPerformed(java.awt.event.ActionEvent evt)
          Saves the login to memory.
 void saveLogin()
           
 void saveNeeded()
           
 void saveUser()
           
private  void saveUserFileAs_actionPerformed(java.awt.event.ActionEvent e, boolean export)
          Opens the Save File as dialog box then saves the selected user into the specified filename.
private  void setCurrentAsDefault()
          Changes the default user entry in the ini file, and saves it.
private  void setLanguageAsDefault()
          Changes the language entry in the ini file, and saves it.
private  void showHelp()
          Shows the help dialog box.
 void showHelpURL()
           
private  void siteNameText_keyPressed(java.awt.event.KeyEvent e)
          Changes the text of the lookup button to "Lookup" if that was pressed, and also runs the lookup when the Enter key is pressed.
 void siteSelected()
          Fired when a site is selected
private  void updateLanguageTexts(java.lang.String newLanguage)
          Reloads all of the text of the GUI, including menus, labels etc.
private  void useEncryption_actionPerformed(java.awt.event.ActionEvent evt)
          Updates the use encryption state.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

PROGRAM_NAME

public static final java.lang.String PROGRAM_NAME
See Also:
Constant Field Values

VERSION_NUMBER

public static final java.lang.String VERSION_NUMBER
See Also:
Constant Field Values

DATE_CREATED

public static final java.lang.String DATE_CREATED
See Also:
Constant Field Values

DATE_UPDATED

public static final java.lang.String DATE_UPDATED
See Also:
Constant Field Values

AUTHOR

public static final java.lang.String AUTHOR
See Also:
Constant Field Values

willTankPanel

private static WillTank willTankPanel

INI_FILE_NAME

private static final java.lang.String INI_FILE_NAME
See Also:
Constant Field Values

pname

private static final java.lang.String pname
See Also:
Constant Field Values

defaultLAF

private static final java.lang.String defaultLAF
See Also:
Constant Field Values

wxmlFilter

private SunFileFilter wxmlFilter

lastLoadedFile

private java.lang.String lastLoadedFile

menulimit

private int menulimit

componentEnableList

private java.util.List componentEnableList

menuUsers

private javax.swing.JMenu menuUsers

menuSites

private javax.swing.JMenu menuSites

xYLayout1

private XYLayout xYLayout1

menuLanguages

private javax.swing.JMenu menuLanguages

baseDirectory

private java.lang.String baseDirectory

users

private java.util.List users

users_name

private java.util.HashMap users_name

users_filename

private java.util.HashMap users_filename

mainIni

private Ini mainIni

currentUser

private WXML currentUser

currentSite

private WXMLSection currentSite

currentLogin

private WXMLSection currentLogin

currentUserFileName

private java.lang.String currentUserFileName

lastUser

private int lastUser

currentSortedSites

private WXMLSection[] currentSortedSites

siteNameText

private javax.swing.JTextField siteNameText

lookup

private javax.swing.JButton lookup

loginNameText

private javax.swing.JTextField loginNameText

loginLabel

private javax.swing.JLabel loginLabel

usernameText

private javax.swing.JTextField usernameText

usernameLabel

private javax.swing.JLabel usernameLabel

passwordText

private javax.swing.JTextField passwordText

passwordLabel

private javax.swing.JLabel passwordLabel

commentLabel

private javax.swing.JLabel commentLabel

commentTextScrollPane

private javax.swing.JScrollPane commentTextScrollPane

commentText

private javax.swing.JTextArea commentText

useEncryption

private javax.swing.JCheckBox useEncryption

menuCreateNewUser

private javax.swing.JMenuItem menuCreateNewUser

menuLogout

private javax.swing.JMenuItem menuLogout

split

private javax.swing.JSplitPane split

searchNum

private int searchNum

currentUserFile

private java.lang.String currentUserFile

siteList

private javax.swing.JList siteList

filter

private javax.swing.JTextField filter

nextAccountButton

private javax.swing.JButton nextAccountButton

mUseEncryption

private javax.swing.JCheckBoxMenuItem mUseEncryption

username

private javax.swing.JTextField username

password

private javax.swing.JTextField password

comment

private javax.swing.JTextArea comment

logins

private WXMLSection[] logins

lastLogin

private WXMLSection lastLogin

lastSite

private WXMLSection lastSite

accList

private javax.swing.JComboBox accList

selSite

int selSite

selLogin

int selLogin

lingual

private MultiLingual lingual

newuser

private boolean newuser

saveConfirm

private boolean saveConfirm

sites

WXMLSection[] sites
Populates the menu site list alphabetically, and limiting the number of sites listed per sub menu to 20 (or the number read in from the ini).

Constructor Detail

Copernicus

public Copernicus()
Method Detail

siteSelected

public void siteSelected()
Fired when a site is selected


resortSiteList

public void resortSiteList()

refreshSiteList

public void refreshSiteList()

loginSelected

public void loginSelected()

refreshCurrentLogin

public void refreshCurrentLogin()

saveLogin

public void saveLogin()

saveCurrentLogin

public void saveCurrentLogin()

closeUser

public boolean closeUser()

saveUser

public void saveUser()

refreshLoginList

public void refreshLoginList()

showHelpURL

public void showHelpURL()

exitCopernicus

public void exitCopernicus()

renameSite

public void renameSite()

renameLogin

public void renameLogin()

deleteSite

public void deleteSite()

deleteLogin

public void deleteLogin()

addNewSite

public void addNewSite()

nextLogin

public void nextLogin()

addNewLogin

public void addNewLogin()

saveNeeded

public void saveNeeded()

main

public static void main(java.lang.String[] args)
Runs Copernicus. Currently command line arguments are ignored


logout

private void logout()
Logs off a user.


loadUser

private void loadUser(java.lang.String filename)
Loads a given user. If the load "fails" without encryption, then it is retried with encryption.


reloadCurrentUser

public void reloadCurrentUser()
Reloads Copernicus using the currentUser WXML data.


lookupSite

private void lookupSite(boolean createNew,
                        boolean startFromStart)
Performs the site search. If an exact match is found, that is loaded, or the first partial match. if a partial match was already found, the next one is loaded.


lookupLogin

private void lookupLogin(java.lang.String login)
Used to lookup an existing login, or create a new one. The logins are searched for a match and if there is, it is loaded, if there isn't a new one is created ready for use.


firstSettings

public static java.lang.String firstSettings(java.lang.String baseDirectory)
Returns the default ini file for the given directory.


firstUser

public static java.lang.String firstUser(java.lang.String number)

populateUsersList

private void populateUsersList()
Populates the user menu list.


populateSiteList

private void populateSiteList()

getOrdedLogins

private WXMLSection[] getOrdedLogins()
Returns a list of all of the logins, listed alphabetically.


checkLoginChanged

private boolean checkLoginChanged(boolean showConfirm)
Check to see if the login was changed.


useEncryption_actionPerformed

private void useEncryption_actionPerformed(java.awt.event.ActionEvent evt)
Updates the use encryption state.


save_actionPerformed

private void save_actionPerformed(java.awt.event.ActionEvent evt)
Saves the current user to disk.


saveIni

private void saveIni()
Writes the ini file to disk.


editUsername_actionPerformed

private void editUsername_actionPerformed(java.awt.event.ActionEvent e)
Allows the user to change the Copernicus display name of the user


changeUserName

private void changeUserName(java.lang.String newUsername)

addUserFile

private void addUserFile()
Adds a new user to the system, and writes it to disk.


newUser

private void newUser()
Creates a new user.


deleteCurrentUser

private void deleteCurrentUser()
Removes the current user from the user list, and the ini file. It doesn't erase it from the hard drive however.


addSite_actionPerformed

void addSite_actionPerformed(java.awt.event.ActionEvent e)
Creates a new site, requesting the name from the user.


createNewSite

void createNewSite(java.lang.String newSiteText)
Creates a new site in memory.


saveCurrentLogin

private void saveCurrentLogin(WXMLSection current,
                              boolean updateLoginName)
Updates the passed login with the text from the loginPanel.


saveLogin_actionPerformed

void saveLogin_actionPerformed(java.awt.event.ActionEvent evt)
Saves the login to memory.


deleteLogin_actionPerformed

void deleteLogin_actionPerformed(java.awt.event.ActionEvent e)
Deletes the current login


siteNameText_keyPressed

private void siteNameText_keyPressed(java.awt.event.KeyEvent e)
Changes the text of the lookup button to "Lookup" if that was pressed, and also runs the lookup when the Enter key is pressed.


keypressed_action

void keypressed_action(java.awt.event.KeyEvent e)
Used to work out enabled state of login buttons


addLogin_actionPerformed

void addLogin_actionPerformed(java.awt.event.ActionEvent e)
Prompts the user for a login name, and greates that login.


deleteSite_actionPerformed

void deleteSite_actionPerformed(java.awt.event.ActionEvent e)
Deletes the current site from memory.


setCurrentAsDefault

private void setCurrentAsDefault()
Changes the default user entry in the ini file, and saves it.


setLanguageAsDefault

private void setLanguageAsDefault()
Changes the language entry in the ini file, and saves it.


saveUserFileAs_actionPerformed

private void saveUserFileAs_actionPerformed(java.awt.event.ActionEvent e,
                                            boolean export)
Opens the Save File as dialog box then saves the selected user into the specified filename.


navigateLogin

public void navigateLogin(int direction)
Code that is executed when the next and back buttons are pressed.


showHelp

private void showHelp()
Shows the help dialog box.


changeLanguage

private void changeLanguage(java.lang.String newLanguage)
Changes the current lannguage. The language menu is updated, the entire GUI is reloaded and the change is saved to disk.


updateLanguageTexts

private void updateLanguageTexts(java.lang.String newLanguage)
Reloads all of the text of the GUI, including menus, labels etc.