org.openswing.swing.permissions.client
Class LoginDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended byorg.openswing.swing.permissions.client.LoginDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class LoginDialog
extends javax.swing.JDialog
implements java.awt.event.ItemListener

Title: OpenSwing Framework

Description: Dialog window used to logon the application. This window is not translated: it's always in english.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
Serialized Form

Field Summary
 
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LoginDialog(javax.swing.JFrame parentFrame, boolean changeLogin, LoginController loginController)
          Constructor: it shows a username + password fields.
LoginDialog(javax.swing.JFrame parentFrame, boolean changeLogin, LoginController loginController, java.lang.String title, java.lang.String loginButtonText, char loginButtonMnemonic, java.lang.String exitButtonText, char exitButtonMnemonic, java.lang.String storeAccount, java.lang.String appId)
          Constructor: it shows a username + password fields.
LoginDialog(javax.swing.JFrame parentFrame, boolean changeLogin, LoginController loginController, java.lang.String title, java.lang.String loginButtonText, char loginButtonMnemonic, java.lang.String exitButtonText, char exitButtonMnemonic, java.lang.String storeAccount, java.lang.String appId, CryptUtils cipher)
          Constructor: it shows a username + password fields.
LoginDialog(javax.swing.JFrame parentFrame, boolean changeLogin, LoginController loginController, java.lang.String title, java.lang.String loginButtonText, char loginButtonMnemonic, java.lang.String exitButtonText, char exitButtonMnemonic, java.lang.String storeAccount, java.lang.String appId, CryptUtils cipher, java.util.Properties supportedLanguageIds, java.lang.String currentLanguageIdentifier)
          Constructor: it shows a username + password fields.
LoginDialog(javax.swing.JFrame parentFrame, boolean changeLogin, LoginController loginController, java.lang.String title, java.lang.String loginButtonText, char loginButtonMnemonic, java.lang.String exitButtonText, char exitButtonMnemonic, java.lang.String storeAccount, java.lang.String appId, CryptUtils cipher, java.util.Properties supportedLanguageIds, java.lang.String currentLanguageIdentifier, java.lang.String usernameTextLabel, java.lang.String passwordTextLabel)
          Constructor: it shows a username + password fields.
LoginDialog(javax.swing.JFrame parentFrame, boolean changeLogin, LoginController loginController, java.lang.String title, java.lang.String loginButtonText, char loginButtonMnemonic, java.lang.String exitButtonText, char exitButtonMnemonic, java.lang.String storeAccount, java.lang.String appId, CryptUtils cipher, java.util.Properties supportedLanguageIds, java.lang.String currentLanguageIdentifier, java.lang.String usernameTextLabel, java.lang.String passwordTextLabel, java.awt.Dimension size)
          Constructor: it shows a username + password fields.
 
Method Summary
 void itemStateChanged(java.awt.event.ItemEvent e)
          Method invoked when changing language from combo box.
 
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoginDialog

public LoginDialog(javax.swing.JFrame parentFrame,
                   boolean changeLogin,
                   LoginController loginController)
Constructor: it shows a username + password fields. No password encoding/decoding task is performed. No multiple language is supported in this login dialog.

Parameters:
parentFrame - parent frame to use as parent of dialog window; could be set to null
changeLogin - flag used to indicate that the login dialog is opened inside the application: if user will click on "Exit" button then the application will not be closed
loginController - login controller

LoginDialog

public LoginDialog(javax.swing.JFrame parentFrame,
                   boolean changeLogin,
                   LoginController loginController,
                   java.lang.String title,
                   java.lang.String loginButtonText,
                   char loginButtonMnemonic,
                   java.lang.String exitButtonText,
                   char exitButtonMnemonic,
                   java.lang.String storeAccount,
                   java.lang.String appId)
Constructor: it shows a username + password fields. A "store account" check box is showed only if "appId" and "storeAccount" arguments are not null. No password encoding/decoding task is performed. No multiple language is supported in this login dialog.

Parameters:
parentFrame - parent frame to use as parent of dialog window; could be set to null
changeLogin - flag used to indicate that the login dialog is opened inside the application: if user will click on "Exit" button then the application will not be closed
loginController - login controller
title - window title
loginButtonText - text to show in login button
loginButtonMnemonic - text to show in login button
storeAccount - store account text label
appId - used to identify the application: for each distinct appId it will be stored a specific account

LoginDialog

public LoginDialog(javax.swing.JFrame parentFrame,
                   boolean changeLogin,
                   LoginController loginController,
                   java.lang.String title,
                   java.lang.String loginButtonText,
                   char loginButtonMnemonic,
                   java.lang.String exitButtonText,
                   char exitButtonMnemonic,
                   java.lang.String storeAccount,
                   java.lang.String appId,
                   CryptUtils cipher)
Constructor: it shows a username + password fields. A "store account" check box is showed only if "appId" and "storeAccount" arguments are not null. No multiple language is supported in this login dialog.

Parameters:
parentFrame - parent frame to use as parent of dialog window; could be set to null
changeLogin - flag used to indicate that the login dialog is opened inside the application: if user will click on "Exit" button then the application will not be closed
loginController - login controller
title - window title
loginButtonText - text to show in login button
loginButtonMnemonic - text to show in login button
storeAccount - store account text label
appId - used to identify the application: for each distinct appId it will be stored a specific account
cipher - optional cipher that can be used to encode and decode the password field; if this argument is null then no password encoding/decoding task is performed

LoginDialog

public LoginDialog(javax.swing.JFrame parentFrame,
                   boolean changeLogin,
                   LoginController loginController,
                   java.lang.String title,
                   java.lang.String loginButtonText,
                   char loginButtonMnemonic,
                   java.lang.String exitButtonText,
                   char exitButtonMnemonic,
                   java.lang.String storeAccount,
                   java.lang.String appId,
                   CryptUtils cipher,
                   java.util.Properties supportedLanguageIds,
                   java.lang.String currentLanguageIdentifier)
Constructor: it shows a username + password fields. A "store account" check box is showed only if "appId" and "storeAccount" arguments are not null. A combo-box for language selection is showed, if "supportedLanguageIds" argument is not null. Username label is prefilled with "Username" text. Password label is prefilled with "Password" text.

Parameters:
parentFrame - parent frame to use as parent of dialog window; could be set to null
changeLogin - flag used to indicate that the login dialog is opened inside the application: if user will click on "Exit" button then the application will not be closed
loginController - login controller
title - window title
loginButtonText - text to show in login button
loginButtonMnemonic - text to show in login button
storeAccount - store account text label
appId - used to identify the application: for each distinct appId it will be stored a specific account
cipher - optional cipher that can be used to encode and decode the password field; if this argument is null then no password encoding/decoding task is performed
supportedLanguageIds - supported languages, i.e. collection of pairs ; may be null
currentLanguageIdentifier - current language identifier; may be null

LoginDialog

public LoginDialog(javax.swing.JFrame parentFrame,
                   boolean changeLogin,
                   LoginController loginController,
                   java.lang.String title,
                   java.lang.String loginButtonText,
                   char loginButtonMnemonic,
                   java.lang.String exitButtonText,
                   char exitButtonMnemonic,
                   java.lang.String storeAccount,
                   java.lang.String appId,
                   CryptUtils cipher,
                   java.util.Properties supportedLanguageIds,
                   java.lang.String currentLanguageIdentifier,
                   java.lang.String usernameTextLabel,
                   java.lang.String passwordTextLabel)
Constructor: it shows a username + password fields. A "store account" check box is showed only if "appId" and "storeAccount" arguments are not null. A combo-box for language selection is showed, if "supportedLanguageIds" argument is not null.

Parameters:
parentFrame - parent frame to use as parent of dialog window; could be set to null
changeLogin - flag used to indicate that the login dialog is opened inside the application: if user will click on "Exit" button then the application will not be closed
loginController - login controller
title - window title
loginButtonText - text to show in login button
loginButtonMnemonic - text to show in login button
storeAccount - store account text label
appId - used to identify the application: for each distinct appId it will be stored a specific account
cipher - optional cipher that can be used to encode and decode the password field; if this argument is null then no password encoding/decoding task is performed
supportedLanguageIds - supported languages, i.e. collection of pairs ; may be null
currentLanguageIdentifier - current language identifier; may be null
usernameTextLabel - text to show in username label
passwordTextLabel - text to show in password label

LoginDialog

public LoginDialog(javax.swing.JFrame parentFrame,
                   boolean changeLogin,
                   LoginController loginController,
                   java.lang.String title,
                   java.lang.String loginButtonText,
                   char loginButtonMnemonic,
                   java.lang.String exitButtonText,
                   char exitButtonMnemonic,
                   java.lang.String storeAccount,
                   java.lang.String appId,
                   CryptUtils cipher,
                   java.util.Properties supportedLanguageIds,
                   java.lang.String currentLanguageIdentifier,
                   java.lang.String usernameTextLabel,
                   java.lang.String passwordTextLabel,
                   java.awt.Dimension size)
Constructor: it shows a username + password fields. A "store account" check box is showed only if "appId" and "storeAccount" arguments are not null. A combo-box for language selection is showed, if "supportedLanguageIds" argument is not null.

Parameters:
parentFrame - parent frame to use as parent of dialog window; could be set to null
changeLogin - flag used to indicate that the login dialog is opened inside the application: if user will click on "Exit" button then the application will not be closed
loginController - login controller
title - window title
loginButtonText - text to show in login button
loginButtonMnemonic - text to show in login button
storeAccount - store account text label
appId - used to identify the application: for each distinct appId it will be stored a specific account
cipher - optional cipher that can be used to encode and decode the password field; if this argument is null then no password encoding/decoding task is performed
supportedLanguageIds - supported languages, i.e. collection of pairs ; may be null
currentLanguageIdentifier - current language identifier; may be null
usernameTextLabel - text to show in username label
passwordTextLabel - text to show in password label
size - window size; if not specified, the size is automatically setted by this class
Method Detail

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Method invoked when changing language from combo box.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener