Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame Class Reference

Collaboration diagram for org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GuiVirtualDatabaseLoginFrame (JFrame parent, ActionListener listener, String databaseName, String controllerHost, String controllerPort, GuiSession session)
JTextField getLoginBox ()
JTextField getPasswordBox ()
String getDatabaseName ()
String getControllerHost ()
String getControllerPort ()

Detailed Description

This class defines a GuiVirtualDatabaseLoginFrame

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 51 of file GuiVirtualDatabaseLoginFrame.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame.GuiVirtualDatabaseLoginFrame JFrame  parent,
ActionListener  listener,
String  databaseName,
String  controllerHost,
String  controllerPort,
GuiSession  session
 

Creates a new GuiVirtualDatabaseLoginFrame.java object

Parameters:
listener that listens for actions
databaseName the name of the virtual database
parent the parent frame
controllerHost controller ip address
controllerPort controller port
session the session to retrieve database stored parameters

Definition at line 72 of file GuiVirtualDatabaseLoginFrame.java.

References org.objectweb.cjdbc.console.gui.session.GuiSession.getAuthenticatedDatabaseLogin(), and org.objectweb.cjdbc.console.gui.session.GuiSession.getAuthenticatedDatabasePassword().

00076   {
00077     super(parent, GuiTranslate.get("frame.database.title", databaseName), true);
00078 
00079     this.actionListener = listener;
00080     this.controllerHost = controllerHost;
00081     this.controllerPort = controllerPort;
00082     Toolkit toolkit = Toolkit.getDefaultToolkit();
00083     Dimension dim = toolkit.getScreenSize();
00084     int screenHeight = dim.height;
00085     int screenWidth = dim.width;
00086     int frameWidth = 450;
00087     int frameHeight = 80;
00088     this.setBounds((screenWidth - frameWidth) / 2,
00089         (screenHeight - frameHeight) / 2, frameWidth, frameHeight);
00090     this.validate();
00091     this.setVisible(false);
00092     this.setResizable(false);
00093     this.getContentPane().setLayout(new FlowLayout());
00094     this.databaseName = databaseName;
00095 
00096     // Define confirm button before listener
00097     optionConfirm = new JButton(GuiTranslate.get("frame.database.approve"));
00098     optionConfirm.setActionCommand(GuiCommands.COMMAND_DATABASE_AUTHENTICATE);
00099     optionConfirm.addActionListener(actionListener);
00100 
00101     keyListener = new FrameConfirmKeyListener(optionConfirm);
00102     this.addKeyListener(keyListener);
00103 
00104     Dimension buttonDim = new Dimension(80, 20);
00105 
00106     this.getContentPane().add(
00107         new JLabel(GuiTranslate.get("frame.database.login")));
00108     loginBox = new JTextField(0);
00109     loginBox.setAlignmentX(CENTER_ALIGNMENT);
00110     String login = session.getAuthenticatedDatabaseLogin(databaseName);
00111     if (login != null)
00112       loginBox.setText(login);
00113     loginBox.setPreferredSize(buttonDim);
00114     loginBox.addActionListener(actionListener);
00115     loginBox.addKeyListener(keyListener);
00116     this.getContentPane().add(loginBox);
00117 
00118     this.getContentPane().add(
00119         new JLabel(GuiTranslate.get("frame.database.password")));
00120     passwordBox = new JPasswordField(0);
00121     passwordBox.setPreferredSize(buttonDim);
00122     String pass = session.getAuthenticatedDatabasePassword(databaseName);
00123     if (pass != null)
00124       passwordBox.setText(pass);
00125     passwordBox.setAlignmentX(CENTER_ALIGNMENT);
00126     passwordBox.addKeyListener(keyListener);
00127     passwordBox.addActionListener(actionListener);
00128     this.getContentPane().add(passwordBox);
00129 
00130     this.getContentPane().add(optionConfirm);
00131     this.validate();
00132     setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
00133   }


Member Function Documentation

String org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame.getControllerHost  ) 
 

Returns the controllerHost value.

Returns:
Returns the controllerHost.

Definition at line 170 of file GuiVirtualDatabaseLoginFrame.java.

00171   {
00172     return controllerHost;
00173   }

String org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame.getControllerPort  ) 
 

Returns the controllerPort value.

Returns:
Returns the controllerPort.

Definition at line 180 of file GuiVirtualDatabaseLoginFrame.java.

00181   {
00182     return controllerPort;
00183   }

String org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame.getDatabaseName  ) 
 

Returns the databaseName value.

Returns:
Returns the databaseName.

Definition at line 160 of file GuiVirtualDatabaseLoginFrame.java.

00161   {
00162     return databaseName;
00163   }

JTextField org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame.getLoginBox  ) 
 

Returns the loginBox value.

Returns:
Returns the loginBox.

Definition at line 140 of file GuiVirtualDatabaseLoginFrame.java.

00141   {
00142     return loginBox;
00143   }

JTextField org.objectweb.cjdbc.console.gui.frames.GuiVirtualDatabaseLoginFrame.getPasswordBox  ) 
 

Returns the passwordBox value.

Returns:
Returns the passwordBox.

Definition at line 150 of file GuiVirtualDatabaseLoginFrame.java.

00151   {
00152     return passwordBox;
00153   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:02:23 2005 for C-JDBC by  doxygen 1.3.9.1